- Update to 16.2.9

- Fix build with python3
- Fix linking with jansson library
This commit is contained in:
Jose Alonso Cardenas Marquez 2019-12-29 20:14:25 +00:00
parent 70a81993bb
commit 706241865b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=521422
7 changed files with 294 additions and 26 deletions

View File

@ -2,8 +2,8 @@
PORTNAME= bareos16
DISTVERSIONPREFIX= Release/
DISTVERSION= 16.2.8
PORTREVISION?= 3
DISTVERSION= 16.2.9
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_SYNC=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 = 1532378401
SHA256 (bareos-bareos-Release-16.2.8_GH0.tar.gz) = 408b45e866d476a8af0cd091b81d9f61cfd1bb14a8d00cb951a755528cf4b860
SIZE (bareos-bareos-Release-16.2.8_GH0.tar.gz) = 4287084
TIMESTAMP = 1576171067
SHA256 (bareos-bareos-Release-16.2.9_GH0.tar.gz) = cd35c0dca1ce5699a57a57a60aeadacec2260536e085f10dce7ad6ea29209150
SIZE (bareos-bareos-Release-16.2.9_GH0.tar.gz) = 4290810

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

@ -1,5 +1,5 @@
--- src/stored/Makefile.in 2016-10-16 10:14:36.000000000 -0500
+++ src/stored/Makefile.in 2016-11-09 15:54:32.944172000 -0500
--- src/stored/Makefile.in 2019-12-12 11:12:41.000000000 -0500
+++ src/stored/Makefile.in 2019-12-28 15:51:03.744493000 -0500
@@ -93,6 +93,7 @@
INCLUDES += -I$(srcdir) -I$(basedir) -I$(basedir)/include
@ -8,43 +8,76 @@
DEBUG = @DEBUG@
GETTEXT_LIBS = @LIBINTL@
@@ -170,7 +171,7 @@
@@ -164,17 +165,17 @@
$(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(JANSSON_CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $<
bareos-sd: Makefile libbareossd$(DEFAULT_ARCHIVE_TYPE) $(SDOBJS) \
- ../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) \
- ../lib/libbareos$(DEFAULT_ARCHIVE_TYPE) \
+ $(LOCALBASE)/lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) \
+ $(LOCALBASE)/lib/libbareos$(DEFAULT_ARCHIVE_TYPE) \
@NDMP_DEPS@
@echo "Linking $@ ..."
$(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L. -L../lib -o $@ $(SDOBJS) \
$(NDMP_LIBS) -lbareossd -lbareoscfg -lbareos -lm $(DLIB) $(LIBS) $(WRAPLIBS) \
- $(SD_LIBS) $(GETTEXT_LIBS) $(COMPRESS_LIBS) $(OPENSSL_LIBS_NONSHARED) $(GNUTLS_LIBS_NONSHARED)
+ $(SD_LIBS) $(GETTEXT_LIBS) $(COMPRESS_LIBS) $(OPENSSL_LIBS) $(GNUTLS_LIBS_NONSHARED) ${JANSSON_LDFLAGS}
+ $(SD_LIBS) $(GETTEXT_LIBS) $(COMPRESS_LIBS) $(OPENSSL_LIBS) $(GNUTLS_LIBS_NONSHARED) $(JANSSON_LDFLAGS)
static-bareos-sd: Makefile libbareossd$(DEFAULT_ARCHIVE_TYPE) $(SDOBJS) \
../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) \
@@ -192,7 +193,7 @@
- ../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) \
- ../lib/libbareos$(DEFAULT_ARCHIVE_TYPE) \
+ $(LOCALBASE)/lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) \
+ $(LOCALBASE)/lib/libbareos$(DEFAULT_ARCHIVE_TYPE) \
@NDMP_DEPS@
@echo "Linking $@ ..."
$(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L. -L../lib -o $@ $(SDOBJS) \
@@ -187,46 +188,47 @@
$(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I../lib $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $<
btape: Makefile libbareossd$(DEFAULT_ARCHIVE_TYPE) $(TAPEOBJS) \
- ../lib/libbareos$(DEFAULT_ARCHIVE_TYPE) \
- ../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE)
+ $(LOCALBASE)/lib/libbareos$(DEFAULT_ARCHIVE_TYPE) \
+ $(LOCALBASE)/lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE)
@echo "Linking $@ ..."
$(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) \
@@ -201,7 +202,7 @@
- ../findlib/libbareosfind$(DEFAULT_ARCHIVE_TYPE) \
- ../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) \
- ../lib/libbareos$(DEFAULT_ARCHIVE_TYPE)
+ $(LOCALBASE)/lib/libbareosfind$(DEFAULT_ARCHIVE_TYPE) \
+ $(LOCALBASE)/lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) \
+ $(LOCALBASE)/lib/libbareos$(DEFAULT_ARCHIVE_TYPE)
@echo "Linking $@ ..."
$(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) \
@@ -210,7 +211,7 @@
- ../findlib/libbareosfind$(DEFAULT_ARCHIVE_TYPE) \
- ../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) \
- ../lib/libbareos$(DEFAULT_ARCHIVE_TYPE)
+ $(LOCALBASE)/lib/libbareosfind$(DEFAULT_ARCHIVE_TYPE) \
+ $(LOCALBASE)/lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) \
+ $(LOCALBASE)/lib/libbareos$(DEFAULT_ARCHIVE_TYPE)
@echo "Linking $@ ..."
$(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) \
@@ -220,13 +221,13 @@
- ../findlib/libbareosfind$(DEFAULT_ARCHIVE_TYPE) \
- ../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) \
+ $(LOCALBASE)/lib/libbareosfind$(DEFAULT_ARCHIVE_TYPE) \
+ $(LOCALBASE)/lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) \
../cats/libbareossql$(DEFAULT_ARCHIVE_TYPE) \
../cats/libbareoscats$(DEFAULT_ARCHIVE_TYPE)
@echo "Linking $@ ..."
$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -L../cats -L../findlib -o $@ $(SCNOBJS) \
-lbareossql -lbareoscats $(DB_LIBS) -lbareossd -lbareosfind -lbareoscfg -lbareos -lm $(LIBS) $(SD_LIBS) \
@ -52,15 +85,17 @@
+ $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(GNUTLS_LIBS_NONSHARED) ${JANSSON_LDFLAGS}
bcopy: Makefile libbareossd$(DEFAULT_ARCHIVE_TYPE) $(COPYOBJS) \
../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbareos$(DEFAULT_ARCHIVE_TYPE)
- ../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbareos$(DEFAULT_ARCHIVE_TYPE)
+ $(LOCALBASE)/lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) $(LOCALBASE)/lib/libbareos$(DEFAULT_ARCHIVE_TYPE)
@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) \
@@ -259,8 +260,8 @@
@@ -259,8 +261,8 @@
destconf="$$RESDIR/$$RES.new"; \
echo " $$RESTYPE/$$RES as \"$$destconf\" (keep existing)"; \
else \

View File

@ -6,8 +6,6 @@
@group bareos
@sample %%ETCDIR%%/bareos-fd.d/messages/Standard.conf.sample
@group bareos
%%PYTHON%%@sample %%ETCDIR%%/bareos-dir.d/fileset/plugin-ldap.conf.sample
%%PYTHON%%@group bareos
%%PYTHON%%@sample %%ETCDIR%%/bareos-dir.d/job/backup-ldap.conf.sample
%%PYTHON%%@group bareos
%%PYTHON%%@sample %%ETCDIR%%/bareos-dir.d/job/restore-ldap.conf.sample