OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Matthias Kurz
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   20-Jul-2005 13:36:10
  Branch: HEAD                             Handle: 2005072012360901

  Added files:
    openpkg-src/bacula      bacula.patch bacula.spec bconsole.sh rc.bacula

  Log:
    new package: bacula 1.37.30 (Network backup tool)

  Summary:
    Revision    Changes     Path
    1.1         +267 -0     openpkg-src/bacula/bacula.patch
    1.1         +224 -0     openpkg-src/bacula/bacula.spec
    1.1         +13 -0      openpkg-src/bacula/bconsole.sh
    1.1         +49 -0      openpkg-src/bacula/rc.bacula
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/bacula/bacula.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1 bacula.patch
  --- /dev/null 2005-07-20 13:36:00 +0200
  +++ bacula.patch      2005-07-20 13:36:10 +0200
  @@ -0,0 +1,267 @@
  +Index: configure
  +--- configure.orig   2005-06-18 15:34:19.000000000 +0200
  ++++ configure        2005-07-20 09:26:54.328806000 +0200
  +@@ -5932,6 +5932,7 @@
  + 
  + got_readline="no"
  + READLINE_SRC=
  ++#set -x
  + if test x$support_readline = xyes; then
  + 
  + # Check whether --with-readline or --without-readline was given.
  +@@ -5942,15 +5943,15 @@
  +     no) : ;;
  +     yes|*)
  +       if test "$with_readline" != "yes"; then
  +-        CONS_INC="-I${with_readline}"
  +-        CONS_LDFLAGS="-L$with_readline"
  ++        CONS_INC="-I${with_readline}/include/readline"
  ++        CONS_LDFLAGS="-L$with_readline/lib"
  +       else
  +          with_readline="/usr/include/readline"
  +       fi
  +-      as_ac_Header=`echo "ac_cv_header_${with_readline}/readline.h" | 
$as_tr_sh`
  ++      as_ac_Header=`echo 
"ac_cv_header_${with_readline}/include/readline/readline.h" | $as_tr_sh`
  + if eval "test \"\${$as_ac_Header+set}\" = set"; then
  +-  echo "$as_me:$LINENO: checking for ${with_readline}/readline.h" >&5
  +-echo $ECHO_N "checking for ${with_readline}/readline.h... $ECHO_C" >&6
  ++  echo "$as_me:$LINENO: checking for 
${with_readline}/include/readline/readline.h" >&5
  ++echo $ECHO_N "checking for ${with_readline}/include/readline/readline.h... 
$ECHO_C" >&6
  + if eval "test \"\${$as_ac_Header+set}\" = set"; then
  +   echo $ECHO_N "(cached) $ECHO_C" >&6
  + fi
  +@@ -5958,8 +5959,8 @@
  + echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
  + else
  +   # Is the header compilable?
  +-echo "$as_me:$LINENO: checking ${with_readline}/readline.h usability" >&5
  +-echo $ECHO_N "checking ${with_readline}/readline.h usability... $ECHO_C" >&6
  ++echo "$as_me:$LINENO: checking ${with_readline}/include/readline/readline.h 
usability" >&5
  ++echo $ECHO_N "checking ${with_readline}/include/readline/readline.h 
usability... $ECHO_C" >&6
  + cat >conftest.$ac_ext <<_ACEOF
  + /* confdefs.h.  */
  + _ACEOF
  +@@ -5967,7 +5968,7 @@
  + cat >>conftest.$ac_ext <<_ACEOF
  + /* end confdefs.h.  */
  + $ac_includes_default
  +-#include <${with_readline}/readline.h>
  ++#include <${with_readline}/include/readline/readline.h>
  + _ACEOF
  + rm -f conftest.$ac_objext
  + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  +@@ -6003,15 +6004,15 @@
  + echo "${ECHO_T}$ac_header_compiler" >&6
  + 
  + # Is the header present?
  +-echo "$as_me:$LINENO: checking ${with_readline}/readline.h presence" >&5
  +-echo $ECHO_N "checking ${with_readline}/readline.h presence... $ECHO_C" >&6
  ++echo "$as_me:$LINENO: checking ${with_readline}/include/readline/readline.h 
presence" >&5
  ++echo $ECHO_N "checking ${with_readline}/include/readline/readline.h 
