[MAINTAINER-UPDATE] sysutils/bacula-server - prepare master port for sysutils/bacula-bat

Alter this port in preparation for a new port, sysutils/bacula-bat
	No need to upgrade bacula-server unless you really want to.

PR:		ports/116449
Submitted by:	Dan Langille <dan@langille.org>
This commit is contained in:
Edwin Groothuis 2007-09-24 03:05:51 +00:00
parent bb2e13e258
commit 165bc22b86
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=200014
10 changed files with 242 additions and 95 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= bacula
DISTVERSION= 2.2.4
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= bacula
@ -22,13 +23,17 @@ UNIQUENAME?=${PORTNAME}${PKGNAMESUFFIX}
DISTFILES= ${PORTNAME}-${PORTVERSION}.tar.gz
.if !defined(WITH_BAT)
.if !defined(WITH_CLIENT_ONLY)
USE_RC_SUBR?= bacula-dir bacula-sd
.endif
.if defined(WITH_CLIENT_ONLY)
SUB_FILES+= pkg-message.client
.else
SUB_FILES+= pkg-message.server
.endif
.endif
# The user/group IDs below are registered, see
# http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#DADS-UID
@ -37,7 +42,7 @@ BACULA_DIR?=/var/db/bacula
#
MANCOMPRESSED= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-tcp-wrappers=/usr/lib \
CONFIGURE_ARGS+= --with-tcp-wrappers=/usr/lib \
--enable-smartalloc \
--with-working-dir=${BACULA_DIR} \
--with-scriptdir=${PREFIX}/share/${PORTNAME} \
@ -90,7 +95,9 @@ WANT_GNOME= yes
USE_GNOME= libgnome gnomelibs libgnomeui
.endif
.if !defined(WITH_BAT)
PLIST_SUB+= BACULA_DIR=${BACULA_DIR}
.endif
.include <bsd.port.pre.mk>
@ -101,6 +108,10 @@ CONFIGURE_ARGS+= --enable-nls
CONFIGURE_ARGS+= --disable-nls
.endif
# overridden if client install
PKGDEINSTALL= ${PKGDIR}/pkg-deinstall.server
PKGINSTALL= ${PKGDIR}/pkg-install.server
# Client only or full server version
.if defined(WITH_CLIENT_ONLY)
CONFFILES= fd
@ -160,16 +171,20 @@ RUN_DEPENDS+= ${LOCALBASE}/sbin/mtx:${PORTSDIR}/misc/mtx
.endif
.endif
.if defined(WITH_OPENSSL)
CONFIGURE_ARGS+= --with-openssl
.endif
.if !defined(WITH_BAT)
.if defined(WITH_CLIENT_ONLY)
MAN8=bacula-fd.8 bconsole.8
.else
MAN8=bacula.8 bacula-dir.8 bacula-sd.8 bcopy.8 bextract.8 bls.8 bscan.8 btape.8 btraceback.8 dbcheck.8
MAN1=bsmtp.1 bacula-bgnome-console.1 bacula-tray-monitor.1 bacula-bwxconsole.1
.endif
.endif
MAKE_ARGS+= -E MAN8 -E MAN1
MAKE_ENV+= MAN8="${MAN8}" MAN1="${MAN1}"
@ -216,6 +231,7 @@ post-patch:
@${REINPLACE_CMD} -e '/^fd_subdirs = /s|src/filed||' -e 's|src/console||' ${WRKSRC}/Makefile.in
.endif
.if !target(pre-install)
pre-install:
if [ ! -d "${BACULA_DIR}" ]; then \
${ECHO_CMD} "creating ${BACULA_DIR}" ; \
@ -227,7 +243,10 @@ pre-install:
# Extend /etc/services and install UID/GID
@ ${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
.endif
.if !target(post-install)
post-install:
.if defined(WITH_CLIENT_ONLY)
# Extend only /etc/services
@ -287,5 +306,6 @@ post-install:
done
@${CAT} ${PKGMESSAGE}
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,11 @@
--- autoconf/configure.in.orig Sat Sep 15 12:11:40 2007
+++ autoconf/configure.in Sat Sep 15 12:11:40 2007
@@ -2225,7 +2225,7 @@
cd src/qt-console
chmod 755 install_conf_file build-depkgs-qt-console
echo "Creating bat Makefile"
- qmake
+ ${QMAKE}
cd ${BUILD_DIR}
fi

View File

@ -0,0 +1,11 @@
--- configure.orig Sat Sep 15 12:11:56 2007
+++ configure Sat Sep 15 12:11:56 2007
@@ -32106,7 +32106,7 @@
cd src/qt-console
chmod 755 install_conf_file build-depkgs-qt-console
echo "Creating bat Makefile"
- qmake
+ ${QMAKE}
cd ${BUILD_DIR}
fi

View File

@ -0,0 +1,11 @@
--- src/qt-console/build-depkgs-qt-console.orig Sat Sep 15 12:11:32 2007
+++ src/qt-console/build-depkgs-qt-console Sat Sep 15 12:11:32 2007
@@ -147,7 +147,7 @@
echo " INSTALLBASE = ${TOP_DIR}/qwt" >>${TOP_DIR}/depkgs/qwt-5.0.2/qwtconfig.pri
echo "}" >>${TOP_DIR}/depkgs/qwt-5.0.2/qwtconfig.pri
cat ${TOP_DIR}/qwtconfig.pri >>${TOP_DIR}/depkgs/qwt-5.0.2/qwtconfig.pri
- qmake >make.log
+ ${QMAKE} >make.log
do_make Makefile >>make.log
do_make Makefile install >>make.log
echo "In case of problems see: `pwd`/make.log"

View File

@ -0,0 +1,32 @@
#!/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
if [ -d ${BACULA_DIR} ]; then
rmdir ${BACULA_DIR};
fi
if [ -d ${BACULA_DIR} ]; then
echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the bacula port"
fi
# Note how to delete UID/GID
USER=bacula
GROUP=${USER}
if pw usershow "${USER}" 2>/dev/null 1>&2; then
echo "To delete Bacula user permanently, use 'pw userdel ${USER}'"
echo "To delete Bacula group permanently, use 'pw groupdel ${GROUP}'"
fi
;;
esac

View File

@ -0,0 +1,62 @@
#!/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
case $2 in
PRE-INSTALL)
# Install UID/GID
USER=bacula
GROUP=${USER}
UID=910
GID=${UID}
if [ ! -d ${BACULA_DIR} ]; then
mkdir -p ${BACULA_DIR}
fi
if pw group show "${GROUP}" 2>/dev/null; then
echo "You already have a group \"${GROUP}\", so I will use it."
else
if pw groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
if pw user show "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
if pw usermod ${USER} -d ${BACULA_DIR} -G operator
then
echo "Changed home directory of \"${USER}\" to \"${BACULA_DIR}\""
else
echo "Changing home directory of \"${USER}\" to \"${BACULA_DIR}\" failed..."
exit 1
fi
else
if pw useradd ${USER} -u ${UID} -g ${GROUP} -G operator -h - \
-d ${BACULA_DIR} -s /sbin/nologin -c "Bacula Daemon"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
chown -R ${USER}:${GROUP} ${BACULA_DIR}
;;
esac

