# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # bacula-server-devel # bacula-server-devel/files # bacula-server-devel/files/bacula-barcodes # bacula-server-devel/files/chio-bacula # bacula-server-devel/files/patch-scripts-Makefile.in # bacula-server-devel/files/patch-src-console-Makefile.in # bacula-server-devel/files/patch-configure # bacula-server-devel/Makefile # bacula-server-devel/distinfo # bacula-server-devel/pkg-deinstall # bacula-server-devel/pkg-descr # bacula-server-devel/pkg-install # bacula-server-devel/pkg-message # bacula-server-devel/pkg-plist # bacula-server-devel/pkg-deinstall.client # bacula-server-devel/pkg-install.client # bacula-server-devel/pkg-plist.client # echo c - bacula-server-devel mkdir -p bacula-server-devel > /dev/null 2>&1 echo c - bacula-server-devel/files mkdir -p bacula-server-devel/files > /dev/null 2>&1 echo x - bacula-server-devel/files/bacula-barcodes sed 's/^X//' >bacula-server-devel/files/bacula-barcodes << 'END-of-bacula-server-devel/files/bacula-barcodes' X# X# Bacula barcode simulation file X# used by ${PREFIX}/sbin/chio-bacula (FreeBSD) X# X# The volumenames are returned by the "changer list" command X# labeling in the console is done by "label barcodes" X# (then all volumes belog to the default pool). X# All Lines with an "#" at the bedinning are ignored X# X# !!!! If you export an tape and reinsert another one, X# !!!! don't forget to change the volume name in this file! X# X1:Volume1-100 X2:Volume1-101 X3:Volume1-102 X4:Volume1-103 X5:Volume1-104 X6:Volume1-105 X7:Volume1-106 X8:Volume1-107 X9:Volume1-108 X10:Volume1-109 X11:Volume1-110 X12:Volume1-111 X# X# Further volumes exported from the changer X# X# 36GB AIT2 tapes X#Volume1-100 X#Volume1-101 X#Volume1-102 X#Volume1-103 X#Volume1-104 X#Volume1-105 X#Volume1-106 X#Volume1-107 X#Volume1-108 X#Volume1-109 X#Volume1-110 X#Volume1-111 X#Volume1-112 X#Volume1-113 X#Volume1-114 X#Volume1-115 X# X# 50GB AIT2 tapes X#Volume2-200 X#Volume2-201 X#Volume2-202 X#Volume2-203 X#Volume2-204 END-of-bacula-server-devel/files/bacula-barcodes echo x - bacula-server-devel/files/chio-bacula sed 's/^X//' >bacula-server-devel/files/chio-bacula << 'END-of-bacula-server-devel/files/chio-bacula' X#!/bin/sh X# X# Bacula interface to FreeBSD chio autoloader command with X# multiple drive support X# (By Lars Köller, lars+bacula@koellers.net, 2004) X# X# If you set in your Device resource X# X# Changer Command = "path-to-this-script/chio-bacula" %c %o %S %a X# you will have the following input to this script: X# X# chio-bacula "changer-device" "command" "slot" "archive-device" "drive-index" X# $1 $2 $3 $4 $5 X# for example: X# X# chio-bacula /dev/sg0 load 1 /dev/nst0 0 (on a FreeBSD system) X# X# If you need to to an offline, refer to the drive as $4 X# e.g. mt -f $f offline X# X# Many changers need an offline after the unload. Also many X# changers need a sleep 60 after the mtx load. X# X# N.B. If you change the script, take care to return either X# the mtx exit code or a 0. If the script exits with a non-zero X# exit code, Bacula will assume the request failed. X# Xme=$(basename $0) X X# Debug output, take care this file is writeable for user bacula! X#LOG=/var/db/bacula/chio-bacula.log X#exec 2>>$LOG X#echo "------------------------- $(date) Start $(basename $0) -------------------------" >> $LOG X#set -x X X# Debug Xlogger -p user.err "$me $@" X X# This simulates a barcode reader in the changer. X# The labes of the virtual barcode reader are located in the BARCODE_FILE XSIMULATE_BARCODE=true XBARCODE_FILE=/usr/local/etc/bacula-barcodes XMTX=/bin/chio X# Set default values (see case statement below for X# free mapping of drive index and tape device X# We have a double drive Qualstar where drive 1 is the default bacula drive X#TAPE=/dev/bacula-tape XTAPE=/dev/nrsa0 XDRIVE=0 X# Time to wait for (un)loading XSLEEP=20 X Xusage() X{ X echo "" X echo "The $me script for bacula" X echo "--------------------------------------" X echo "" X echo "usage: $me [slot] [devicename of tapedrive] [drive index]" X echo "" X echo "Valid commands:" X echo "" X echo "unload Unloads a tape into the slot" X echo " from where it was loaded." X echo "load Loads a tape from the slot " X echo " (slot-base is calculated to 1 as first slot)" X echo "list Lists full storage slots" X echo "loaded Gives slot from where the tape was loaded." X echo " 0 means the tape drive is empty." X echo "slots Gives Number of aviable slots." X echo "" X echo "Example:" X echo " $me /dev/changer load 1 loads a tape from slot 1" X echo "" X exit 2 X} X X# The changer device Xif [ -z "$1" ] ; then X usage; Xelse X CHANGER=$1 Xfi X# The command Xif [ -z "$2" ] ; then X usage; Xelse X COMMAND=$2 Xfi X# The slot number Xif [ ! -z "$3" ]; then X SLOT=$3 X # btape fill says "... slot 1 drive 0" :-( X if [ "$SLOT" = "slot" ]; then X shift X SLOT=$3 X fi Xfi X# Set tape device Xif [ ! -z "$4" ]; then X TAPE=$4 Xfi X X# Here you can map bacula drive number to any tape device X# DRIVE is the chio drive number used below by chio! Xcase $5 in X 0) X # First Drive in Changer is Bacula drive X DRIVE=0 X #TAPE=/dev/bacula-tape X TAPE=/dev/nrsa0 X ;; X 1) X DRIVE=1 X #TAPE=/dev/bacula-tape2 X TAPE=/dev/nrsa1 X ;; Xesac X X# X# Main X# Xcase ${COMMAND} in X unload) X # enable the following line if you need to eject the cartridge X mt -f ${TAPE} off X sleep 2 X # if we have a slot, try it X if [ ! -z "$SLOT" ]; then X ${MTX} -f ${CHANGER} move drive ${DRIVE} slot $((${SLOT}-1)) X exit $? X fi X # Try other way (works if source element information is valid for drive) X ${MTX} -f ${CHANGER} return drive ${DRIVE} X # If the changer is power cycled with a tape loaded in a drive X # we can compute the slot in case of a complete filled magazine, with X # one slot free. X if [ "$?" != "0" ]; then X free_slot=`${MTX} -f ${CHANGER} stat | grep "^slot " | grep -v "FULL" | awk '{print $2}'` X free_slot=${free_slot%:} X ${MTX} -f ${CHANGER} move drive ${DRIVE} slot $free_slot X fi X ;; X X load) X ${MTX} -f ${CHANGER} move slot $((${SLOT}-1)) drive ${DRIVE} X rtn=$? X # Increase the sleep time if you have a slow device X sleep $SLEEP X exit $rtn X ;; X X list) X if [ "${SIMULATE_BARCODE}" = "true" ]; then X if [ -f "$BARCODE_FILE" ]; then X cat $BARCODE_FILE | grep -v -e "^#" -e "^$" X exit 0 X else X echo "Barcode file $BARCODE_FILE missing ... exiting!" X exit 1 X fi X else X ${MTX} -f ${CHANGER} status | grep "^slot .*: .*FULL>" | awk '{print $2}' | awk -F: '{print $1+1" "}' | tr -d "[\r\n]" X fi X ;; X X loaded) X # echo "Request loaded" X ${MTX} -f ${CHANGER} status -S > /tmp/mtx.$$ X rtn=$? X # Try to get chio slot source from drive entry X SLOT=$(cat /tmp/mtx.$$ | grep "^drive ${DRIVE}: .*slot" | awk '{print $6+1}' | tr -d ">") X if [ -z "$SLOT" ]; then X # This handles the case a source slot is not available (power on X # of the changer with a drive loaded) and all other slots are X # occupied with a tape! X SLOT=$(cat /tmp/mtx.$$ | grep "^slot .*: " | awk '{print $2+1}') X if [ -z "$SLOT" ]; then X echo 0 X else X echo $SLOT X fi X else X echo $SLOT X fi X # All tapes are in the slots X #cat /tmp/mtx.$$ | grep "^drive ${DRIVE}: .* source: <>" | awk "{print 0}" X rm -f /tmp/mtx.$$ X exit $rtn X ;; X X slots) X # echo "Request slots" X ${MTX} -f ${CHANGER} status | grep "^slot " | tail -1 | awk '{print $2+1}' | tr -d ":" X ;; X X *) X usage X ;; Xesac END-of-bacula-server-devel/files/chio-bacula echo x - bacula-server-devel/files/patch-scripts-Makefile.in sed 's/^X//' >bacula-server-devel/files/patch-scripts-Makefile.in << 'END-of-bacula-server-devel/files/patch-scripts-Makefile.in' X*** scripts/Makefile.in.orig Thu Nov 3 15:33:16 2005 X--- scripts/Makefile.in Thu Nov 17 08:31:29 2005 X*************** X*** 33,43 **** X $(MKDIR) $(DESTDIR)$(mandir) X X install: installdirs X! $(INSTALL_SCRIPT) startmysql $(DESTDIR)$(scriptdir)/startmysql X! $(INSTALL_SCRIPT) stopmysql $(DESTDIR)$(scriptdir)/stopmysql X! $(INSTALL_SCRIPT) bconsole $(DESTDIR)$(scriptdir)/bconsole X! $(INSTALL_SCRIPT) gconsole $(DESTDIR)$(scriptdir)/gconsole X! $(INSTALL_SCRIPT) bacula $(DESTDIR)$(scriptdir)/bacula X @if test -f ${DESTDIR}${scriptdir}/mtx-changer; then \ X echo " ==> Saving existing mtx-changer to mtx-changer.old"; \ X $(MV) -f ${DESTDIR}${scriptdir}/mtx-changer ${DESTDIR}${scriptdir}/mtx-changer.old; \ X--- 33,43 ---- X $(MKDIR) $(DESTDIR)$(mandir) X X install: installdirs X! # $(INSTALL_SCRIPT) startmysql $(DESTDIR)$(scriptdir)/startmysql X! # $(INSTALL_SCRIPT) stopmysql $(DESTDIR)$(scriptdir)/stopmysql X! # $(INSTALL_SCRIPT) bconsole $(DESTDIR)$(scriptdir)/bconsole X! # $(INSTALL_SCRIPT) gconsole $(DESTDIR)$(scriptdir)/gconsole X! $(INSTALL_SCRIPT) bacula $(DESTDIR)$(sysconfdir)/rc.d/z-bacula.sh.sample X @if test -f ${DESTDIR}${scriptdir}/mtx-changer; then \ X echo " ==> Saving existing mtx-changer to mtx-changer.old"; \ X $(MV) -f ${DESTDIR}${scriptdir}/mtx-changer ${DESTDIR}${scriptdir}/mtx-changer.old; \ X*************** X*** 48,58 **** X $(MV) -f ${DESTDIR}${scriptdir}/dvd-handler ${DESTDIR}${scriptdir}/dvd-handler.old; \ X fi X $(INSTALL_SCRIPT) dvd-handler $(DESTDIR)$(scriptdir)/dvd-handler X! $(INSTALL_DATA) btraceback.gdb $(DESTDIR)$(scriptdir)/btraceback.gdb X! $(INSTALL_DATA) btraceback.dbx $(DESTDIR)$(scriptdir)/btraceback.dbx X! $(INSTALL_SCRIPT) btraceback $(DESTDIR)$(sbindir)/btraceback X! gzip bacula.8.gz X! $(INSTALL_DATA) bacula.8.gz $(DESTDIR)$(mandir)/bacula.8.gz X @rm -f bacula.8.gz X X X--- 48,58 ---- X $(MV) -f ${DESTDIR}${scriptdir}/dvd-handler ${DESTDIR}${scriptdir}/dvd-handler.old; \ X fi X $(INSTALL_SCRIPT) dvd-handler $(DESTDIR)$(scriptdir)/dvd-handler X! # $(INSTALL_DATA) btraceback.gdb $(DESTDIR)$(scriptdir)/btraceback.gdb X! # $(INSTALL_DATA) btraceback.dbx $(DESTDIR)$(scriptdir)/btraceback.dbx X! # $(INSTALL_SCRIPT) btraceback $(DESTDIR)$(sbindir)/btraceback X! # gzip bacula.8.gz X! $(INSTALL_DATA) bacula.man $(DESTDIR)$(mandir)/bacula.8 X @rm -f bacula.8.gz X X END-of-bacula-server-devel/files/patch-scripts-Makefile.in echo x - bacula-server-devel/files/patch-src-console-Makefile.in sed 's/^X//' >bacula-server-devel/files/patch-src-console-Makefile.in << 'END-of-bacula-server-devel/files/patch-src-console-Makefile.in' X*** src/console/Makefile.in.org Sat Apr 3 20:40:26 2004 X--- src/console/Makefile.in Sat May 8 14:01:49 2004 X*************** X*** 89,95 **** X destconf=$$srcconf; \ X if test -f ${DESTDIR}${sysconfdir}/console.conf; then \ X echo "Existing console.conf moved to bconsole.conf"; \ X! @$(MV) ${DESTDIR}${sysconfdir}/console.conf ${DESTDIR}${sysconfdir}/bconsole.conf; \ X destconf=$$srcconf.new; \ X fi; \ X fi; \ X--- 89,95 ---- X destconf=$$srcconf; \ X if test -f ${DESTDIR}${sysconfdir}/console.conf; then \ X echo "Existing console.conf moved to bconsole.conf"; \ X! $(MV) ${DESTDIR}${sysconfdir}/console.conf ${DESTDIR}${sysconfdir}/bconsole.conf; \ X destconf=$$srcconf.new; \ X fi; \ X fi; \ END-of-bacula-server-devel/files/patch-src-console-Makefile.in echo x - bacula-server-devel/files/patch-configure sed 's/^X//' >bacula-server-devel/files/patch-configure << 'END-of-bacula-server-devel/files/patch-configure' X*** configure.org Sun Mar 6 16:46:54 2005 X--- configure Sun Mar 6 16:49:20 2005 X*************** X*** 29490,29497 **** X DISTVER=`uname -a |awk '{print $3}'` X VER=`echo $DISTVER | cut -c 1` X if test x$VER = x4 ; then X! PTHREAD_LIB="-pthread" X! CFLAGS="${CFLAGS} -pthread" X fi X lld="qd" X llu="qu" X--- 21037,21044 ---- X DISTVER=`uname -a |awk '{print $3}'` X VER=`echo $DISTVER | cut -c 1` X if test x$VER = x4 ; then X! PTHREAD_LIB="${PTHREAD_LIBS}" X! CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" X fi X lld="qd" X llu="qu" END-of-bacula-server-devel/files/patch-configure echo x - bacula-server-devel/Makefile sed 's/^X//' >bacula-server-devel/Makefile << 'END-of-bacula-server-devel/Makefile' X# New ports collection makefile for: bacula X# Date created: 24 February 2003 X# Whom: Dmitry Sivachenko X# X# $FreeBSD: ports/sysutils/bacula-server/Makefile,v 1.58 2006/01/09 19:36:17 lkoeller Exp $ X# X XPORTNAME= bacula X XPORTVERSION= 1.38.4.20060112 XDISTVERSION= 1.38.4-20060112 XCATEGORIES= sysutils XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE} XMASTER_SITE_SUBDIR= bacula X XPKGNAMESUFFIX?= -server-devel X X X X XDISTFILES= bacula-beta-${DISTVERSION}.tar.gz XWRKSRC= work/bacula-beta-${DISTVERSION} XMAINTAINER= dan@langille.org XCOMMENT?= The network backup solution (server) - DEVELOPMENT Version X X# The user/group IDs below are registered, see X# http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#DADS-UID X# XBACULA_DIR?=/var/db/bacula X# XUSE_REINPLACE= yes XGNU_CONFIGURE= yes XCONFIGURE_ARGS= --with-tcp-wrappers=/usr/lib \ X --enable-smartalloc \ X --with-working-dir=${BACULA_DIR} \ X --with-scriptdir=${PREFIX}/share/${PORTNAME} \ X --mandir=${PREFIX}/man \ X --with-fd-user=root \ X --with-fd-group=wheel \ X --with-dir-user=bacula \ X --with-dir-group=bacula \ X --with-sd-user=bacula \ X --with-sd-group=operator \ X --with-readline=yes \ X --disable-conio X XCONFIGURE_ENV+= CPPFLAGS="-I/usr/include/readline -I${LOCALBASE}/include" \ X LDFLAGS="-L${LOCALBASE}/lib" \ X PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \ X PTHREAD_LIBS="${PTHREAD_LIBS}" X XALL_OPTIONS= CLIENT_ONLY WXCONSOLE GNOMECONSOLE SQLITE3 MYSQL POSTGRESQL MTX OPENSSL X X.for opt in ${ALL_OPTIONS} X.if defined(WITH_${opt}) XBATCH= yes X.endif X.endfor X X.if !defined(BATCH) XIS_INTERACTIVE= yes X.endif X X.if defined(WITH_CLIENT_ONLY) XOPTIONS+= WXCONSOLE "Build with wxGTK based GUI console" off XOPTIONS+= GNOMECONSOLE "Build with GNOME based GUI console" off X.else XOPTIONS= SQLITE3 "Use SqLite-3 database instead of SqLite-2" off XOPTIONS+= MYSQL "Use MySQL database instead of SqLite" off XOPTIONS+= POSTGRESQL "Use PostgreSQL database instead of SqLite" off XOPTIONS+= MTX "Install mtx for control of autochanger devices" off X.endif X XOPTIONS+= OPENSSL "Enable OpenSSL for encrypted communication" off X X# Prepare if gnome-console is selected this must be happen before X# include of bsd.port.pre.mk! XWANT_GNOME= yes X.if defined(WITH_GNOMECONSOLE) XUSE_GNOME= libgnome X.endif X XPLIST_SUB+= BACULA_DIR=${BACULA_DIR} X XMAN8= bacula.8 X X.include X X# Client only or full server version X.if defined(WITH_CLIENT_ONLY) XCONFFILES= fd XCONFIGURE_ARGS+= --enable-client-only X XPKGDEINSTALL= ${PKGDIR}/pkg-deinstall.client XPKGINSTALL= ${PKGDIR}/pkg-install.client X# Build gnome-console X.if defined(WITH_GNOMECONSOLE) XCONFIGURE_ARGS+= --enable-gnome XPLIST_SUB+= GNOMECONS="" X.else X# We didn't need GTK (it's not possible to put WANT_GNOME in an .if statement!) XWITHOUT_GNOME= yes XPLIST_SUB+= GNOMECONS="@comment " X.endif X# Build wx-console X.if defined(WITH_WXCONSOLE) XCONFIGURE_ARGS+= --enable-wx-console XLIB_DEPENDS+= wx_gtk2-2.4.0:${PORTSDIR}/x11-toolkits/wxgtk24 XCONFIGURE_ENV+= WXCONFIG=${X11BASE}/bin/wxgtk2-2.4-config XPLIST_SUB+= WXCONS="" X.else X# We didn't need GTK (it's not possible to put WANT_GNOME in an .if statement!) XWITHOUT_GNOME= yes XPLIST_SUB+= WXCONS="@comment " X.endif X.else X# Server only Options XPLIST_SUB+= GNOMECONS="@comment " XPLIST_SUB+= WXCONS="@comment " XCONFFILES= sd dir X.if defined(WITH_MYSQL) XCONFIGURE_ARGS+= --with-mysql=yes XUSE_MYSQL= yes XDBTYPE= mysql X.elif defined(WITH_POSTGRESQL) XUSE_PGSQL= yes XCONFIGURE_ARGS+= --with-postgresql=yes XDBTYPE= postgresql X.elif defined(WITH_SQLITE3) XCONFIGURE_ARGS+= --with-sqlite3=yes XLIB_DEPENDS+= sqlite3:${PORTSDIR}/databases/sqlite3 XDBTYPE= sqlite X.else XCONFIGURE_ARGS+= --with-sqlite=yes XLIB_DEPENDS+= sqlite.2:${PORTSDIR}/databases/sqlite2 XDBTYPE= sqlite X.endif XPLIST_SUB+= DBTYPE=${DBTYPE} X# Install mtx X.if defined(WITH_MTX) XRUN_DEPENDS+= ${LOCALBASE}/sbin/mtx:${PORTSDIR}/misc/mtx X.endif X.endif X X.if defined(WITH_OPENSSL) XCONFIGURE_ARGS+= --with-openssl X.endif X X.if defined(WITH_CLIENT_ONLY) XMAN8=bacula.8 X.endif X Xpre-everything:: X.if !defined(WITH_CLIENT_ONLY) X @${ECHO_MSG} "=======> ATTENTION <=======" X @${ECHO_MSG} "===> Note that there is a pthreads problem, which leads to the loss of 500kB" X @${ECHO_MSG} "===> of data at the end of an tape. This is corrected in newer versions of FreeBSD" X @${ECHO_MSG} "===> READ ${WRKSRC}/platforms/freebsd/pthreads-fix.txt" X @${ECHO_MSG} "" X @${ECHO_MSG} "You may use the following build options (or make config):" X @${ECHO_MSG} "" X @${ECHO_MSG} " WITH_CLIENT_ONLY=yes if you only want the file daemon." X @${ECHO_MSG} " WITH_WXCONSOLE=yes if you only want a wxGTK based GUI console." X @${ECHO_MSG} " WITH_GNOMECONSOLE=yes if you only want a GNOME based GUI console." X @${ECHO_MSG} " WITH_MTX=yes if you want to use mtx instead of chio for autochanger control." X @${ECHO_MSG} " WITH_SQLITE3=yes if you want SqLite-3 instead of SqLite-2 as the database." X.if !defined(WITH_MYSQL) && !defined(WITH_POSTGRESQL) X @${ECHO_MSG} " WITH_MYSQL=yes if you want MySQL instead of SqLite as the database." X @${ECHO_MSG} " WITH_POSTGRESQL=yes if you want PostgreSQL instead of SqLite as the database." X @${ECHO_MSG} "" X @${ECHO_MSG} "The default DB is SQLite-2!" X.endif X @${ECHO_MSG} "" X @${ECHO_MSG} "===> Using ${DBTYPE} as the bacula database." X @${ECHO_MSG} "" X.else X @${ECHO_MSG} "===> Building file daemon only." X.endif X Xpost-patch: X# Default bconsole.conf is ${PREFIX}/etc X @${REINPLACE_CMD} -e 's|./bconsole.conf|${PREFIX}/etc/bconsole.conf|g' ${WRKSRC}/src/console/console.c X.if defined(WITH_CLIENT_ONLY) X# In client port only install startup script out of script dir (see below post-install) X# Dont mkdir ${PREFIX}/share/bacule cause it's empty X @${REINPLACE_CMD} -e 's|^\(fd_subdirs = .*\)scripts\(.*\)|\1\2|g' ${WRKSRC}/Makefile.in X ${REINPLACE_CMD} -e 's|\(.*$$(MKDIR) $$(DESTDIR)$$(scriptdir)\)|#\1|g' ${WRKSRC}/Makefile.in X.else X# In server port don't install filed X @${REINPLACE_CMD} -e 's|^all_subdirs = .*|all_subdirs = scripts src\/lib src\/findlib $${subdirs}|g' ${WRKSRC}/Makefile.in X.endif X Xpost-install: X# Migration: move existing bacula.sh to z-bacula.sh to start bacula AFTER DB start X if [ -f ${PREFIX}/etc/rc.d/bacula.sh ]; then \ X ${MV} ${PREFIX}/etc/rc.d/bacula.sh ${PREFIX}/etc/rc.d/z-bacula.sh; \ X fi X if [ -f ${PREFIX}/etc/rc.d/bacula.sh.sample ]; then \ X ${MV} ${PREFIX}/etc/rc.d/bacula.sh.sample ${PREFIX}/etc/rc.d/z-bacula.sh.sample; \ X fi X.if defined(WITH_CLIENT_ONLY) X# Install start script X ${INSTALL_SCRIPT} ${WRKSRC}/scripts/bacula ${PREFIX}/etc/rc.d/z-bacula.sh.sample X# Extend only /etc/services X @ ${SETENV} PKG_PREFIX=${PREFIX} \ X ${SH} ${PKGINSTALL} ${PORTNAME} X# Console stuff X if [ -f ${PREFIX}/etc/bconsole.conf.new ]; then \ X ${ECHO_CMD} "etc/bconsole.conf.new" >> ${TMPPLIST}; \ X elif [ -f ${PREFIX}/etc/bconsole.conf ]; then \ X ${MV} ${PREFIX}/etc/bconsole.conf ${PREFIX}/etc/bconsole.conf.sample; \ X ${ECHO_CMD} "etc/bconsole.conf.sample" >> ${TMPPLIST}; \ X fi X.if defined(WITH_WXCONSOLE) X if [ -f ${PREFIX}/etc/wx-console.conf.new ]; then \ X ${ECHO_CMD} "etc/wx-console.conf.new" >> ${TMPPLIST}; \ X elif [ -f ${PREFIX}/etc/wx-console.conf ]; then \ X ${MV} ${PREFIX}/etc/wx-console.conf ${PREFIX}/etc/wx-console.conf.sample; \ X ${ECHO_CMD} "etc/wx-console.conf.sample" >> ${TMPPLIST}; \ X fi X.endif X.if defined(WITH_GNOMECONSOLE) X if [ -f ${PREFIX}/etc/gnome-console.conf.new ]; then \ X ${ECHO_CMD} "etc/gnome-console.conf.new" >> ${TMPPLIST}; \ X elif [ -f ${PREFIX}/etc/gnome-console.conf ]; then \ X ${MV} ${PREFIX}/etc/gnome-console.conf ${PREFIX}/etc/gnome-console.conf.sample; \ X ${ECHO_CMD} "etc/gnome-console.conf.sample" >> ${TMPPLIST}; \ X fi X.endif X X# @${CHMOD} a+x ${WRKSRC}/scripts/bacula.man X.if defined(WITH_CLIENT_ONLY) X ${INSTALL_MAN} ${WRKSRC}/scripts/bacula.man ${PREFIX}/man/man8/bacula.8 X.endif X.else X# Extend /etc/services and install UID/GID X @ ${SETENV} PKG_PREFIX=${PREFIX} \ X ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL X# Install config files and preserve existing ones X ${INSTALL_SCRIPT} ${FILESDIR}/chio-bacula ${PREFIX}/sbin X if [ -f ${PREFIX}/etc/bacula-barcodes ]; then \ X ${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${PREFIX}/etc/bacula-barcodes.new ; \ X ${ECHO_CMD} "etc/bacula-barcodes.new" >> ${TMPPLIST}; \ X else \ X ${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${PREFIX}/etc/bacula-barcodes.samples ; \ X ${ECHO_CMD} "etc/bacula-barcodes.samples" >> ${TMPPLIST}; \ X fi X# chmod of bsmtp program so bacula can use it with dropped down permissions X ${CHMOD} o+x ${PREFIX}/sbin/bsmtp X ${CHOWN} -R bacula:bacula ${PREFIX}/share/bacula X.endif X# Install leaves existing conf files untouched. Respect this here! X for na in ${CONFFILES}; do \ X if [ -f ${PREFIX}/etc/bacula-$$na.conf.new ]; then \ X ${ECHO_CMD} "etc/bacula-$$na.conf.new" >> ${TMPPLIST}; \ X elif [ -f ${PREFIX}/etc/bacula-$$na.conf ]; then \ X ${MV} ${PREFIX}/etc/bacula-$$na.conf ${PREFIX}/etc/bacula-$$na.conf.sample; \ X ${ECHO_CMD} "etc/bacula-$$na.conf.sample" >> ${TMPPLIST}; \ X fi; \ X done X X# Inform user after install about important things .... X @${ECHO_MSG} "*********************************************************************" X @${ECHO_MSG} "NOTE:" X @${ECHO_MSG} "Sample files are installed in ${PREFIX}/etc:" X @${ECHO_MSG} " bconsole.conf.sample, bacula-barcodes.sample, bacula-fd.conf.sample" X.if !defined(WITH_CLIENT_ONLY) X @${ECHO_MSG} " bacula-sd.conf.sample, bacula-dir.conf.sample" X @${ECHO_MSG} "" X @${ECHO_MSG} "An auto-changer manipulation script based on FreeBSDs" X @${ECHO_MSG} "chio command is included and installed at" X @${ECHO_MSG} "" X @${ECHO_MSG} " ${PREFIX}/sbin/chio-bacula" X @${ECHO_MSG} "" X @${ECHO_MSG} "Please have a look at it if you want to use an" X @${ECHO_MSG} "autochanger. You have to configure the usage in" X @${ECHO_MSG} "" X @${ECHO_MSG} " ${PREFIX}/etc/bacula-dir.conf" X @${ECHO_MSG} "" X @${ECHO_MSG} "Take care of correct permissions for changer and" X @${ECHO_MSG} "tape device (e.g. /dev/ch0 and /dev/n[r]sa0) i.e." X @${ECHO_MSG} "they must be accessible by user bacula." X @${ECHO_MSG} "" X @${ECHO_MSG} "Due to lack of some features in the FreeBSD tape driver" X @${ECHO_MSG} "implementation you MUST add some OS dependent options to" X @${ECHO_MSG} "the bacula-sd.conf file:" X @${ECHO_MSG} "" X @${ECHO_MSG} " Hardware End of Medium = no;" X @${ECHO_MSG} " Backward Space Record = no;" X @${ECHO_MSG} " Backward Space File = no;" X @${ECHO_MSG} "" X @${ECHO_MSG} "With 2 filemarks at EOT (see man mt):" X @${ECHO_MSG} " Fast Forward Space File = no;" X @${ECHO_MSG} " BSF at EOM = yes;" X @${ECHO_MSG} " TWO EOF = yes;" X @${ECHO_MSG} "" X @${ECHO_MSG} "With 1 filemarks at EOT (see man mt):" X @${ECHO_MSG} " Fast Forward Space File = yes;" X @${ECHO_MSG} " BSF at EOM = no;" X @${ECHO_MSG} " TWO EOF = no;" X @${ECHO_MSG} "" X @${ECHO_MSG} "NOTE: YOU CAN SWITCH EOT model ONLY when starting" X @${ECHO_MSG} " from scratch with EMPTY tapes!!!!" X @${ECHO_MSG} "" X @${ECHO_MSG} "It is also important that all the scripts accessed" X @${ECHO_MSG} "by RunBeforeJob and RunAfterJob can be executed by" X @${ECHO_MSG} "the user bacula." X @${ECHO_MSG} "" X @${ECHO_MSG} "For USB support read the bacula manual!! It could be necessary" X @${ECHO_MSG} "to configure/compile a new kernel!" X @${ECHO_MSG} "" X @${ECHO_MSG} "Look at $PREFIX/share/bacula/update_bacula_tables for" X @${ECHO_MSG} "database update procedure. Details can be found in the" X @${ECHO_MSG} "ReleaseNotes" X.endif X @${ECHO_MSG} "*********************************************************************" X X.if !defined(WITH_CLIENT_ONLY) X ${CAT} pkg-message X.endif X X.include END-of-bacula-server-devel/Makefile echo x - bacula-server-devel/distinfo sed 's/^X//' >bacula-server-devel/distinfo << 'END-of-bacula-server-devel/distinfo' XMD5 (bacula-beta-1.38.4-20060112.tar.gz) = 2e15775d145cf7681a56593308af80bd XSIZE (bacula-beta-1.38.4-20060112.tar.gz) = 1909974 END-of-bacula-server-devel/distinfo echo x - bacula-server-devel/pkg-deinstall sed 's/^X//' >bacula-server-devel/pkg-deinstall << 'END-of-bacula-server-devel/pkg-deinstall' X#!/bin/sh X XPATH=/bin:/usr/bin:/usr/sbin XTMPFILE=/tmp/services-$RANDOM-$$ Xif [ -z "${BACULA_DIR}" ]; then X BACULA_DIR=/var/db/bacula Xfi X Xcase "$2" in X"DEINSTALL") X # Delete entries in /etc/services X sed -e '/# Bacula port start/,/# Bacule port end/{' \ X -e 'd' \ X -e '}' /etc/services > $TMPFILE X mv -f $TMPFILE /etc/services X X if [ -d ${BACULA_DIR} ]; then X rmdir ${BACULA_DIR}; X fi X if [ -d ${BACULA_DIR} ]; then X echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the bacula port" X fi X X # Note how to delete UID/GID X USER=bacula X GROUP=${USER} X if pw usershow "${USER}" 2>/dev/null 1>&2; then X echo "To delete Bacula user permanently, use 'pw userdel ${USER}'" X echo "To delete Bacula group permanently, use 'pw groupdel ${GROUP}'" X fi X ;; Xesac END-of-bacula-server-devel/pkg-deinstall echo x - bacula-server-devel/pkg-descr sed 's/^X//' >bacula-server-devel/pkg-descr << 'END-of-bacula-server-devel/pkg-descr' XBacula is a set of computer programs that permit you (or the system Xadministrator) to manage backup, recovery, and verification of Xcomputer data across a network of computers of different kinds. XIn technical terms, it is a network Client/Server based backup program. XBacula is relatively easy to use and efficient, while offering many Xadvanced storage management features that make it easy to find and Xrecover lost or damaged files. Due to its modular design, Bacula is Xscalable from small single computer systems to systems consisting of Xhundreds of computers located over a large network. X XThis port is built from the development branch of Bacula. X XWWW: http://www.bacula.org/ END-of-bacula-server-devel/pkg-descr echo x - bacula-server-devel/pkg-install sed 's/^X//' >bacula-server-devel/pkg-install << 'END-of-bacula-server-devel/pkg-install' X#!/bin/sh X XPATH=/bin:/usr/bin:/usr/sbin Xif [ -z "${BACULA_DIR}" ]; then X BACULA_DIR=/var/db/bacula Xfi X X# Always add lines in /etc/services Xgrep -q "bacula-dir" /etc/services Xif [ "$?" != "0" ]; then X echo "# Bacula port start Xbacula-dir 9101/tcp #Bacula director daemon Xbacula-fd 9102/tcp #Bacula file daemon Xbacula-sd 9103/tcp #Bacula storage daemon X# Bacule port end" >> /etc/services Xfi X Xcase $2 in XPOST-INSTALL) X # Install UID/GID X USER=bacula X GROUP=${USER} X UID=910 X GID=${UID} X X if pw group show "${GROUP}" 2>/dev/null; then X echo "You already have a group \"${GROUP}\", so I will use it." X else X if pw groupadd ${GROUP} -g ${GID}; then X echo "Added group \"${GROUP}\"." X else X echo "Adding group \"${GROUP}\" failed..." X exit 1 X fi X fi X X if pw user show "${USER}" 2>/dev/null; then X echo "You already have a user \"${USER}\", so I will use it." X if pw usermod ${USER} -d ${BACULA_DIR} -G operator X then X echo "Changed home directory of \"${USER}\" to \"${BACULA_DIR}\"" X else X echo "Changing home directory of \"${USER}\" to \"${BACULA_DIR}\" failed..." X exit 1 X fi X else X if pw useradd ${USER} -u ${UID} -g ${GROUP} -G operator -h - \ X -d ${BACULA_DIR} -s /sbin/nologin -c "Bacula Daemon" X then X echo "Added user \"${USER}\"." X else X echo "Adding user \"${USER}\" failed..." X exit 1 X fi X fi X chown -R ${USER}:${GROUP} ${BACULA_DIR} X ;; Xesac END-of-bacula-server-devel/pkg-install echo x - bacula-server-devel/pkg-message sed 's/^X//' >bacula-server-devel/pkg-message << 'END-of-bacula-server-devel/pkg-message' X################################################################################ X Please read the file" X X ${DOCSDIR}/ReleaseNotes" X X for the upgrade procedure! X X IF YOU IGNORE THIS you may !! LOSE DATA !! X X For USB support read the manual. It could be necessary X to configure/compile a new kernel! X X################################################################################ END-of-bacula-server-devel/pkg-message echo x - bacula-server-devel/pkg-plist sed 's/^X//' >bacula-server-devel/pkg-plist << 'END-of-bacula-server-devel/pkg-plist' X%%DATADIR%%/query.sql Xetc/rc.d/z-bacula.sh.sample Xsbin/chio-bacula Xsbin/bacula-dir Xsbin/bacula-sd Xsbin/bcopy Xsbin/bextract Xsbin/bls Xsbin/bscan Xsbin/btape X%%WXCONS%%sbin/wx-console X%%GNOMECONS%%sbin/gnome-console Xsbin/dbcheck Xsbin/bsmtp X@unexec if cmp -s %D/share/bacula/mtx-changer.old %D/share/bacula/mtx-changer; then rm -f %D/share/bacula/mtx-changer.old; fi X%%DATADIR%%/mtx-changer X%%DATADIR%%/create_bacula_database X%%DATADIR%%/create_%%DBTYPE%%_database X%%DATADIR%%/drop_bacula_database X%%DATADIR%%/drop_%%DBTYPE%%_database X%%DATADIR%%/drop_bacula_tables X%%DATADIR%%/drop_%%DBTYPE%%_tables X%%DATADIR%%/grant_bacula_privileges X%%DATADIR%%/grant_%%DBTYPE%%_privileges X%%DATADIR%%/make_bacula_tables X%%DATADIR%%/make_%%DBTYPE%%_tables X%%DATADIR%%/update_bacula_tables X%%DATADIR%%/update_%%DBTYPE%%_tables X%%DATADIR%%/delete_catalog_backup X%%DATADIR%%/make_catalog_backup X%%DATADIR%%/dvd-handler X X@dirrm %%DATADIR%% X@unexec /usr/bin/killall badula-sd > /dev/null 2>&1 || true X@unexec /usr/bin/killall bacula-dir > /dev/null 2>&1 || true X@exec mkdir -p %%BACULA_DIR%% END-of-bacula-server-devel/pkg-plist echo x - bacula-server-devel/pkg-deinstall.client sed 's/^X//' >bacula-server-devel/pkg-deinstall.client << 'END-of-bacula-server-devel/pkg-deinstall.client' X#!/bin/sh X XPATH=/bin:/usr/bin:/usr/sbin XTMPFILE=/tmp/services-$RANDOM-$$ Xif [ -z "${BACULA_DIR}" ]; then X BACULA_DIR=/var/db/bacula Xfi X Xcase "$2" in X"DEINSTALL") X # Delete entries in /etc/services X sed -e '/# Bacula port start/,/# Bacule port end/{' \ X -e 'd' \ X -e '}' /etc/services > $TMPFILE X mv -f $TMPFILE /etc/services X X if [ -d ${BACULA_DIR} ]; then X rmdir ${BACULA_DIR}; X fi X if [ -d ${BACULA_DIR} ]; then X echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the bacula port" X fi X ;; Xesac END-of-bacula-server-devel/pkg-deinstall.client echo x - bacula-server-devel/pkg-install.client sed 's/^X//' >bacula-server-devel/pkg-install.client << 'END-of-bacula-server-devel/pkg-install.client' X#!/bin/sh X XPATH=/bin:/usr/bin:/usr/sbin Xif [ -z "${BACULA_DIR}" ]; then X BACULA_DIR=/var/db/bacula Xfi X X# Always add lines in /etc/services Xgrep -q "bacula-dir" /etc/services Xif [ "$?" != "0" ]; then X echo "# Bacula port start Xbacula-dir 9101/tcp #Bacula director daemon Xbacula-fd 9102/tcp #Bacula file daemon Xbacula-sd 9103/tcp #Bacula storage daemon X# Bacule port end" >> /etc/services Xfi X END-of-bacula-server-devel/pkg-install.client echo x - bacula-server-devel/pkg-plist.client sed 's/^X//' >bacula-server-devel/pkg-plist.client << 'END-of-bacula-server-devel/pkg-plist.client' Xetc/rc.d/z-bacula.sh.sample Xsbin/bacula-fd Xsbin/bconsole X%%GNOMECONS%%sbin/gnome-console X%%WXCONS%%sbin/wx-console X@unexec /usr/bin/killall badula-fd > /dev/null 2>&1 || true X@exec mkdir -p %%BACULA_DIR%% END-of-bacula-server-devel/pkg-plist.client exit