presence... $ECHO_C" >&6
  + cat >conftest.$ac_ext <<_ACEOF
  + /* confdefs.h.  */
  + _ACEOF
  + cat confdefs.h >>conftest.$ac_ext
  + cat >>conftest.$ac_ext <<_ACEOF
  + /* end confdefs.h.  */
  +-#include <${with_readline}/readline.h>
  ++#include <${with_readline}/include/readline/readline.h>
  + _ACEOF
  + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  +   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  +@@ -6045,25 +6046,25 @@
  + # So?  What about this header?
  + case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  +   yes:no: )
  +-    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: accepted 
by the compiler, rejected by the preprocessor!" >&5
  +-echo "$as_me: WARNING: ${with_readline}/readline.h: accepted by the 
compiler, rejected by the preprocessor!" >&2;}
  +-    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: 
proceeding with the compiler's result" >&5
  +-echo "$as_me: WARNING: ${with_readline}/readline.h: proceeding with the 
compiler's result" >&2;}
  ++    { echo "$as_me:$LINENO: WARNING: 
${with_readline}/include/readline/readline.h: accepted by the compiler, 
rejected by the preprocessor!" >&5
  ++echo "$as_me: WARNING: ${with_readline}/include/readline/readline.h: 
accepted by the compiler, rejected by the preprocessor!" >&2;}
  ++    { echo "$as_me:$LINENO: WARNING: 
${with_readline}/include/readline/readline.h: proceeding with the compiler's 
result" >&5
  ++echo "$as_me: WARNING: ${with_readline}/include/readline/readline.h: 
proceeding with the compiler's result" >&2;}
  +     ac_header_preproc=yes
  +     ;;
  +   no:yes:* )
  +-    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: present 
but cannot be compiled" >&5
  +-echo "$as_me: WARNING: ${with_readline}/readline.h: present but cannot be 
compiled" >&2;}
  +-    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h:     check 
for missing prerequisite headers?" >&5
  +-echo "$as_me: WARNING: ${with_readline}/readline.h:     check for missing 
prerequisite headers?" >&2;}
  +-    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: see the 
Autoconf documentation" >&5
  +-echo "$as_me: WARNING: ${with_readline}/readline.h: see the Autoconf 
documentation" >&2;}
  +-    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h:     
section \"Present But Cannot Be Compiled\"" >&5
  +-echo "$as_me: WARNING: ${with_readline}/readline.h:     section \"Present 
But Cannot Be Compiled\"" >&2;}
  +-    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: 
proceeding with the preprocessor's result" >&5
  +-echo "$as_me: WARNING: ${with_readline}/readline.h: proceeding with the 
