aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorWilliam Grzybowski <wg@FreeBSD.org>2014-08-07 19:21:45 +0000
committerWilliam Grzybowski <wg@FreeBSD.org>2014-08-07 19:21:45 +0000
commitd8e5efd339004124efb1a710db697b6d97dd9757 (patch)
tree7e5615caac15ce6b29acbb7409204779b369714e /sysutils
parent4b5e2cd2155f28ca4b30bc74267b8e0688c1bae4 (diff)
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile5
-rw-r--r--sysutils/bacula5-bat/Makefile33
-rw-r--r--sysutils/bacula5-bat/pkg-descr13
-rw-r--r--sysutils/bacula5-bat/pkg-plist5
-rw-r--r--sysutils/bacula5-client-static/Makefile26
-rw-r--r--sysutils/bacula5-client/Makefile19
-rw-r--r--sysutils/bacula5-docs/Makefile35
-rw-r--r--sysutils/bacula5-docs/distinfo2
-rw-r--r--sysutils/bacula5-docs/pkg-descr13
-rw-r--r--sysutils/bacula5-server/Makefile192
-rw-r--r--sysutils/bacula5-server/Makefile.common27
-rw-r--r--sysutils/bacula5-server/distinfo2
-rw-r--r--sysutils/bacula5-server/files/bacula-barcodes51
-rw-r--r--sysutils/bacula5-server/files/bacula-dir.in31
-rw-r--r--sysutils/bacula5-server/files/bacula-fd.in31
-rw-r--r--sysutils/bacula5-server/files/bacula-sd.in31
-rw-r--r--sysutils/bacula5-server/files/chio-bacula200
-rw-r--r--sysutils/bacula5-server/files/patch-src__cats__Makefile.in51
-rw-r--r--sysutils/bacula5-server/files/patch-src__cats__install-default-backend.in25
-rw-r--r--sysutils/bacula5-server/files/patch-src__console__Makefile.in11
-rw-r--r--sysutils/bacula5-server/files/patch-src__dird__Makefile.in28
-rw-r--r--sysutils/bacula5-server/files/patch-src__filed__Makefile.in11
-rw-r--r--sysutils/bacula5-server/files/patch-src__findlib__Makefile.in20
-rw-r--r--sysutils/bacula5-server/files/patch-src__lib__Makefile.in38
-rw-r--r--sysutils/bacula5-server/files/patch-src__qt-configle__bat.pro.in11
-rw-r--r--sysutils/bacula5-server/files/patch-src__stored__Makefile.in71
-rw-r--r--sysutils/bacula5-server/files/patch-src__tools__Makefile.in99
-rw-r--r--sysutils/bacula5-server/files/pkg-deinstall.client.in33
-rw-r--r--sysutils/bacula5-server/files/pkg-install.client.in13
-rw-r--r--sysutils/bacula5-server/files/pkg-message.client.in15
-rw-r--r--sysutils/bacula5-server/files/pkg-message.server.in67
-rw-r--r--sysutils/bacula5-server/pkg-descr11
-rw-r--r--sysutils/bacula5-server/pkg-plist79
-rw-r--r--sysutils/bacula5-server/pkg-plist.client31
34 files changed, 1330 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 22a54a563a11..c863e4d32d9a 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -56,6 +56,11 @@
SUBDIR += bacula-client-static
SUBDIR += bacula-docs
SUBDIR += bacula-server
+ SUBDIR += bacula5-bat
+ SUBDIR += bacula5-client
+ SUBDIR += bacula5-client-static
+ SUBDIR += bacula5-docs
+ SUBDIR += bacula5-server
SUBDIR += bamf
SUBDIR += bashburn
SUBDIR += batmon
diff --git a/sysutils/bacula5-bat/Makefile b/sysutils/bacula5-bat/Makefile
new file mode 100644
index 000000000000..e176d8bf4d9f
--- /dev/null
+++ b/sysutils/bacula5-bat/Makefile
@@ -0,0 +1,33 @@
+# Created by: Dan Langille <dan@langille.org>
+# $FreeBSD$
+
+PORTNAME= bacula
+PKGNAMESUFFIX= 5-bat
+PORTREVISION= 5
+
+COMMENT= Network backup solution (GUI)
+
+LIB_DEPENDS+= libqwt.so:${PORTSDIR}/x11-toolkits/qwt5 \
+ libbac.so:${PORTSDIR}/sysutils/bacula5-client
+
+CONFLICTS= bacula-bat-*
+
+USES= pkgconfig
+USE_QT4= qmake_build uic_build moc_build rcc_build
+WITH_BAT= yes
+
+PLIST= ${.CURDIR}/pkg-plist
+MAKE_ENV+= MAKEOBJDIRPREFIX=/
+
+MASTERDIR= ${.CURDIR}/../../sysutils/bacula5-server
+
+CONFIGURE_ARGS+= --enable-bat \
+ --with-qwt=${LOCALBASE}/lib \
+ --disable-build-dird \
+ --disable-build-stored \
+ --enable-client-only
+
+OPTIONS_DEFINE= OPENSSL
+OPTIONS_DEFAULT=OPENSSL
+
+.include "${MASTERDIR}/Makefile"
diff --git a/sysutils/bacula5-bat/pkg-descr b/sysutils/bacula5-bat/pkg-descr
new file mode 100644
index 000000000000..91e157ffc8b8
--- /dev/null
+++ b/sysutils/bacula5-bat/pkg-descr
@@ -0,0 +1,13 @@
+bat is the GUI inteface for Bacula.
+
+Bacula is a set of computer programs that permit you (or the system
+administrator) to manage backup, recovery, and verification of
+computer data across a network of computers of different kinds.
+In technical terms, it is a network Client/Server based backup program.
+Bacula is relatively easy to use and efficient, while offering many
+advanced storage management features that make it easy to find and
+recover lost or damaged files. Due to its modular design, Bacula is
+scalable from small single computer systems to systems consisting of
+hundreds of computers located over a large network.
+
+WWW: http://www.bacula.org/
diff --git a/sysutils/bacula5-bat/pkg-plist b/sysutils/bacula5-bat/pkg-plist
new file mode 100644
index 000000000000..0b1e4857dd11
--- /dev/null
+++ b/sysutils/bacula5-bat/pkg-plist
@@ -0,0 +1,5 @@
+@sample %%ETCDIR%%/bat.conf.sample
+man/man1/bat.1.gz
+sbin/bat
+@dirrmtry %%ETCDIR%%
+
diff --git a/sysutils/bacula5-client-static/Makefile b/sysutils/bacula5-client-static/Makefile
new file mode 100644
index 000000000000..7a980fb59e43
--- /dev/null
+++ b/sysutils/bacula5-client-static/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= bacula
+PKGNAMESUFFIX= 5-client-static
+
+COMMENT= Network backup solution (static client)
+
+CONFLICTS= bacula-client-static-*
+
+PLIST= ${.CURDIR}/pkg-plist
+MASTERDIR= ${.CURDIR}/../../sysutils/bacula5-server
+
+PLIST_FILES= sbin/bacula-fd-static \
+ sbin/bconsole-static
+
+OPTIONS_DEFINE= NLS OPENSSL
+OPTIONS_DEFAULT=NLS OPENSSL
+
+CONFIGURE_ARGS+= --enable-client-only \
+ --enable-static-fd \
+ --enable-static-cons \
+ --disable-libtool \
+ --disable-build-dird \
+ --disable-build-stored
+
+.include "${MASTERDIR}/Makefile"
diff --git a/sysutils/bacula5-client/Makefile b/sysutils/bacula5-client/Makefile
new file mode 100644
index 000000000000..d5cd7f21a477
--- /dev/null
+++ b/sysutils/bacula5-client/Makefile
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+PORTNAME= bacula
+PKGNAMESUFFIX= 5-client
+
+COMMENT= Network backup solution (client)
+
+CONFLICTS= bacula-client-*
+
+WITH_CLIENT_ONLY=yes
+USE_RC_SUBR= bacula-fd
+
+PLIST= ${PKGDIR}/pkg-plist.client
+MASTERDIR= ${.CURDIR}/../../sysutils/bacula5-server
+
+OPTIONS_DEFINE= NLS OPENSSL PYTHON
+OPTIONS_DEFAULT=NLS OPENSSL
+
+.include "${MASTERDIR}/Makefile"
diff --git a/sysutils/bacula5-docs/Makefile b/sysutils/bacula5-docs/Makefile
new file mode 100644
index 000000000000..a8be65df4226
--- /dev/null
+++ b/sysutils/bacula5-docs/Makefile
@@ -0,0 +1,35 @@
+# Created by: Dan Langille <dan@langille.org>
+# $FreeBSD$
+
+PORTNAME= bacula
+PORTVERSION= 5.2.12
+CATEGORIES= sysutils
+MASTER_SITES= SF
+PKGNAMESUFFIX= 5-docs
+DISTFILES= ${PORTNAME}-docs-${PORTVERSION}.tar.bz2
+
+CONFLICTS= bacula-*
+
+MAINTAINER= dan@langille.org
+COMMENT= Bacula document set
+
+NO_BUILD= yes
+
+UNIQUENAME= ${PORTNAME}${PKGNAMESUFFIX}
+
+PORTDOCS= *.pdf
+
+OPTIONS_DEFINE= DOCS
+
+.include <bsd.port.options.mk>
+
+.if empty(PORT_OPTIONS:DOCS)
+IGNORE= consists of only documentation, please enable DOCS and try again
+.endif
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${FIND} ${WRKDIR}/${PORTNAME}-docs-${PORTVERSION}/manuals/en \
+ -name "*.pdf" -exec ${INSTALL_DATA} {} ${STAGEDIR}${DOCSDIR}/ \;
+
+.include <bsd.port.mk>
diff --git a/sysutils/bacula5-docs/distinfo b/sysutils/bacula5-docs/distinfo
new file mode 100644
index 000000000000..9ed7ccaff98e
--- /dev/null
+++ b/sysutils/bacula5-docs/distinfo
@@ -0,0 +1,2 @@
+SHA256 (bacula-docs-5.2.12.tar.bz2) = 0cb61dbb1224786521286ce2b828d6b802908efc32ef7220db2e3e35530b7876
+SIZE (bacula-docs-5.2.12.tar.bz2) = 41968688
diff --git a/sysutils/bacula5-docs/pkg-descr b/sysutils/bacula5-docs/pkg-descr
new file mode 100644
index 000000000000..2beb63b5605d
--- /dev/null
+++ b/sysutils/bacula5-docs/pkg-descr
@@ -0,0 +1,13 @@
+Bacula is a set of computer programs that permit you (or the system
+administrator) to manage backup, recovery, and verification of
+computer data across a network of computers of different kinds.
+In technical terms, it is a network Client/Server based backup program.
+Bacula is relatively easy to use and efficient, while offering many
+advanced storage management features that make it easy to find and
+recover lost or damaged files. Due to its modular design, Bacula is
+scalable from small single computer systems to systems consisting of
+hundreds of computers located over a large network.
+
+This port installs the latest documentation for Bacula.
+
+WWW: http://www.bacula.org/
diff --git a/sysutils/bacula5-server/Makefile b/sysutils/bacula5-server/Makefile
new file mode 100644
index 000000000000..ba82a0e8d4e3
--- /dev/null
+++ b/sysutils/bacula5-server/Makefile
@@ -0,0 +1,192 @@
+# Created by: Dmitry Sivachenko <demon@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= bacula
+DISTVERSION= 5.2.12
+PORTREVISION?= 0
+CATEGORIES?= sysutils
+MASTER_SITES= SF/bacula/bacula/${PORTVERSION}
+PKGNAMEPREFIX?= #
+PKGNAMESUFFIX?= 5-server
+
+MAINTAINER= dan@langille.org
+COMMENT?= Network backup solution (server)
+
+USES+= libtool:keepla
+
+CONFLICTS?= bacula-server-*
+
+LIB_DEPENDS+= liblzo2.so:${PORTSDIR}/archivers/lzo2
+
+USERS= bacula
+GROUPS= ${USERS}
+
+PLIST_SUB+= MAJOR=${PORTVERSION:R:R}
+
+GNU_CONFIGURE= yes
+USE_LDCONFIG= yes
+
+CPPFLAGS+= -I/usr/include/readline -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+
+OPTIONS_DEFINE?= SQLITE3 MYSQL PGSQL MTX PYTHON NLS OPENSSL
+OPTIONS_DEFAULT?= NLS OPENSSL PGSQL
+MTX_DESC= Install mtx for control of autochanger devices
+
+OPENSSL_USE= OPENSSL=yes
+OPENSSL_CONFIGURE_ON= --with-openssl=${OPENSSLBASE}
+OPENSSL_CONFIGURE_OFF= --with-openssl="no"
+
+.if ${PKGNAMESUFFIX} == "5-client" || ${PKGNAMESUFFIX} == "5-server" #Till end of the file
+
+PYTHON_USE= PYTHON=yes
+PYTHON_CONFIGURE_ON= --with-python=yes
+
+.if !defined(WITH_CLIENT_ONLY)
+LIB_DEPENDS+= libbac.so:${PORTSDIR}/sysutils/bacula5-client
+USE_RC_SUBR?= bacula-dir bacula-sd
+.endif
+
+.if defined(WITH_CLIENT_ONLY)
+SUB_FILES+= pkg-install.client pkg-deinstall.client pkg-message.client
+.else
+SUB_FILES+= pkg-message.server
+.endif
+
+MANCOMPRESSED= yes
+CONFIGURE_ARGS+=--with-tcp-wrappers=/usr/lib \
+ --enable-smartalloc \
+ --sysconfdir=${ETCDIR} \
+ --with-working-dir=${BACULA_DIR} \
+ --with-scriptdir=${PREFIX}/share/${PORTNAME} \
+ --with-readline=yes \
+ --disable-conio \
+ --enable-batch-insert \
+ --with-plugindir=${PREFIX}/lib \
+ --with-dump-email=root@localhost \
+ --with-job-email=root@localhost \
+ --with-db-name=bacula \
+ --with-sbin-perm=755 \
+ --with-db-user=bacula \
+ --with-baseport=9101
+
+.if defined(WITH_CLIENT_ONLY)
+CONFIGURE_ARGS+=--with-fd-user=root \
+ --with-fd-group=wheel
+.else
+CONFIGURE_ARGS+=--with-dir-user=${BACULA_USER} \
+ --with-dir-group=${BACULA_GROUP} \
+ --with-sd-user=${BACULA_USER} \
+ --with-sd-group=operator
+.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
+#
+BACULA_USER?= bacula
+BACULA_GROUP?= ${BACULA_USER}
+BACULA_UID?= 910
+BACULA_GID?= ${BACULA_UID}
+BACULA_DIR?= /var/db/bacula
+
+PLIST_SUB+= BACULA_DIR=${BACULA_DIR}
+
+SUB_LIST= BACULA_USER=${BACULA_USER} \
+ BACULA_GROUP=${BACULA_GROUP} \
+ BACULA_UID=${BACULA_UID} \
+ BACULA_GID=${BACULA_GID} \
+ BACULA_DIR=${BACULA_DIR}
+
+NLS_USES= gettext
+NLS_CONFIGURE_ENABLE= nls
+
+# Client only or full server version
+.if defined(WITH_CLIENT_ONLY)
+CONFFILES= fd
+CONFIGURE_ARGS+= --enable-client-only
+
+PKGDEINSTALL= ${FILESDIR}/pkg-deinstall.client
+PKGINSTALL= ${FILESDIR}/pkg-install.client
+.else
+# 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}
+DBTYPE= mysql
+SUB_LIST+= REQ_MYSQL=mysql REQ_PGSQL=""
+.elif ${PORT_OPTIONS:MSQLITE3}
+DBTYPE= sqlite3
+.else
+DBTYPE= postgresql
+SUB_LIST+= REQ_MYSQL="" REQ_PGSQL=postgresql
+.endif
+PLIST_SUB+= DBTYPE=${DBTYPE}
+
+.endif
+
+.if defined(WITH_CLIENT_ONLY)
+MP8+= bacula-fd.8 bconsole.8
+.else
+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
+MP1+= bsmtp.1 bacula-tray-monitor.1 bacula-bwxconsole.1
+.endif
+
+MAKE_ENV+= MAN8="${MP8}" MAN1="${MP1}"
+
+post-patch:
+# This port does not install docs. See bacula-docs for that
+ ${REINPLACE_CMD} -e '/docdir/d' ${WRKSRC}/Makefile.in
+# Change $(ECHO) to echo in some Makefile.in files
+ @${REINPLACE_CMD} -e 's|$$(ECHO)|echo|g' ${WRKSRC}/src/filed/Makefile.in \
+ ${WRKSRC}/src/console/Makefile.in
+# Default bconsole.conf is in ${ETCDIR}
+ @${REINPLACE_CMD} -e 's|./bconsole.conf|${ETCDIR}/bconsole.conf|g' ${WRKSRC}/src/console/console.c
+ @${REINPLACE_CMD} -e 's|^MAN8 =|MAN8 ?=|g' -e 's|^MAN1 =|MAN1 ?=|g' ${WRKSRC}/manpages/Makefile.in
+.if defined(WITH_CLIENT_ONLY)
+# In client port only install startup script out of script dir (see below post-install)
+# Dont mkdir ${PREFIX}/share/bacula cause it's empty
+ @${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
+.else
+# In server port don't install filed
+ @${REINPLACE_CMD} -e '/^fd_subdirs = /s|src/filed||' -e 's|src/console||' \
+ -e 's|src/lib||' -e 's|src/findlib||' -e 's|@FD_PLUGIN_DIR@||' ${WRKSRC}/Makefile.in
+ @${REINPLACE_CMD} -e 's|../lib/|$$(LOCALBASE)/lib/|g' -e 's|../findlib/|$$(LOCALBASE)/lib/|g' ${WRKSRC}/src/dird/Makefile.in \
+ ${WRKSRC}/src/stored/Makefile.in ${WRKSRC}/src/tools/Makefile.in
+ @${REINPLACE_CMD} -e 's|fd_plugins.h|filed/fd_plugins.h|g' -e 's|dir_plugins.h|dird/dir_plugins.h|g' -e 's|stored.h|stored/stored.h|g' \
+ ${WRKSRC}/src/tools/bpluginfo.c
+.endif
+
+pre-install:
+ ${MKDIR} ${STAGEDIR}${BACULA_DIR}
+
+.if !target(post-install)
+post-install:
+.if defined(WITH_CLIENT_ONLY)
+ ${MV} ${STAGEDIR}${ETCDIR}/bconsole.conf ${STAGEDIR}${ETCDIR}/bconsole.conf.sample
+.else
+ ${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
+ for na in ${CONFFILES}; do \
+ ${MV} ${STAGEDIR}${ETCDIR}/bacula-$$na.conf ${STAGEDIR}${ETCDIR}/bacula-$$na.conf.sample; \
+ done
+.endif
+.else
+.include "${MASTERDIR}/Makefile.common"
+.endif # -client and -server are defined
+.include <bsd.port.mk>
diff --git a/sysutils/bacula5-server/Makefile.common b/sysutils/bacula5-server/Makefile.common
new file mode 100644
index 000000000000..1b443bffed78
--- /dev/null
+++ b/sysutils/bacula5-server/Makefile.common
@@ -0,0 +1,27 @@
+post-patch:
+# Change $(ECHO) to echo in some Makefile.in files
+ @${REINPLACE_CMD} -e 's|$$(ECHO)|echo|g' ${WRKSRC}/src/filed/Makefile.in \
+ ${WRKSRC}/src/console/Makefile.in
+
+post-build:
+.if ${PKGNAMEPREFIX} == "nagios-check_"
+ ${MAKE_CMD} -C ${WRKSRC}/examples/nagios/check_bacula
+.endif
+
+do-install:
+.if ${PKGNAMESUFFIX} == "5-bat"
+# Install config files and preserve existing ones
+ ${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} ${STAGEDIR}${PREFIX}/libexec/nagios
+ ${INSTALL_PROGRAM} ${WRKSRC}/examples/nagios/check_bacula/check_bacula \
+ ${STAGEDIR}${PREFIX}/libexec/nagios
+.endif
+.if ${PKGNAMESUFFIX} == "5-client-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
diff --git a/sysutils/bacula5-server/distinfo b/sysutils/bacula5-server/distinfo
new file mode 100644
index 000000000000..2943922e8de8
--- /dev/null
+++ b/sysutils/bacula5-server/distinfo
@@ -0,0 +1,2 @@
+SHA256 (bacula-5.2.12.tar.gz) = 360435634e28881b3fedb0dc1901b9c9be1895ce1e39c9737262b25f44513887
+SIZE (bacula-5.2.12.tar.gz) = 4147847
diff --git a/sysutils/bacula5-server/files/bacula-barcodes b/sysutils/bacula5-server/files/bacula-barcodes
new file mode 100644
index 000000000000..0a0b2dc28f24
--- /dev/null
+++ b/sysutils/bacula5-server/files/bacula-barcodes
@@ -0,0 +1,51 @@
+#
+# Bacula barcode simulation file
+# used by ${PREFIX}/sbin/chio-bacula (FreeBSD)
+#
+# The volumenames are returned by the "changer list" command
+# labeling in the console is done by "label barcodes"
+# (then all volumes belog to the default pool).
+# All Lines with an "#" at the bedinning are ignored
+#
+# !!!! If you export an tape and reinsert another one,
+# !!!! don't forget to change the volume name in this file!
+#
+1:Volume1-100
+2:Volume1-101
+3:Volume1-102
+4:Volume1-103
+5:Volume1-104
+6:Volume1-105
+7:Volume1-106
+8:Volume1-107
+9:Volume1-108
+10:Volume1-109
+11:Volume1-110
+12:Volume1-111
+#
+# Further volumes exported from the changer
+#
+# 36GB AIT2 tapes
+#Volume1-100
+#Volume1-101
+#Volume1-102
+#Volume1-103
+#Volume1-104
+#Volume1-105
+#Volume1-106
+#Volume1-107
+#Volume1-108
+#Volume1-109
+#Volume1-110
+#Volume1-111
+#Volume1-112
+#Volume1-113
+#Volume1-114
+#Volume1-115
+#
+# 50GB AIT2 tapes
+#Volume2-200
+#Volume2-201
+#Volume2-202
+#Volume2-203
+#Volume2-204
diff --git a/sysutils/bacula5-server/files/bacula-dir.in b/sysutils/bacula5-server/files/bacula-dir.in
new file mode 100644
index 000000000000..49086897bd68
--- /dev/null
+++ b/sysutils/bacula5-server/files/bacula-dir.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: bacula_dir
+# REQUIRE: DAEMON %%REQ_MYSQL%% %%REQ_PGSQL%%
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# bacula_dir_enable (bool): Set to NO by default.
+# Set it to YES to enable bacula_dir.
+# bacula_dir_flags (params): Set params used to start bacula_dir.
+#
+
+. /etc/rc.subr
+
+name="bacula_dir"
+rcvar=${name}_enable
+command=%%PREFIX%%/sbin/bacula-dir
+
+load_rc_config $name
+
+: ${bacula_dir_enable="NO"}
+: ${bacula_dir_flags=" -u bacula -g bacula -v -c %%PREFIX%%/etc/bacula/bacula-dir.conf"}
+: ${bacula_dir_pidfile="/var/run/bacula-dir.9101.pid"}
+
+pidfile="${bacula_dir_pidfile}"
+
+run_rc_command "$1"
diff --git a/sysutils/bacula5-server/files/bacula-fd.in b/sysutils/bacula5-server/files/bacula-fd.in
new file mode 100644
index 000000000000..70add50a1915
--- /dev/null
+++ b/sysutils/bacula5-server/files/bacula-fd.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: bacula_fd
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# bacula_fd_enable (bool): Set to NO by default.
+# Set it to YES to enable bacula_fd.
+# bacula_fd_flags (params): Set params used to start bacula_fd.
+#
+
+. /etc/rc.subr
+
+name="bacula_fd"
+rcvar=${name}_enable
+command=%%PREFIX%%/sbin/bacula-fd
+
+load_rc_config $name
+
+: ${bacula_fd_enable="NO"}
+: ${bacula_fd_flags=" -u root -g wheel -v -c %%PREFIX%%/etc/bacula/bacula-fd.conf"}
+: ${bacula_fd_pidfile="/var/run/bacula-fd.9102.pid"}
+
+pidfile="${bacula_fd_pidfile}"
+
+run_rc_command "$1"
diff --git a/sysutils/bacula5-server/files/bacula-sd.in b/sysutils/bacula5-server/files/bacula-sd.in
new file mode 100644
index 000000000000..1c37c68fd6d5
--- /dev/null
+++ b/sysutils/bacula5-server/files/bacula-sd.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: bacula_sd
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# bacula_sd_enable (bool): Set to NO by default.
+# Set it to YES to enable bacula_sd.
+# bacula_sd_flags (params): Set params used to start bacula_sd.
+#
+
+. /etc/rc.subr
+
+name="bacula_sd"
+rcvar=${name}_enable
+command=%%PREFIX%%/sbin/bacula-sd
+
+load_rc_config $name
+
+: ${bacula_sd_enable="NO"}
+: ${bacula_sd_flags=" -u bacula -g bacula -v -c %%PREFIX%%/etc/bacula/bacula-sd.conf"}
+: ${bacula_sd_pidfile="/var/run/bacula-sd.9103.pid"}
+
+pidfile="${bacula_sd_pidfile}"
+
+run_rc_command "$1"
diff --git a/sysutils/bacula5-server/files/chio-bacula b/sysutils/bacula5-server/files/chio-bacula
new file mode 100644
index 000000000000..6650426857dc
--- /dev/null
+++ b/sysutils/bacula5-server/files/chio-bacula
@@ -0,0 +1,200 @@
+#!/bin/sh
+#
+# Bacula interface to FreeBSD chio autoloader command with
+# multiple drive support
+# (By Lars Köller, lars+bacula@koellers.net, 2004)
+#
+# If you set in your Device resource
+#
+# Changer Command = "path-to-this-script/chio-bacula" %c %o %S %a
+# you will have the following input to this script:
+#
+# chio-bacula "changer-device" "command" "slot" "archive-device" "drive-index"
+# $1 $2 $3 $4 $5
+# for example:
+#
+# chio-bacula /dev/sg0 load 1 /dev/nst0 0 (on a FreeBSD system)
+#
+# If you need to to an offline, refer to the drive as $4
+# e.g. mt -f $f offline
+#
+# Many changers need an offline after the unload. Also many
+# changers need a sleep 60 after the mtx load.
+#
+# N.B. If you change the script, take care to return either
+# the mtx exit code or a 0. If the script exits with a non-zero
+# exit code, Bacula will assume the request failed.
+#
+me=$(basename $0)
+
+# Debug output, take care this file is writeable for user bacula!
+#LOG=/var/db/bacula/chio-bacula.log
+#exec 2>>$LOG
+#echo "------------------------- $(date) Start $(basename $0) -------------------------" >> $LOG
+#set -x
+
+# Debug
+logger -p user.err "$me $@"
+
+# This simulates a barcode reader in the changer.
+# The labes of the virtual barcode reader are located in the BARCODE_FILE
+SIMULATE_BARCODE=true
+BARCODE_FILE=/usr/local/etc/bacula/bacula-barcodes
+MTX=/bin/chio
+# Set default values (see case statement below for
+# free mapping of drive index and tape device
+# We have a double drive Qualstar where drive 1 is the default bacula drive
+#TAPE=/dev/bacula-tape
+TAPE=/dev/nrsa0
+DRIVE=0
+# Time to wait for (un)loading
+SLEEP=20
+
+usage()
+{
+ echo ""
+ echo "The $me script for bacula"
+ echo "--------------------------------------"
+ echo ""
+ echo "usage: $me <changer-device> <command> [slot] [devicename of tapedrive] [drive index]"
+ echo ""
+ echo "Valid commands:"
+ echo ""
+ echo "unload Unloads a tape into the slot"
+ echo " from where it was loaded."
+ echo "load <slot> Loads a tape from the slot <slot>"
+ echo " (slot-base is calculated to 1 as first slot)"
+ echo "list Lists full storage slots"
+ echo "loaded Gives slot from where the tape was loaded."
+ echo " 0 means the tape drive is empty."
+ echo "slots Gives Number of aviable slots."
+ echo ""
+ echo "Example:"
+ echo " $me /dev/changer load 1 loads a tape from slot 1"
+ echo ""
+ exit 2
+}
+
+# The changer device
+if [ -z "$1" ] ; then
+ usage;
+else
+ CHANGER=$1
+fi
+# The command
+if [ -z "$2" ] ; then
+ usage;
+else
+ COMMAND=$2
+fi
+# The slot number
+if [ ! -z "$3" ]; then
+ SLOT=$3
+ # btape fill says "... slot 1 drive 0" :-(
+ if [ "$SLOT" = "slot" ]; then
+ shift
+ SLOT=$3
+ fi
+fi
+# Set tape device
+if [ ! -z "$4" ]; then
+ TAPE=$4
+fi
+
+# Here you can map bacula drive number to any tape device
+# DRIVE is the chio drive number used below by chio!
+case $5 in
+ 0)
+ # First Drive in Changer is Bacula drive
+ DRIVE=0
+ #TAPE=/dev/bacula-tape
+ TAPE=/dev/nrsa0
+ ;;
+ 1)
+ DRIVE=1
+ #TAPE=/dev/bacula-tape2
+ TAPE=/dev/nrsa1
+ ;;
+esac
+
+#
+# Main
+#
+case ${COMMAND} in
+ unload)
+ # enable the following line if you need to eject the cartridge
+ mt -f ${TAPE} off
+ sleep 2
+ # if we have a slot, try it
+ if [ ! -z "$SLOT" ]; then
+ ${MTX} -f ${CHANGER} move drive ${DRIVE} slot $((${SLOT}-1))
+ exit $?
+ fi
+ # Try other way (works if source element information is valid for drive)
+ ${MTX} -f ${CHANGER} return drive ${DRIVE}
+ # If the changer is power cycled with a tape loaded in a drive
+ # we can compute the slot in case of a complete filled magazine, with
+ # one slot free.
+ if [ "$?" != "0" ]; then
+ free_slot=`${MTX} -f ${CHANGER} stat | grep "^slot " | grep -v "FULL" | awk '{print $2}'`
+ free_slot=${free_slot%:}
+ ${MTX} -f ${CHANGER} move drive ${DRIVE} slot $free_slot
+ fi
+ ;;
+
+ load)
+ ${MTX} -f ${CHANGER} move slot $((${SLOT}-1)) drive ${DRIVE}
+ rtn=$?
+ # Increase the sleep time if you have a slow device
+ sleep $SLEEP
+ exit $rtn
+ ;;
+
+ list)
+ if [ "${SIMULATE_BARCODE}" = "true" ]; then
+ if [ -f "$BARCODE_FILE" ]; then
+ cat $BARCODE_FILE | grep -v -e "^#" -e "^$"
+ exit 0
+ else
+ echo "Barcode file $BARCODE_FILE missing ... exiting!"
+ exit 1
+ fi
+ else
+ ${MTX} -f ${CHANGER} status | grep "^slot .*: .*FULL>" | awk '{print $2}' | awk -F: '{print $1+1" "}' | tr -d "[\r\n]"
+ fi
+ ;;
+
+ loaded)
+ # echo "Request loaded"
+ ${MTX} -f ${CHANGER} status -S > /tmp/mtx.$$
+ rtn=$?
+ # Try to get chio slot source from drive entry
+ SLOT=$(cat /tmp/mtx.$$ | grep "^drive ${DRIVE}: <FULL> .*slot" | awk '{print $6+1}' | tr -d ">")
+ if [ -z "$SLOT" ]; then
+ # This handles the case a source slot is not available (power on
+ # of the changer with a drive loaded) and all other slots are
+ # occupied with a tape!
+ SLOT=$(cat /tmp/mtx.$$ | grep "^slot .*: <ACCESS>" | awk '{print $2+1}')
+ if [ -z "$SLOT" ]; then
+ echo 0
+ else
+ echo $SLOT
+ fi
+ else
+ echo $SLOT
+ fi
+ # All tapes are in the slots
+ #cat /tmp/mtx.$$ | grep "^drive ${DRIVE}: .* source: <>" | awk "{print 0}"
+ rm -f /tmp/mtx.$$
+ exit $rtn
+ ;;
+
+ slots)
+ # echo "Request slots"
+ ${MTX} -f ${CHANGER} status | grep "^slot " | tail -1 | awk '{print $2+1}' | tr -d ":"
+ ;;
+
+ *)
+ usage
+ ;;
+esac
diff --git a/sysutils/bacula5-server/files/patch-src__cats__Makefile.in b/sysutils/bacula5-server/files/patch-src__cats__Makefile.in
new file mode 100644
index 000000000000..dc44319846de
--- /dev/null
+++ b/sysutils/bacula5-server/files/patch-src__cats__Makefile.in
@@ -0,0 +1,51 @@
+--- src/cats/Makefile.in 2012-06-28 09:52:03.000000000 -0500
++++ src/cats/Makefile.in 2012-08-09 15:30:19.000000000 -0500
+@@ -142,25 +142,25 @@
+
+ libbacsql.la: Makefile $(LIBBACSQL_LOBJS)
+ @echo "Making $@ ..."
+- $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACSQL_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACSQL_LT_RELEASE) $(DB_LIBS)
++ $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACSQL_LOBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBACSQL_LT_RELEASE:S/./:/g:S/12/0/g)
+
+ libbaccats.la: Makefile cats_dummy.lo
+ @echo "Making $@ ..."
+- $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ cats_dummy.lo -export-dynamic -rpath $(libdir) -release $(LIBBACCATS_LT_RELEASE)
++ $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ cats_dummy.lo -export-dynamic -rpath $(libdir) -version-info $(LIBBACCATS_LT_RELEASE:S/./:/g:S/12/0/g)
+
+ libbaccats-mysql.la: Makefile $(MYSQL_LOBJS)
+ @echo "Making $@ ..."
+- $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(MYSQL_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACCATS_LT_RELEASE) \
++ $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(MYSQL_LOBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBACCATS_LT_RELEASE:S/./:/g:S/12/0/g) \
+ -soname libbaccats-$(LIBBACCATS_LT_RELEASE).so $(MYSQL_LIBS)
+
+ libbaccats-postgresql.la: Makefile $(POSTGRESQL_LOBJS)
+ @echo "Making $@ ..."
+- $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(POSTGRESQL_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACCATS_LT_RELEASE) \
++ $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(POSTGRESQL_LOBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBACCATS_LT_RELEASE:S/./:/g:S/12/0/g) \
+ -soname libbaccats-$(LIBBACCATS_LT_RELEASE).so $(POSTGRESQL_LIBS)
+
+ libbaccats-sqlite3.la: Makefile $(SQLITE_LOBJS)
+ @echo "Making $@ ..."
+- $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(SQLITE_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACCATS_LT_RELEASE) \
++ $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(SQLITE_LOBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBACCATS_LT_RELEASE:S/./:/g:S/12/0/g) \
+ -soname libbaccats-$(LIBBACCATS_LT_RELEASE).so $(SQLITE_LIBS)
+
+ #libbaccats-ingres.la: Makefile $(INGRES_LOBJS)
+@@ -237,7 +237,7 @@
+ for db_type in @DB_BACKENDS@; do \
+ $(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbaccats-$${db_type}.la $(DESTDIR)$(libdir); \
+ done
+- ./install-default-backend @DEFAULT_DB_TYPE@ $(LIBBACCATS_LT_RELEASE) $(DESTDIR)$(libdir)
++ ./install-default-backend @DEFAULT_DB_TYPE@ 5 $(DESTDIR)$(libdir)
+
+ libtool-uninstall:
+ $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacsql.la
+@@ -323,7 +323,7 @@
+ depend:
+ @$(MV) Makefile Makefile.bak
+ @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
+- @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
++ @echo "# DO NOT DELETE: nice dependency list follows" >> Makefile
+ @for src in $(LIBBACSQL_SRCS); do \
+ $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) $(DEFS) -I$(srcdir) -I$(basedir) $$src >> Makefile; \
+ done
diff --git a/sysutils/bacula5-server/files/patch-src__cats__install-default-backend.in b/sysutils/bacula5-server/files/patch-src__cats__install-default-backend.in
new file mode 100644
index 000000000000..2e919224eade
--- /dev/null
+++ b/sysutils/bacula5-server/files/patch-src__cats__install-default-backend.in
@@ -0,0 +1,25 @@
+--- src/cats/install-default-backend.in 2012-03-31 23:39:38.000000000 -0500
++++ src/cats/install-default-backend.in 2012-03-31 23:40:56.000000000 -0500
+@@ -22,11 +22,11 @@
+ exit 1
+ fi
+
+-if [ -f ${install_dir}/libbaccats-${default_backend}-${library_version}${SHLIB_EXT} ]; then
++if [ -f ${install_dir}/libbaccats-${default_backend}${SHLIB_EXT}.${library_version} ]; then
+ #
+ # Create a default catalog library pointing to one of the shared libs.
+ #
+- rm -f ${install_dir}/libbaccats-${library_version}${SHLIB_EXT}
++ rm -f ${install_dir}/libbaccats${SHLIB_EXT}.${library_version}
+
+ #
+ # Create a relative symlink to the default backend
+@@ -34,7 +34,7 @@
+ # always work.
+ #
+ ln -s libbaccats-${default_backend}${SHLIB_EXT} \
+- ${install_dir}/libbaccats-${library_version}${SHLIB_EXT}
++ ${install_dir}/libbaccats${SHLIB_EXT}.${library_version}
+ fi
+
+ exit 0
diff --git a/sysutils/bacula5-server/files/patch-src__console__Makefile.in b/sysutils/bacula5-server/files/patch-src__console__Makefile.in
new file mode 100644
index 000000000000..8be368f7c399
--- /dev/null
+++ b/sysutils/bacula5-server/files/patch-src__console__Makefile.in
@@ -0,0 +1,11 @@
+--- src/console/Makefile.in 2012-03-24 15:10:18.000000000 -0500
++++ src/console/Makefile.in 2012-03-24 15:10:35.000000000 -0500
+@@ -53,7 +53,7 @@
+
+ static-bconsole: Makefile $(CONSOBJS) ../lib/libbac.a ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE)
+ $(LIBTOOL_LINK) $(CXX) -static $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
+- $(DLIB) $(CONS_LIBS) -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) \
++ $(DLIB) $(CONS_LIBS) -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS:S/.so/.a/g) \
+ $(OPENSSL_LIBS)
+ strip $@
+
diff --git a/sysutils/bacula5-server/files/patch-src__dird__Makefile.in b/sysutils/bacula5-server/files/patch-src__dird__Makefile.in
new file mode 100644
index 000000000000..6f122e116c3a
--- /dev/null
+++ b/sysutils/bacula5-server/files/patch-src__dird__Makefile.in
@@ -0,0 +1,28 @@
+--- src/dird/Makefile.in 2011-11-26 09:08:12.000000000 -0500
++++ src/dird/Makefile.in 2011-12-02 13:15:46.000000000 -0500
+@@ -68,14 +68,14 @@
+ ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) \
+ ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
+ @echo "Linking $@ ..."
+- $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
++ $(LIBTOOL_LINK) $(CXX) -L../lib -L../cats -L../findlib $(WLDFLAGS) $(LDFLAGS) -o $@ $(SVROBJS) \
+ -lbacfind -lbacsql -lbaccats -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) \
+ $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
+
+ static-bacula-dir: Makefile $(SVROBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
+ ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) \
+ ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
+- $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
++ $(LIBTOOL_LINK) $(CXX) -static -L../lib -L../cats -L../findlib $(WLDFLAGS) $(LDFLAGS) -o $@ $(SVROBJS) \
+ -lbacfind -lbacsql -lbaccats -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) \
+ $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
+ strip $@
+@@ -141,7 +141,7 @@
+ depend:
+ @$(MV) Makefile Makefile.bak
+ @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
+- @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
++ @echo "# DO NOT DELETE: nice dependency list follows" >> Makefile
+ @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) *.c >> Makefile
+ @if test -f Makefile ; then \
+ $(RMF) Makefile.bak; \
diff --git a/sysutils/bacula5-server/files/patch-src__filed__Makefile.in b/sysutils/bacula5-server/files/patch-src__filed__Makefile.in
new file mode 100644
index 000000000000..04100d795e3f
--- /dev/null
+++ b/sysutils/bacula5-server/files/patch-src__filed__Makefile.in
@@ -0,0 +1,11 @@
+--- src/filed/Makefile.in 2012-06-28 09:52:03.000000000 -0500
++++ src/filed/Makefile.in 2012-08-09 15:04:48.000000000 -0500
+@@ -102,7 +102,7 @@
+ static-bacula-fd: Makefile $(SVROBJS) ../findlib/libbacfind.a ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) @WIN32@
+ $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
+ $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(LIBS) \
+- $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS) $(AFS_LIBS) $(LZOLIBS)
++ $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS:S/.so/.a/g) $(OPENSSL_LIBS) $(CAP_LIBS) $(AFS_LIBS) $(LZOLIBS)
+ strip $@
+
+ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
diff --git a/sysutils/bacula5-server/files/patch-src__findlib__Makefile.in b/sysutils/bacula5-server/files/patch-src__findlib__Makefile.in
new file mode 100644
index 000000000000..df0ed6f2b560
--- /dev/null
+++ b/sysutils/bacula5-server/files/patch-src__findlib__Makefile.in
@@ -0,0 +1,20 @@
+--- src/findlib/Makefile.in 2011-11-26 09:08:12.000000000 -0500
++++ src/findlib/Makefile.in 2011-12-02 13:02:46.000000000 -0500
+@@ -57,7 +57,7 @@
+
+ libbacfind.la: Makefile $(LIBBACFIND_LOBJS)
+ @echo "Making $@ ..."
+- $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACFIND_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACFIND_LT_RELEASE)
++ $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACFIND_LOBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBACFIND_LT_RELEASE:S/./:/g:S/12/0/g)
+
+ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
+ cd $(topdir) \
+@@ -112,7 +112,7 @@
+ depend:
+ @$(MV) Makefile Makefile.bak
+ @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
+- @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
++ @echo "# DO NOT DELETE: nice dependency list follows" >> Makefile
+ @for src in $(LIBBACFIND_SRCS); do \
+ $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $$src >> Makefile; \
+ done
diff --git a/sysutils/bacula5-server/files/patch-src__lib__Makefile.in b/sysutils/bacula5-server/files/patch-src__lib__Makefile.in
new file mode 100644
index 000000000000..0f0501e34678
--- /dev/null
+++ b/sysutils/bacula5-server/files/patch-src__lib__Makefile.in
@@ -0,0 +1,38 @@
+--- src/lib/Makefile.in 2012-06-28 09:52:03.000000000 -0500
++++ src/lib/Makefile.in 2012-08-09 15:08:16.000000000 -0500
+@@ -120,7 +120,7 @@
+
+ libbac.la: Makefile $(LIBBAC_LOBJS)
+ @echo "Making $@ ..."
+- $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBAC_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBAC_LT_RELEASE) $(WRAPLIBS) $(CAP_LIBS) $(ZLIBS) $(OPENSSL_LIBS) $(LIBS) $(DLLIBS)
++ $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBAC_LOBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBAC_LT_RELEASE:S/./:/g:S/12/0/g) $(WRAPLIBS) $(CAP_LIBS) $(ZLIBS) $(OPENSSL_LIBS) $(LIBS) $(DLLIBS)
+
+ libbaccfg.a: $(LIBBACCFG_OBJS)
+ @echo "Making $@ ..."
+@@ -129,7 +129,7 @@
+
+ libbaccfg.la: Makefile $(LIBBACCFG_LOBJS)
+ @echo "Making $@ ..."
+- $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACCFG_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACCFG_LT_RELEASE) $(OPENSSL_LIBS) $(LIBS)
++ $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACCFG_LOBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBACCFG_LT_RELEASE:S/./:/g:S/12/0/g) $(OPENSSL_LIBS) $(LIBS)
+
+ libbacpy.a: $(LIBBACPY_OBJS)
+ @echo "Making $@ ..."
+@@ -138,7 +138,7 @@
+
+ libbacpy.la: Makefile $(LIBBACPY_LOBJS)
+ @echo "Making $@ ..."
+- $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACPY_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACPY_LT_RELEASE) $(PYTHON_LIBS) $(OPENSSL_LIBS) $(LIBS)
++ $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACPY_LOBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBACPY_LT_RELEASE:S/./:/g:S/12/0/g) $(PYTHON_LIBS) $(OPENSSL_LIBS) $(LIBS)
+
+ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
+ cd $(topdir) \
+@@ -267,7 +267,7 @@
+ depend:
+ @$(MV) Makefile Makefile.bak
+ @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
+- @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
++ @echo "# DO NOT DELETE: nice dependency list follows" >> Makefile
+ @for src in $(LIBBAC_SRCS) $(LIBBACCFG_SRCS) $(LIBBACPY_SRCS); do \
+ $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $$src >> Makefile; \
+ done
diff --git a/sysutils/bacula5-server/files/patch-src__qt-configle__bat.pro.in b/sysutils/bacula5-server/files/patch-src__qt-configle__bat.pro.in
new file mode 100644
index 000000000000..3e9dafa261ed
--- /dev/null
+++ b/sysutils/bacula5-server/files/patch-src__qt-configle__bat.pro.in
@@ -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)
diff --git a/sysutils/bacula5-server/files/patch-src__stored__Makefile.in b/sysutils/bacula5-server/files/patch-src__stored__Makefile.in
new file mode 100644
index 000000000000..03ff31812381
--- /dev/null
+++ b/sysutils/bacula5-server/files/patch-src__stored__Makefile.in
@@ -0,0 +1,71 @@
+--- src/stored/Makefile.in 2011-11-26 09:08:12.000000000 -0500
++++ src/stored/Makefile.in 2011-12-02 13:20:38.000000000 -0500
+@@ -95,12 +95,12 @@
+
+ bacula-sd: Makefile $(SDOBJS) ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+ @echo "Linking $@ ..."
+- $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -o $@ $(SDOBJS) $(ZLIBS) \
++ $(LIBTOOL_LINK) $(CXX) -L../lib $(WLDFLAGS) $(LDFLAGS) -o $@ $(SDOBJS) $(ZLIBS) \
+ -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(DLIB) $(LIBS) $(WRAPLIBS) \
+ $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
+
+ static-bacula-sd: Makefile $(SDOBJS) ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+- $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -o $@ $(SDOBJS) $(ZLIBS) \
++ $(LIBTOOL_LINK) $(CXX) -static -L../lib $(WLDFLAGS) $(LDFLAGS) -o $@ $(SDOBJS) $(ZLIBS) \
+ -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(DLIB) $(LIBS) $(WRAPLIBS) \
+ $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
+ strip $@
+@@ -111,7 +111,7 @@
+ -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+
+ btape: Makefile $(TAPEOBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE)
+- $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -o $@ $(TAPEOBJS) \
++ $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) -L../lib $(LDFLAGS) -o $@ $(TAPEOBJS) \
+ -lbaccfg -lbac $(DLIB) -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ bls.o: bls.c
+@@ -121,7 +121,7 @@
+
+ bls: Makefile $(BLSOBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+ @echo "Compiling $<"
+- $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BLSOBJS) $(DLIB) \
++ $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) -L../lib -L../findlib $(LDFLAGS) -o $@ $(BLSOBJS) $(DLIB) \
+ -lbacfind -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ bextract.o: bextract.c
+@@ -131,7 +131,7 @@
+
+ bextract: Makefile $(BEXTOBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+ @echo "Compiling $<"
+- $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BEXTOBJS) $(DLIB) $(ZLIBS) $(LZOLIBS) \
++ $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) -L../lib -L../findlib $(LDFLAGS) -o $@ $(BEXTOBJS) $(DLIB) $(ZLIBS) $(LZOLIBS) \
+ -lbacfind -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ bscan.o: bscan.c
+@@ -141,7 +141,7 @@
+
+ bscan: Makefile $(SCNOBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
+ ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE)
+- $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SCNOBJS) \
++ $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) -L../lib -L../cats -L../findlib $(LDFLAGS) -o $@ $(SCNOBJS) \
+ -lbacsql -lbaccats $(DB_LIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ bcopy.o: bcopy.c
+@@ -150,7 +150,7 @@
+ -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+
+ bcopy: Makefile $(COPYOBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+- $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -o $@ $(COPYOBJS) \
++ $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) -L../lib $(LDFLAGS) -o $@ $(COPYOBJS) \
+ -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
+@@ -215,7 +215,7 @@
+ depend:
+ @$(MV) Makefile Makefile.bak
+ @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
+- @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
++ @echo "# DO NOT DELETE: nice dependency list follows" >> Makefile
+ @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) *.c >> Makefile
+ @if test -f Makefile ; then \
+ $(RMF) Makefile.bak; \
diff --git a/sysutils/bacula5-server/files/patch-src__tools__Makefile.in b/sysutils/bacula5-server/files/patch-src__tools__Makefile.in
new file mode 100644
index 000000000000..4e681f47ce4b
--- /dev/null
+++ b/sysutils/bacula5-server/files/patch-src__tools__Makefile.in
@@ -0,0 +1,99 @@
+--- src/tools/Makefile.in 2011-11-26 09:08:12.000000000 -0500
++++ src/tools/Makefile.in 2011-12-02 13:26:44.000000000 -0500
+@@ -58,22 +58,22 @@
+ @echo " "
+
+ bsmtp: Makefile bsmtp.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+- $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++ $(LIBTOOL_LINK) $(CXX) -L../lib $(LDFLAGS) -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ bregtest: Makefile bregtest.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+- $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ bregtest.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++ $(LIBTOOL_LINK) $(CXX) -L../lib $(LDFLAGS) -o $@ bregtest.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ dbcheck: Makefile dbcheck.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
+ ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) $(DIRCONFOBJS)
+- $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) \
++ $(LIBTOOL_LINK) $(CXX) -L../lib -L../cats $(LDFLAGS) -o $@ dbcheck.o $(DIRCONFOBJS) \
+ -lbaccats -lbacsql -lbaccfg -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ fstype: Makefile fstype.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
+- $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ fstype.o -lbacfind -lbac -lm \
++ $(LIBTOOL_LINK) $(CXX) -L../lib -L../findlib $(LDFLAGS) -o $@ fstype.o -lbacfind -lbac -lm \
+ $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ drivetype: Makefile drivetype.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
+- $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ drivetype.o -lbacfind -lbac -lm \
++ $(LIBTOOL_LINK) $(CXX) -L../lib -L../findlib $(LDFLAGS) -o $@ drivetype.o -lbacfind -lbac -lm \
+ $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ dird_conf.o: ../dird/dird_conf.c
+@@ -87,34 +87,34 @@
+
+ testfind: Makefile ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
+ ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) $(FINDOBJS)
+- $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -o $@ $(FINDOBJS) -L. -L../lib -L../findlib \
++ $(LIBTOOL_LINK) $(CXX) -g -o $@ $(FINDOBJS) -L. -L../lib -L../findlib $(LDFLAGS) \
+ $(DLIB) -lbacfind -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ testls: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) testls.o
+- $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \
++ $(LIBTOOL_LINK) $(CXX) -g -L. -L../lib -L../findlib $(LDFLAGS) -o $@ testls.o \
+ $(DLIB) -lbacfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ bregex: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) bregex.o
+- $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bregex.o \
++ $(LIBTOOL_LINK) $(CXX) -g -L. -L../lib $(LDFLAGS) -o $@ bregex.o \
+ $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ bwild: Makefile ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) bwild.o
+- $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bwild.o \
++ $(LIBTOOL_LINK) $(CXX) -g -L. -L../lib $(LDFLAGS) -o $@ bwild.o \
+ $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ bbatch: Makefile ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) \
+ ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) bbatch.o
+- $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -o $@ bbatch.o \
++ $(LIBTOOL_LINK) $(CXX) -g -L../cats -L. -L../lib $(LDFLAGS) -o $@ bbatch.o \
+ -lbaccats -lbacsql -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ bvfs_test: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) \
+ ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) bvfs_test.o
+- $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -L../findlib -o $@ bvfs_test.o \
++ $(LIBTOOL_LINK) $(CXX) -g -L../cats -L. -L../lib -L../findlib $(LDFLAGS) -o $@ bvfs_test.o \
+ -lbaccats -lbacsql -lbacfind -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ ing_test: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) \
+ ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) ing_test.o
+- $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -L../findlib -o $@ ing_test.o \
++ $(LIBTOOL_LINK) $(CXX) -g -L../cats -L. -L../lib -L../findlib $(LDFLAGS) -o $@ ing_test.o \
+ -lbaccats -lbacsql -lbacfind -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ cats_test.o: cats_test.c
+@@ -122,7 +122,7 @@
+ $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+
+ cats_test: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) cats_test.o
+- $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -L../findlib -o $@ cats_test.o \
++ $(LIBTOOL_LINK) $(CXX) -g -L../cats -L. -L../lib -L../findlib $(LDFLAGS) -o $@ cats_test.o \
+ -lbaccats -lbacsql -lbacfind -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ gigaslam.o: gigaslam.c
+@@ -132,7 +132,7 @@
+ $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -o $@ gigaslam.o
+
+ grow: Makefile grow.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+- $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ grow.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++ $(LIBTOOL_LINK) $(CXX) -L../lib $(LDFLAGS) -o $@ grow.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+
+ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
+ cd $(topdir) \
+@@ -184,7 +184,7 @@
+ depend:
+ @$(MV) Makefile Makefile.bak
+ @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
+- @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
++ @echo "# DO NOT DELETE: nice dependency list follows" >> Makefile
+ @$(CXX) -S -M $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) *.c >> Makefile
+ @if test -f Makefile ; then \
+ $(RMF) Makefile.bak; \
diff --git a/sysutils/bacula5-server/files/pkg-deinstall.client.in b/sysutils/bacula5-server/files/pkg-deinstall.client.in
new file mode 100644
index 000000000000..7c07237addd7
--- /dev/null
+++ b/sysutils/bacula5-server/files/pkg-deinstall.client.in
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin:/usr/sbin
+
+# Note how to delete UID/GID
+USER=%%BACULA_USER%%
+GROUP=%%BACULA_GROUP%%
+UID=%%BACULA_UID%%
+GID=%%BACULA_UID%%
+BACULA_DIR=%%BACULA_DIR%%
+
+TMPFILE=/tmp/services-$RANDOM-$$
+
+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
+
+ if pw groupshow "${USER}" 2>/dev/null 1>&2; then
+ echo "To delete Bacula group permanently, use 'pw groupdel ${GROUP}'"
+ fi
+ ;;
+esac
diff --git a/sysutils/bacula5-server/files/pkg-install.client.in b/sysutils/bacula5-server/files/pkg-install.client.in
new file mode 100644
index 000000000000..99cfaecd128f
--- /dev/null
+++ b/sysutils/bacula5-server/files/pkg-install.client.in
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin:/usr/sbin
+
+# 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/bacula5-server/files/pkg-message.client.in b/sysutils/bacula5-server/files/pkg-message.client.in
new file mode 100644
index 000000000000..52bf005221bc
--- /dev/null
+++ b/sysutils/bacula5-server/files/pkg-message.client.in
@@ -0,0 +1,15 @@
+################################################################################
+
+NOTE:
+Sample files are installed in %%PREFIX%%/etc/bacula:
+bconsole.conf.sample, bacula-barcodes.sample, bacula-fd.conf.sample
+
+ Please read this file:
+
+ %%DOCSDIR%%/ReleaseNotes
+
+ as installed by docs port for the upgrade procedure.
+
+Read the ReleaseNotes for further information.
+
+################################################################################
diff --git a/sysutils/bacula5-server/files/pkg-message.server.in b/sysutils/bacula5-server/files/pkg-message.server.in
new file mode 100644
index 000000000000..a332f01777fc
--- /dev/null
+++ b/sysutils/bacula5-server/files/pkg-message.server.in
@@ -0,0 +1,67 @@
+###############################################################################
+
+bacula server was installed
+
+1) Important information about new version of bacula can be found in the
+ ReleaseNotes.
+
+ %%DOCSDIR%%/ReleaseNotes
+
+NOTE:
+
+An auto-changer manipulation script based on FreeBSDs
+chio command is included and installed at
+
+ %%PREFIX%%/sbin/chio-bacula
+
+Please have a look at it if you want to use an
+autochanger. You have to configure the usage in
+
+ %%PREFIX%%/etc/bacula/bacula-dir.conf
+
+Take care of correct permissions for changer and
+tape device (e.g. /dev/ch0 and /dev/n[r]sa0) i.e.
+they must be accessible by user bacula.
+
+Due to lack of some features in the FreeBSD tape driver
+implementation you MUST add some OS dependent options to
+the bacula-sd.conf file:
+
+ Hardware End of Medium = no;
+ Backward Space Record = no;
+ Backward Space File = no;
+
+With 2 filemarks at EOT (see man mt):
+ Fast Forward Space File = no;
+ BSF at EOM = yes;
+ TWO EOF = yes;
+
+With 1 filemarks at EOT (see man mt):
+ Fast Forward Space File = yes;
+ BSF at EOM = no;
+ TWO EOF = no;
+
+NOTE: YOU CAN SWITCH EOT model ONLY when starting
+ from scratch with EMPTY tapes.
+
+It is also important that all the scripts accessed
+by RunBeforeJob and RunAfterJob will be executed by
+the user bacula. Check your permissions.
+
+For USB support read the bacula manual. It could be necessary
+to configure/compile a new kernel.
+
+Look at %%PREFIX%%/share/bacula/update_bacula_tables for
+database update procedure. Details can be found in the
+ReleaseNotes
+
+ Please read this file:
+
+ %%DOCSDIR%%/ReleaseNotes
+
+ as installed by docs port for the upgrade procedure.
+
+If you are using sqlite you need to run the make_sqlite_tables script as
+the bacula user. Do this using 'sudo su -m bacula'.
+
+################################################################################
diff --git a/sysutils/bacula5-server/pkg-descr b/sysutils/bacula5-server/pkg-descr
new file mode 100644
index 000000000000..4167c26533dc
--- /dev/null
+++ b/sysutils/bacula5-server/pkg-descr
@@ -0,0 +1,11 @@
+Bacula is a set of computer programs that permit you (or the system
+administrator) to manage backup, recovery, and verification of
+computer data across a network of computers of different kinds.
+In technical terms, it is a network Client/Server based backup program.
+Bacula is relatively easy to use and efficient, while offering many
+advanced storage management features that make it easy to find and
+recover lost or damaged files. Due to its modular design, Bacula is
+scalable from small single computer systems to systems consisting of
+hundreds of computers located over a large network.
+
+WWW: http://www.bacula.org/
diff --git a/sysutils/bacula5-server/pkg-plist b/sysutils/bacula5-server/pkg-plist
new file mode 100644
index 000000000000..387e55fdef66
--- /dev/null
+++ b/sysutils/bacula5-server/pkg-plist
@@ -0,0 +1,79 @@
+@sample %%ETCDIR%%/bacula-barcodes.sample
+@group bacula
+@sample %%ETCDIR%%/bacula-dir.conf.sample
+@group wheel
+@sample %%ETCDIR%%/bacula-sd.conf.sample
+lib/libbaccats.la
+lib/libbaccats.so
+lib/libbaccats.so.5
+lib/libbaccats.so.5.0.2
+lib/libbaccats-%%DBTYPE%%.la
+lib/libbaccats-%%DBTYPE%%.so
+lib/libbaccats-%%DBTYPE%%.so.5
+lib/libbaccats-%%DBTYPE%%.so.5.0.2
+lib/libbacsql.la
+lib/libbacsql.so
+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-sd.8.gz
+man/man8/bacula.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
+sbin/bcopy
+sbin/bextract
+sbin/bls
+sbin/bregex
+sbin/bscan
+sbin/bsmtp
+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
+%%DATADIR%%/bacula-ctl-sd
+%%DATADIR%%/bacula_config
+%%DATADIR%%/bconsole
+%%DATADIR%%/btraceback.dbx
+%%DATADIR%%/btraceback.gdb
+%%DATADIR%%/btraceback.mdb
+%%DATADIR%%/create_bacula_database
+%%DATADIR%%/create_%%DBTYPE%%_database
+%%DATADIR%%/delete_catalog_backup
+%%DATADIR%%/disk-changer
+%%DATADIR%%/drop_bacula_database
+%%DATADIR%%/drop_bacula_tables
+%%DATADIR%%/drop_%%DBTYPE%%_database
+%%DATADIR%%/drop_%%DBTYPE%%_tables
+%%DATADIR%%/dvd-handler
+%%DATADIR%%/grant_bacula_privileges
+%%DATADIR%%/grant_%%DBTYPE%%_privileges
+%%DATADIR%%/make_bacula_tables
+%%DATADIR%%/make_catalog_backup
+%%DATADIR%%/make_catalog_backup.pl
+%%DATADIR%%/make_%%DBTYPE%%_tables
+%%DATADIR%%/mtx-changer
+%%DATADIR%%/mtx-changer.conf
+%%DATADIR%%/query.sql
+%%DATADIR%%/update_bacula_tables
+%%DATADIR%%/update_%%DBTYPE%%_tables
+@owner root
+@group wheel
diff --git a/sysutils/bacula5-server/pkg-plist.client b/sysutils/bacula5-server/pkg-plist.client
new file mode 100644
index 000000000000..0257d088bf8f
--- /dev/null
+++ b/sysutils/bacula5-server/pkg-plist.client
@@ -0,0 +1,31 @@
+@sample %%ETCDIR%%/bacula-fd.conf.sample
+@group bacula
+@sample %%ETCDIR%%/bconsole.conf.sample
+@group wheel
+lib/libbac.la
+lib/libbac.so
+lib/libbac.so.5
+lib/libbac.so.5.0.2
+lib/libbaccfg.la
+lib/libbaccfg.so
+lib/libbaccfg.so.5
+lib/libbaccfg.so.5.0.2
+lib/libbacfind.la
+lib/libbacfind.so
+lib/libbacfind.so.5
+lib/libbacfind.so.5.0.2
+lib/libbacpy.la
+lib/libbacpy.so
+lib/libbacpy.so.5
+lib/libbacpy.so.5.0.2
+lib/bpipe-fd.so
+man/man8/bacula-fd.8.gz
+man/man8/bconsole.8.gz
+sbin/bacula-fd
+@group bacula
+sbin/bconsole
+@group wheel
+@exec mkdir -p %%BACULA_DIR%%
+@dirrmtry %%BACULA_DIR%%
+@dirrmtry share/bacula
+@dirrmtry %%ETCDIR%%