View File

@ -1,32 +0,0 @@
#!/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
if [ -d ${BACULA_DIR} ]; then
rmdir ${BACULA_DIR};
fi
if [ -d ${BACULA_DIR} ]; then
echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the bacula port"
fi
# Note how to delete UID/GID
USER=bacula
GROUP=${USER}
if pw usershow "${USER}" 2>/dev/null 1>&2; then
echo "To delete Bacula user permanently, use 'pw userdel ${USER}'"
echo "To delete Bacula group permanently, use 'pw groupdel ${GROUP}'"
fi
;;
esac

View File

@ -0,0 +1,32 @@
#!/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
if [ -d ${BACULA_DIR} ]; then
rmdir ${BACULA_DIR};
fi
if [ -d ${BACULA_DIR} ]; then
echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the bacula port"
fi
# Note how to delete UID/GID
USER=bacula
GROUP=${USER}
if pw usershow "${USER}" 2>/dev/null 1>&2; then
echo "To delete Bacula user permanently, use 'pw userdel ${USER}'"
echo "To delete Bacula group permanently, use 'pw groupdel ${GROUP}'"
fi
;;
esac

View File

@ -1,62 +0,0 @@
#!/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
case $2 in
PRE-INSTALL)
# Install UID/GID
USER=bacula
GROUP=${USER}
UID=910
GID=${UID}
if [ ! -d ${BACULA_DIR} ]; then
mkdir -p ${BACULA_DIR}
fi
if pw group show "${GROUP}" 2>/dev/null; then
echo "You already have a group \"${GROUP}\", so I will use it."
else
if pw groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
if pw user show "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
if pw usermod ${USER} -d ${BACULA_DIR} -G operator
then
echo "Changed home directory of \"${USER}\" to \"${BACULA_DIR}\""
else
echo "Changing home directory of \"${USER}\" to \"${BACULA_DIR}\" failed..."
exit 1
fi
else
if pw useradd ${USER} -u ${UID} -g ${GROUP} -G operator -h - \
-d ${BACULA_DIR} -s /sbin/nologin -c "Bacula Daemon"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
chown -R ${USER}:${GROUP} ${BACULA_DIR}
;;
esac

View File

@ -0,0 +1,62 @@
#!/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
case $2 in
PRE-INSTALL)
# Install UID/GID
USER=bacula
GROUP=${USER}
UID=910
GID=${UID}
if [ ! -d ${BACULA_DIR} ]; then
mkdir -p ${BACULA_DIR}
fi
if pw group show "${GROUP}" 2>/dev/null; then
echo "You already have a group \"${GROUP}\", so I will use it."
else
if pw groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
if pw user show "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
if pw usermod ${USER} -d ${BACULA_DIR} -G operator
then
echo "Changed home directory of \"${USER}\" to \"${BACULA_DIR}\""
else
echo "Changing home directory of \"${USER}\" to \"${BACULA_DIR}\" failed..."
exit 1
fi
else
if pw useradd ${USER} -u ${UID} -g ${GROUP} -G operator -h - \
-d ${BACULA_DIR} -s /sbin/nologin -c "Bacula Daemon"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
chown -R ${USER}:${GROUP} ${BACULA_DIR}
;;
esac