]> 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 cd16bf70d63ba7af846a2e60df00fc1d01731fc7..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
@@ -447,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
 
@@ -465,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
@@ -521,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
@@ -555,7 +562,7 @@ Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
 Conflicts: bacula-client
 
 Requires: ncurses, libstdc++, zlib, openssl
-Requires: glibc, readline, bacula-libs
+Requires: glibc, readline, %{name}-libs
 
 %if %{suse}
 Conflicts: bacula
@@ -628,7 +635,7 @@ Provides: bacula
 %endif
 
 Requires: libstdc++, zlib, openssl
-Requires: glibc, readline, bacula-libs
+Requires: glibc, readline, %{name}-libs
 
 %if %{suse}
 Requires: termcap
@@ -708,7 +715,7 @@ This package installs the shared libraries used by many bacula programs.
 %prep
 %setup
 %setup -T -D -b 1
-%setup -T -D -b 3
+%setup -T -D -b 2
 
 %build
 
@@ -723,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
@@ -776,8 +780,8 @@ export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
         --disable-gnome \
         --disable-bwx-console \
         --disable-tray-monitor \
-       --disable-conio \
-       --enable-readline \
+        --disable-conio \
+        --enable-readline \
 %if %{mysql}
         --with-mysql \
 %endif
@@ -963,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}
@@ -990,6 +995,7 @@ 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
+%{_libdir}/libbacsql*
 %endif
 
 # The rest is DB backend independent
@@ -1011,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
@@ -1078,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
@@ -1107,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
@@ -1118,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
@@ -1234,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
@@ -1251,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
@@ -1288,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
@@ -1421,7 +1428,8 @@ fi
 
 %files libs
 %defattr(-,root,root)
-%{_libdir}/libbac*
+%{_libdir}/libbac-*
+%{_libdir}/libbac.*
 %{_libdir}/libbaccfg*
 %{_libdir}/libbacfind*
 %{_libdir}/libbacpy*
@@ -1455,6 +1463,13 @@ 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>