preprocessor's result" >&2;}
  +-    { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: in the 
future, the compiler will take precedence" >&5
  +-echo "$as_me: WARNING: ${with_readline}/readline.h: in the future, the 
compiler will take precedence" >&2;}
  ++    { echo "$as_me:$LINENO: WARNING: 
${with_readline}/include/readline/readline.h: present but cannot be compiled" 
>&5
  ++echo "$as_me: WARNING: ${with_readline}/include/readline/readline.h: 
present but cannot be compiled" >&2;}
  ++    { echo "$as_me:$LINENO: WARNING: 
${with_readline}/include/readline/readline.h:     check for missing 
prerequisite headers?" >&5
  ++echo "$as_me: WARNING: ${with_readline}/include/readline/readline.h:     
check for missing prerequisite headers?" >&2;}
  ++    { echo "$as_me:$LINENO: WARNING: 
${with_readline}/include/readline/readline.h: see the Autoconf documentation" 
>&5
  ++echo "$as_me: WARNING: ${with_readline}/include/readline/readline.h: see 
the Autoconf documentation" >&2;}
  ++    { echo "$as_me:$LINENO: WARNING: 
${with_readline}/include/readline/readline.h:     section \"Present But Cannot 
Be Compiled\"" >&5
  ++echo "$as_me: WARNING: ${with_readline}/include/readline/readline.h:     
section \"Present But Cannot Be Compiled\"" >&2;}
  ++    { echo "$as_me:$LINENO: WARNING: 
${with_readline}/include/readline/readline.h: proceeding with the 
preprocessor's result" >&5
  ++echo "$as_me: WARNING: ${with_readline}/include/readline/readline.h: 
proceeding with the preprocessor's result" >&2;}
  ++    { echo "$as_me:$LINENO: WARNING: 
${with_readline}/include/readline/readline.h: in the future, the compiler will 
take precedence" >&5
  ++echo "$as_me: WARNING: ${with_readline}/include/readline/readline.h: in the 
future, the compiler will take precedence" >&2;}
  +     (
  +       cat <<\_ASBOX
  + ## ------------------------------------------ ##
  +@@ -6074,8 +6075,8 @@
  +       sed "s/^/$as_me: WARNING:     /" >&2
  +     ;;
  + esac
  +-echo "$as_me:$LINENO: checking for ${with_readline}/readline.h" >&5
  +-echo $ECHO_N "checking for ${with_readline}/readline.h... $ECHO_C" >&6
  ++echo "$as_me:$LINENO: checking for 
${with_readline}/include/readline/readline.h" >&5
  ++echo $ECHO_N "checking for ${with_readline}/include/readline/readline.h... 
$ECHO_C" >&6
  + if eval "test \"\${$as_ac_Header+set}\" = set"; then
  +   echo $ECHO_N "(cached) $ECHO_C" >&6
  + else
  +@@ -6090,7 +6091,7 @@
  + #define HAVE_READLINE 1
  + _ACEOF
  + 
  +-           CONS_LIBS="-lreadline -ltermcap"
  ++           CONS_LIBS="-lreadline -lhistory -ltermcap"
  +            got_readline="yes"
  + 
  + else
  +@@ -22032,7 +22033,7 @@
  + s,@WCFLAGS@,$WCFLAGS,;t t
  + s,@WLDFLAGS@,$WLDFLAGS,;t t
  + s,@OBJLIST@,$OBJLIST,;t t
  +-s,@hostname@,$hostname,;t t
  ++s,@hostname@,localhost,;t t
  + s,@TAPEDRIVE@,$TAPEDRIVE,;t t
  + s,@PSCMD@,$PSCMD,;t t
  + s,@WIN32@,$WIN32,;t t
  +Index: scripts/bacula.in
  +--- scripts/bacula.in.orig   2005-07-04 21:57:31.000000000 +0200
  ++++ scripts/bacula.in        2005-07-20 09:26:30.410660000 +0200
  +@@ -203,9 +203,15 @@
  +    export LD_ASSUME_KERNEL=2.4.19
  + fi
  + 
  +-case "$1" in
  ++action=$1
  ++debug=$2
  ++[ -n "$3" ] && enable_dir=$3 || enable_dir=yes
  ++[ -n "$4" ] && enable_sd=$4  || enable_sd=yes
  ++[ -n "$5" ] && enable_fd=$5  || enable_fd=yes
  ++
  ++case "$action" in
  +    start)
  +-      [ -x ${BACSDBIN}/bacula-sd ] && {
  ++      [ "$enable_sd" = "yes" ] && [ -x ${BACSDBIN}/bacula-sd ] && {
  +      echo "Starting the Bacula Storage daemon"
  +      OPTIONS=''
  +      if [ "${SD_USER}" != '' ]; then
  +@@ -216,10 +222,10 @@
  +         OPTIONS="${OPTIONS} -g ${SD_GROUP}"
  +      fi
  + 
  +-     ${BACSDBIN}/bacula-sd $2 ${OPTIONS} -v -c ${BACSDCFG}/bacula-sd.conf
  ++     ${BACSDBIN}/bacula-sd $debug ${OPTIONS} -v -c 
${BACSDCFG}/bacula-sd.conf
  +       }
  + 
  +-      [ -x ${BACFDBIN}/bacula-fd ] && {
  ++      [ "$enable_fd" = "yes" ] && [ -x ${BACFDBIN}/bacula-fd ] && {
  +      echo "Starting the Bacula File daemon"
  +      OPTIONS=''
  +      if [ "${FD_USER}" != '' ]; then
  +@@ -230,10 +236,10 @@
  +         OPTIONS="${OPTIONS} -g ${FD_GROUP}"
  +      fi
  + 
  +-     ${BACFDBIN}/bacula-fd $2 ${OPTIONS} -v -c ${BACFDCFG}/bacula-fd.conf
  ++     ${BACFDBIN}/bacula-fd $debug ${OPTIONS} -v -c 
${BACFDCFG}/bacula-fd.conf
  +       }
  + 
  +-      [ -x ${BACDIRBIN}/bacula-dir ] && { 
  ++      [ "$enable_dir" = "yes" ] && [ -x ${BACDIRBIN}/bacula-dir ] && { 
  +       sleep 2
  +       echo "Starting the Bacula Director daemon"
  +      OPTIONS=''
  +@@ -245,23 +251,23 @@
  +         OPTIONS="${OPTIONS} -g ${DIR_GROUP}"
  +      fi
  + 
  +-     ${BACDIRBIN}/bacula-dir $2 ${OPTIONS} -v -c 
${BACDIRCFG}/bacula-dir.conf
  ++     ${BACDIRBIN}/bacula-dir $debug ${OPTIONS} -v -c 
${BACDIRCFG}/bacula-dir.conf
  +       }
  +       ;;
  + 
  +    stop)
  +       # Stop the FD first so that SD will fail jobs and update catalog
  +-      [ -x ${BACFDBIN}/bacula-fd ] && {
  ++      [ "$enable_fd" = "yes" ] && [ -x ${BACFDBIN}/bacula-fd ] && {
  +      echo "Stopping the Bacula File daemon"
  +      killproc ${BACFDBIN}/bacula-fd ${FD_PORT}
  +       }
  + 
  +-      [ -x ${BACSDBIN}/bacula-sd ] && {
  ++      [ "$enable_sd" = "yes" ] && [ -x ${BACSDBIN}/bacula-sd ] && {
  +      echo "Stopping the Bacula Storage daemon"
  +      killproc ${BACSDBIN}/bacula-sd ${SD_PORT}
  +       }
  + 
  +-      [ -x ${BACDIRBIN}/bacula-dir ] && {
  ++      [ "$enable_dir" = "yes" ] && [ -x ${BACDIRBIN}/bacula-dir ] && {
  +      echo "Stopping the Bacula Director daemon"
  +      killproc ${BACDIRBIN}/bacula-dir ${DIR_PORT}
  +       }
  +@@ -269,15 +275,15 @@
  +       ;;
  + 
  +    restart)
  +-      $0 stop
  ++      $0 stop $debug $enable_dir $enable_sd $enable_fd
  +       sleep 5
  +-      $0 start
  ++      $0 start $debug $enable_dir $enable_sd $enable_fd
  +       ;;
  + 
  +    status)
  +-      [ -x ${BACSDBIN}/bacula-sd   ] && status ${BACSDBIN}/bacula-sd  
${SD_PORT}
  +-      [ -x ${BACFDBIN}/bacula-fd   ] && status ${BACFDBIN}/bacula-fd  
${FD_PORT}
  +-      [ -x ${BACDIRBIN}/bacula-dir ] && status ${BACDIRBIN}/bacula-dir 
${DIR_PORT}
  ++      [ "$enable_sd" = "yes" ] && [ -x ${BACSDBIN}/bacula-sd   ] && status 
${BACSDBIN}/bacula-sd  ${SD_PORT}
  ++      [ "$enable_fd" = "yes" ] && [ -x ${BACFDBIN}/bacula-fd   ] && status 
${BACFDBIN}/bacula-fd  ${FD_PORT}
  ++      [ "$enable_dir" = "yes" ] && [ -x ${BACDIRBIN}/bacula-dir ] && status 
${BACDIRBIN}/bacula-dir ${DIR_PORT}
  +       ;;
  + 
  +    *)
  +Index: src/bacula.h
  +--- src/bacula.h.orig        2005-04-22 10:09:08.000000000 +0200
  ++++ src/bacula.h     2005-07-20 09:26:30.424894000 +0200
  +@@ -113,10 +113,13 @@
  + #include <pthread.h>
  + 
  + #ifdef HAVE_OPENSSL
  ++/* fight OpenSSL namespace pollution */
  ++#define STORE OSSL_STORE
  + #include <openssl/ssl.h>
  + #include <openssl/x509v3.h>
  + #include <openssl/rand.h>
  + #include <openssl/err.h>
  ++#undef STORE
  + #endif
  + 
  + /* Local Bacula includes. Be sure to put all the system
  +Index: src/lib/tls.c
  +--- src/lib/tls.c.orig       2005-06-04 21:20:35.000000000 +0200
  ++++ src/lib/tls.c    2005-07-20 09:26:30.426826000 +0200
  +@@ -331,7 +331,7 @@
  +             X509V3_EXT_METHOD *method;
  +             STACK_OF(CONF_VALUE) *val;
  +             CONF_VALUE *nval;
  +-            unsigned char *data;
  ++            const unsigned char *data;
  +             void *extstr = NULL;
  + 
  +             /* Get x509 extension method structure */
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/bacula/bacula.spec
  ============================================================================
  $ cvs diff -u -r0 -r1.1 bacula.spec
  --- /dev/null 2005-07-20 13:36:00 +0200
  +++ bacula.spec       2005-07-20 13:36:10 +0200
  @@ -0,0 +1,224 @@
  +##
  +##  bacula.spec -- OpenPKG RPM Package Specification
  +##  Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  +##  Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.com/>
  +##
  +##  Permission to use, copy, modify, and distribute this software for
  +##  any purpose with or without fee is hereby granted, provided that
  +##  the above copyright notice and this permission notice appear in all
  +##  copies.
  +##
  +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  +##  SUCH DAMAGE.
  +##
  +
  +#   package component versions
  +%define       V_bacula     1.37.30
  +%define       V_doc        20050717
  +
  +#   package information
  +Name:         bacula
  +Summary:      Network backup tool
  +URL:          http://www.bacula.org/
  +Vendor:       Kern Sibbald
  +Packager:     OpenPKG
  +Distribution: OpenPKG
  +Class:        EVAL
  +Group:        System
  +License:      GPL
  +Version:      %{V_bacula}
  +Release:      20050720
  +
  +#   package options
  +%option       with_server   yes
  +%option       with_user     %{l_musr}
  +%option       with_group    %{l_mgrp}
  +%option       with_tls      yes
  +%option       with_db       sqlite
  +%option       with_dvd      no
  +%option       with_mtx      no
  +%option       with_x11      no
  +
  +#   list of sources
  +Source0:      
http://prdownloads.sourceforge.net/bacula/bacula-%{version}.tar.gz
  +Source1:      
ftp://ftp.openpkg.org/sources/CPY/VERSIONED/bacula-doc-%{V_doc}.tar.gz
  +Source2:      rc.bacula
  +Source3:      bconsole.sh
  +Patch0:       bacula.patch
  +
  +#   build information
  +Prefix:       %{l_prefix}
  +BuildRoot:    %{l_buildroot}
  +BuildPreReq:  OpenPKG, openpkg >= 20040712, gcc, readline, odoc
  +PreReq:       OpenPKG, openpkg >= 20040712, readline
  +%if "%{with_tls}" == "yes"
  +PreReq:       openssl >= 0.9.8
  +%endif
  +%if "%{with_db}" == "sqlite"
  +PreReq:       sqlite
  +%endif
  +%if "%{with_db}" == "mysql"
  +PreReq:       mysql
  +%endif
  +%if "%{with_db}" == "postgres"
  +PreReq:       postgresql
  +%endif
  +%if "%{with_dvd}" == "yes"
  +PreReq:       dvdrw-tools
  +%endif
  +%if "%{with_mtx}" == "yes"
  +PreReq:       mtx
  +%endif
  +AutoReq:      no
  +AutoReqProv:  no
  +
  +%description
  +    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.
  +
  +%track
  +    prog bacula = {
  +        version   = %{version}
  +        url       = http://prdownloads.sourceforge.net/bacula/
  +        regex     = bacula-(__VER__)\.tar\.gz
  +    }
  +
  +%prep
  +    %setup -q
  +    %setup -q -D -T -b 1
  +    %patch -p0
  +
  +%build
  +    #   configure
  +    ./configure --help
  +    case "%{with_db}" in
  +           sqlite ) cfg_db="--with-sqlite=%{l_prefix}";;
  +            mysql ) cfg_db="--with-mysql=%{l_prefix}";;
  +         postgres ) cfg_db="--with-postgresql=%{l_prefix}";;
  +                * ) echo "with_db must be in (sqlite|mysql|postgres)" 1>&2
  +                    exit 1;;
  +    esac
  +    CC="%{l_cc}" \
  +    CFLAGS="%{l_cflags -O}" \
  +    CPPFLAGS="%{l_cppflags}" \
  +    LDFLAGS="%{l_ldflags}" \
  +    ./configure \
  +        --prefix=%{l_prefix} \
  +        --with-dir-user=%{with_user}\
  +        --with-dir-group=%{with_group}\
  +        --with-sd-user=%{with_user} \
  +        --with-sd-group=%{with_group} \
  +        --with-fd-user=%{l_susr} \
  +        --with-fd-group=%{l_sgrp} \
  +        --disable-conio \
  +        --enable-readline \
  +        --with-readline=%{l_prefix} \
  +%if "%{with_server}" == "no"
  +        --enable-client-only
  +%endif
  +%if "%{with_tls}" == "yes"
  +        --with-openssl=%{l_prefix} \
  +%endif
  +        $cfg_db \
  +%if "%{with_x11}" == "yes"
  +        --with-x \
  +%endif
  +        --sysconfdir=%{l_prefix}/etc/bacula \
  +        --mandir=%{l_prefix}/man \
  +        --with-scriptdir=%{l_prefix}/libexec/bacula \
  +        --with-working-dir=%{l_prefix}/var/bacula \
  +        --with-pid-dir=%{l_prefix}/var/bacula/run \
  +        --with-subsys-dir=%{l_prefix}/var/bacula/run/subsys
  +    #   build
  +    %{l_make} %{l_mflags -O}
  +
  +%install
  +    rm -rf $RPM_BUILD_ROOT
  +
  +    %{l_shtool} mkdir -f -p -m 755 \
  +        $RPM_BUILD_ROOT%{l_prefix}/bin \
  +        $RPM_BUILD_ROOT%{l_prefix}/sbin \
  +        $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/bacula \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/bacula \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/bacula/run \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/bacula/run/subsys \
  +        $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  +        $RPM_BUILD_ROOT%{l_prefix}/share/bacula/docs \
  +        $RPM_BUILD_ROOT%{l_prefix}/share/bacula/examples \
  +        $RPM_BUILD_ROOT%{l_prefix}/share/bacula/examples/default-config \
  +        $RPM_BUILD_ROOT%{l_docdir}/bacula
  +
  +    %{l_make} %{l_mflags} DESTDIR=$RPM_BUILD_ROOT install
  +    strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true
  +    ( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula &&
  +      for unwanted in bconsole startmysql stopmysql; do
  +          rm -f $unwanted;
  +      done
  +    ) || exit $?
  +    rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/bacula.8.gz
  +
  +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
  +        %{SOURCE bconsole.sh} $RPM_BUILD_ROOT%{l_prefix}/bin/bconsole
  +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
  +        -e 's,@busr@,%{with_user},g' \
  +        -e 's,@bgrp@,%{with_group},g' \
  +        -e 's,@with_server@,%{with_server},g' \
  +        %{SOURCE rc.bacula} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  +
  +    #   documentation/examples
  +    %{l_shtool} install -c -m 644 \
  +        -e 's,/usr/share/doc/bacula-<version>,%{l_prefix}/doc/bacula,' \
  +        scripts/bacula.man $RPM_BUILD_ROOT%{l_prefix}/man/man8/bacula.8
  +    if   %{l_odoc} -F
  +    then echo "WARNING: will not package auxiliary documentation" 1>&2
  +    else mv ../bacula-doc-%{V_doc}/* $RPM_BUILD_ROOT%{l_docdir}/bacula
  +          #   % {l_odoc} -ame % {SOURCE % {name}.spec}
  +          #   sometimes i'm so ... _tired_
  +          %{l_odoc} -ame `dirname %{SOURCE bconsole.sh}`/bacula.spec
  +    fi
  +
  +    #   create file list
  +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  +        %{l_files_std} \
  +        '%attr(750,%{with_user},%{with_group}) %{l_prefix}/var/bacula' \
  +        '%attr(750,%{with_user},%{with_group}) %{l_prefix}/var/bacula/run' \
  +        '%attr(750,%{with_user},%{with_group}) 
%{l_prefix}/var/bacula/run/subsys' \
  +        '%config %{l_prefix}/etc/bacula/bconsole.conf' \
  +        '%config %{l_prefix}/etc/bacula/bacula-sd.conf' \
  +        '%config %{l_prefix}/etc/bacula/bacula-fd.conf' \
  +        '%config %{l_prefix}/etc/bacula/bacula-dir.conf'
  +
  +%files -f files
  +    %docdir %{l_docdir}
  +
  +%clean
  +    rm -rf $RPM_BUILD_ROOT
  +
  +%post
  +    #   after upgrade, restart service
  +    [ $1 -eq 2 ] || exit 0
  +    %{l_rc} -v bacula restart
  +
  +%preun
  +    #   before erase, stop service and remove working files
  +    %{l_rc} -v bacula stop
  +    rm -rf $RPM_INSTALL_PREFIX/var/bacula
  +    exit 0
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/bacula/bconsole.sh
  ============================================================================
  $ cvs diff -u -r0 -r1.1 bconsole.sh
  --- /dev/null 2005-07-20 13:36:00 +0200
  +++ bconsole.sh       2005-07-20 13:36:10 +0200
  @@ -0,0 +1,13 @@
  +#!/bin/sh
  +if [ $# = 1 ] ; then
  +   case "$1" in
  +       -*) ;;
  +        *) echo "doing bconsole $1.conf"
  +           @l_prefix@/sbin/bconsole -c $1.conf
  +           exit;;
  +   esac
  +fi
  +
  +# The following works, because bconsole accepts multiple '-c' options.
  +# The last '-c' wins.
  +exec @l_prefix@/sbin/bconsole -c @l_prefix@/etc/bacula/bconsole.conf "$@"
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/bacula/rc.bacula
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rc.bacula
  --- /dev/null 2005-07-20 13:36:00 +0200
  +++ rc.bacula 2005-07-20 13:36:10 +0200
  @@ -0,0 +1,49 @@
  [EMAIL PROTECTED]@/lib/openpkg/bash @l_prefix@/etc/rc
  +##
  +##  rc.bacula -- Run-Commands
  +##
  +
  +%config
  +    bacula_enable="$openpkg_rc_def"
  +    [EMAIL PROTECTED]@
  +    [EMAIL PROTECTED]@
  +    bacula_fd_enable=yes
  +    bacula_debug=""
  +    [EMAIL PROTECTED]@;
  +    [EMAIL PROTECTED]@
  +
  +%status -u @l_susr@ -o
  +    @l_prefix@/libexec/bacula/bacula status \
  +        "$bacula_debug" $bacula_dir_enable $bacula_sd_enable 
$bacula_fd_enable
  +
  +%start -u @l_susr@
  +    rcService bacula enable yes || exit 0
  +    if [ ! -e @l_prefix@/var/bacula/bacula.db ]; then
  +        #   create database
  +        @l_prefix@/libexec/bacula/make_bacula_tables
  +        chmod 600 @l_prefix@/var/bacula/bacula.db
  +        chown $bacula_user:$bacula_group @l_prefix@/var/bacula/bacula.db
  +    fi
  +    @l_prefix@/libexec/bacula/bacula start \
  +        "$bacula_debug" $bacula_dir_enable $bacula_sd_enable 
$bacula_fd_enable
  +
  +%stop -u @l_susr@
  +    rcService bacula enable yes || exit 0
  +    @l_prefix@/libexec/bacula/bacula stop
  +
  +%restart -u @l_susr@
  +    rcService bacula enable yes || exit 0
  +    @l_prefix@/libexec/bacula/bacula stop
  +    sleep 5
  +    @l_prefix@/libexec/bacula/bacula start \
  +        "$bacula_debug" $bacula_dir_enable $bacula_sd_enable 
$bacula_fd_enable
  +
  +%reload -u @l_susr@
  +    rcService bacula enable yes || exit 0
  +    echo "bacula: reload not supported !" 1>&2
  +    exit 1
  +
  +%daily -u @l_susr@
  +    rcService bacula enable yes || exit 0
  +    exit 0
  +
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     openpkg-cvs@openpkg.org

Reply via email to