]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/platforms/rpm/bacula.spec
Apply patches from bug #1672 to clean up configuration
[bacula/bacula] / bacula / platforms / rpm / bacula.spec
index 2ef98838f95d390841e18736588bed708a2a9ef2..201370f5261bc05804d6ef1996e8a4e19e35f3ad 100644 (file)
@@ -1,16 +1,28 @@
 # Bacula RPM spec file
 #
-# Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+# Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
 
 # Platform Build Configuration
 
 # basic defines for every build
 %define _release           1
-%define _version           5.0.1
+%define _version           5.0.3
 %define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
 %define depkgs_version 18Dec09
 
-%define single_dir 0
+# postgresql defines - defaults for most platforms
+# pass changes if required
+# versions less than 8 are no longer supported
+%define postgres_version 8
+%{?postgresql_version:%define postgres_version %{postgresql_version}}
+%define postgres_package postgresql84
+%{?postgresql_package:%define postgres_package %{postgresql_package}}
+%define postgres_server_package postgresql84-server
+%{?postgresql_server_package:%define postgres_server_package %{postgresql_server_package}}
+%define postgres_devel_package postgresql84-devel
+%{?postgresql_devel_package:%define postgres_devel_package %{postgresql_devel_package}}
+
+%define single_dir 1
 %{?single_dir_install:%define single_dir 1}
 
 # Installation Directory locations
@@ -19,7 +31,7 @@
 %define _sbindir       /opt/bacula/bin
 %define _bindir        /opt/bacula/bin
 %define _subsysdir     /opt/bacula/working
-%define sqlite_bindir /opt/bacula/sqlite
+%define sqlite_bindir  /opt/bacula/sqlite
 %define _mandir        /usr/share/man
 %define sysconf_dir    /opt/bacula/etc
 %define script_dir     /opt/bacula/scripts
@@ -217,7 +229,7 @@ Name: bacula
 Version: %{_version}
 Release: %{_release}
 Group: System Environment/Daemons
-License: GPL v2
+License: AGPLv3
 BuildRoot: %{_tmppath}/%{name}-root
 URL: http://www.bacula.org/
 Vendor: The Bacula Team
@@ -232,18 +244,17 @@ Source1: Release_Notes-%{version}-1.tar.gz
 %else
 Source1: Release_Notes-%{version}-%{release}.tar.gz
 %endif
-Source2: bacula-2.2.7-postgresql.patch
-Source3: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
+Source2: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
 
 # define the basic package description
-%define blurb Bacula - It comes by night and sucks the vital essence from your computers.
+%define blurb Bacula - The Leading Open Source Backup Solution.
 %define blurb2 Bacula is a set of computer programs that permit you (or the system
 %define blurb3 administrator) to manage backup, recovery, and verification of computer
 %define blurb4 data across a network of computers of different kinds. In technical terms,
 %define blurb5 it is a network client/server based backup program. Bacula is relatively
 %define blurb6 easy to use and efficient, while offering many advanced storage management
 %define blurb7 features that make it easy to find and recover lost or damaged files.
-%define blurb8 Bacula source code has been released under the GPL version 2 license.
+%define blurb8 Bacula source code has been released under the AGPL version 3 license.
 
 %define user_file  /etc/passwd
 %define group_file /etc/group
@@ -280,6 +291,10 @@ Source3: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.
 %{?build_fc9:%define fc9 1}
 %define fc10 0
 %{?build_fc10:%define fc10 1}
+%define fc11 0
+%{?build_fc11:%define fc11 1}
+%define fc12 0
+%{?build_fc12:%define fc12 1}
 # Whitebox Enterprise build
 %define wb3 0
 %{?build_wb3:%define wb3 1}
@@ -345,7 +360,7 @@ Source3: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.
 %define rhat 1
 %endif
 %define fed 0
-%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || %{fc10}
+%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
 %define fed 1
 %endif
 %define suse 0
