- Update to 17.2.8

- Fix build with python3
- Fix linking with jansson library
This commit is contained in:
Jose Alonso Cardenas Marquez 2019-12-29 20:16:22 +00:00
parent 706241865b
commit d71653bc5e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=521423
6 changed files with 245 additions and 10 deletions

View File

@ -2,8 +2,8 @@
PORTNAME= bareos17
DISTVERSIONPREFIX= Release/
DISTVERSION= 17.2.7
PORTREVISION?= 4
DISTVERSION= 17.2.8
PORTREVISION?= 0
CATEGORIES?= sysutils
PKGNAMEPREFIX?= #
PKGNAMESUFFIX?= -server
@ -110,7 +110,8 @@ CONFIGURE_ARGS+=--with-tcp-wrappers=/usr/lib \
.if defined(WITH_CLIENT_ONLY)
LMDB_CONFIGURE_ON= --enable-lmdb=yes
LMDB_CONFIGURE_OFF= --enable-lmdb=no
LMDB_CFLAGS= -DMDB_DSYNC=O_SYNC
LMDB_CFLAGS= -DMDB_DSYNC=O_SYNC \
-DMDB_USE_POSIX_MUTEX=1
CONFIGURE_ARGS+=--with-fd-user=root \
--with-fd-group=wheel
@ -194,6 +195,7 @@ post-patch:
# Default bconsole.conf is in ${ETCDIR}
@${REINPLACE_CMD} -e 's|^MAN8 =|MAN8 ?=|g' -e 's|^MAN1 =|MAN1 ?=|g' ${WRKSRC}/manpages/Makefile.in
@${REINPLACE_CMD} -e 's|_NONSHARED||g' ${WRKSRC}/src/filed/Makefile.in
@${REINPLACE_CMD} -e 's|/usr/bin/python-config|${PYTHON_CMD}-config|g' ${WRKSRC}/configure
.if defined(WITH_CLIENT_ONLY)
@${REINPLACE_CMD} -e 's|^\(fd_subdirs = .*\)scripts\(.*\)|\1\2|g' ${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's|\(.*$${MKDIR} $${DESTDIR}$${scriptdir}\)|#\1|g' ${WRKSRC}/Makefile.in

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1535610174
SHA256 (bareos-bareos-Release-17.2.7_GH0.tar.gz) = 99a5f907e3422532c783ee254dcf5c737d2b1b53522c00924d3e1009289d2fd2
SIZE (bareos-bareos-Release-17.2.7_GH0.tar.gz) = 4184028
TIMESTAMP = 1576174004
SHA256 (bareos-bareos-Release-17.2.8_GH0.tar.gz) = 199457c82b8e61f3ec708f8a399d2db24e720fb62864ebab9ec7a077b4e7084b
SIZE (bareos-bareos-Release-17.2.8_GH0.tar.gz) = 4190546

View File

@ -0,0 +1,61 @@
--- src/plugins/dird/python-dir.c 2019-12-29 01:43:39.125609000 -0500
+++ src/plugins/dird/python-dir.c 2019-12-29 01:48:30.581353000 -0500
@@ -34,6 +34,13 @@
#error "Need at least Python version 2.6 or newer"
#endif
+#if (PY_VERSION_HEX > 0x03050000)
+#define PyInt_AsLong PyLong_AsLong
+#define PyInt_FromLong PyLong_FromLong
+#define PyString_AsString PyUnicode_AsUTF8
+#define PyString_FromString PyUnicode_FromString
+#endif
+
static const int dbglvl = 150;
#define PLUGIN_LICENSE "Bareos AGPLv3"
@@ -114,6 +121,20 @@
*/
static PyThreadState *mainThreadState;
+#if (PY_VERSION_HEX > 0x03050000)
+static struct PyModuleDef BareosDIRModuleDef = {
+ PyModuleDef_HEAD_INIT,
+ "bareosdir",
+ NULL,
+ -1,
+ BareosDIRMethods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -675,7 +696,11 @@
/*
* Make our callback methods available for Python.
*/
+#if (PY_VERSION_HEX > 0x03050000)
+ p_ctx->pInstance = PyModule_Create(&BareosDIRModuleDef);
+#else
p_ctx->pInstance = Py_InitModule("bareosdir", BareosDIRMethods);
+#endif
}
/*
@@ -955,7 +980,11 @@
char *value;
ctx = PyGetbpContext(pyCtx);
+#if (PY_VERSION_HEX > 0x03050000)
+ value = bstrdup(PyString_AsString(pyValue));
+#else
value = PyString_AsString(pyValue);
+#endif
if (value) {
retval = bfuncs->setBareosValue(ctx, (bwDirVariable)var, value);
}

View File

@ -0,0 +1,111 @@
--- src/plugins/filed/python-fd.c 2019-12-29 01:20:40.033054000 -0500
+++ src/plugins/filed/python-fd.c 2019-12-29 01:27:28.921617000 -0500
@@ -37,6 +37,14 @@
#error "Need at least Python version 2.6 or newer"
#endif
+#if (PY_VERSION_HEX > 0x03050000)
+#define PyInt_AsLong PyLong_AsLong
+#define PyInt_FromLong PyLong_FromLong
+#define PyString_AsString PyUnicode_AsUTF8
+#define PyString_FromString PyUnicode_FromString
+#define PyString_Check PyBytes_Check
+#endif
+
static const int dbglvl = 150;
#define PLUGIN_LICENSE "Bareos AGPLv3"
@@ -162,6 +170,20 @@
*/
static PyThreadState *mainThreadState;
+#if (PY_VERSION_HEX > 0x03050000)
+static struct PyModuleDef BareosFDModuleDef = {
+ PyModuleDef_HEAD_INIT,
+ "bareosfd",
+ NULL,
+ -1,
+ BareosFDMethods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -1225,7 +1247,11 @@
/*
* Make our callback methods available for Python.
*/
+#if (PY_VERSION_HEX > 0x03050000)
+ p_ctx->pInstance = PyModule_Create(&BareosFDModuleDef);
+#else
p_ctx->pInstance = Py_InitModule("bareosfd", BareosFDMethods);
+#endif
/*
* Fill in the slots of PyRestoreObject
@@ -2702,8 +2728,11 @@
}
case bVarFileSeen: {
char *value;
-
+#if (PY_VERSION_HEX > 0x03050000)
+ value = bstrdup(PyString_AsString(pyValue));
+#else
value = PyString_AsString(pyValue);
+#endif
if (value) {
retval = bfuncs->setBareosValue(ctx, (bVariable)var, value);
}
@@ -3090,7 +3119,11 @@
sp.type = pSavePkt->type;
if (pSavePkt->fname) {
if (PyString_Check(pSavePkt->fname)) {
+#if (PY_VERSION_HEX > 0x03050000)
+ sp.fname = bstrdup(PyString_AsString(pSavePkt->fname));
+#else
sp.fname = PyString_AsString(pSavePkt->fname);
+#endif
} else {
goto bail_out;
}
@@ -3099,7 +3132,11 @@
}
if (pSavePkt->link) {
if (PyString_Check(pSavePkt->link)) {
+#if (PY_VERSION_HEX > 0x03050000)
+ sp.link = bstrdup(PyString_AsString(pSavePkt->link));
+#else
sp.link = PyString_AsString(pSavePkt->link);
+#endif
} else {
goto bail_out;
}
@@ -3142,7 +3179,11 @@
*/
if (pSavePkt->fname) {
if (PyString_Check(pSavePkt->fname)) {
+#if (PY_VERSION_HEX > 0x03050000)
+ sp.fname = bstrdup(PyString_AsString(pSavePkt->fname));
+#else
sp.fname = PyString_AsString(pSavePkt->fname);
+#endif
} else {
goto bail_out;
}
@@ -3219,7 +3260,11 @@
return (char *)"";
}
+#if (PY_VERSION_HEX > 0x03050000)
+ return bstrdup(PyString_AsString(object));
+#else
return PyString_AsString(object);
+#endif
}
static inline char *PyGetByteArrayValue(PyObject *object)

View File

@ -0,0 +1,61 @@
--- src/plugins/stored/python-sd.c 2019-12-29 01:43:28.821366000 -0500
+++ src/plugins/stored/python-sd.c 2019-12-29 01:45:39.796709000 -0500
@@ -34,6 +34,13 @@
#error "Need at least Python version 2.6 or newer"
#endif
+#if (PY_VERSION_HEX > 0x03050000)
+#define PyInt_AsLong PyLong_AsLong
+#define PyInt_FromLong PyLong_FromLong
+#define PyString_AsString PyUnicode_AsUTF8
+#define PyString_FromString PyUnicode_FromString
+#endif
+
static const int dbglvl = 150;
#define PLUGIN_LICENSE "Bareos AGPLv3"
@@ -114,6 +121,20 @@
*/
static PyThreadState *mainThreadState;
+#if (PY_VERSION_HEX > 0x03050000)
+static struct PyModuleDef BareosSDModuleDef = {
+ PyModuleDef_HEAD_INIT,
+ "bareossd",
+ NULL,
+ -1,
+ BareosSDMethods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -695,7 +716,11 @@
/*
* Make our callback methods available for Python.
*/
+#if (PY_VERSION_HEX > 0x03050000)
+ p_ctx->pInstance = PyModule_Create(&BareosSDModuleDef);
+#else
p_ctx->pInstance = Py_InitModule("bareossd", BareosSDMethods);
+#endif
}
/*
@@ -976,7 +1001,11 @@
char *value;
ctx = PyGetbpContext(pyCtx);
+#if (PY_VERSION_HEX > 0x03050000)
+ value = bstrdup(PyString_AsString(pyValue));
+#else
value = PyString_AsString(pyValue);
+#endif
if (value) {
bfuncs->setBareosValue(ctx, (bsdwVariable)var, value);
}

View File

@ -43,7 +43,7 @@
$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -o $@ $(TAPEOBJS) \
-lbareossd -lbareoscfg -lbareos $(DLIB) -lm $(LIBS) $(GETTEXT_LIBS) \
- $(OPENSSL_LIBS_NONSHARED) $(GNUTLS_LIBS_NONSHARED)
+ $(OPENSSL_LIBS) $(GNUTLS_LIBS_NONSHARED)
+ $(OPENSSL_LIBS) $(GNUTLS_LIBS_NONSHARED) $(JANSSON_LDFLAGS)
bls: Makefile libbareossd$(DEFAULT_ARCHIVE_TYPE) $(BLSOBJS) \
- ../findlib/libbareosfind$(DEFAULT_ARCHIVE_TYPE) \
@ -56,7 +56,7 @@
$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(BLSOBJS) $(DLIB) \
-lbareossd -lbareosfind -lbareoscfg -lbareos -lm $(LIBS) $(GETTEXT_LIBS) \
- $(OPENSSL_LIBS_NONSHARED) $(GNUTLS_LIBS_NONSHARED)
+ $(OPENSSL_LIBS) $(GNUTLS_LIBS_NONSHARED)
+ $(OPENSSL_LIBS) $(GNUTLS_LIBS_NONSHARED) $(JANSSON_LDFLAGS)
bextract: Makefile libbareossd$(DEFAULT_ARCHIVE_TYPE) $(BEXTOBJS) \
- ../findlib/libbareosfind$(DEFAULT_ARCHIVE_TYPE) \
@ -69,7 +69,7 @@
$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(BEXTOBJS) $(DLIB) \
-lbareossd -lbareosfind -lbareoscfg -lbareos -lm $(LIBS) $(SD_LIBS) $(BEXTRACT_LIBS) \
- $(GETTEXT_LIBS) $(OPENSSL_LIBS_NONSHARED) $(GNUTLS_LIBS_NONSHARED)
+ $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(GNUTLS_LIBS_NONSHARED)
+ $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(GNUTLS_LIBS_NONSHARED) $(JANSSON_LDFLAGS)
bscan: Makefile libbareossd$(DEFAULT_ARCHIVE_TYPE) $(SCNOBJS) \
- ../findlib/libbareosfind$(DEFAULT_ARCHIVE_TYPE) \
@ -90,7 +90,7 @@
@echo "Linking $@ ..."
$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -o $@ $(COPYOBJS) \
- -lbareossd -lbareoscfg -lbareos -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS_NONSHARED) $(GNUTLS_LIBS_NONSHARED)
+ -lbareossd -lbareoscfg -lbareos -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(GNUTLS_LIBS_NONSHARED)
+ -lbareossd -lbareoscfg -lbareos -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(GNUTLS_LIBS_NONSHARED) $(JANSSON_LDFLAGS)
Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
cd $(topdir) \