Commit a35cf935 authored by dvl's avatar dvl
Browse files

Add Bacula 11.0.1

NOTE: New Catalog format in version 11.0 and greater
The upgrade process will require more or less twice the
size of the actual database.

see update_bacula_tables

re https://www.bacula.org/bacula-release-11-0-1/

While here, update Bacula 9 conflicts.
parent 9bd80847
......@@ -135,6 +135,7 @@
SUBDIR += nagios
SUBDIR += nagios-certexp-plugin
SUBDIR += nagios-check_bacula9
SUBDIR += nagios-check_bacula11
SUBDIR += nagios-check_clamav
SUBDIR += nagios-check_cpu_usage
SUBDIR += nagios-check_dhcp.pl
......
# Created by: Anders Troback
# $FreeBSD$
PORTNAME= bacula
CATEGORIES= net-mgmt
PKGNAMEPREFIX= nagios-check_
PKGNAMESUFFIX= 11
MAINTAINER= dvl@FreeBSD.org
COMMENT= Nagios plugin for Bacula
LIB_DEPENDS+= libbac.so:sysutils/bacula11-client
PLIST= ${.CURDIR}/pkg-plist
PLIST_FILES= libexec/nagios/check_bacula
WITH_NAGIOS_CHECK_ONLY= yes
MASTERDIR= ${.CURDIR}/../../sysutils/bacula11-server
CONFIGURE_ARGS= --enable-client-only \
--disable-build-dird \
--disable-build-stored \
--disable-nls \
--disable-xatt
OPTIONS_DEFINE= #
OPTIONS_DEFAULT=#
NO_CCACHE= yes
.include "${MASTERDIR}/Makefile"
SHA256 (bacula-5.0.0.tar.gz) = 4c6344807769d1b6b61f9cbddc0a5dc1160c3eb51744b23c790fcb57947ac294
SIZE (bacula-5.0.0.tar.gz) = 4075825
check_bacula is a plugin intended for use with the
Nagios network monitoring system to monitor Bacula.
......@@ -88,6 +88,10 @@
SUBDIR += bacula9-client-static
SUBDIR += bacula9-docs
SUBDIR += bacula9-server
SUBDIR += bacula11-client
SUBDIR += bacula11-client-static
SUBDIR += bacula11-docs
SUBDIR += bacula11-server
SUBDIR += baloo-widgets
SUBDIR += bamf
SUBDIR += bareos-client
......
# $FreeBSD$
PORTNAME= bacula
PKGNAMESUFFIX= 11-client-static
COMMENT= Network backup solution (static client)
BROKEN_aarch64= Fails to link: missing sbrk
BROKEN_riscv64= Fails to link: missing sbrk
BROKEN_SSL= libressl
WITH_CLIENT_ONLY=yes
PLIST= ${.CURDIR}/pkg-plist
MASTERDIR= ${.CURDIR}/../../sysutils/bacula11-server
PLIST_FILES= sbin/bacula-fd-static \
sbin/bconsole-static
OPTIONS_DEFINE= NLS OPENSSL
OPTIONS_DEFAULT=OPENSSL
CONFIGURE_ARGS+= --enable-client-only \
--enable-static-fd \
--enable-static-cons \
--disable-libtool \
--disable-build-dird \
--disable-build-stored
.include "${MASTERDIR}/Makefile"
# $FreeBSD$
PORTNAME= bacula
PKGNAMESUFFIX= 11-client
COMMENT= Network backup solution (client)
BROKEN_aarch64= Fails to link: missing sbrk
BROKEN_riscv64= Fails to link: missing sbrk
WITH_CLIENT_ONLY=yes
USE_RC_SUBR= bacula-fd
PLIST= ${PKGDIR}/pkg-plist.client
MASTERDIR= ${.CURDIR}/../../sysutils/bacula11-server
OPTIONS_DEFINE= NLS PYTHON IPV6
.include "${MASTERDIR}/Makefile"
# $FreeBSD$
PORTNAME= bacula
PORTVERSION= 11.0.1
CATEGORIES= sysutils
MASTER_SITES= SF
PKGNAMESUFFIX= 11-docs
DISTNAME= ${PORTNAME}-docs-${PORTVERSION}
CONFLICTS= bacula9-*
MAINTAINER= dvl@FreeBSD.org
COMMENT= Bacula document set
USES= tar:bz2
NO_BUILD= yes
NO_ARCH= yes
PORTDOCS= *.pdf
OPTIONS_DEFINE= DOCS
do-install:
${MKDIR} ${STAGEDIR}${DOCSDIR}
${FIND} ${WRKSRC}/manuals/en \
-name "*.pdf" -exec ${INSTALL_DATA} {} ${STAGEDIR}${DOCSDIR}/ \;
.include <bsd.port.mk>
TIMESTAMP = 1614132177
SHA256 (bacula-docs-11.0.1.tar.bz2) = 9d7dcbeac3f59466dabc221e49a5d73112b643367727d0f39b36606c6a3ac9a1
SIZE (bacula-docs-11.0.1.tar.bz2) = 53307003
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: https://www.bacula.org/
# Created by: Dmitry Sivachenko <demon@FreeBSD.org>
# $FreeBSD$
PORTNAME= bacula
PORTVERSION= 11.0.1
CATEGORIES?= sysutils
MASTER_SITES= SF/bacula/bacula/${PORTVERSION}
PKGNAMEPREFIX?= #
PKGNAMESUFFIX?= 11-server
MAINTAINER= dvl@FreeBSD.org
COMMENT?= Network backup solution (server)
LICENSE= AGPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
USES+= libtool readline shebangfix ssl
SHEBANG_FILES= src/cats/make_catalog_backup.pl.in
CONFLICTS?= bacula9-server-* bacula5-server-* bacula-server-*
LIB_DEPENDS+= liblzo2.so:archivers/lzo2
USERS= bacula
GROUPS= ${USERS}
PLIST_SUB+= LIB_VERSION=${PORTVERSION}
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
CPPFLAGS+= -I/usr/include/readline -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
OPTIONS_DEFINE?= MTX NLS IPV6
MTX_DESC= Install mtx for control of autochanger devices
.if ${PKGNAMESUFFIX} == "11-server"
OPTIONS_MULTI= BACKEND
OPTIONS_MULTI_BACKEND= SQLITE3 MYSQL PGSQL
OPTIONS_DEFAULT+= PGSQL
.endif
OPTIONS_SUB= yes
.if ${PKGNAMESUFFIX} == "11-client" || ${PKGNAMESUFFIX} == "11-server" #Till end of the file
.if !defined(WITH_CLIENT_ONLY)
LIB_DEPENDS+= libbac-${PORTVERSION}.so:sysutils/bacula11-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
CONFIGURE_ARGS+=--with-tcp-wrappers=/usr/lib \
--enable-smartalloc \
--sysconfdir=${ETCDIR} \
--with-working-dir=${BACULA_DIR} \
--with-scriptdir=${PREFIX}/share/${PORTNAME} \
--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-logdir=/var/log \
--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#users-and-groups
#
BACULA_USER?= bacula
BACULA_GROUP?= ${BACULA_USER}
BACULA_UID?= bacula
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_USES= mysql
SQLITE3_CONFIGURE_ON= --with-sqlite3=yes
SQLITE3_USES= sqlite:3
PGSQL_CONFIGURE_ON= --with-postgresql=yes
PGSQL_USES= pgsql
MTX_RUN_DEPENDS= ${LOCALBASE}/sbin/mtx:misc/mtx
.endif
.include <bsd.port.pre.mk>
.if ${readline_ARGS} == "port"
readline_CONFIGURE= ${LOCALBASE}
.else
readline_CONFIGURE= yes
.endif
# if IPv6 is not in the kernel, it generates many errors
.if ! ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+= --disable-ipv6
.endif
CONFIGURE_ARGS+= --with-readline=${readline_CONFIGURE}
.if defined(WITH_CLIENT_ONLY)
MP8+= bacula.8 bacula-fd.8 bconsole.8
.else
MP8+= 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
.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 \
${WRKSRC}/src/cats/Makefile.in \
${WRKSRC}/src/dird/Makefile.in \
${WRKSRC}/src/stored/Makefile.in \
${WRKSRC}/src/tools/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||' \
${WRKSRC}/Makefile.in
.endif
.if !target(post-install)
post-install:
.if defined(WITH_CLIENT_ONLY)
${MV} ${STAGEDIR}${ETCDIR}/bconsole.conf ${STAGEDIR}${ETCDIR}/bconsole.conf.sample
${INSTALL_DATA} ${WRKSRC}/examples/sample-query.sql ${STAGEDIR}${LOCALBASE}/share/bacula/query.sql.sample
.else
${INSTALL_SCRIPT} ${FILESDIR}/chio-bacula ${STAGEDIR}${PREFIX}/sbin
${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${STAGEDIR}${ETCDIR}/bacula-barcodes.sample
# bacula-dir attempts to install query.sql as bpart of bacula-server, but that should only installed by bacula-client.
${RM} ${STAGEDIR}${LOCALBASE}/share/bacula/query.sql
#the following are installed by the -CLIENT port, and I (ler@lerctr.org)
#don't know how to remove them from being built for the -SERVER port.
${RM} ${STAGEDIR}${LOCALBASE}/lib/bpipe-fd.so
${RM} ${STAGEDIR}${LOCALBASE}/lib/libbac-${PORTVERSION}.so
${RM} ${STAGEDIR}${LOCALBASE}/lib/libbac.so
${RM} ${STAGEDIR}${LOCALBASE}/lib/libbaccfg-${PORTVERSION}.so
${RM} ${STAGEDIR}${LOCALBASE}/lib/libbaccfg.so
${RM} ${STAGEDIR}${LOCALBASE}/lib/libbacfind-${PORTVERSION}.so
${RM} ${STAGEDIR}${LOCALBASE}/lib/libbacfind.so
.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 # 11-client and 11-server are defined
.include <bsd.port.post.mk>
.include <bsd.port.pre.mk>
post-build:
.if ${PKGNAMEPREFIX} == "nagios-check_"
${MAKE_CMD} -C ${WRKSRC}/examples/nagios/check_bacula
.endif
do-install:
.if ${PKGNAMESUFFIX} == "11-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} == "11-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
TIMESTAMP = 1614131085
SHA256 (bacula-11.0.1.tar.gz) = 2ebd9cdb885953c03f09df31180eeb7ea81aebb821cf45c9fdcb3fcff85294f5
SIZE (bacula-11.0.1.tar.gz) = 5975841
#
# 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
#!/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"
#!/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"
#!/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"
#!/bin/sh
#
# Bacula interface to FreeBSD chio autoloader command with
# multiple drive support
# (By Lars Kller, 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:"