@@ -411,7 +426,7 @@ exit 1
 %if %{rhat} || %{rhel}
 %define _dist %(grep Red /etc/redhat-release)
 %endif
-%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10}
+%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
 %define _dist %(grep Fedora /etc/redhat-release)
 %endif
 %if %{centos5} || %{centos4} || %{centos3}
@@ -443,8 +458,8 @@ BuildRequires: mysql-client
 BuildRequires: mysql
 %endif
 %if 0%{?opensuse_bs} &&  %{suse} && %{postgresql}
-BuildRequires: postgresql
-BuildRequires: postgresql-server
+BuildRequires: %{postgres_package}
+BuildRequires: %{postgres_server_package}
 %endif
 BuildRequires: openssl
 
@@ -461,10 +476,6 @@ BuildRequires: sysconfig
 %define tcpwrappers 0
 %{?build_tcpwrappers:%define tcpwrappers 1}
 
-# do we need to patch for old postgresql version?
-%define old_pgsql 0
-%{?build_old_pgsql:%define old_pgsql 1}
-
 # Mandriva somehow forces the manpage file extension to bz2 rather than gz
 %if %{mdk}
 %define manpage_ext bz2
@@ -481,7 +492,7 @@ BuildRequires: sysconfig
 
 BuildRequires: gcc, gcc-c++, make, autoconf
 BuildRequires: glibc, glibc-devel
-BuildRequires: ncurses-devel, perl
+BuildRequires: ncurses-devel, perl, readline-devel
 BuildRequires: libstdc++-devel, zlib-devel
 BuildRequires: openssl-devel
 BuildRequires: libacl-devel
@@ -517,11 +528,11 @@ BuildRequires: mysql-devel
 %endif
 
 %if %{postgresql} && %{wb3}
-BuildRequires: rh-postgresql-devel >= 7
+BuildRequires: rh-postgresql-devel >= %{postgres_version}
 %endif
 
 %if %{postgresql} && ! %{wb3}
-BuildRequires: postgresql-devel >= 7
+BuildRequires: %{postgres_devel_package} >= %{postgres_version}
 %endif
 
 %description
@@ -551,7 +562,7 @@ Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
 Conflicts: bacula-client
 
 Requires: ncurses, libstdc++, zlib, openssl
-Requires: glibc
+Requires: glibc, readline, %{name}-libs
 
 %if %{suse}
 Conflicts: bacula
@@ -624,7 +635,7 @@ Provides: bacula
 %endif
 
 Requires: libstdc++, zlib, openssl
-Requires: glibc
+Requires: glibc, readline, %{name}-libs
 
 %if %{suse}
 Requires: termcap
@@ -677,6 +688,24 @@ This package installs scripts for updating older versions of the bacula
 database.
 %endif
 
+%package libs
+
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+
+%description libs
+%{blurb}
+
+%{blurb2}
+%{blurb3}
+%{blurb4}
+%{blurb5}
+%{blurb6}
+%{blurb7}
+%{blurb8}
+
+This package installs the shared libraries used by many bacula programs.
+
 # Must explicitly enable debug pkg on SuSE
 # but not in opensuse_bs
 %if %{suse} && ! 0%{?opensuse_bs}
@@ -686,12 +715,12 @@ database.
 %prep
 %setup
 %setup -T -D -b 1
-%setup -T -D -b 3
+%setup -T -D -b 2
 
 %build
 
 %if %{suse}
-export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap"
+export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap -L/usr/lib64/termcap"
 %endif
 
 cwd=${PWD}
@@ -701,9 +730,6 @@ make sqlite3
 cd ${cwd}
 %endif
 
-%if %{wb3} || %{old_pgsql}
-patch -p3 src/cats/postgresql.c < %SOURCE2
-%endif
 
 %if %{sqlite}
 # patches for the bundled sqlite scripts
@@ -754,6 +780,8 @@ export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
         --disable-gnome \
         --disable-bwx-console \
         --disable-tray-monitor \
