1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

Stage bacula

Fix building bat on 10 and head
Allow packaging as a user
This commit is contained in:
Baptiste Daroussin 2014-07-02 16:14:10 +00:00
parent 21448c9080
commit e73b692405
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=360216
10 changed files with 132 additions and 194 deletions

View File

@ -9,9 +9,11 @@ PKGNAMESUFFIX= #
MAINTAINER= freebsd@troback.com
COMMENT= Nagios plugin for Bacula
LIB_DEPENDS+= bac:${PORTSDIR}/sysutils/bacula-client
UNIQUENAME= ${PKGNAMEPREFIX}${PORTNAME}
LIB_DEPENDS+= libbac.so:${PORTSDIR}/sysutils/bacula-client
PLIST= ${.CURDIR}/pkg-plist
PLIST_FILES= libexec/nagios/check_bacula
PLIST_DIRS= libexec/nagios
WITH_NAGIOS_CHECK_ONLY= yes
MASTERDIR= ${.CURDIR}/../../sysutils/bacula-server
@ -23,5 +25,4 @@ CONFIGURE_ARGS= --enable-client-only \
OPTIONS_DEFINE= #
NO_STAGE= yes
.include "${MASTERDIR}/Makefile"

View File

@ -3,19 +3,18 @@
PORTNAME= bacula
PKGNAMESUFFIX= -bat
PORTREVISION= 4
PORTREVISION= 5
COMMENT= Network backup solution (GUI)
LIB_DEPENDS+= qwt.5:${PORTSDIR}/x11-toolkits/qwt5 \
bac:${PORTSDIR}/sysutils/bacula-client
LIB_DEPENDS+= libqwt.so:${PORTSDIR}/x11-toolkits/qwt5 \
libbac.so:${PORTSDIR}/sysutils/bacula-client
USES= pkgconfig
USE_QT4= qmake_build uic_build moc_build rcc_build
WITH_BAT= yes
MAN1= bat.1
PLIST= ${.CURDIR}/pkg-plist
MAKE_ENV+= MAKEOBJDIRPREFIX=/
MASTERDIR= ${.CURDIR}/../../sysutils/bacula-server
@ -29,5 +28,4 @@ CONFIGURE_ARGS+= --enable-bat \
OPTIONS_DEFINE= OPENSSL
OPTIONS_DEFAULT=OPENSSL
NO_STAGE= yes
.include "${MASTERDIR}/Makefile"

View File

@ -0,0 +1,5 @@
@sample %%ETCDIR%%/bat.conf.sample
man/man1/bat.1.gz
sbin/bat
@dirrmtry %%ETCDIR%%

View File

@ -5,8 +5,12 @@ PKGNAMESUFFIX= -client-static
COMMENT= Network backup solution (static client)
PLIST= ${.CURDIR}/pkg-plist
MASTERDIR= ${.CURDIR}/../../sysutils/bacula-server
PLIST_FILES= sbin/bacula-fd-static \
sbin/bconsole-static
OPTIONS_DEFINE= NLS OPENSSL
OPTIONS_DEFAULT=NLS OPENSSL
@ -17,5 +21,4 @@ CONFIGURE_ARGS+= --enable-client-only \
--disable-build-dird \
--disable-build-stored
NO_STAGE= yes
.include "${MASTERDIR}/Makefile"

View File

@ -14,5 +14,4 @@ MASTERDIR= ${.CURDIR}/../../sysutils/bacula-server
OPTIONS_DEFINE= NLS OPENSSL PYTHON
OPTIONS_DEFAULT=NLS OPENSSL
NO_STAGE= yes
.include "${MASTERDIR}/Makefile"

View File

