From 825a2f3d813c8566f03e1162977e1214ba1cce8b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 31 Jan 2010 18:42:59 +0100 Subject: [PATCH] Commit spec+rpm build files from Scott --- bacula/platforms/contrib-rpm/build_rpm.sh | 62 +++- bacula/platforms/redhat/bacula-bat.spec | 45 ++- bacula/platforms/redhat/bacula-docs.spec | 12 +- bacula/platforms/redhat/bacula-mtx.spec | 2 +- bacula/platforms/redhat/bacula.spec | 277 +++++++++--------- bacula/src/cats/make_sqlite3_tables.in.patch | 6 +- .../src/cats/update_sqlite3_tables.in.patch | 8 +- 7 files changed, 247 insertions(+), 165 deletions(-) diff --git a/bacula/platforms/contrib-rpm/build_rpm.sh b/bacula/platforms/contrib-rpm/build_rpm.sh index c27e3886f4..ad9b63c8ea 100755 --- a/bacula/platforms/contrib-rpm/build_rpm.sh +++ b/bacula/platforms/contrib-rpm/build_rpm.sh @@ -21,19 +21,19 @@ ########################################################################################### # script configuration section -VERSION=3.0.0 +VERSION=5.0.0 RELEASE=1 # build platform for spec -# set to one of rh7,rh8,rh9,fc1,fc3,fc4,fc5,fc6,fc7,fc8,fc9,wb3,rhel3,rhel4,rhel5,centos3,centos4,centos5,sl3, sl4,sl5,su9,su10,su102,su103,su110,su111,mdk,mdv +# set to one of rh7,rh8,rh9,fc1,fc3,fc4,fc5,fc6,fc7,fc8,fc9,fc10,wb3,rhel3,rhel4,rhel5,centos3,centos4,centos5,sl3, sl4,sl5,su9,su10,su102,su103,su110,su111,su112,mdk,mdv PLATFORM=su111 # platform designator for file names -# for RedHat/Fedora set to one of rh7,rh8,rh9,fc1,fc3,fc4,fc5,fc6,fc7,fc8,fc9 OR +# for RedHat/Fedora set to one of rh7,rh8,rh9,fc1,fc3,fc4,fc5,fc6,fc7,fc8,fc9,fc10 OR # for RHEL3/clones wb3, rhel3, sl3 & centos3 set to el3 OR # for RHEL4/clones rhel4, sl4 & centos4 set to el4 OR # for RHEL5/clones rhel5, sl5 & centos5 set to el5 OR -# for SuSE set to su90, su91, su92, su100 or su101 or su102 or su103 or su110 or su111 OR +# for SuSE set to su90, su91, su92, su100 or su101 or su102 or su103 or su110 or su111 or su112 OR # for Mandrake set to 101mdk or 20060mdk FILENAME=su111 @@ -46,6 +46,7 @@ PACKAGER="Your Name " # enter the full path to your RPMS output directory RPMDIR=/usr/src/packages/RPMS/i586 +RPMDIR2=/usr/src/packages/RPMS/noarch # enter the full path to your rpm BUILD directory RPMBUILD=/usr/src/packages/BUILD @@ -57,8 +58,14 @@ ARCH=i586 # with trailing slash where it is found. SRPMDIR= +# to build the mtx package set to 1, else 0 +BUILDMTX=0 + +# to build the bat package set to 1, else 0 +BUILDBAT=1 + # set to 1 to sign packages, 0 not to sign if you want to sign on another machine. -SIGN=1 +SIGN=0 # to save the bacula-updatedb package set to 1, else 0 # only one updatedb package is required per release so normally this should be 0 @@ -79,13 +86,15 @@ SAVEUPDATEDB=0 ############################################################################################ SRPM=${SRPMDIR}bacula-$VERSION-$RELEASE.src.rpm +SRPM2=${SRPMDIR}bacula-bat-$VERSION-$RELEASE.src.rpm +SRPM3=${SRPMDIR}bacula-docs-$VERSION-$RELEASE.src.rpm +SRPM4=${SRPMDIR}bacula-mtx-$VERSION-$RELEASE.src.rpm echo Building MySQL packages for "$PLATFORM"... sleep 2 rpmbuild --rebuild --define "build_${PLATFORM} 1" \ --define "build_mysql${MYSQL} 1" \ --define "build_python 1" \ ---define "nobuild_gconsole 1" \ --define "contrib_packager ${PACKAGER}" ${SRPM} rm -rf ${RPMBUILD}/* @@ -94,9 +103,7 @@ sleep 2 rpmbuild --rebuild --define "build_${PLATFORM} 1" \ --define "build_postgresql 1" \ --define "contrib_packager ${PACKAGER}" \ ---define "build_python 1" \ ---define "build_bat 1" \ ---define "nobuild_gconsole 1" ${SRPM} +--define "build_python 1" ${SRPM} rm -rf ${RPMBUILD}/* echo Building SQLite packages for "$PLATFORM"... @@ -104,10 +111,28 @@ sleep 2 rpmbuild --rebuild --define "build_${PLATFORM} 1" \ --define "build_sqlite 1" \ --define "contrib_packager ${PACKAGER}" \ ---define "build_python 1" \ ---define "nobuild_gconsole 1" ${SRPM} +--define "build_python 1" ${SRPM} +rm -rf ${RPMBUILD}/* + +if [ "$BUILDBAT" = "1" ]; then + echo Building Bat package for "$PLATFORM"... + sleep 2 + rpmbuild --rebuild ${SRPM2} + rm -rf ${RPMBUILD}/* +fi + +echo Building Docs package for "$PLATFORM"... +sleep 2 +rpmbuild --rebuild ${SRPM3} rm -rf ${RPMBUILD}/* +if [ "$BUILDMTX" = "1" ]; then + echo Building mtx package for "$PLATFORM"... + sleep 2 + rpmbuild --rebuild ${SRPM4} + rm -rf ${RPMBUILD}/* +fi + # delete the updatedb package and any debuginfo packages built rm -f ${RPMDIR}/bacula*debug* if [ "$SAVEUPDATEDB" = "1" ]; then @@ -127,14 +152,20 @@ mv -f ${RPMDIR}/bacula-postgresql-${VERSION}-${RELEASE}.${ARCH}.rpm \ mv -f ${RPMDIR}/bacula-sqlite-${VERSION}-${RELEASE}.${ARCH}.rpm \ ./bacula-sqlite-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm -mv -f ${RPMDIR}/bacula-mtx-${VERSION}-${RELEASE}.${ARCH}.rpm \ -./bacula-mtx-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm +if [ "$BUILDMTX" = "1" ]; then + mv -f ${RPMDIR}/bacula-mtx-${VERSION}-${RELEASE}.${ARCH}.rpm \ + ./bacula-mtx-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm +fi mv -f ${RPMDIR}/bacula-client-${VERSION}-${RELEASE}.${ARCH}.rpm \ ./bacula-client-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm -mv -f ${RPMDIR}/bacula-bat-${VERSION}-${RELEASE}.${ARCH}.rpm \ -./bacula-bat-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm +if [ "$BUILDBAT" = "1" ]; then + mv -f ${RPMDIR}/bacula-bat-${VERSION}-${RELEASE}.${ARCH}.rpm \ + ./bacula-bat-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm +fi + +mv -f ${RPMDIR2}/bacula-docs-${VERSION}-${RELEASE}.noarch.rpm . # now sign the packages if [ "$SIGN" = "1" ]; then @@ -164,3 +195,4 @@ ls # 08 Nov 2008 add use of pkgconfig to obtain QT4 paths # 31 Dec 2008 add su111 # 05 Apr 2009 deprecate gconsole and wxconsole, bat built by default +# 30 Jan 2010 adjust for mtx, bat and docs in separate srpm diff --git a/bacula/platforms/redhat/bacula-bat.spec b/bacula/platforms/redhat/bacula-bat.spec index 487350e64c..a407fa55ef 100644 --- a/bacula/platforms/redhat/bacula-bat.spec +++ b/bacula/platforms/redhat/bacula-bat.spec @@ -6,7 +6,7 @@ # basic defines for every build %define _release 1 -%define _version 3.0.3 +%define _version 5.0.0 %define depkgs_qt_version 28Jul09 %define _packager D. Scott Barninger @@ -55,6 +55,28 @@ %{?contrib_packager:%define _packager %{contrib_packager}} +# determine what platform we are building on +%define fedora 0 +%define suse 0 +%define mdk 0 + +%if %{_vendor} == redhat + %define fedora 1 + %define _dist %(cat /etc/redhat-release) +%endif +%if %{_vendor} == suse + %define suse 1 + %define _dist %(grep -i SuSE /etc/SuSE-release) +%endif +%if %{_vendor} == Mandriva + %define mdk 1 + %define _dist %(grep Mand /etc/mandrake-release) +%endif +%if ! %{fedora} && ! %{suse} && ! %{mdk} +%{error: Unknown platform. Please examine the spec file.} +exit 1 +%endif + Summary: Bacula - The Network Backup Solution Name: bacula-bat Version: %{_version} @@ -66,7 +88,7 @@ URL: http://www.bacula.org/ Vendor: The Bacula Team Packager: %{_packager} Prefix: %{_prefix} -Distribution: Bacula Bat +Distribution: %{_dist} Source0: http://www.prdownloads.sourceforge.net/bacula/bacula-%{version}.tar.gz Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-qt-%{depkgs_qt_version}.tar.gz @@ -159,19 +181,29 @@ make %install mkdir -p $RPM_BUILD_ROOT/usr/share/applications mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps +%if ! %{suse} mkdir -p $RPM_BUILD_ROOT/etc/pam.d mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps mkdir -p $RPM_BUILD_ROOT%{_sbindir} +mkdir -p $RPM_BUILD_ROOT/usr/bin +%endif cd src/qt-console make DESTDIR=$RPM_BUILD_ROOT install cd ../.. +rm -rf $RPM_BUILD_ROOT%{_prefix}/share/doc/bacula + +%if %{suse} +cp -p src/qt-console/images/bat_icon.png $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png +cp -p scripts/bat.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/bat.desktop +%else cp -p src/qt-console/images/bat_icon.png $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png cp -p scripts/bat.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bat.desktop cp -p scripts/bat.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bat cp -p scripts/bat.pamd $RPM_BUILD_ROOT/etc/pam.d/bat -ln -sf consolehelper $RPM_BUILD_ROOT/%{_sbindir}/bat +ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bat +%endif %files %defattr(-,root,root) @@ -180,12 +212,13 @@ ln -sf consolehelper $RPM_BUILD_ROOT/%{_sbindir}/bat %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bat.conf /usr/share/pixmaps/bat_icon.png /usr/share/applications/bat.desktop -/usr/share/doc/bacula/* -#%{_mandir}/man1/bat.1.%{manpage_ext} +%if ! %{suse} # add the console helper files %config(noreplace,missingok) /etc/pam.d/bat %config(noreplace,missingok) /etc/security/console.apps/bat +/usr/bin/bat +%endif %pre # create the daemon group @@ -228,5 +261,7 @@ fi rm -rf $RPM_BUILD_DIR/depkgs-qt %changelog +* Sat Jan 30 2010 D. Scott Barninger +- fix consolehelper/xsu for suse packages * Sat Aug 1 2009 Kern Sibbald - Split bat into separate bacula-bat.spec diff --git a/bacula/platforms/redhat/bacula-docs.spec b/bacula/platforms/redhat/bacula-docs.spec index 15f71bba9a..6cdee044a7 100644 --- a/bacula/platforms/redhat/bacula-docs.spec +++ b/bacula/platforms/redhat/bacula-docs.spec @@ -6,7 +6,7 @@ # basic defines for every build %define _release 1 -%define _version 3.0.3 +%define _version 5.0.0 %define _packager D. Scott Barninger %define _prefix /usr @@ -31,10 +31,11 @@ BuildRoot: %{_tmppath}/%{name}-root URL: http://www.bacula.org/ Vendor: The Bacula Team Packager: %{_packager} +BuildArchitectures: noarch Prefix: %{_prefix} Distribution: Bacula Documentation -Source: %{name}-%{_version}.tar.gz +Source: %{name}-%{_version}.tar.bz2 # Source directory locations %define _docsrc . @@ -74,14 +75,15 @@ This package installs the Bacula pdf and html documentation. rm -rf $RPM_BUILD_DIR/%{name}-%{_version} %files -%doc %{_docsrc}/manuals/en/catalog/catalog %{_docsrc}/manuals/en/catalog/catalog.pdf -%doc %{_docsrc}/manuals/en/concepts/concepts %{_docsrc}/manuals/en/concepts/concepts.pdf %doc %{_docsrc}/manuals/en/console/console %{_docsrc}/manuals/en/console/console.pdf %doc %{_docsrc}/manuals/en/developers/developers %{_docsrc}/manuals/en/developers/developers.pdf -%doc %{_docsrc}/manuals/en/install/install %{_docsrc}/manuals/en/install/install.pdf +%doc %{_docsrc}/manuals/en/main/main %{_docsrc}/manuals/en/main/main.pdf +%doc %{_docsrc}/manuals/en/misc/misc %{_docsrc}/manuals/en/misc/misc.pdf %doc %{_docsrc}/manuals/en/problems/problems %{_docsrc}/manuals/en/problems/problems.pdf %doc %{_docsrc}/manuals/en/utility/utility %{_docsrc}/manuals/en/utility/utility.pdf %changelog +* Sat Jan 30 2010 D. Scott Barninger +- change source file to bz2, update for new doc structure * Sat Aug 1 2009 Kern Sibbald - Split docs into separate bacula-docs.spec diff --git a/bacula/platforms/redhat/bacula-mtx.spec b/bacula/platforms/redhat/bacula-mtx.spec index 675e66dec7..5376d0f159 100644 --- a/bacula/platforms/redhat/bacula-mtx.spec +++ b/bacula/platforms/redhat/bacula-mtx.spec @@ -6,7 +6,7 @@ # basic defines for every build %define _release 1 -%define _version 3.0.3 +%define _version 5.0.0 %define depkgs_version 18Feb09 %define _packager D. Scott Barninger diff --git a/bacula/platforms/redhat/bacula.spec b/bacula/platforms/redhat/bacula.spec index 5a4d8fe086..e66565b14a 100644 --- a/bacula/platforms/redhat/bacula.spec +++ b/bacula/platforms/redhat/bacula.spec @@ -1,6 +1,6 @@ # Bacula RPM spec file # -# Copyright (C) 2000-2010 Free Software Foundation Europe e.V. +# Copyright (C) 2000-2009 Free Software Foundation Europe e.V. # Platform Build Configuration @@ -8,6 +8,7 @@ %define _release 1 %define _version 5.0.0 %define _packager D. Scott Barninger +%define depkgs_version 18Dec09 %define single_dir 0 %{?single_dir_install:%define single_dir 1} @@ -18,6 +19,7 @@ %define _sbindir /opt/bacula/bin %define _bindir /opt/bacula/bin %define _subsysdir /opt/bacula/working +%define sqlite_bindir /opt/bacula/sqlite %define _mandir /usr/share/man %define sysconf_dir /opt/bacula/etc %define script_dir /opt/bacula/scripts @@ -30,6 +32,7 @@ %define _sbindir %_prefix/sbin %define _bindir %_prefix/bin %define _subsysdir /var/lock/subsys +%define sqlite_bindir %_libdir/bacula/sqlite %define _mandir %_prefix/share/man %define sysconf_dir /etc/bacula %define script_dir %_libdir/bacula @@ -47,6 +50,7 @@ # group that has write access to tape devices, usually disk on Linux %define storage_daemon_group disk +%define depkgs ../depkgs # probems with mandriva build: # nothing provides libbonobo2_0-devel, nothing provides libbonoboui2_0-devel @@ -175,6 +179,11 @@ BuildRequires: suse-release %define _dist "SUSE 11" %endif +%if 0%{?suse_version} == 1120 +%define build_su112 1 +%define _dist "SUSE 11" +%endif + %if 0%{?sles_version} == 9 %define build_su9 1 @@ -227,6 +236,7 @@ Source1: Release_Notes-%{version}-1.tar.gz 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 # define the basic package description %define blurb Bacula - It comes by night and sucks the vital essence from your computers. @@ -271,6 +281,8 @@ Source2: bacula-2.2.7-postgresql.patch %{?build_fc8:%define fc8 1} %define fc9 0 %{?build_fc9:%define fc9 1} +%define fc10 0 +%{?build_fc10:%define fc10 1} # Whitebox Enterprise build %define wb3 0 %{?build_wb3:%define wb3 1} @@ -317,6 +329,8 @@ Source2: bacula-2.2.7-postgresql.patch %{?build_su110:%define su110 1} %define su111 0 %{?build_su111:%define su111 1} +%define su112 0 +%{?build_su112:%define su112 1} # Mandrake builds %define mdk 0 %{?build_mdk:%define mdk 1} @@ -334,11 +348,11 @@ Source2: bacula-2.2.7-postgresql.patch %define rhat 1 %endif %define fed 0 -%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} +%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || %{fc10} %define fed 1 %endif %define suse 0 -%if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} +%if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} || %{su112} %define suse 1 %endif %define rhel 0 @@ -407,7 +421,7 @@ exit 1 %if %{rhat} || %{rhel} %define _dist %(grep Red /etc/redhat-release) %endif -%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} +%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10} %define _dist %(grep Fedora /etc/redhat-release) %endif %if %{centos5} || %{centos4} || %{centos3} @@ -505,17 +519,10 @@ BuildRequires: libtermcap-devel BuildRequires: libstdc++-static-devel BuildRequires: glibc-static-devel %endif -%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} +%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} BuildRequires: libtermcap-devel %endif -%if !%{rh7} && !%{su9} && !%{su10} && !%{su102} && !%{su103} && !%{su110} && !%{su111} && !%{mdk} && !%{fc3} && !%{fc4} && !%{fc5} && !%{fc6} && !%{fc7} && !%{fc8} && !%{fc9} -#BuildRequires: libtermcap-devel -%endif - -%if %{sqlite} && %{su10} -BuildRequires: sqlite2-devel -%endif -%if %{sqlite} && ! %{su10} +%if %{sqlite} BuildRequires: sqlite-devel %endif @@ -586,9 +593,6 @@ Requires: rh-postgresql-server >= 7 Requires: postgresql >= 7 Requires: postgresql-server >= 7 %endif -%if %{sqlite} -Requires: sqlite -%endif %if %{mysql} %description mysql @@ -690,78 +694,50 @@ This package installs scripts for updating older versions of the bacula database. %endif -%package docs - -Summary: Bacula - The Network Backup Solution -Group: System Environment/Daemons - -%description docs -%{blurb} - -%{blurb2} -%{blurb3} -%{blurb4} -%{blurb5} -%{blurb6} -%{blurb7} -%{blurb8} - -This package installs the Bacula pdf and html documentation. - # Must explicitly enable debug pkg on SuSE # but not in opensuse_bs -%if ! 0%{?opensuse_bs} -%if %{suse} +%if %{suse} && ! 0%{?opensuse_bs} %debug_package -export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap" -%endif %endif %prep %setup %setup -T -D -b 1 -#%setup -T -D -b 2 +%setup -T -D -b 3 %build +%if %{suse} +export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap" +%endif + +cwd=${PWD} +%if %{sqlite} +cd %{depkgs} +make sqlite3 +cd ${cwd} +%endif + %if %{wb3} || %{old_pgsql} -patch -p3 src/cats/postgresql.c < %SOURCE5 +patch -p3 src/cats/postgresql.c < %SOURCE2 %endif # patches for the bundled sqlite scripts # patch the make_sqlite_tables script for installation bindir -#patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch -#patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch +patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch # patch the create_sqlite_database script for installation bindir -#patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch -#patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch +patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch # patch the make_catalog_backup script for installation bindir -#patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch +patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch # patch the update_sqlite_tables script for installation bindir -#patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch -#patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch +patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch # patch the bacula-dir init script to remove sqlite service -%if %{sqlite} && %{su9} -patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch -%endif -%if %{sqlite} && %{su10} -patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch -%endif -%if %{sqlite} && %{su102} -patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch -%endif -%if %{sqlite} && %{su103} -patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch -%endif -%if %{sqlite} && %{su110} -patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch -%endif -%if %{sqlite} && %{su111} +%if %{sqlite} && %{suse} patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch %endif @@ -778,12 +754,6 @@ export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql" export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}" %endif -# Red Hat's 64 bit installation of QT4 appears to be broken so: -%define qt_path 0 -%if %{rhel5} || %{centos5} || %{sl5} -%define qt_path 1 -%endif - # Main Bacula configuration %configure \ --prefix=%{_prefix} \ @@ -803,16 +773,13 @@ export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}" --with-mysql \ %endif %if %{sqlite} -%if %{su9} || %{su10} - --with-sqlite \ -%else - --with-sqlite3 \ + --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \ %endif -%endif # sqlite? %if %{postgresql} --with-postgresql \ %endif --disable-bat \ + --without-qwt \ %if %{python} --with-python \ %endif @@ -852,7 +819,10 @@ mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb mkdir -p $RPM_BUILD_ROOT/etc/pam.d mkdir -p $RPM_BUILD_ROOT%{_sbindir} -#mkdir -p $RPM_BUILD_ROOT%{_bindir} + +%if %{sqlite} +mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir} +%endif make DESTDIR=$RPM_BUILD_ROOT install @@ -909,6 +879,14 @@ rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd %endif +# install sqlite +%if %{sqlite} +cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3 +cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h +cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a +%endif + + # install the logrotate file cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula @@ -917,14 +895,14 @@ cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/ # install the logwatch scripts %if ! %{client_only} -cp -p scripts/%{logwatch_dir}/bacula $RPM_BUILD_ROOT/etc/%{logwatch_dir}/scripts/services/bacula -cp -p scripts/%{logwatch_dir}/applybacula $RPM_BUILD_ROOT/etc/%{logwatch_dir}/scripts/shared/applybacula -cp -p scripts/%{logwatch_dir}/logfile.bacula.conf $RPM_BUILD_ROOT/etc/%{logwatch_dir}/conf/logfiles/bacula.conf -cp -p scripts/%{logwatch_dir}/services.bacula.conf $RPM_BUILD_ROOT/etc/%{logwatch_dir}/conf/services/bacula.conf -chmod 755 $RPM_BUILD_ROOT/etc/%{logwatch_dir}/scripts/services/bacula -chmod 755 $RPM_BUILD_ROOT/etc/%{logwatch_dir}/scripts/shared/applybacula -chmod 644 $RPM_BUILD_ROOT/etc/%{logwatch_dir}/conf/logfiles/bacula.conf -chmod 644 $RPM_BUILD_ROOT/etc/%{logwatch_dir}/conf/services/bacula.conf +cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula +cp -p scripts/logwatch/applybaculadate $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate +cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf +cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf +chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula +chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate +chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf +chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf %endif # now clean up permissions that are left broken by the install @@ -971,17 +949,6 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %endif %if %{sqlite} -%if %{su9} || %{su10} -# use sqlite2 on SLE_10 and SLES9 -%files sqlite -%defattr(-,root,root) -%attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite_database -%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite_database -%attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite_privileges -%attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite_tables -%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite_tables -%attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite_tables -%else %files sqlite %defattr(-,root,root) %attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database @@ -990,7 +957,9 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables %attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables -%endif # sqlite? +%{sqlite_bindir}/libsqlite3.a +%{sqlite_bindir}/sqlite3.h +%{sqlite_bindir}/sqlite3 %endif @@ -1007,11 +976,12 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt # The rest is DB backend independent %endif # opensuse_bs: directories not owned by any package -/etc/bacula +#/etc/bacula %if ! %{client_only} %attr(-, root, %{daemon_group}) %dir %{script_dir} %attr(-, root, %{daemon_group}) %{script_dir}/bacula +%attr(-, root, %{daemon_group}) %{script_dir}/bacula_config %attr(-, root, %{daemon_group}) %{script_dir}/bconsole %attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database @@ -1020,6 +990,7 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables %attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup +%attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup.pl %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 @@ -1036,14 +1007,14 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer.conf /etc/logrotate.d/bacula -/etc/%{logwatch_dir}/scripts/services/bacula -/etc/%{logwatch_dir}/scripts/shared/applybacula +%{logwatch_dir}/scripts/services/bacula +%{logwatch_dir}/scripts/shared/applybaculadate %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-dir.conf %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-sd.conf %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/%{logwatch_dir}/conf/logfiles/bacula.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/%{logwatch_dir}/conf/services/bacula.conf +%attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/logfiles/bacula.conf +%attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/services/bacula.conf %attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir} @@ -1078,22 +1049,50 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %{_mandir}/man1/bsmtp.1.%{manpage_ext} %{_mandir}/man1/bat.1.%{manpage_ext} %{_libdir}/libbac* -/usr/share/doc/* +%_prefix/share/doc/* + +# opensuse build service changes the release itself +%if 0%{?opensuse_bs} +%doc ../Release_Notes-%{version}-1.txt +%else +%doc ../Release_Notes-%{version}-%{release}.txt +%endif %endif %if %{mysql} %pre mysql -# test for bacula database older than version 10 +# test for bacula database older than version 12 # 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 %if %{sqlite} %pre sqlite -# test for bacula database older than version 10 and sqlite3 -if [ -s %{working_dir}/bacula.db ]; then - DB_VER=`echo "select * from Version;" | sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1` +# are we upgrading from sqlite to sqlite3? +if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then + echo "This version of bacula-sqlite involves an upgrade to sqlite3." + echo "Your catalog database file is not compatible with sqlite3, thus" + echo "you will need to dump the data, delete the old file, and re-run" + echo "this rpm upgrade." + echo "" + echo "Backing up your current database..." + echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db > %{working_dir}/bacula_backup.sql + mv %{working_dir}/bacula.db %{working_dir}/bacula.db.old + echo "Your catalog data has been saved in %{working_dir}/bacula_backup.sql and your" + echo "catalog file has been renamed %{working_dir}/bacula.db.old." + echo "" + echo "Please re-run this rpm package upgrade." + echo "After the upgrade is complete, restore your catalog" + echo "with the following commands:" + echo "%{script_dir}/drop_sqlite3_tables" + echo "cd %{working_dir}" + echo "%{sqlite_bindir}/sqlite3 $* bacula.db < bacula_backup.sql" + echo "chown bacula.bacula bacula.db" + exit 1 fi +# test for bacula database older than version 11 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 %if %{postgresql} @@ -1102,17 +1101,20 @@ 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 "10" ]; then - echo "This bacula upgrade will update a bacula database from version 10 to 11." +if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "11" ]; then + echo "This bacula upgrade will update a bacula database from version 11 to 12." echo "You appear to be running database version $DB_VER. You must first update" - echo "your database to version 10 and then install this upgrade. The alternative" + echo "your database to version 11 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 10 can be found in the release notes." + echo "database older than version 11 can be found in the release notes." exit 1 fi %endif +%if %{sqlite} +fi +%endif %if ! %{client_only} # check for and copy %{sysconf_dir}/console.conf to bconsole.conf @@ -1214,7 +1216,7 @@ if [ -z "$DB_VER" ]; then echo "Creating bacula tables..." %{script_dir}/make_mysql_tables -# check to see if we need to upgrade a 2.x database +# check to see if we need to upgrade a 3.x database elif [ "$DB_VER" -lt "11" ]; then echo "This release requires an upgrade to your bacula database." echo "Backing up your current database..." @@ -1230,24 +1232,24 @@ fi %if %{sqlite} # test for an existing database if [ -s %{working_dir}/bacula.db ]; then - DB_VER=`echo "select * from Version;" | sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1` - # check to see if we need to upgrade a 2.x database - if [ "$DB_VER" -lt "11" ] && [ "$DB_VER" -ge "10" ]; then - echo "This release requires an upgrade to your bacula database." - echo "Backing up your current database..." - echo ".dump" | sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2 - echo "Upgrading bacula database ..." - %{script_dir}/update_sqlite3_tables - echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" - fi + 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 + 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 + echo "Upgrading bacula database ..." + %{script_dir}/update_sqlite3_tables + echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" + fi else - # create the database and tables - echo "Hmm, it doesn't look like you have an existing database." - echo "Creating SQLite database..." - %{script_dir}/create_sqlite3_database - echo "Creating the SQLite tables..." - %{script_dir}/make_sqlite3_tables - chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db + # create the database and tables + echo "Hmm, doesn't look like you have an existing database." + echo "Creating SQLite database..." + %{script_dir}/create_sqlite3_database + chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db + echo "Creating the SQLite tables..." + %{script_dir}/make_sqlite3_tables fi %endif @@ -1269,8 +1271,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 2.x database -elif [ "$DB_VER" -lt "11" ]; then +# check to see if we need to upgrade a 3.x database +elif [ "$DB_VER" -lt "12" ]; 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 @@ -1362,9 +1364,10 @@ fi %{_libdir}/libbaccfg.* %{_libdir}/libbacfind.* %{_libdir}/libbacpy.* -/usr/share/doc/* +%_prefix/share/doc/* + #opensuse_bs: directories not owned by any package -/etc/bacula +#/etc/bacula %pre client # create the daemon group and user @@ -1429,7 +1432,7 @@ fi %defattr(-,root,%{daemon_group}) %{script_dir}/updatedb/* #oensuse_bs: directories not owned by any package -%{script_dir}/updatedb +#%{script_dir}/updatedb %pre updatedb # create the daemon group @@ -1445,8 +1448,18 @@ echo "The database update scripts were installed to %{script_dir}/updatedb" %endif %changelog +* Sat Jan 30 2010 D. Scott Barninger +- 5.0.0 +- add su112 and fc10 builds, remove doc package declaration. +- fix source path for logwatch files. +- restore static bundled build of sqlite (who took that out?) and remove use +- of system sqlite. we don't support use of sqlite2. +- upgrade database from version 11 to 12. * Mon Aug 10 2009 Philipp Storz - changes to work with opensuse build service +* Sat Aug 1 2009 Kern Sibbald +- Split docs into separate bacula-docs.spec, bacula-bat.spec and bacula-mtx.spec +- removed build of rescue, gnome console and wxconsole * Sat Jun 20 2009 D. Scott Barninger - Fix bat install which is now handled by make and uses shared libs * Sat May 16 2009 D. Scott Barninger diff --git a/bacula/src/cats/make_sqlite3_tables.in.patch b/bacula/src/cats/make_sqlite3_tables.in.patch index 125f105bba..06b577b2bb 100644 --- a/bacula/src/cats/make_sqlite3_tables.in.patch +++ b/bacula/src/cats/make_sqlite3_tables.in.patch @@ -1,11 +1,11 @@ ---- make_sqlite3_tables.in 2007-11-17 08:33:03.000000000 -0500 -+++ make_sqlite3_tables.in.fixed 2007-11-17 08:35:28.000000000 -0500 +--- ./make_sqlite3_tables.in 2010-01-25 02:56:28.000000000 -0500 ++++ ../../../bacula-5.0.0-fixed/src/cats/make_sqlite3_tables.in 2010-01-31 10:09:50.000000000 -0500 @@ -2,7 +2,7 @@ # # shell script to create Bacula SQLite tables -bindir=@SQL_BINDIR@ +bindir=/usr/lib/bacula/sqlite + PATH="$bindir:$PATH" cd @working_dir@ sqlite=@DB_TYPE@ - db_name=@db_name@ diff --git a/bacula/src/cats/update_sqlite3_tables.in.patch b/bacula/src/cats/update_sqlite3_tables.in.patch index 6d7d2164ab..5b2a36b8de 100644 --- a/bacula/src/cats/update_sqlite3_tables.in.patch +++ b/bacula/src/cats/update_sqlite3_tables.in.patch @@ -1,11 +1,11 @@ ---- update_sqlite3_tables.in 2007-11-17 08:33:18.000000000 -0500 -+++ update_sqlite3_tables.in.fixed 2007-11-17 08:35:50.000000000 -0500 -@@ -9,7 +9,7 @@ +--- ./update_sqlite3_tables.in 2010-01-25 02:56:28.000000000 -0500 ++++ ../../../bacula-5.0.0-fixed/src/cats/update_sqlite3_tables.in 2010-01-31 10:22:52.000000000 -0500 +@@ -11,7 +11,7 @@ echo "this script may take several minutes to run." echo " " -bindir=@SQL_BINDIR@ +bindir=/usr/lib/bacula/sqlite + PATH="$bindir:$PATH" cd @working_dir@ sqlite=@DB_TYPE@ - db_name=@db_name@ -- 2.39.5