+        --disable-conio \
+        --enable-readline \
 %if %{mysql}
         --with-mysql \
 %endif
@@ -764,7 +792,6 @@ export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
         --with-postgresql \
 %endif
         --disable-bat \
-        --without-qwt \
 %if %{python}
         --with-python \
 %endif
@@ -825,8 +852,6 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
-# installed but not packaged
-rm -f $RPM_BUILD_ROOT%{script_dir}/bacula_config
 %endif
 # Docs for programs that are depreciated
 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
@@ -884,7 +909,9 @@ cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
 cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
 
 # install the sample-query.sql file
+%if ! %{client_only}
 cp -p examples/sample-query.sql $RPM_BUILD_ROOT%{script_dir}/sample-query.sql
+%endif
 
 # install the logwatch scripts
 %if ! %{client_only}
@@ -940,6 +967,7 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
 %attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
 %attr(-, root, %{daemon_group}) %{script_dir}/startmysql
 %attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
+%{_libdir}/libbacsql*
 %endif
 
 %if %{sqlite}
@@ -967,13 +995,14 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
 %attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
 %attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
-# The rest is DB backend independent
+%{_libdir}/libbacsql*
 %endif
-# opensuse_bs: directories not owned by any package
-%dir %attr(-, root, %{daemon_group}) %{sysconf_dir}
+
+# The rest is DB backend independent
 
 %if ! %{client_only}
 %attr(-, root, %{daemon_group}) %dir %{script_dir}
+%attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula_config
 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
@@ -988,6 +1017,7 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
 %attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
+%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.mdb
 %attr(-, root, %{daemon_group}) %{script_dir}/disk-changer
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
@@ -1043,7 +1073,6 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
 %{_mandir}/man1/bat.1.%{manpage_ext}