@ -3,7 +3,7 @@
PORTNAME= bacula
DISTVERSION= 5.2.12
PORTREVISION?= 4
PORTREVISION?= 5
CATEGORIES?= sysutils
MASTER_SITES= SF/bacula/bacula/${PORTVERSION}
PKGNAMEPREFIX?= #
@ -12,9 +12,9 @@ PKGNAMESUFFIX?= -server
MAINTAINER= dan@langille.org
COMMENT?= Network backup solution (server)
LIB_DEPENDS+= lzo2:${PORTSDIR}/archivers/lzo2
USES+= libtool
UNIQUENAME?= ${PORTNAME}${PKGNAMESUFFIX}
LIB_DEPENDS+= liblzo2.so:${PORTSDIR}/archivers/lzo2
USERS= bacula
GROUPS= ${USERS}
@ -31,18 +31,17 @@ OPTIONS_DEFINE?= SQLITE3 MYSQL PGSQL MTX PYTHON NLS OPENSSL
OPTIONS_DEFAULT?= NLS OPENSSL PGSQL
MTX_DESC= Install mtx for control of autochanger devices
NO_STAGE= yes
.include <bsd.port.options.mk>
OPENSSL_USE= OPENSSL=yes
OPENSSL_CONFIGURE_ON= --with-openssl=${OPENSSLBASE}
OPENSSL_CONFIGURE_OFF= --with-openssl="no"
.if ${PKGNAMESUFFIX} == "-client" || ${PKGNAMESUFFIX} == "-server" #Till end of the file
.if defined(WITH_PYTHON)
USE_PYTHON= yes
CONFIGURE_ARGS+= --with-python=yes
.endif
PYTHON_USE= PYTHON=yes
PYTHON_CONFIGURE_ON= --with-python=yes
.if !defined(WITH_CLIENT_ONLY)
LIB_DEPENDS+= bac:${PORTSDIR}/sysutils/bacula-client
LIB_DEPENDS+= libbac.so:${PORTSDIR}/sysutils/bacula-client
USE_RC_SUBR?= bacula-dir bacula-sd
.endif
@ -96,12 +95,8 @@ SUB_LIST= BACULA_USER=${BACULA_USER} \
BACULA_GID=${BACULA_GID} \
BACULA_DIR=${BACULA_DIR}
.if ${PORT_OPTIONS:MNLS}
USES+= gettext
CONFIGURE_ARGS+= --enable-nls
.else
CONFIGURE_ARGS+= --disable-nls
.endif
NLS_USES= gettext
NLS_CONFIGURE_ENABLE= nls
# overridden if client install
PKGDEINSTALL= ${FILESDIR}/pkg-deinstall.server
@ -118,64 +113,40 @@ PKGINSTALL= ${FILESDIR}/pkg-install.client
# Server only Options
CONFFILES= sd dir
# Server default database
MYSQL_CONFIGURE_ON= --with-mysql=yes
MYSQL_USE= MYSQL=yes
SQLITE3_CONFIGURE_ON= --with=sqlite3=yes
SQLITE3_LIB_DEPENDS= libsqlite3.so:${PORTSDIR}/databases/sqlite3
PGSQL_CONFIGURE_ON= --with-postgresql=yes
PGSQL_USES= pgsql
MTX_RUN_DEPENDS= ${LOCALBASE}/sbin/mtx:${PORTSDIR}/misc/mtx
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MMYSQL}
CONFIGURE_ARGS+= --with-mysql=yes
USE_MYSQL= yes
DBTYPE= mysql
SUB_LIST+= REQ_MYSQL=mysql REQ_PGSQL=""
.elif ${PORT_OPTIONS:MSQLITE3}
CONFIGURE_ARGS+= --with-sqlite3=yes
LIB_DEPENDS+= sqlite3:${PORTSDIR}/databases/sqlite3
DBTYPE= sqlite3
.else
USE_PGSQL= yes
CONFIGURE_ARGS+= --with-postgresql=yes
DBTYPE= postgresql
SUB_LIST+= REQ_MYSQL="" REQ_PGSQL=postgresql
.endif
PLIST_SUB+= DBTYPE=${DBTYPE}
# Install mtx
.if ${PORT_OPTIONS:MMTX}
RUN_DEPENDS+= ${LOCALBASE}/sbin/mtx:${PORTSDIR}/misc/mtx
.endif
.endif
.if ${PORT_OPTIONS:MOPENSSL}
.include "${PORTSDIR}/Mk/bsd.openssl.mk"
CONFIGURE_ARGS+= --with-openssl=${OPENSSLBASE}
.else
CONFIGURE_ARGS+= --with-openssl="no"
.endif
.if defined(WITH_CLIENT_ONLY)
MAN8+= bacula-fd.8 bconsole.8
MP8+= bacula-fd.8 bconsole.8
.else
MAN8+= bacula.8 bacula-dir.8 bacula-sd.8 bcopy.8 bextract.8 bls.8 bscan.8 \
MP8+= bacula.8 bacula-dir.8 bacula-sd.8 bcopy.8 bextract.8 bls.8 bscan.8 \
btape.8 btraceback.8 dbcheck.8 bwild.8 bregex.8
MAN1+= bsmtp.1 bacula-tray-monitor.1 bacula-bwxconsole.1
MP1+= bsmtp.1 bacula-tray-monitor.1 bacula-bwxconsole.1
.endif
MAKE_ENV+= MAN8="${MAN8}" MAN1="${MAN1}"
pre-everything::
.if !defined(WITH_CLIENT_ONLY)
@${ECHO_MSG} "You may use the following build options (or make config):"
@${ECHO_MSG} ""
@${ECHO_MSG} " WITH_CLIENT_ONLY=yes if you only want the file daemon."
@${ECHO_MSG} " WITH_MTX=yes if you want to use mtx instead of chio for autochanger control."
@${ECHO_MSG} " WITH_PYTHON=yes Enable Python scripting in the director."
@${ECHO_MSG} " WITH_SQLITE3=yes if you want SQLite-3 as the database (not recommended)."
.if ! ${PORT_OPTIONS:MMYSQL} && ! ${PORT_OPTIONS:MPGSQL}
@${ECHO_MSG} " WITH_MYSQL=yes if you want MySQL as the database."
@${ECHO_MSG} " WITH_PGSQL=yes if you want PostgreSQL as the database."
@${ECHO_MSG} ""
@${ECHO_MSG} "The default DB is PostgreSQL!"
.endif
@${ECHO_MSG} " WITH_OPENSSL=yes Enable OpenSSL for encrypted communication."
@${ECHO_MSG} ""
@${ECHO_MSG} "===> Using ${DBTYPE} as the bacula database."
@${ECHO_MSG} ""
.endif
MAKE_ENV+= MO8="${MAN8}" MAN1="${MP1}"
post-patch:
# This port does not install docs. See bacula-docs for that
@ -201,80 +172,21 @@ post-patch:
${WRKSRC}/src/tools/bpluginfo.c
.endif
.if !target(pre-install)
pre-install:
if [ ! -d "${BACULA_DIR}" ]; then \
${ECHO_CMD} "creating ${BACULA_DIR}" ; \
${MKDIR} ${BACULA_DIR}; \
else \
${ECHO_CMD} "${BACULA_DIR} already exists"; \
fi
# Extend /etc/services and install UID/GID
@ ${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
.endif
${MKDIR} ${STAGEDIR}${BACULA_DIR}
.if !target(post-install)
post-install:
.if defined(WITH_CLIENT_ONLY)
# Extend only /etc/services
@ ${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PORTNAME}
# Console stuff
if [ -f ${ETCDIR}/bconsole.conf.new ]; then \
${ECHO_CMD} "etc/bconsole.conf.new" >> ${TMPPLIST}; \
${CHGRP} bacula ${ETCDIR}/bconsole.conf.new; \
elif [ -f ${ETCDIR}/bconsole.conf ]; then \
${MV} ${ETCDIR}/bconsole.conf ${ETCDIR}/bconsole.conf.sample; \
${CHGRP} bacula ${ETCDIR}/bconsole.conf.sample; \
${ECHO_CMD} "etc/bacula/bconsole.conf.sample" >> ${TMPPLIST}; \
fi
# ensure that users in the bacula group can run bconsole
${CHGRP} bacula ${PREFIX}/sbin/bconsole
${MV} ${STAGEDIR}${ETCDIR}/bconsole.conf ${STAGEDIR}${ETCDIR}/bconsole.conf.sample
.else
# Install config files and preserve existing ones
${INSTALL_SCRIPT} ${FILESDIR}/chio-bacula ${PREFIX}/sbin
if [ -f ${ETCDIR}/bacula-barcodes ]; then \
${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${ETCDIR}/bacula-barcodes.new ; \
${ECHO_CMD} "etc/bacula/bacula-barcodes.new" >> ${TMPPLIST}; \
else \
${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${ETCDIR}/bacula-barcodes.samples ; \
${ECHO_CMD} "etc/bacula/bacula-barcodes.samples" >> ${TMPPLIST}; \
fi
# Add configuration files directory to packing list
${ECHO_CMD} "@unexec ${RMDIR} %D/etc/bacula 2>/dev/null || true" >> ${TMPPLIST}
# chmod of bsmtp program so bacula can use it with dropped down permissions
${CHMOD} o+x ${PREFIX}/sbin/bsmtp
${CHOWN} -R bacula:bacula ${PREFIX}/share/bacula
# on a fresh install, the .new suffix is not used
if [ -f ${ETCDIR}/bacula-dir.conf.new ]; then \
${CHGRP} bacula ${ETCDIR}/bacula-dir.conf.new; \
else \
${CHGRP} bacula ${ETCDIR}/bacula-dir.conf; \
fi
${CHGRP} bacula ${PREFIX}/sbin/dbcheck
${INSTALL_SCRIPT} ${FILESDIR}/chio-bacula ${STAGEDIR}${PREFIX}/sbin
${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${STAGEDIR}${ETCDIR}/bacula-barcodes.sample
${CHMOD} o+x ${STAGEDIR}${PREFIX}/sbin/bsmtp
.endif
# Install leaves existing conf files untouched. Respect this here!
for na in ${CONFFILES}; do \
if [ -f ${ETCDIR}/bacula-$$na.conf.new ]; then \
${ECHO_CMD} "etc/bacula/bacula-$$na.conf.new" >> ${TMPPLIST}; \
elif [ -f ${ETCDIR}/bacula-$$na.conf ]; then \
${MV} ${ETCDIR}/bacula-$$na.conf ${ETCDIR}/bacula-$$na.conf.sample; \
${ECHO_CMD} "etc/bacula/bacula-$$na.conf.sample" >> ${TMPPLIST}; \
fi; \
${MV} ${STAGEDIR}${ETCDIR}/bacula-$$na.conf ${STAGEDIR}${ETCDIR}/bacula-$$na.conf.sample; \
done
# Add configuration files directory to packing list
${ECHO_CMD} "@unexec ${RMDIR} %D/etc/bacula 2>/dev/null || true" >> ${TMPPLIST}
${CHGRP} wheel ${PREFIX}/etc
@${CAT} ${PKGMESSAGE}
.endif
.else
.include "${MASTERDIR}/Makefile.common"

View File

@ -1,25 +1,3 @@
PLIST= ${WRKDIR}/pkg-plist
.if ${PKGNAMESUFFIX} == "-bat"
.if defined(WITH_OPENSSL)
.include "${PORTSDIR}/Mk/bsd.openssl.mk"
CONFIGURE_ARGS+= --with-openssl=${OPENSSLBASE}
.else
CONFIGURE_ARGS+= --with-openssl="no"
.endif
.endif
pre-everything::
.if ${PKGNAMESUFFIX} == "-bat"
@${ECHO_MSG} "===> Building bat the GUI interface for Bacula."
.endif
.if ${PKGNAMEPREFIX} == "nagios-check_"
@${ECHO_MSG} "===> Building nagios check only."
.endif
.if ${PKGNAMESUFFIX} == "-client-static"
@${ECHO_MSG} "===> Building static version of fd."
.endif
post-patch:
# Change $(ECHO) to echo in some Makefile.in files
@${REINPLACE_CMD} -e 's|$$(ECHO)|echo|g' ${WRKSRC}/src/filed/Makefile.in \
@ -27,37 +5,23 @@ post-patch:
post-build:
.if ${PKGNAMEPREFIX} == "nagios-check_"
${MAKE} -C ${WRKSRC}/examples/nagios/check_bacula
.endif
pre-install:
@${RM} -f ${PLIST}
.if ${PKGNAMESUFFIX} == "-bat"
@${ECHO_CMD} "etc/bacula/bat.conf.sample" >> ${PLIST}
@${ECHO_CMD} "sbin/bat" >> ${PLIST}
.endif
.if ${PKGNAMEPREFIX} == "nagios-check_"
@${ECHO_CMD} "libexec/nagios/check_bacula" >> ${PLIST}
@${ECHO_CMD} "@dirrmtry libexec/nagios" >> ${PLIST}
.endif
.if ${PKGNAMESUFFIX} == "-client-static"
@${ECHO_CMD} "sbin/bacula-fd-static" >> ${PLIST}
@${ECHO_CMD} "sbin/bconsole-static" >> ${PLIST}
${MAKE_CMD} -C ${WRKSRC}/examples/nagios/check_bacula
.endif
do-install:
.if ${PKGNAMESUFFIX} == "-bat"
# Install config files and preserve existing ones
${INSTALL_SCRIPT} ${WRKSRC}/src/qt-console/bat.conf ${PREFIX}/etc/bacula/bat.conf.sample
${INSTALL_MAN} ${WRKSRC}/manpages/bat.1 ${PREFIX}/man/man1/
${INSTALL_PROGRAM} ${WRKSRC}/src/qt-console/bat ${PREFIX}/sbin
${MKDIR} ${STAGEDIR}${ETCDIR}
${INSTALL_SCRIPT} ${WRKSRC}/src/qt-console/bat.conf ${STAGEDIR}${PREFIX}/etc/bacula/bat.conf.sample
${INSTALL_MAN} ${WRKSRC}/manpages/bat.1 ${STAGEDIR}${PREFIX}/man/man1/
${INSTALL_PROGRAM} ${WRKSRC}/src/qt-console/bat ${STAGEDIR}${PREFIX}/sbin
.endif
.if ${PKGNAMEPREFIX} == "nagios-check_"
@${MKDIR} ${PREFIX}/libexec/nagios
@${MKDIR} ${STAGEDIR}${PREFIX}/libexec/nagios
${INSTALL_PROGRAM} ${WRKSRC}/examples/nagios/check_bacula/check_bacula \
${PREFIX}/libexec/nagios
${STAGEDIR}${PREFIX}/libexec/nagios
.endif
.if ${PKGNAMESUFFIX} == "-client-static"
${INSTALL_PROGRAM} ${WRKSRC}/src/filed/static-bacula-fd ${PREFIX}/sbin/bacula-fd-static
${INSTALL_PROGRAM} ${WRKSRC}/src/console/static-bconsole ${PREFIX}/sbin/bconsole-static
${INSTALL_PROGRAM} ${WRKSRC}/src/filed/static-bacula-fd ${STAGEDIR}${PREFIX}/sbin/bacula-fd-static
${INSTALL_PROGRAM} ${WRKSRC}/src/console/static-bconsole ${STAGEDIR}${PREFIX}/sbin/bconsole-static
.endif

View File

@ -0,0 +1,11 @@
--- src/qt-console/bat.pro.in.orig 2012-09-13 10:51:19.000000000 +0200
+++ src/qt-console/bat.pro.in 2014-07-02 18:02:18.587979885 +0200
@@ -19,7 +19,7 @@
TARGET = bat
DEPENDPATH += .
INCLUDEPATH += .. . ./console ./restore ./select
-LIBS += -L../lib -lbaccfg -lbac -L../findlib -lbacfind @OPENSSL_LIBS@
+LIBS += -L../lib -lbaccfg -lbac -L../findlib -lbacfind @OPENSSL_LIBS@ -lintl
LIBTOOL_LINK = @QMAKE_LIBTOOL@ --silent --tag=CXX --mode=link
LIBTOOL_INSTALL = @QMAKE_LIBTOOL@ --silent --mode=install
QMAKE_LINK = $${LIBTOOL_LINK} $(CXX)

View File

@ -1,12 +1,34 @@
lib/libbaccats.la
@sample %%ETCDIR%%/bacula-barcodes.sample
@group bacula
@sample %%ETCDIR%%/bacula-dir.conf.sample
@group wheel
@sample %%ETCDIR%%/bacula-sd.conf.sample
lib/libbaccats.so
lib/libbaccats.so.%%MAJOR%%
lib/libbaccats-%%DBTYPE%%.la
lib/libbaccats.so.5
lib/libbaccats.so.5.0.2
lib/libbaccats-%%DBTYPE%%.so
lib/libbaccats-%%DBTYPE%%.so.%%MAJOR%%
lib/libbacsql.la
lib/libbaccats-%%DBTYPE%%.so.5
lib/libbaccats-%%DBTYPE%%.so.5.0.2
lib/libbacsql.so
lib/libbacsql.so.%%MAJOR%%
lib/libbacsql.so.5
lib/libbacsql.so.5.0.2
man/man1/bacula-bwxconsole.1.gz
man/man1/bacula-tray-monitor.1.gz
man/man1/bsmtp.1.gz
man/man8/bacula-dir.8.gz
man/man8/bacula-fd.8.gz
man/man8/bacula-sd.8.gz
man/man8/bacula.8.gz
man/man8/bconsole.8.gz
man/man8/bcopy.8.gz
man/man8/bextract.8.gz
man/man8/bls.8.gz
man/man8/bregex.8.gz
man/man8/bscan.8.gz
man/man8/btape.8.gz
man/man8/btraceback.8.gz
man/man8/bwild.8.gz
man/man8/dbcheck.8.gz
sbin/bacula
sbin/bacula-dir
sbin/bacula-sd
@ -20,7 +42,9 @@ sbin/btape
sbin/btraceback
sbin/bwild
sbin/chio-bacula
@group bacula
sbin/dbcheck
@owner bacula
%%DATADIR%%/bacula
%%DATADIR%%/bacula-ctl-dir
%%DATADIR%%/bacula-ctl-fd
@ -50,8 +74,9 @@ sbin/dbcheck
%%DATADIR%%/query.sql
%%DATADIR%%/update_bacula_tables
%%DATADIR%%/update_%%DBTYPE%%_tables
@owner root
@group wheel
@dirrm %%DATADIR%%
@unexec /usr/bin/killall bacula-sd > /dev/null 2>&1 || true
@unexec /usr/bin/killall bacula-dir > /dev/null 2>&1 || true
@exec mkdir -p %%BACULA_DIR%%
@dirrmtry %%BACULA_DIR%%
@dirrmtry %%ETCDIR%%

View File

@ -1,19 +1,39 @@
lib/libbac.la
@sample %%ETCDIR%%/bacula-fd.conf.sample
@group bacula
@sample %%ETCDIR%%/bconsole.conf.sample
@group wheel
lib/libbac.so
lib/libbac.so.%%MAJOR%%
lib/libbaccfg.la
lib/libbac.so.5
lib/libbac.so.5.0.2
lib/libbaccfg.so
lib/libbaccfg.so.%%MAJOR%%
lib/libbacfind.la
lib/libbaccfg.so.5
lib/libbaccfg.so.5.0.2
lib/libbacfind.so
lib/libbacfind.so.%%MAJOR%%
lib/libbacpy.la
lib/libbacfind.so.5
lib/libbacfind.so.5.0.2
lib/libbacpy.so
lib/libbacpy.so.%%MAJOR%%
lib/libbacpy.so.5
lib/libbacpy.so.5.0.2
lib/bpipe-fd.so
man/man8/bacula-dir.8.gz
man/man8/bacula-fd.8.gz
man/man8/bacula-sd.8.gz
man/man8/bacula.8.gz
man/man8/bconsole.8.gz
man/man8/bcopy.8.gz
man/man8/bextract.8.gz
man/man8/bls.8.gz
man/man8/bregex.8.gz
man/man8/bscan.8.gz
man/man8/btape.8.gz
man/man8/btraceback.8.gz
man/man8/bwild.8.gz
man/man8/dbcheck.8.gz
sbin/bacula-fd
@group bacula
sbin/bconsole
@unexec /usr/bin/killall bacula-fd > /dev/null 2>&1 || true
@group wheel
@exec mkdir -p %%BACULA_DIR%%
@dirrmtry %%BACULA_DIR%%
@dirrmtry share/bacula
@dirrmtry %%ETCDIR%%