aboutsummaryrefslogtreecommitdiff
path: root/sysutils/bacula-server/files
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2007-09-24 03:05:51 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2007-09-24 03:05:51 +0000
commit165bc22b86e23a94b6af79f1d402111311fa1382 (patch)
tree99ada15fd3234c6c100178cd4439c8655a85b33c /sysutils/bacula-server/files
parentbb2e13e258f10284c5cbd5723f691e52ead26e31 (diff)
[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>
Notes
Notes: svn path=/head/; revision=200014
Diffstat (limited to 'sysutils/bacula-server/files')
-rw-r--r--sysutils/bacula-server/files/patch-autoconf-configure.in11
-rw-r--r--sysutils/bacula-server/files/patch-configure11
-rw-r--r--sysutils/bacula-server/files/patch-src-qt-console-build-depkgs-qt-console11
-rw-r--r--sysutils/bacula-server/files/pkg-deinstall.server.in32
-rw-r--r--sysutils/bacula-server/files/pkg-install.server.in62
5 files changed, 127 insertions, 0 deletions
diff --git a/sysutils/bacula-server/files/patch-autoconf-configure.in b/sysutils/bacula-server/files/patch-autoconf-configure.in
new file mode 100644
index 000000000000..1dfdcd5f342c
--- /dev/null
+++ b/sysutils/bacula-server/files/patch-autoconf-configure.in
@@ -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
+
diff --git a/sysutils/bacula-server/files/patch-configure b/sysutils/bacula-server/files/patch-configure
new file mode 100644
index 000000000000..00235be17914
--- /dev/null
+++ b/sysutils/bacula-server/files/patch-configure
@@ -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
+
diff --git a/sysutils/bacula-server/files/patch-src-qt-console-build-depkgs-qt-console b/sysutils/bacula-server/files/patch-src-qt-console-build-depkgs-qt-console
new file mode 100644
index 000000000000..2e0a7e6d2d54
--- /dev/null
+++ b/sysutils/bacula-server/files/patch-src-qt-console-build-depkgs-qt-console
@@ -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"
diff --git a/sysutils/bacula-server/files/pkg-deinstall.server.in b/sysutils/bacula-server/files/pkg-deinstall.server.in
new file mode 100644
index 000000000000..3af061509188
--- /dev/null
+++ b/sysutils/bacula-server/files/pkg-deinstall.server.in
@@ -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
diff --git a/sysutils/bacula-server/files/pkg-install.server.in b/sysutils/bacula-server/files/pkg-install.server.in
new file mode 100644
index 000000000000..1dc3d8613ada
--- /dev/null
+++ b/sysutils/bacula-server/files/pkg-install.server.in
@@ -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