-%{_libdir}/libbac*
 %_prefix/share/doc/*
 
 # opensuse build service changes the release itself
@@ -1056,7 +1085,7 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
 
 %if %{mysql}
 %pre mysql
-# test for bacula database older than version 12
+# test for bacula database older than version 13
 # note: this ASSUMES no password has been set for bacula database
 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
 %endif
@@ -1085,7 +1114,7 @@ if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
         echo "chown bacula.bacula bacula.db"
         exit 1
 fi
-# test for bacula database older than version 11 and sqlite3
+# test for bacula database older than version 12 and sqlite3
 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite3 ];then
         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
 %endif
@@ -1096,13 +1125,13 @@ DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head
 %endif
 
 %if ! %{client_only}
-if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "11" ]; then
-    echo "This bacula upgrade will update a bacula database from version 11 to 12."
+if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "12" ]; then
+    echo "This bacula upgrade will update a bacula database from version 12 to 13."
     echo "You appear to be running database version $DB_VER. You must first update"
-    echo "your database to version 11 and then install this upgrade. The alternative"
+    echo "your database to version 12 and then install this upgrade. The alternative"
     echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current"
     echo "catalog information, then do the upgrade. Information on updating a"
-    echo "database older than version 11 can be found in the release notes."
+    echo "database older than version 12 can be found in the release notes."
     exit 1
 fi
 %endif
@@ -1212,7 +1241,7 @@ if [ -z "$DB_VER" ]; then
     %{script_dir}/make_mysql_tables
 
 # check to see if we need to upgrade a 3.x database
-elif [ "$DB_VER" -lt "12" ]; then
+elif [ "$DB_VER" -lt "13" ]; then
     echo "This release requires an upgrade to your bacula database."
     echo "Backing up your current database..."
     mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
@@ -1229,7 +1258,7 @@ fi
 if [ -s %{working_dir}/bacula.db ]; then
         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
         # check to see if we need to upgrade a 3.x database
-        if [ "$DB_VER" -lt "12" ] && [ "$DB_VER" -ge "11" ]; then
+        if [ "$DB_VER" -lt "13" ] && [ "$DB_VER" -ge "12" ]; then
                 echo "This release requires an upgrade to your bacula database."
                 echo "Backing up your current database..."
                 echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
@@ -1266,8 +1295,8 @@ if [ -z "$DB_VER" ]; then
     echo "Granting privileges for PostgreSQL user bacula..."
     %{script_dir}/grant_postgresql_privileges
 
-# check to see if we need to upgrade a 3.x database
-elif [ "$DB_VER" -lt "12" ]; then
+# check to see if we need to upgrade a 5.0.x database
+elif [ "$DB_VER" -lt "13" ]; then
     echo "This release requires an upgrade to your bacula database."
     echo "Backing up your current database..."
     pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
@@ -1298,8 +1327,7 @@ if [ -d %{sysconf_dir} ]; then
    done
 fi
 %endif
-/sbin/ldconfig
-exit 0 # always exit successfull, as otherwise opensuse build service complains
+
 
 %if %{mysql}
 %preun mysql
@@ -1318,24 +1346,12 @@ if [ $1 = 0 ]; then
   /sbin/chkconfig --del bacula-fd
   /sbin/chkconfig --del bacula-sd
 fi
-/sbin/ldconfig
-%endif
-
-# added: run ldconfig in postun
-%if %{mysql}
-%postun mysql
-%endif
-%if %{sqlite}
-%postun sqlite
 %endif
-%if %{postgresql}
-%postun postgresql
-%endif
-/sbin/ldconfig
 
 %files client
 %defattr(-,root,root)
 %attr(-, root, %{daemon_group}) %dir %{script_dir}
+%attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
 %{script_dir}/bacula-ctl-fd
 /etc/init.d/bacula-fd
 
@@ -1355,15 +1371,8 @@ fi
 %{_mandir}/man8/bconsole.8.%{manpage_ext}
 %{_mandir}/man8/btraceback.8.%{manpage_ext}
 %{_mandir}/man1/bat.1.%{manpage_ext}
-%{_libdir}/libbac.*
-%{_libdir}/libbaccfg.*
-%{_libdir}/libbacfind.*
-%{_libdir}/libbacpy.*
 %_prefix/share/doc/*
 
-#opensuse_bs: directories not owned by any package
-%dir %attr(-, root, %{daemon_group}) %{sysconf_dir}
-
 %pre client
 # create the daemon group and user
 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
@@ -1411,16 +1420,27 @@ if [ -d %{sysconf_dir} ]; then
    done
 fi
 
-/sbin/ldconfig
-exit 0
 %preun client
 # delete our link
 if [ $1 = 0 ]; then
    /sbin/chkconfig --del bacula-fd
 fi
 
-%postun client
+%files libs
+%defattr(-,root,root)
+%{_libdir}/libbac-*
+%{_libdir}/libbac.*
+%{_libdir}/libbaccfg*
+%{_libdir}/libbacfind*
+%{_libdir}/libbacpy*
+
+%post libs
 /sbin/ldconfig
+exit 0
+
+%postun libs
+/sbin/ldconfig
+exit 0
 
 %if ! %{client_only}
 %files updatedb
@@ -1443,11 +1463,24 @@ echo "The database update scripts were installed to %{script_dir}/updatedb"
 %endif
 
 %changelog
+* Mon Sep 06 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+* Mon Sep 06 2010 Kern Sibbald <kern@sibbald.com>
+- 5.0.3
+- change license to AGPL v3
+- add defines for postgresql version and packages, require version 8 or greater
+- adjusted package description
+- fix bug with libbacsql files
+* Sun Mar 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- remove --without-qwt from configure statement
+* Sat Feb 27 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- move shared libraries into bacula-libs package
 * Sat Feb 20 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
 - remove deprecated mysql4 and mysql5 build defines
 - add build support for tcpwrappers
 - remove bacula_config file for client only build
 - remove requirements for database server packages
+- enable readline support
+- add fc11 and fc12
 * Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
 - 5.0.1
 - fix client only build