###########################################################################################
 # script configuration section
 
-VERSION=2.4.1
+VERSION=3.0.0
 RELEASE=1
 
 # build platform for spec
 # set to empty (for MySQL 3), 4 or 5
 MYSQL=5
 
-# building wxconsole
-# set to 1 to build wxconsole package else set 0
-WXCONSOLE=0
-
-# building bat
-# set to 1 to build bat package else set 0
-BAT=0
-
 # enter your name and email address here
 PACKAGER="Your Name <your-email@site.org>"
 
 
 echo Building MySQL packages for "$PLATFORM"...
 sleep 2
-if [ "$WXCONSOLE" = "1" ]; then
-rpmbuild --rebuild --define "build_${PLATFORM} 1" \
---define "build_mysql${MYSQL} 1" \
---define "contrib_packager ${PACKAGER}" \
---define "build_python 1" \
---define "build_wxconsole 1" \
-${SRPM}
-else
 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
 --define "build_mysql${MYSQL} 1" \
 --define "build_python 1" \
+--define "nobuild_gconsole 1" \
 --define "contrib_packager ${PACKAGER}" ${SRPM}
-fi
 rm -rf ${RPMBUILD}/*
 
 echo Building PostgreSQL packages for "$PLATFORM"...
 sleep 2
-if [ "$BAT" = "1" ]; then
 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}
-else
-rpmbuild --rebuild --define "build_${PLATFORM} 1" \
---define "build_postgresql 1" \
---define "contrib_packager ${PACKAGER}" \
---define "build_python 1" \
---define "nobuild_gconsole 1" ${SRPM}
-fi
 rm -rf ${RPMBUILD}/*
 
 echo Building SQLite packages for "$PLATFORM"...
 mv -f ${RPMDIR}/bacula-client-${VERSION}-${RELEASE}.${ARCH}.rpm \
 ./bacula-client-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm
 
-mv -f ${RPMDIR}/bacula-gconsole-${VERSION}-${RELEASE}.${ARCH}.rpm \
-./bacula-gconsole-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm
-
-mv -f ${RPMDIR}/bacula-wxconsole-${VERSION}-${RELEASE}.${ARCH}.rpm \
-./bacula-wxconsole-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm
-
 mv -f ${RPMDIR}/bacula-bat-${VERSION}-${RELEASE}.${ARCH}.rpm \
 ./bacula-bat-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm
 
 # 28 Jun 2008 add su110
 # 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
 
 # specifically disallow gconsole if desired
 %{?nobuild_gconsole:%define gconsole 0}
 
-# specifically disallow rescue files if desired
-%define rescue 1
-%{?nobuild_rescue:%define rescue 0}
+# specifically disallow rescue files
+%define rescue 0
+%{?build_rescue:%define rescue 1}
 
 # Should we build wxconsole, only wxWidgets >=2.6 is supported
 # SuSE 10 and FC4 and newer
        --disable-batch-insert \
 %endif
        --mandir=%{_mandir} \
+       --with-plugindir=%{script_dir} \
         --with-subsys-dir=%{_subsysdir} \
         --with-dir-user=%{director_daemon_user} \
         --with-dir-group=%{daemon_group} \
 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
 %endif
 
-make \
-        prefix=$RPM_BUILD_ROOT%{_prefix} \
-        sbindir=$RPM_BUILD_ROOT%{_sbindir} \
-       sysconfdir=$RPM_BUILD_ROOT%{sysconf_dir} \
-       scriptdir=$RPM_BUILD_ROOT%{script_dir} \
-        working_dir=$RPM_BUILD_ROOT%{working_dir} \
-       piddir=$RPM_BUILD_ROOT%{pid_dir} \
-       mandir=$RPM_BUILD_ROOT%{_mandir} \
-        install
+%makeinstall
 
 %if ! %{client_only} && %{mtx}
 cd %{depkgs}
 cp -p src/qt-console/bat.conf $RPM_BUILD_ROOT%{sysconf_dir}/bat.conf
 %endif
 
+# remove the docs installed by make
+%if ! %{single_dir}
+rm -rf $RPM_BUILD_ROOT/usr/share/doc
+%endif
+
 # install docs for single dir installation
 %if %{single_dir}
 mkdir $RPM_BUILD_ROOT%{_prefix}/doc
 cp ChangeLog $RPM_BUILD_ROOT%{_prefix}/doc/
 cp ReleaseNotes $RPM_BUILD_ROOT%{_prefix}/doc/
 cp VERIFYING $RPM_BUILD_ROOT%{_prefix}/doc/
+cp LICENSE $RPM_BUILD_ROOT%{_prefix}/doc/
 cp kernstodo $RPM_BUILD_ROOT%{_prefix}/doc/
 cp %{_docsrc}/manual/bacula.pdf $RPM_BUILD_ROOT%{_prefix}/doc/
 cp %{_docsrc}/developers/developers.pdf $RPM_BUILD_ROOT%{_prefix}/doc/
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
+%attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
+%attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer.conf
 
 /etc/logrotate.d/bacula
 /etc/log.d/scripts/services/bacula
 %{_sbindir}/bacula-dir
 %{_sbindir}/bacula-fd
 %{_sbindir}/bacula-sd
+%{_sbindir}/bacula
 %{_sbindir}/bcopy
 %{_sbindir}/bextract
 %{_sbindir}/bls
 %{_mandir}/man8/btraceback.8.%{manpage_ext}
 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
+%{_libdir}/libbac*
 %endif
 
 %if ! %{client_only} && %{rescue}
 %endif
 
 %if ! %{client_only} && ! %{single_dir}
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc COPYING ChangeLog ReleaseNotes LICENSE VERIFYING kernstodo 
 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
 %endif
 
 
 %if %{mysql}
 %pre mysql
-# test for bacula database older than version 9
+# test for bacula database older than version 10
 # 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
        echo "chown bacula.bacula bacula.db"
        exit 1
 fi
-# test for bacula database older than version 9 and sqlite3
+# test for bacula database older than version 10 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
 %endif
 
 %if ! %{client_only}
-if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "9" ]; then
-        echo "This bacula upgrade will update a bacula database from version 9 to 10."
+if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "10" ]; then
+        echo "This bacula upgrade will update a bacula database from version 10 to 11."
         echo "You appear to be running database version $DB_VER. You must first update"
-        echo "your database to version 9 and then install this upgrade. The alternative"
+        echo "your database to version 10 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 9 can be found in the release notes."
+        echo "database older than version 10 can be found in the release notes."
         exit 1
 fi
 %endif
         echo "Creating bacula tables..."
        %{script_dir}/make_mysql_tables
 
-# check to see if we need to upgrade a 1.38 or lower database
-elif [ "$DB_VER" -lt "10" ]; then
+# check to see if we need to upgrade a 2.x database
+elif [ "$DB_VER" -lt "11" ]; 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
 # test for an existing database
 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 1.38 or lower database
-        if [ "$DB_VER" -lt "10" ] && [ "$DB_VER" -ge "9" ]; then
+        # 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" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
         echo "Granting privileges for PostgreSQL user bacula..."
        %{script_dir}/grant_postgresql_privileges
 
-# check to see if we need to upgrade a 1.38 or lower database
-elif [ "$DB_VER" -lt "10" ]; then
+# check to see if we need to upgrade a 2.x database
+elif [ "$DB_VER" -lt "11" ]; 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
 fi
 %endif
 
+/sbin/ldconfig
+
 %if %{mysql}
 %preun mysql
 %endif
 fi
 %endif
 
+%if %{mysql}
+%postun mysql
+%endif
+%if %{sqlite}
+%postun sqlite
+%endif
+%if %{postgresql}
+%postun postgresql
+%endif
+
+/sbin/ldconfig
+
 
 %if ! %{client_only} && %{mtx}
 %files mtx
 %endif
 
 %if ! %{single_dir}
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc COPYING ChangeLog ReleaseNotes LICENSE VERIFYING kernstodo 
 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
 %else
 %{_prefix}/doc
 %{_mandir}/man8/bacula.8.%{manpage_ext}
 %{_mandir}/man8/bconsole.8.%{manpage_ext}
 %{_mandir}/man8/btraceback.8.%{manpage_ext}
+%{_libdir}/libbac*
 
 
 %pre client
         done
 fi
 
+/sbin/ldconfig
+
 %preun client
 # delete our link
 if [ $1 = 0 ]; then
 /sbin/chkconfig --del bacula-fd
 fi
 
+%postun client
+/sbin/ldconfig
+
 %if ! %{client_only}
 %files updatedb
 %defattr(-,root,%{daemon_group})
 %endif
 
 %changelog
+* Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- 3.0.0 release
+- database update version 10 to 11
+- make now installs docs so we rm from buildroot
+- add shared libs in %_libdir and other misc new files
 * Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
 - add su111 target
 * Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
 
 # specifically disallow gconsole if desired
 %{?nobuild_gconsole:%define gconsole 0}
 
-# specifically disallow rescue files if desired
-%define rescue 1
-%{?nobuild_rescue:%define rescue 0}
+# specifically disallow rescue files
+%define rescue 0
+%{?build_rescue:%define rescue 1}
 
 # Should we build wxconsole, only wxWidgets >=2.6 is supported
 # SuSE 10 and FC4 and newer
        --disable-batch-insert \
 %endif
        --mandir=%{_mandir} \
+       --with-plugindir=%{script_dir} \
         --with-subsys-dir=%{_subsysdir} \
         --with-dir-user=%{director_daemon_user} \
         --with-dir-group=%{daemon_group} \
 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
 %endif
 
-make \
-        prefix=$RPM_BUILD_ROOT%{_prefix} \
-        sbindir=$RPM_BUILD_ROOT%{_sbindir} \
-       sysconfdir=$RPM_BUILD_ROOT%{sysconf_dir} \
-       scriptdir=$RPM_BUILD_ROOT%{script_dir} \
-        working_dir=$RPM_BUILD_ROOT%{working_dir} \
-       piddir=$RPM_BUILD_ROOT%{pid_dir} \
-       mandir=$RPM_BUILD_ROOT%{_mandir} \
-        install
+%makeinstall
 
 %if ! %{client_only} && %{mtx}
 cd %{depkgs}
 cp -p src/qt-console/bat.conf $RPM_BUILD_ROOT%{sysconf_dir}/bat.conf
 %endif
 
+# remove the docs installed by make
+%if ! %{single_dir}
+rm -rf $RPM_BUILD_ROOT/usr/share/doc
+%endif
+
 # install docs for single dir installation
 %if %{single_dir}
 mkdir $RPM_BUILD_ROOT%{_prefix}/doc
 cp ChangeLog $RPM_BUILD_ROOT%{_prefix}/doc/
 cp ReleaseNotes $RPM_BUILD_ROOT%{_prefix}/doc/
 cp VERIFYING $RPM_BUILD_ROOT%{_prefix}/doc/
+cp LICENSE $RPM_BUILD_ROOT%{_prefix}/doc/
 cp kernstodo $RPM_BUILD_ROOT%{_prefix}/doc/
 cp %{_docsrc}/manual/bacula.pdf $RPM_BUILD_ROOT%{_prefix}/doc/
 cp %{_docsrc}/developers/developers.pdf $RPM_BUILD_ROOT%{_prefix}/doc/
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
+%attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
+%attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer.conf
 
 /etc/logrotate.d/bacula
 /etc/log.d/scripts/services/bacula
 %{_sbindir}/bacula-dir
 %{_sbindir}/bacula-fd
 %{_sbindir}/bacula-sd
+%{_sbindir}/bacula
 %{_sbindir}/bcopy
 %{_sbindir}/bextract
 %{_sbindir}/bls
 %{_mandir}/man8/btraceback.8.%{manpage_ext}
 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
+%{_libdir}/libbac*
 %endif
 
 %if ! %{client_only} && %{rescue}
 %endif
 
 %if ! %{client_only} && ! %{single_dir}
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc COPYING ChangeLog ReleaseNotes LICENSE VERIFYING kernstodo 
 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
 %endif
 
 
 %if %{mysql}
 %pre mysql
-# test for bacula database older than version 9
+# test for bacula database older than version 10
 # 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
        echo "chown bacula.bacula bacula.db"
        exit 1
 fi
-# test for bacula database older than version 9 and sqlite3
+# test for bacula database older than version 10 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
 %endif
 
 %if ! %{client_only}
-if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "9" ]; then
-        echo "This bacula upgrade will update a bacula database from version 9 to 10."
+if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "10" ]; then
+        echo "This bacula upgrade will update a bacula database from version 10 to 11."
         echo "You appear to be running database version $DB_VER. You must first update"
-        echo "your database to version 9 and then install this upgrade. The alternative"
+        echo "your database to version 10 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 9 can be found in the release notes."
+        echo "database older than version 10 can be found in the release notes."
         exit 1
 fi
 %endif
         echo "Creating bacula tables..."
        %{script_dir}/make_mysql_tables
 
-# check to see if we need to upgrade a 1.38 or lower database
-elif [ "$DB_VER" -lt "10" ]; then
+# check to see if we need to upgrade a 2.x database
+elif [ "$DB_VER" -lt "11" ]; 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
 # test for an existing database
 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 1.38 or lower database
-        if [ "$DB_VER" -lt "10" ] && [ "$DB_VER" -ge "9" ]; then
+        # 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" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
         echo "Granting privileges for PostgreSQL user bacula..."
        %{script_dir}/grant_postgresql_privileges
 
-# check to see if we need to upgrade a 1.38 or lower database
-elif [ "$DB_VER" -lt "10" ]; then
+# check to see if we need to upgrade a 2.x database
+elif [ "$DB_VER" -lt "11" ]; 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
 fi
 %endif
 
+/sbin/ldconfig
+
 %if %{mysql}
 %preun mysql
 %endif
 fi
 %endif
 
+%if %{mysql}
+%postun mysql
+%endif
+%if %{sqlite}
+%postun sqlite
+%endif
+%if %{postgresql}
+%postun postgresql
+%endif
+
+/sbin/ldconfig
+
 
 %if ! %{client_only} && %{mtx}
 %files mtx
 %endif
 
 %if ! %{single_dir}
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc COPYING ChangeLog ReleaseNotes LICENSE VERIFYING kernstodo 
 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
 %else
 %{_prefix}/doc
 %{_mandir}/man8/bacula.8.%{manpage_ext}
 %{_mandir}/man8/bconsole.8.%{manpage_ext}
 %{_mandir}/man8/btraceback.8.%{manpage_ext}
+%{_libdir}/libbac*
 
 
 %pre client
         done
 fi
 
+/sbin/ldconfig
+
 %preun client
 # delete our link
 if [ $1 = 0 ]; then
 /sbin/chkconfig --del bacula-fd
 fi
 
+%postun client
+/sbin/ldconfig
+
 %if ! %{client_only}
 %files updatedb
 %defattr(-,root,%{daemon_group})
 %endif
 
 %changelog
+* Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- 3.0.0 release
+- database update version 10 to 11
+- make now installs docs so we rm from buildroot
+- add shared libs in %_libdir and other misc new files
 * Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
 - add su111 target
 * Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
 
 # specifically disallow gconsole if desired
 %{?nobuild_gconsole:%define gconsole 0}
 
-# specifically disallow rescue files if desired
-%define rescue 1
-%{?nobuild_rescue:%define rescue 0}
+# specifically disallow rescue files
+%define rescue 0
+%{?build_rescue:%define rescue 1}
 
 # Should we build wxconsole, only wxWidgets >=2.6 is supported
 # SuSE 10 and FC4 and newer
        --disable-batch-insert \
 %endif
        --mandir=%{_mandir} \
+       --with-plugindir=%{script_dir} \
         --with-subsys-dir=%{_subsysdir} \
         --with-dir-user=%{director_daemon_user} \
         --with-dir-group=%{daemon_group} \
 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
 %endif
 
-make \
-        prefix=$RPM_BUILD_ROOT%{_prefix} \
-        sbindir=$RPM_BUILD_ROOT%{_sbindir} \
-       sysconfdir=$RPM_BUILD_ROOT%{sysconf_dir} \
-       scriptdir=$RPM_BUILD_ROOT%{script_dir} \
-        working_dir=$RPM_BUILD_ROOT%{working_dir} \
-       piddir=$RPM_BUILD_ROOT%{pid_dir} \
-       mandir=$RPM_BUILD_ROOT%{_mandir} \
-        install
+%makeinstall
 
 %if ! %{client_only} && %{mtx}
 cd %{depkgs}
 cp -p src/qt-console/bat.conf $RPM_BUILD_ROOT%{sysconf_dir}/bat.conf
 %endif
 
+# remove the docs installed by make
+%if ! %{single_dir}
+rm -rf $RPM_BUILD_ROOT/usr/share/doc
+%endif
+
 # install docs for single dir installation
 %if %{single_dir}
 mkdir $RPM_BUILD_ROOT%{_prefix}/doc
 cp ChangeLog $RPM_BUILD_ROOT%{_prefix}/doc/
 cp ReleaseNotes $RPM_BUILD_ROOT%{_prefix}/doc/
 cp VERIFYING $RPM_BUILD_ROOT%{_prefix}/doc/
+cp LICENSE $RPM_BUILD_ROOT%{_prefix}/doc/
 cp kernstodo $RPM_BUILD_ROOT%{_prefix}/doc/
 cp %{_docsrc}/manual/bacula.pdf $RPM_BUILD_ROOT%{_prefix}/doc/
 cp %{_docsrc}/developers/developers.pdf $RPM_BUILD_ROOT%{_prefix}/doc/
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
+%attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
+%attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer.conf
 
 /etc/logrotate.d/bacula
 /etc/log.d/scripts/services/bacula
 %{_sbindir}/bacula-dir
 %{_sbindir}/bacula-fd
 %{_sbindir}/bacula-sd
+%{_sbindir}/bacula
 %{_sbindir}/bcopy
 %{_sbindir}/bextract
 %{_sbindir}/bls
 %{_mandir}/man8/btraceback.8.%{manpage_ext}
 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
+%{_libdir}/libbac*
 %endif
 
 %if ! %{client_only} && %{rescue}
 %endif
 
 %if ! %{client_only} && ! %{single_dir}
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc COPYING ChangeLog ReleaseNotes LICENSE VERIFYING kernstodo 
 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
 %endif
 
 
 %if %{mysql}
 %pre mysql
-# test for bacula database older than version 9
+# test for bacula database older than version 10
 # 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
        echo "chown bacula.bacula bacula.db"
        exit 1
 fi
-# test for bacula database older than version 9 and sqlite3
+# test for bacula database older than version 10 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
 %endif
 
 %if ! %{client_only}
-if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "9" ]; then
-        echo "This bacula upgrade will update a bacula database from version 9 to 10."
+if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "10" ]; then
+        echo "This bacula upgrade will update a bacula database from version 10 to 11."
         echo "You appear to be running database version $DB_VER. You must first update"
-        echo "your database to version 9 and then install this upgrade. The alternative"
+        echo "your database to version 10 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 9 can be found in the release notes."
+        echo "database older than version 10 can be found in the release notes."
         exit 1
 fi
 %endif
         echo "Creating bacula tables..."
        %{script_dir}/make_mysql_tables
 
-# check to see if we need to upgrade a 1.38 or lower database
-elif [ "$DB_VER" -lt "10" ]; then
+# check to see if we need to upgrade a 2.x database
+elif [ "$DB_VER" -lt "11" ]; 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
 # test for an existing database
 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 1.38 or lower database
-        if [ "$DB_VER" -lt "10" ] && [ "$DB_VER" -ge "9" ]; then
+        # 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" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
         echo "Granting privileges for PostgreSQL user bacula..."
        %{script_dir}/grant_postgresql_privileges
 
-# check to see if we need to upgrade a 1.38 or lower database
-elif [ "$DB_VER" -lt "10" ]; then
+# check to see if we need to upgrade a 2.x database
+elif [ "$DB_VER" -lt "11" ]; 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
 fi
 %endif
 
+/sbin/ldconfig
+
 %if %{mysql}
 %preun mysql
 %endif
 fi
 %endif
 
+%if %{mysql}
+%postun mysql
+%endif
+%if %{sqlite}
+%postun sqlite
+%endif
+%if %{postgresql}
+%postun postgresql
+%endif
+
+/sbin/ldconfig
+
 
 %if ! %{client_only} && %{mtx}
 %files mtx
 %endif
 
 %if ! %{single_dir}
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
+%doc COPYING ChangeLog ReleaseNotes LICENSE VERIFYING kernstodo 
 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
 %else
 %{_prefix}/doc
 %{_mandir}/man8/bacula.8.%{manpage_ext}
 %{_mandir}/man8/bconsole.8.%{manpage_ext}
 %{_mandir}/man8/btraceback.8.%{manpage_ext}
+%{_libdir}/libbac*
 
 
 %pre client
         done
 fi
 
+/sbin/ldconfig
+
 %preun client
 # delete our link
 if [ $1 = 0 ]; then
 /sbin/chkconfig --del bacula-fd
 fi
 
+%postun client
+/sbin/ldconfig
+
 %if ! %{client_only}
 %files updatedb
 %defattr(-,root,%{daemon_group})
 %endif
 
 %changelog
+* Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- 3.0.0 release
+- database update version 10 to 11
+- make now installs docs so we rm from buildroot
+- add shared libs in %_libdir and other misc new files
 * Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
 - add su111 target
 * Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>