diff options
author | lkoeller <lkoeller@FreeBSD.org> | 2004-12-01 03:49:39 +0800 |
---|---|---|
committer | lkoeller <lkoeller@FreeBSD.org> | 2004-12-01 03:49:39 +0800 |
commit | 0007dd96b318747a24adc529eb4636b1f9694e4b (patch) | |
tree | bf0e641be22e9d4099b079eec87258a0edeb9569 /sysutils/bacula-server | |
parent | d087f5b58e0790d1124c54ac930f053edd02f435 (diff) | |
download | freebsd-ports-gnome-0007dd96b318747a24adc529eb4636b1f9694e4b.tar.gz freebsd-ports-gnome-0007dd96b318747a24adc529eb4636b1f9694e4b.tar.zst freebsd-ports-gnome-0007dd96b318747a24adc529eb4636b1f9694e4b.zip |
o) Commit changes necessary to get a working -server, -client split of the
port after repro-copy of bacula -> bacula-server.
Diffstat (limited to 'sysutils/bacula-server')
-rw-r--r-- | sysutils/bacula-server/Makefile | 70 | ||||
-rw-r--r-- | sysutils/bacula-server/files/pkg-deinstall.client.in | 19 | ||||
-rw-r--r-- | sysutils/bacula-server/files/pkg-install.client.in | 17 | ||||
-rw-r--r-- | sysutils/bacula-server/pkg-deinstall.client | 19 | ||||
-rw-r--r-- | sysutils/bacula-server/pkg-install.client | 17 | ||||
-rw-r--r-- | sysutils/bacula-server/pkg-plist | 56 | ||||
-rw-r--r-- | sysutils/bacula-server/pkg-plist.client | 7 |
7 files changed, 153 insertions, 52 deletions
diff --git a/sysutils/bacula-server/Makefile b/sysutils/bacula-server/Makefile index ee9e1a7cc0d0..7156135cf597 100644 --- a/sysutils/bacula-server/Makefile +++ b/sysutils/bacula-server/Makefile @@ -11,14 +11,15 @@ PORTREVISION= 0 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= bacula +PKGNAMESUFFIX?= -server MAINTAINER= Lars.Koeller@Uni-Bielefeld.DE -COMMENT= The network backup solution +COMMENT= The network backup solution (server) # The user/group IDs below are registered, see # http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#DADS-UID # -BACULA_DIR=/var/db/bacula +BACULA_DIR?=/var/db/bacula # USE_REINPLACE= yes GNU_CONFIGURE= yes @@ -38,12 +39,26 @@ CONFIGURE_ARGS= --with-tcp-wrappers=/usr/lib \ CONFIGURE_ENV+= CPPFLAGS="-I/usr/include/readline -I${LOCALBASE}/include" \ LDFLAGS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}" -OPTIONS= CLIENT_ONLY "Build bacula file daemon only" off +ALL_OPTIONS= CLIENT_ONLY WXCONSOLE GNOMECONSOLE MYSQL POSTGRESQL + +.for opt in ${ALL_OPTIONS} +.if defined(WITH_${opt}) +BATCH= yes +.endif +.endfor + +.if !defined(BATCH) +IS_INTERACTIVE= yes +.endif + +.if defined(WITH_CLIENT_ONLY) OPTIONS+= WXCONSOLE "Build with wxGTK based GUI console" off OPTIONS+= GNOMECONSOLE "Build with GNOME based GUI console" off -OPTIONS+= MYSQL "Use MySQL database instead of SqLite" off +.else +OPTIONS= MYSQL "Use MySQL database instead of SqLite" off OPTIONS+= POSTGRESQL7 "Use PostgreSQL 7.X database instead of SqLite" off OPTIONS+= MTX "Install mtx for control of autochanger devices" off +.endif # Prepare if gnome-console is selected this must be happen before # include of bsd.port.pre.mk! @@ -81,7 +96,10 @@ PLIST_SUB+= WXCONS="@comment " # Client only or full server version .if defined(WITH_CLIENT_ONLY) CONFIGURE_ARGS+= --enable-client-only -PLIST_SUB+= SERVER="@comment " +PORTDOCS= bacula.pdf ReleaseNotes html-manual +PKGDEINSTALL= ${PKGDIR}/pkg-deinstall.client +PKGINSTALL= ${PKGDIR}/pkg-install.client + .else .if defined(WITH_MYSQL) CONFIGURE_ARGS+= --with-mysql=yes @@ -105,8 +123,6 @@ PLIST_SUB+= SERVER="" RUN_DEPENDS+= ${LOCALBASE}/sbin/mtx:${PORTSDIR}/misc/mtx .endif -PORTDOCS= bacula.pdf ReleaseNotes html-manual - pre-everything:: .if !defined(WITH_CLIENT_ONLY) @${ECHO_MSG} "=======> ATTENTION <=======" @@ -147,19 +163,7 @@ post-install: # Extend only /etc/services @ ${SETENV} PKG_PREFIX=${PREFIX} \ ${SH} ${PKGINSTALL} ${PORTNAME} -.else - # Extend /etc/services and install UID/GID - @ ${SETENV} PKG_PREFIX=${PREFIX} \ - ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL - # Install config files and preserve existing ones - ${INSTALL_SCRIPT} ${FILESDIR}/chio-bacula ${PREFIX}/sbin - if [ -f ${PREFIX}/etc/bacula-barcodes ]; then \ - ${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${PREFIX}/etc/bacula-barcodes.new ; \ - ${ECHO_CMD} "etc/bacula-barcodes.new" >> ${TMPPLIST}; \ - else \ - ${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${PREFIX}/etc/bacula-barcodes.samples ; \ - ${ECHO_CMD} "etc/bacula-barcodes.samples" >> ${TMPPLIST}; \ - fi + # Console stuff if [ -f ${PREFIX}/etc/bconsole.conf.new ]; then \ ${ECHO_CMD} "etc/bconsole.conf.new" >> ${TMPPLIST}; \ elif [ -f ${PREFIX}/etc/bconsole.conf ]; then \ @@ -181,12 +185,30 @@ post-install: ${MV} ${PREFIX}/etc/gnome-console.conf ${PREFIX}/etc/gnome-console.conf.sample; \ ${ECHO_CMD} "etc/gnome-console.conf.sample" >> ${TMPPLIST}; \ fi -.endif # chmod of bsmtp program so bacula can use it with dropped down permissions +.endif +.else + # Extend /etc/services and install UID/GID + @ ${SETENV} PKG_PREFIX=${PREFIX} \ + ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL + # Install config files and preserve existing ones + ${INSTALL_SCRIPT} ${FILESDIR}/chio-bacula ${PREFIX}/sbin + if [ -f ${PREFIX}/etc/bacula-barcodes ]; then \ + ${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${PREFIX}/etc/bacula-barcodes.new ; \ + ${ECHO_CMD} "etc/bacula-barcodes.new" >> ${TMPPLIST}; \ + else \ + ${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${PREFIX}/etc/bacula-barcodes.samples ; \ + ${ECHO_CMD} "etc/bacula-barcodes.samples" >> ${TMPPLIST}; \ + fi + # 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 .endif # Install leaves existing conf files untouched. Respect this here! - for na in sd fd dir; do \ +.if defined(WITH_CLIENT_ONLY) + for na in fd; do \ +.else + for na in sd dir; do \ +.fi if [ -f ${PREFIX}/etc/bacula-$$na.conf.new ]; then \ ${ECHO_CMD} "etc/bacula-$$na.conf.new" >> ${TMPPLIST}; \ elif [ -f ${PREFIX}/etc/bacula-$$na.conf ]; then \ @@ -252,6 +274,8 @@ post-install: .endif @${ECHO_MSG} "*********************************************************************" - @$(CAT) pkg-message +.if !defined(WITH_CLIENT_ONLY) + $(CAT) pkg-message +.endif .include <bsd.port.post.mk> diff --git a/sysutils/bacula-server/files/pkg-deinstall.client.in b/sysutils/bacula-server/files/pkg-deinstall.client.in new file mode 100644 index 000000000000..a3c5e5a1ba2e --- /dev/null +++ b/sysutils/bacula-server/files/pkg-deinstall.client.in @@ -0,0 +1,19 @@ +#!/bin/sh + +PATH=/bin:/usr/bin:/usr/sbin +TMPFILE=/tmp/services-$RANDOM-$$ +if [ -z "${BACULA_DIR}" ]; then + BACULA_DIR=/var/db/bacula +fi + +case "$2" in +"DEINSTALL") + # Delete entries in /etc/services + sed -e '/# Bacula port start/,/# Bacule port end/{' \ + -e 'd' \ + -e '}' /etc/services > $TMPFILE + mv -f $TMPFILE /etc/services + + echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the bacula port" + ;; +esac diff --git a/sysutils/bacula-server/files/pkg-install.client.in b/sysutils/bacula-server/files/pkg-install.client.in new file mode 100644 index 000000000000..7dc31b47c8b8 --- /dev/null +++ b/sysutils/bacula-server/files/pkg-install.client.in @@ -0,0 +1,17 @@ +#!/bin/sh + +PATH=/bin:/usr/bin:/usr/sbin +if [ -z "${BACULA_DIR}" ]; then + BACULA_DIR=/var/db/bacula +fi + +# Always add lines in /etc/services +grep -q "bacula-dir" /etc/services +if [ "$?" != "0" ]; then + echo "# Bacula port start +bacula-dir 9101/tcp #Bacula director daemon +bacula-fd 9102/tcp #Bacula file daemon +bacula-sd 9103/tcp #Bacula storage daemon +# Bacule port end" >> /etc/services +fi + diff --git a/sysutils/bacula-server/pkg-deinstall.client b/sysutils/bacula-server/pkg-deinstall.client new file mode 100644 index 000000000000..a3c5e5a1ba2e --- /dev/null +++ b/sysutils/bacula-server/pkg-deinstall.client @@ -0,0 +1,19 @@ +#!/bin/sh + +PATH=/bin:/usr/bin:/usr/sbin +TMPFILE=/tmp/services-$RANDOM-$$ +if [ -z "${BACULA_DIR}" ]; then + BACULA_DIR=/var/db/bacula +fi + +case "$2" in +"DEINSTALL") + # Delete entries in /etc/services + sed -e '/# Bacula port start/,/# Bacule port end/{' \ + -e 'd' \ + -e '}' /etc/services > $TMPFILE + mv -f $TMPFILE /etc/services + + echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the bacula port" + ;; +esac diff --git a/sysutils/bacula-server/pkg-install.client b/sysutils/bacula-server/pkg-install.client new file mode 100644 index 000000000000..7dc31b47c8b8 --- /dev/null +++ b/sysutils/bacula-server/pkg-install.client @@ -0,0 +1,17 @@ +#!/bin/sh + +PATH=/bin:/usr/bin:/usr/sbin +if [ -z "${BACULA_DIR}" ]; then + BACULA_DIR=/var/db/bacula +fi + +# Always add lines in /etc/services +grep -q "bacula-dir" /etc/services +if [ "$?" != "0" ]; then + echo "# Bacula port start +bacula-dir 9101/tcp #Bacula director daemon +bacula-fd 9102/tcp #Bacula file daemon +bacula-sd 9103/tcp #Bacula storage daemon +# Bacule port end" >> /etc/services +fi + diff --git a/sysutils/bacula-server/pkg-plist b/sysutils/bacula-server/pkg-plist index 0bbb75ba717e..de5287f8a343 100644 --- a/sysutils/bacula-server/pkg-plist +++ b/sysutils/bacula-server/pkg-plist @@ -1,35 +1,33 @@ -%%SERVER%%share/bacula/query.sql +%%DATADIR%%/bacula/query.sql etc/rc.d/bacula.sh.sample -%%SERVER%%sbin/chio-bacula -%%SERVER%%sbin/bacula-dir -sbin/bacula-fd -%%SERVER%%sbin/bacula-sd -%%SERVER%%sbin/bextract -%%SERVER%%sbin/bcopy -%%SERVER%%sbin/bls -%%SERVER%%sbin/bscan -%%SERVER%%sbin/btape -sbin/bconsole +sbin/chio-bacula +sbin/bacula-dir +sbin/bacula-sd +sbin/bcopy +sbin/bextract +sbin/bls +sbin/bscan +sbin/btape %%WXCONS%%sbin/wx-console %%GNOMECONS%%sbin/gnome-console -%%SERVER%%sbin/dbcheck -%%SERVER%%sbin/bsmtp -%%SERVER%%share/bacula/mtx-changer -%%SERVER%%share/bacula/create_bacula_database -%%SERVER%%share/bacula/create_%%DBTYPE%%_database -%%SERVER%%share/bacula/drop_bacula_database -%%SERVER%%share/bacula/drop_%%DBTYPE%%_database -%%SERVER%%share/bacula/drop_bacula_tables -%%SERVER%%share/bacula/drop_%%DBTYPE%%_tables -%%SERVER%%share/bacula/grant_bacula_privileges -%%SERVER%%share/bacula/grant_%%DBTYPE%%_privileges -%%SERVER%%share/bacula/make_bacula_tables -%%SERVER%%share/bacula/make_%%DBTYPE%%_tables -%%SERVER%%share/bacula/update_bacula_tables -%%SERVER%%share/bacula/update_%%DBTYPE%%_tables -%%SERVER%%share/bacula/delete_catalog_backup -%%SERVER%%share/bacula/make_catalog_backup -%%SERVER%%@dirrm share/bacula +sbin/dbcheck +sbin/bsmtp +%%DATADIR%%/mtx-changer +%%DATADIR%%/create_bacula_database +%%DATADIR%%/create_%%DBTYPE%%_database +%%DATADIR%%/drop_bacula_database +%%DATADIR%%/drop_%%DBTYPE%%_database +%%DATADIR%%/drop_bacula_tables +%%DATADIR%%/drop_%%DBTYPE%%_tables +%%DATADIR%%/grant_bacula_privileges +%%DATADIR%%/grant_%%DBTYPE%%_privileges +%%DATADIR%%/make_bacula_tables +%%DATADIR%%/make_%%DBTYPE%%_tables +%%DATADIR%%/update_bacula_tables +%%DATADIR%%/update_%%DBTYPE%%_tables +%%DATADIR%%/delete_catalog_backup +%%DATADIR%%/make_catalog_backup +@dirrm %%DATADIR%% @unexec /usr/bin/killall badula-sd > /dev/null 2>&1 || true @unexec /usr/bin/killall bacula-dir > /dev/null 2>&1 || true @exec mkdir -p %%BACULA_DIR%% diff --git a/sysutils/bacula-server/pkg-plist.client b/sysutils/bacula-server/pkg-plist.client new file mode 100644 index 000000000000..b1b22ed6ef0d --- /dev/null +++ b/sysutils/bacula-server/pkg-plist.client @@ -0,0 +1,7 @@ +etc/rc.d/bacula.sh.sample +sbin/bacula-fd +sbin/bconsole +%%GNOMECONS%%sbin/gnome-console +%%WXCONS%%sbin/wx-console +@unexec /usr/bin/killall badula-fd > /dev/null 2>&1 || true +@exec mkdir -p %%BACULA_DIR%% |