Wed, 07 Jan 2009 00:25:41 +0100
Import package vendor original specs for necessary manipulations.
bacula/bacula.patch | file | annotate | diff | comparison | revisions | |
bacula/bacula.spec | file | annotate | diff | comparison | revisions | |
bacula/bexec.sh | file | annotate | diff | comparison | revisions | |
bacula/rc.bacula | file | annotate | diff | comparison | revisions |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/bacula/bacula.patch Wed Jan 07 00:25:41 2009 +0100 1.3 @@ -0,0 +1,131 @@ 1.4 +Index: manpages/Makefile.in 1.5 +--- manpages/Makefile.in.orig 2007-04-24 17:47:01 +0200 1.6 ++++ manpages/Makefile.in 2008-07-09 07:45:59 +0200 1.7 +@@ -20,23 +20,21 @@ 1.8 + install: 1.9 + $(MKDIR) $(DESTDIR)/$(mandir)/man8 1.10 + for I in ${MAN8}; \ 1.11 +- do ($(RMF) $$I.gz; gzip -c $$I >$$I.gz; \ 1.12 +- $(INSTALL_DATA) $$I.gz $(DESTDIR)$(mandir)/man8/$$I.gz; \ 1.13 +- rm -f $$I.gz); \ 1.14 ++ do \ 1.15 ++ $(INSTALL_DATA) $$I $(DESTDIR)$(mandir)/man8/$$I; \ 1.16 + done 1.17 + $(MKDIR) $(DESTDIR)/$(mandir)/man1 1.18 + for I in ${MAN1}; \ 1.19 +- do ($(RMF) $$I.gz; gzip -c $$I >$$I.gz; \ 1.20 +- $(INSTALL_DATA) $$I.gz $(DESTDIR)$(mandir)/man1/$$I.gz; \ 1.21 +- rm -f $$I.gz); \ 1.22 ++ do \ 1.23 ++ $(INSTALL_DATA) $$I $(DESTDIR)$(mandir)/man1/$$I; \ 1.24 + done 1.25 + 1.26 + uninstall: 1.27 + for I in ${MAN8}; \ 1.28 +- do (rm -f $(DESTDIR)$(mandir)/man8/$$I.gz); \ 1.29 ++ do (rm -f $(DESTDIR)$(mandir)/man8/$$I); \ 1.30 + done 1.31 + for I in ${MAN1}; \ 1.32 +- do (rm -f $(DESTDIR)$(mandir)/man1/$$I.gz); \ 1.33 ++ do (rm -f $(DESTDIR)$(mandir)/man1/$$I); \ 1.34 + done 1.35 + 1.36 + clean: dummy 1.37 +Index: scripts/bacula.in 1.38 +--- scripts/bacula.in.orig 2008-07-06 15:06:15 +0200 1.39 ++++ scripts/bacula.in 2008-07-09 07:53:22 +0200 1.40 +@@ -15,30 +15,36 @@ 1.41 + # 1.42 + SCRIPTDIR=@scriptdir@ 1.43 + 1.44 ++action=$1 1.45 ++debug=$2 1.46 ++[ -n "$3" ] && enable_dir=$3 || enable_dir=yes 1.47 ++[ -n "$4" ] && enable_sd=$4 || enable_sd=yes 1.48 ++[ -n "$5" ] && enable_fd=$5 || enable_fd=yes 1.49 ++ 1.50 + case "$1" in 1.51 + start) 1.52 +- [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2 1.53 +- [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2 1.54 +- [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2 1.55 ++ [ "$enable_sd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2 1.56 ++ [ "$enable_fd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2 1.57 ++ [ "$enable_dir" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2 1.58 + ;; 1.59 + 1.60 + stop) 1.61 + # Stop the FD first so that SD will fail jobs and update catalog 1.62 +- [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2 1.63 +- [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2 1.64 +- [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2 1.65 ++ [ "$enable_fd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2 1.66 ++ [ "$enable_sd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2 1.67 ++ [ "$enable_dir" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2 1.68 + ;; 1.69 + 1.70 + restart) 1.71 +- $0 stop 1.72 ++ $0 stop $debug $enable_dir $enable_sd $enable_fd 1.73 + sleep 2 1.74 +- $0 start 1.75 ++ $0 start $debug $enable_dir $enable_sd $enable_fd 1.76 + ;; 1.77 + 1.78 + status) 1.79 +- [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd status 1.80 +- [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd status 1.81 +- [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir status 1.82 ++ [ "$enable_sd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd status 1.83 ++ [ "$enable_fd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd status 1.84 ++ [ "$enable_dir" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir status 1.85 + ;; 1.86 + 1.87 + *) 1.88 +Index: scripts/btraceback.in 1.89 +--- scripts/btraceback.in.orig 2008-06-01 10:49:00 +0200 1.90 ++++ scripts/btraceback.in 2008-07-09 07:45:59 +0200 1.91 +@@ -12,6 +12,9 @@ 1.92 + PNAME="${PNAME} on `hostname`" 1.93 + if test `uname -s` = SunOS ; then 1.94 + gcore -o @working_dir@/${PNAME} $2 1.95 ++fi 1.96 ++if test `uname -s` = SunOS && 1.97 ++ test -n `which dbx 2>/dev/null` ; then 1.98 + dbx $1 $2 <@scriptdir@/btraceback.dbx 2>&1 \ 1.99 + | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula DBX traceback of ${PNAME}" @dump_email@ 1.100 + else 1.101 +Index: src/dird/bacula-dir.conf.in 1.102 +--- src/dird/bacula-dir.conf.in.orig 2008-06-19 21:44:34 +0200 1.103 ++++ src/dird/bacula-dir.conf.in 2008-07-09 07:45:59 +0200 1.104 +@@ -29,7 +29,8 @@ 1.105 + Level = Incremental 1.106 + Client = @hostname@-fd 1.107 + FileSet = "Full Set" 1.108 +- Schedule = "WeeklyCycle" 1.109 ++ #Schedule = "WeeklyCycle" 1.110 ++ Schedule = "NEVER" 1.111 + Storage = File 1.112 + Messages = Standard 1.113 + Pool = Default 1.114 +@@ -109,7 +110,7 @@ 1.115 + # directory to give a reasonable FileSet to backup to 1.116 + # disk storage during initial testing. 1.117 + # 1.118 +- File = @BUILD_DIR@ 1.119 ++ File = @scriptdir@ 1.120 + } 1.121 + 1.122 + # 1.123 +@@ -124,6 +125,11 @@ 1.124 + } 1.125 + } 1.126 + 1.127 ++# This schedule can be used to disable automatic scheduling 1.128 ++Schedule { 1.129 ++ Name = NEVER 1.130 ++} 1.131 ++ 1.132 + # 1.133 + # When to do the backups, full backup on first sunday of the month, 1.134 + # differential (i.e. incremental since full) every other sunday,
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/bacula/bacula.spec Wed Jan 07 00:25:41 2009 +0100 2.3 @@ -0,0 +1,296 @@ 2.4 +## 2.5 +## bacula.spec -- OpenPKG RPM Package Specification 2.6 +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 2.7 +## 2.8 +## Permission to use, copy, modify, and distribute this software for 2.9 +## any purpose with or without fee is hereby granted, provided that 2.10 +## the above copyright notice and this permission notice appear in all 2.11 +## copies. 2.12 +## 2.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 2.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 2.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 2.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 2.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 2.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 2.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2.24 +## SUCH DAMAGE. 2.25 +## 2.26 + 2.27 +# package information 2.28 +Name: bacula 2.29 +Summary: Network Backup Tool 2.30 +URL: http://www.bacula.org/ 2.31 +Vendor: Kern Sibbald 2.32 +Packager: OpenPKG Foundation e.V. 2.33 +Distribution: OpenPKG Community 2.34 +Class: PLUS 2.35 +Group: System 2.36 +License: GPL 2.37 +Version: 2.4.3 2.38 +Release: 20081013 2.39 + 2.40 +# package options 2.41 +%option with_server yes 2.42 +%option with_ssl yes 2.43 +%option with_wrap no 2.44 +%option with_dvd no 2.45 +%option with_mtx no 2.46 +%option with_python no 2.47 +%option with_db_sqlite no 2.48 +%option with_db_pgsql no 2.49 +%option with_db_mysql no 2.50 + 2.51 +# package option sanity check 2.52 +%if "%{with_db_sqlite}" == "no" && "%{with_db_mysql}" == "no" && "%{with_db_pgsql}" == "no" 2.53 +%undefine with_db_sqlite 2.54 +%define with_db_sqlite yes 2.55 +%endif 2.56 + 2.57 +# list of sources 2.58 +Source0: http://switch.dl.sourceforge.net/bacula/bacula-%{version}.tar.gz 2.59 +Source1: rc.bacula 2.60 +Source2: bexec.sh 2.61 +Patch0: bacula.patch 2.62 + 2.63 +# build information 2.64 +Prefix: %{l_prefix} 2.65 +BuildRoot: %{l_buildroot} 2.66 +BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, gcc::with_cxx = yes 2.67 +PreReq: OpenPKG, openpkg >= 20060823 2.68 +BuildPreReq: readline, zlib 2.69 +PreReq: readline, zlib 2.70 +%if "%{with_ssl}" == "yes" 2.71 +BuildPreReq: openssl >= 0.9.8 2.72 +PreReq: openssl >= 0.9.8 2.73 +%endif 2.74 +%if "%{with_wrap}" == "yes" 2.75 +BuildPreReq: tcpwrappers 2.76 +PreReq: tcpwrappers 2.77 +%endif 2.78 +%if "%{with_db_sqlite}" == "yes" 2.79 +BuildPreReq: sqlite 2.80 +PreReq: sqlite 2.81 +%endif 2.82 +%if "%{with_db_mysql}" == "yes" 2.83 +BuildPreReq: mysql 2.84 +PreReq: mysql 2.85 +%endif 2.86 +%if "%{with_db_pgsql}" == "yes" 2.87 +BuildPreReq: postgresql 2.88 +PreReq: postgresql 2.89 +%endif 2.90 +%if "%{with_dvd}" == "yes" 2.91 +BuildPreReq: dvdrw-tools 2.92 +PreReq: dvdrw-tools 2.93 +%endif 2.94 +%if "%{with_mtx}" == "yes" 2.95 +BuildPreReq: mtx 2.96 +PreReq: mtx 2.97 +%endif 2.98 +%if "%{with_python}" == "yes" || "%{with_dvd}" == "yes" 2.99 +BuildPreReq: python 2.100 +PreReq: python 2.101 +%endif 2.102 +AutoReq: no 2.103 +AutoReqProv: no 2.104 + 2.105 +%description 2.106 + Bacula is a set of computer programs that permit you (or the system 2.107 + administrator) to manage backup, recovery, and verification of 2.108 + computer data across a network of computers of different kinds. In 2.109 + technical terms, it is a network client/server based backup program. 2.110 + Bacula is relatively easy to use and efficient, while offering many 2.111 + advanced storage management features that make it easy to find and 2.112 + recover lost or damaged files. 2.113 + 2.114 +%track 2.115 + prog bacula = { 2.116 + version = %{version} 2.117 + url = http://prdownloads.sourceforge.net/bacula/ 2.118 + regex = bacula-(\d+\.\d*[02468]\.\d+)\.tar\.gz 2.119 + } 2.120 + 2.121 +%prep 2.122 + %setup -q 2.123 + %patch -p0 2.124 + rm -f src/lib/tcpd.h 2.125 + 2.126 +%build 2.127 + # generate a random director password 2.128 + password="`openssl rand -base64 33`" 2.129 + 2.130 + # for the same reason remove version informations from config files 2.131 + %{l_shtool} subst \ 2.132 + -e "s;For Bacula release @VERSION@ .*;;" \ 2.133 + `find . -name "*.conf.in"` 2.134 + 2.135 + # use localhost as default host 2.136 + %{l_shtool} subst \ 2.137 + -e 's;hostname=.*;hostname=localhost;g' \ 2.138 + configure 2.139 + 2.140 + # configure 2.141 + LIBS= 2.142 + case "%{l_platform -t}" in 2.143 + *-linux*) LIBS="-L/usr/lib/termcap";; 2.144 + esac 2.145 + CC="%{l_cc}" \ 2.146 + CFLAGS="%{l_cflags -O}" \ 2.147 + CPPFLAGS="%{l_cppflags}" \ 2.148 + LDFLAGS="%{l_ldflags} $LIBS" \ 2.149 + ./configure \ 2.150 + --prefix=%{l_prefix} \ 2.151 + --with-dir-user=%{l_rusr} \ 2.152 + --with-dir-group=%{l_rgrp} \ 2.153 + --with-sd-user=%{l_rusr} \ 2.154 + --with-sd-group=%{l_rgrp} \ 2.155 + --with-fd-user=%{l_susr} \ 2.156 + --with-fd-group=%{l_sgrp} \ 2.157 + --with-dir-password="$password" \ 2.158 + --with-fd-password="$password" \ 2.159 + --with-sd-password="$password" \ 2.160 + --with-mon-dir-password="$password" \ 2.161 + --with-mon-fd-password="$password" \ 2.162 + --with-mon-sd-password="$password" \ 2.163 + --disable-conio \ 2.164 + --enable-readline \ 2.165 + --with-readline=%{l_prefix} \ 2.166 +%if "%{with_server}" != "yes" 2.167 + --enable-client-only \ 2.168 +%endif 2.169 +%if "%{with_ssl}" == "yes" 2.170 + --with-openssl=%{l_prefix} \ 2.171 +%endif 2.172 +%if "%{with_wrap}" == "yes" 2.173 + --with-tcp-wrappers=yes \ 2.174 +%endif 2.175 +%if "%{with_db_sqlite}" == "yes" 2.176 + --with-sqlite3=%{l_prefix} \ 2.177 +%endif 2.178 +%if "%{with_db_mysql}" == "yes" 2.179 + --with-mysql=%{l_prefix} \ 2.180 +%endif 2.181 +%if "%{with_db_pgsql}" == "yes" 2.182 + --with-postgresql=%{l_prefix} \ 2.183 +%endif 2.184 +%if "%{with_python}" == "yes" || "%{with_dvd}" == "yes" 2.185 + --with-python=%{l_prefix} \ 2.186 +%endif 2.187 + --enable-wx-console=no \ 2.188 + --sysconfdir=%{l_prefix}/etc/bacula \ 2.189 + --mandir=%{l_prefix}/man \ 2.190 + --with-scriptdir=%{l_prefix}/libexec/bacula \ 2.191 + --with-working-dir=%{l_prefix}/var/bacula \ 2.192 + --with-pid-dir=%{l_prefix}/var/bacula/run \ 2.193 + --with-subsys-dir=%{l_prefix}/var/bacula/run/subsys \ 2.194 + --disable-nls 2.195 + 2.196 + # build 2.197 + %{l_make} %{l_mflags -O} 2.198 + 2.199 +%install 2.200 + rm -rf $RPM_BUILD_ROOT 2.201 + 2.202 + # create installation hierarchy 2.203 + %{l_shtool} mkdir -f -p -m 755 \ 2.204 + $RPM_BUILD_ROOT%{l_prefix}/bin \ 2.205 + $RPM_BUILD_ROOT%{l_prefix}/sbin \ 2.206 + $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula \ 2.207 + $RPM_BUILD_ROOT%{l_prefix}/etc/bacula \ 2.208 + $RPM_BUILD_ROOT%{l_prefix}/etc/bacula/clients \ 2.209 + $RPM_BUILD_ROOT%{l_prefix}/etc/bacula/scripts \ 2.210 + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ 2.211 + $RPM_BUILD_ROOT%{l_prefix}/var/bacula \ 2.212 + $RPM_BUILD_ROOT%{l_prefix}/var/bacula/run \ 2.213 + $RPM_BUILD_ROOT%{l_prefix}/var/bacula/run/subsys \ 2.214 + $RPM_BUILD_ROOT%{l_prefix}/man/man1 \ 2.215 + $RPM_BUILD_ROOT%{l_prefix}/man/man8 \ 2.216 + $RPM_BUILD_ROOT%{l_prefix}/share/bacula/examples \ 2.217 + $RPM_BUILD_ROOT%{l_prefix}/share/bacula/examples/default-config 2.218 + 2.219 + # install 2.220 + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT 2.221 + 2.222 + # strip down installation 2.223 + # do not strip binaries, to make it easier to diagnose problems 2.224 + # strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true 2.225 + ( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula && 2.226 + for unwanted in bconsole startmysql stopmysql; do 2.227 + rm -f $unwanted 2.228 + done 2.229 + ) || exit $? 2.230 + 2.231 + # install additional files 2.232 + %{l_shtool} install -c -m 754 %{l_value -s -a} \ 2.233 + %{SOURCE bexec.sh} $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec 2.234 + 2.235 + # wrap binaries to avoid to specify "-c" for each run 2.236 + ( cd $RPM_BUILD_ROOT%{l_prefix}/sbin 2.237 + for bin in bacula-dir bacula-fd bacula-sd \ 2.238 + bconsole bcopy bextract bls bscan dbcheck \ 2.239 + tray-monitor wx-console; do 2.240 + if [ -x $bin ]; then 2.241 + mv $bin $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula 2.242 + ln $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec ./$bin 2.243 + fi 2.244 + done 2.245 + ) || exit $? 2.246 + 2.247 + # install run-command script 2.248 + %{l_shtool} install -c -m 755 %{l_value -s -a} \ 2.249 + -e 's,@with_server@,%{with_server},g' \ 2.250 + %{SOURCE rc.bacula} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 2.251 + 2.252 + # determine installation files 2.253 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 2.254 + %{l_files_std} \ 2.255 + '%attr(640,%{l_musr},%{l_mgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bconsole.conf' \ 2.256 + '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula' \ 2.257 + '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula/run' \ 2.258 + '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula/run/subsys' \ 2.259 + '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/dvd-handler' \ 2.260 + '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/mtx-changer' \ 2.261 +%if "%{with_server}" == "yes" 2.262 + '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/make_catalog_backup' \ 2.263 + '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/delete_catalog_backup'\ 2.264 + '%config(noreplace) %{l_prefix}/etc/bacula/bacula-dir.conf' \ 2.265 + '%config(noreplace) %{l_prefix}/etc/bacula/bacula-sd.conf' \ 2.266 +%endif 2.267 + '%config(noreplace) %{l_prefix}/etc/bacula/bacula-fd.conf' \ 2.268 +%if "%{with_server}" == "yes" 2.269 + '%attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/bacula-dir.conf' \ 2.270 + '%attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/bacula-sd.conf' \ 2.271 +%endif 2.272 + '%attr(640,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/bacula/bacula-fd.conf' 2.273 + 2.274 +%files -f files 2.275 + 2.276 +%clean 2.277 + rm -rf $RPM_BUILD_ROOT 2.278 + 2.279 +%post 2.280 + # create initial database 2.281 + if [ ! -f $RPM_INSTALL_PREFIX/var/bacula/bacula.db ]; then 2.282 + $RPM_INSTALL_PREFIX/libexec/bacula/make_bacula_tables 2.283 + chmod 600 $RPM_INSTALL_PREFIX/var/bacula/bacula.db 2.284 + chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/bacula/bacula.db 2.285 + fi 2.286 + 2.287 + # after upgrade, restart service 2.288 + [ $1 -eq 2 ] || exit 0 2.289 + eval `%{l_rc} bacula status 2>/dev/null` 2.290 + [ ".$bacula_active" = .yes ] && %{l_rc} bacula restart 2.291 + exit 0 2.292 + 2.293 +%preun 2.294 + # before erase, stop service and remove working files 2.295 + [ $1 -eq 0 ] || exit 0 2.296 + %{l_rc} bacula stop 2>/dev/null 2.297 + rm -rf $RPM_INSTALL_PREFIX/var/bacula/* 2.298 + exit 0 2.299 +
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/bacula/bexec.sh Wed Jan 07 00:25:41 2009 +0100 3.3 @@ -0,0 +1,21 @@ 3.4 +#!/bin/sh 3.5 +myName=`basename $0` 3.6 +cfgPath="@l_prefix@/etc/bacula" 3.7 +case "$myName" in 3.8 + bacula-dir ) cfg="bacula-dir.conf" ;; 3.9 + bacula-fd ) cfg="bacula-fd.conf" ;; 3.10 + bacula-sd ) cfg="bacula-sd.conf" ;; 3.11 + bconsole ) cfg="bconsole.conf" ;; 3.12 + bcopy ) cfg="bacula-sd.conf" ;; 3.13 + bextract ) cfg="bacula-sd.conf" ;; 3.14 + bls ) cfg="bacula-sd.conf" ;; 3.15 + bscan ) cfg="bacula-sd.conf" ;; 3.16 + dbcheck ) cfg="bacula-dir.conf" ;; 3.17 + tray-monitor ) cfg="tray-monitor.conf" ;; 3.18 + wx-console ) cfg="wx-console.conf" ;; 3.19 + * ) echo "bexec: illegal link to '$0'" 1>&2; exit 1 ;; 3.20 +esac 3.21 +cfg="$cfgPath/$cfg" 3.22 +# The user is still able to specify own config files, because 3.23 +# the commands accept multiple '-c' options. The last '-c' wins. 3.24 +exec @l_prefix@/libexec/bacula/$myName -c $cfg "$@"
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/bacula/rc.bacula Wed Jan 07 00:25:41 2009 +0100 4.3 @@ -0,0 +1,54 @@ 4.4 +#!@l_prefix@/bin/openpkg rc 4.5 +## 4.6 +## rc.bacula -- Run-Commands 4.7 +## 4.8 + 4.9 +%config 4.10 + bacula_enable="$openpkg_rc_def" 4.11 + bacula_dir_enable="@with_server@" 4.12 + bacula_sd_enable="@with_server@" 4.13 + bacula_fd_enable="yes" 4.14 + bacula_debug="" 4.15 + bacula_log_files="@l_prefix@/var/bacula/log" 4.16 + bacula_log_prolog="true" 4.17 + bacula_log_epilog="true" 4.18 + bacula_log_numfiles="10" 4.19 + bacula_log_minsize="1M" 4.20 + bacula_log_complevel="9" 4.21 + 4.22 +%status -u @l_susr@ -o 4.23 + bacula_usable="no" 4.24 + bacula_active="no" 4.25 + [ ".`@l_prefix@/libexec/bacula/bacula status 2>/dev/null | grep running`" != . ] && bacula_active="yes" 4.26 + echo "bacula_enable=\"$bacula_enable\"" 4.27 + echo "bacula_usable=\"$bacula_usable\"" 4.28 + echo "bacula_active=\"$bacula_active\"" 4.29 + 4.30 +%start -u @l_susr@ 4.31 + rcService bacula enable yes || exit 0 4.32 + rcService bacula active yes && exit 0 4.33 + @l_prefix@/libexec/bacula/bacula start \ 4.34 + "$bacula_debug" $bacula_dir_enable $bacula_sd_enable $bacula_fd_enable 4.35 + 4.36 +%stop -u @l_susr@ 4.37 + rcService bacula enable yes || exit 0 4.38 + rcService bacula active no && exit 0 4.39 + @l_prefix@/libexec/bacula/bacula stop 4.40 + 4.41 +%restart -u @l_susr@ 4.42 + rcService bacula enable yes || exit 0 4.43 + rc bacula stop 4.44 + sleep 5 4.45 + rc bacula start 4.46 + 4.47 +%daily -u @l_susr@ 4.48 + rcService bacula enable yes || exit 0 4.49 + if [ ".$bacula_log_files" != . ]; then 4.50 + shtool rotate -f \ 4.51 + -n ${bacula_log_numfiles} -s ${bacula_log_minsize} -d \ 4.52 + -z ${bacula_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 640 \ 4.53 + -P "${bacula_log_prolog}" \ 4.54 + -E "${bacula_log_epilog}" \ 4.55 + $bacula_log_files 4.56 + fi 4.57 +