From: Scott Barninger Date: Sun, 8 Apr 2007 14:24:04 +0000 (+0000) Subject: Merge Otto Mueller's patch for FSH compat. Add scientific linux target. X-Git-Tag: Release-7.0.0~6604 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=46fe242c15f899415033175d2f0072fc16c2a9da;p=bacula%2Fbacula Merge Otto Mueller's patch for FSH compat. Add scientific linux target. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4523 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/platforms/mandrake/bacula.spec.in b/bacula/platforms/mandrake/bacula.spec.in index 63d2ae8f0e..6eb90603b4 100644 --- a/bacula/platforms/mandrake/bacula.spec.in +++ b/bacula/platforms/mandrake/bacula.spec.in @@ -51,12 +51,17 @@ Packager: %{_packager} # directory locations %define sqlite_bindir /usr/lib/bacula/sqlite -%define working_dir /var/bacula %define _docsrc ../%{name}-docs-%{docs_version} %define _rescuesrc ../%{name}-rescue-%{_rescuever} %define depkgs ../depkgs %define _mandir /usr/share/man +# directory locations for FHS-compatibility +%define sysconf_dir /etc/bacula +%define script_dir /etc/bacula +%define working_dir /var/lib/bacula +%define pid_dir /var/run + # NOTE these defines are used in some rather complex useradd and groupadd # commands. If you change them examine the post scripts for consequences. %define director_daemon_user bacula @@ -109,6 +114,13 @@ Packager: %{_packager} %define centos4 0 %{?build_centos4:%define centos4 1} %{?build_centos4:%define fc3 1} +# SL build +%define sl3 0 +%{?build_sl3:%define sl3 1} +%{?build_sl3:%define wb3 1} +%define sl4 0 +%{?build_sl4:%define sl4 1} +%{?build_sl4:%define fc3 1} # SuSE build %define su9 0 %{?build_su9:%define su9 1} @@ -182,10 +194,13 @@ exit 1 %if %{centos4} || %{centos3} %define _dist %(grep CentOS /etc/redhat-release) %endif -%if %{fc3} && ! %{rhel4} && ! %{centos4} +%if %{sl4} || %{sl3} +%define _dist %(grep 'Scientific Linux' /etc/redhat-release) +%endif +%if %{fc3} && ! %{rhel4} && ! %{centos4} && ! %{sl4} %define _dist %(grep Fedora /etc/redhat-release) %endif -%if %{wb3} && ! %{rhel3} && ! %{centos3} +%if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3} %define _dist %(grep White /etc/whitebox-release) %endif %if %{su9} || %{su10} || %{su102} @@ -957,8 +972,10 @@ export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}" %configure \ --prefix=/usr \ --sbindir=/usr/sbin \ - --sysconfdir=/etc/bacula \ - --with-scriptdir=/etc/bacula \ + --sysconfdir=%{sysconf_dir} \ + --with-scriptdir=%{script_dir} \ + --with-working-dir=%{working_dir} \ + --with-pid-dir=%{pid_dir} \ --enable-smartalloc \ --enable-client-only \ %if %{mdk} @@ -971,8 +988,10 @@ make %configure \ --prefix=/usr \ --sbindir=/usr/sbin \ - --sysconfdir=/etc/bacula \ - --with-scriptdir=/etc/bacula \ + --sysconfdir=%{sysconf_dir} \ + --with-scriptdir=%{script_dir} \ + --with-working-dir=%{working_dir} \ + --with-pid-dir=%{pid_dir} \ --enable-smartalloc \ %if %{gconsole} --enable-gnome \ @@ -999,8 +1018,6 @@ make --enable-client-only \ %endif --mandir=%{_mandir} \ - --with-working-dir=%{working_dir} \ - --with-pid-dir=/var/run \ --with-subsys-dir=/var/lock/subsys \ --with-dir-user=%{director_daemon_user} \ --with-dir-group=%{daemon_group} \ @@ -1027,7 +1044,7 @@ mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services -mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb +mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb %if %{gconsole} || %{wxconsole} mkdir -p $RPM_BUILD_ROOT/usr/share/applications @@ -1053,9 +1070,10 @@ mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir} make \ prefix=$RPM_BUILD_ROOT/usr \ sbindir=$RPM_BUILD_ROOT/usr/sbin \ - sysconfdir=$RPM_BUILD_ROOT/etc/bacula \ - scriptdir=$RPM_BUILD_ROOT/etc/bacula \ + 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 @@ -1064,8 +1082,10 @@ cd %{depkgs} make \ prefix=$RPM_BUILD_ROOT/usr \ sbindir=$RPM_BUILD_ROOT/usr/sbin \ - sysconfdir=$RPM_BUILD_ROOT/etc/bacula \ + 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} \ mtx-install cd ${cwd} @@ -1094,20 +1114,20 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.gz # fixme - make installs the mysql scripts for sqlite build %if %{sqlite} -rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges +rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges %endif # fixme - make installs the mysql scripts for postgresql build %if %{postgresql} -rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql %endif # fixme - make installs gconsole script for build without gconsole %if ! %{gconsole} -rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole +rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole %endif rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd @@ -1196,7 +1216,7 @@ cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula # install the updatedb scripts -cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/ +cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/ # install the logwatch scripts %if ! %{client_only} @@ -1209,43 +1229,43 @@ chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf %endif # install the rescue files -mkdir $RPM_BUILD_ROOT/etc/bacula/rescue -cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/ -touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release -cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd +mkdir $RPM_BUILD_ROOT%{sysconf_dir}/rescue +cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +touch $RPM_BUILD_ROOT%{sysconf_dir}/rescue/linux/cdrom/rpm_release +cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT%{sysconf_dir}/rescue/linux/cdrom/bacula/bin/bacula-fd rm -f src/filed/static-bacula-fd %if %{wxconsole} mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole -mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf +mv $RPM_BUILD_ROOT%{sysconf_dir}/wx-console.conf $RPM_BUILD_ROOT%{sysconf_dir}/wxconsole.conf %endif # now clean up permissions that are left broken by the install %if ! %{client_only} -chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql +chmod o-r $RPM_BUILD_ROOT%{script_dir}/query.sql %endif chmod o-rwx $RPM_BUILD_ROOT%{working_dir} %if %{gconsole} && ! %{rh8} chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor -chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf +chmod 644 $RPM_BUILD_ROOT%{sysconf_dir}/tray-monitor.conf %endif # fix me - building enable-client-only installs files not included in bacula-client package %if %{client_only} -rm -f $RPM_BUILD_ROOT/etc/bacula/bacula -rm -f $RPM_BUILD_ROOT/etc/bacula/bacula-ctl-dir -rm -f $RPM_BUILD_ROOT/etc/bacula/bacula-ctl-sd -rm -f $RPM_BUILD_ROOT/etc/bacula/disk-changer -rm -f $RPM_BUILD_ROOT/etc/bacula/dvd-handler -rm -f $RPM_BUILD_ROOT/etc/bacula/mtx-changer -rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql -rm -rf $RPM_BUILD_ROOT/etc/bacula/updatedb +rm -f $RPM_BUILD_ROOT%{script_dir}/bacula +rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir +rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd +rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer +rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler +rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer +rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql +rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb %endif %clean @@ -1259,25 +1279,25 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt # MySQL specific files %files mysql %defattr(-, root, root) -%attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database -%attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges -%attr(-, root, %{daemon_group}) /etc/bacula/startmysql -%attr(-, root, %{daemon_group}) /etc/bacula/stopmysql +%attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database +%attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database +%attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables +%attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables +%attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables +%attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/startmysql +%attr(-, root, %{daemon_group}) %{script_dir}/stopmysql %endif %if %{sqlite} %files sqlite %defattr(-,root,root) -%attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database -%attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges -%attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables +%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 %{sqlite_bindir}/libsqlite.a %{sqlite_bindir}/sqlite.h %{sqlite_bindir}/sqlite @@ -1286,52 +1306,52 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %if %{postgresql} %files postgresql %defattr(-,root,root) -%attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database -%attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database +%attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database +%attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables +%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 %endif # The rest is DB backend independent %if ! %{client_only} -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/bconsole -%attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database -%attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges -%attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables -%attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup -%attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb -%attr(-, root, %{daemon_group}) /etc/bacula/rescue -%attr(-, root, %{daemon_group}) /etc/bacula/disk-changer -%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir -%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd -%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd +%attr(-, root, %{daemon_group}) %dir %{script_dir} +%attr(-, root, %{daemon_group}) %{script_dir}/bacula +%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 +%attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables +%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}/delete_catalog_backup +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb +%attr(-, root, %{daemon_group}) %{sysconf_dir}/rescue +%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 +%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd -%attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler +%attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd -%attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer +%attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt /etc/logrotate.d/bacula /etc/log.d/scripts/services/bacula -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf -%attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf +%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/log.d/conf/logfiles/bacula.conf %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/query.sql +%attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir} @@ -1388,7 +1408,7 @@ if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "9" ]; then echo "This bacula upgrade will update a bacula database from version 9 to 10." 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 "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current" + 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." exit 1 @@ -1400,9 +1420,9 @@ fi %endif %if ! %{client_only} -# check for and copy /etc/bacula/console.conf to bconsole.conf -if [ -s /etc/bacula/console.conf ];then - cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf +# check for and copy %{sysconf_dir}/console.conf to bconsole.conf +if [ -s %{sysconf_dir}/console.conf ];then + cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf fi # create the daemon users and groups @@ -1484,11 +1504,11 @@ DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1` if [ -z "$DB_VER" ]; then echo "Hmm, doesn't look like you have an existing database." echo "Granting privileges for MySQL user bacula..." - /etc/bacula/grant_mysql_privileges + %{script_dir}/grant_mysql_privileges echo "Creating MySQL bacula database..." - /etc/bacula/create_mysql_database + %{script_dir}/create_mysql_database echo "Creating bacula tables..." - /etc/bacula/make_mysql_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 @@ -1496,7 +1516,7 @@ elif [ "$DB_VER" -lt "10" ]; then echo "Backing up your current database..." mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - /etc/bacula/update_mysql_tables + %{script_dir}/update_mysql_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi @@ -1512,16 +1532,16 @@ if [ -s %{working_dir}/bacula.db ]; then echo "Backing up your current database..." echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - /etc/bacula/update_sqlite_tables + %{script_dir}/update_sqlite_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, doesn't look like you have an existing database." echo "Creating SQLite database..." - /etc/bacula/create_sqlite_database + %{script_dir}/create_sqlite_database echo "Creating the SQLite tables..." - /etc/bacula/make_sqlite_tables + %{script_dir}/make_sqlite_tables fi %endif @@ -1534,11 +1554,11 @@ DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head if [ -z "$DB_VER" ]; then echo "Hmm, doesn't look like you have an existing database." echo "Creating PostgreSQL bacula database..." - /etc/bacula/create_postgresql_database + %{script_dir}/create_postgresql_database echo "Creating bacula tables..." - /etc/bacula/make_postgresql_tables + %{script_dir}/make_postgresql_tables echo "Granting privileges for PostgreSQL user bacula..." - /etc/bacula/grant_postgresql_privileges + %{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 @@ -1546,7 +1566,7 @@ elif [ "$DB_VER" -lt "10" ]; then echo "Backing up your current database..." pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - /etc/bacula/update_postgresql_tables + %{script_dir}/update_postgresql_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi @@ -1554,8 +1574,8 @@ fi %if ! %{client_only} # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1602,29 +1622,28 @@ fi %{_mandir}/man1/tapeinfo.1.%{manpage_ext} %endif - %files client %defattr(-,root,root) -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/bconsole -/etc/bacula/bacula-ctl-fd +%attr(-, root, %{daemon_group}) %dir %{script_dir} +%attr(-, root, %{daemon_group}) %{script_dir}/bconsole +%{script_dir}/bacula-ctl-fd /etc/init.d/bacula-fd -%attr(-, root, %{daemon_group}) /etc/bacula/rescue +%attr(-, root, %{daemon_group}) %{sysconf_dir}/rescue %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt /etc/logrotate.d/bacula -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf %attr(-, root, %{daemon_group}) %dir %{working_dir} /usr/sbin/bacula-fd /usr/sbin/btraceback -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx /usr/sbin/bconsole %{_mandir}/man8/bacula-fd.8.%{manpage_ext} %{_mandir}/man8/bacula.8.%{manpage_ext} @@ -1662,8 +1681,8 @@ if [ "$1" -ge 1 ] ; then fi # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1685,7 +1704,7 @@ fi %if ! %{client_only} %files updatedb %defattr(-,root,%{daemon_group}) -/etc/bacula/updatedb/* +%{script_dir}/updatedb/* %pre updatedb # create the daemon group @@ -1697,16 +1716,16 @@ if [ -z "$HAVE_BACULA" ]; then fi %post updatedb -echo "The database update scripts were installed to /etc/bacula/updatedb" +echo "The database update scripts were installed to %{script_dir}/updatedb" %endif %if %{gconsole} %files gconsole %defattr(-,root,root) /usr/sbin/gnome-console -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/gconsole -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf +%attr(-, root, %{daemon_group}) %dir %{script_dir} +%attr(-, root, %{daemon_group}) %{script_dir}/gconsole +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/gnome-console.conf /usr/share/pixmaps/bacula.png /usr/share/applications/bacula.desktop %{_mandir}/man1/bacula-console-gnome.1.%{manpage_ext} @@ -1714,7 +1733,7 @@ echo "The database update scripts were installed to /etc/bacula/updatedb" %if %{gconsole} && ! %{rh8} /usr/sbin/bacula-tray-monitor -%config(noreplace) /etc/bacula/tray-monitor.conf +%config(noreplace) %{sysconf_dir}/tray-monitor.conf /usr/share/pixmaps/bacula-tray-monitor.xpm /usr/share/applications/bacula-tray-monitor.desktop %{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext} @@ -1739,8 +1758,8 @@ fi %post gconsole # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1758,8 +1777,8 @@ fi %files wxconsole %defattr(-,root,root) /usr/sbin/wxconsole -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf +%attr(-, root, %{daemon_group}) %dir %{sysconf_dir} +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/wxconsole.conf /usr/share/pixmaps/wxwin16x16.xpm /usr/share/applications/wxconsole.desktop %{_mandir}/man1/bacula-wxconsole.1.%{manpage_ext} @@ -1784,8 +1803,8 @@ fi %post wxconsole # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1800,6 +1819,13 @@ fi %endif %changelog +* Sat Apr 08 2007 D. Scott Barninger +- merge Otto Mueller's patch but keep script dir set to /etc/bacula +- add build tag for Scientific Linux per Jon Peatfield +* Tue Mar 27 2007 Otto Mueller +- adjust directory locations for FHS-compatibility + sysconf_dir (/etc/bacula), script_dir (/usr/lib/bacula), + working_dir (/var/lib/bacula) and pid_dir (/var/run) * Mon Feb 26 2007 D. Scott Barninger - add SuSE 10.2 target * Sat Jan 20 2007 D. Scott Barninger diff --git a/bacula/platforms/redhat/bacula.spec.in b/bacula/platforms/redhat/bacula.spec.in index 63d2ae8f0e..6eb90603b4 100644 --- a/bacula/platforms/redhat/bacula.spec.in +++ b/bacula/platforms/redhat/bacula.spec.in @@ -51,12 +51,17 @@ Packager: %{_packager} # directory locations %define sqlite_bindir /usr/lib/bacula/sqlite -%define working_dir /var/bacula %define _docsrc ../%{name}-docs-%{docs_version} %define _rescuesrc ../%{name}-rescue-%{_rescuever} %define depkgs ../depkgs %define _mandir /usr/share/man +# directory locations for FHS-compatibility +%define sysconf_dir /etc/bacula +%define script_dir /etc/bacula +%define working_dir /var/lib/bacula +%define pid_dir /var/run + # NOTE these defines are used in some rather complex useradd and groupadd # commands. If you change them examine the post scripts for consequences. %define director_daemon_user bacula @@ -109,6 +114,13 @@ Packager: %{_packager} %define centos4 0 %{?build_centos4:%define centos4 1} %{?build_centos4:%define fc3 1} +# SL build +%define sl3 0 +%{?build_sl3:%define sl3 1} +%{?build_sl3:%define wb3 1} +%define sl4 0 +%{?build_sl4:%define sl4 1} +%{?build_sl4:%define fc3 1} # SuSE build %define su9 0 %{?build_su9:%define su9 1} @@ -182,10 +194,13 @@ exit 1 %if %{centos4} || %{centos3} %define _dist %(grep CentOS /etc/redhat-release) %endif -%if %{fc3} && ! %{rhel4} && ! %{centos4} +%if %{sl4} || %{sl3} +%define _dist %(grep 'Scientific Linux' /etc/redhat-release) +%endif +%if %{fc3} && ! %{rhel4} && ! %{centos4} && ! %{sl4} %define _dist %(grep Fedora /etc/redhat-release) %endif -%if %{wb3} && ! %{rhel3} && ! %{centos3} +%if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3} %define _dist %(grep White /etc/whitebox-release) %endif %if %{su9} || %{su10} || %{su102} @@ -957,8 +972,10 @@ export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}" %configure \ --prefix=/usr \ --sbindir=/usr/sbin \ - --sysconfdir=/etc/bacula \ - --with-scriptdir=/etc/bacula \ + --sysconfdir=%{sysconf_dir} \ + --with-scriptdir=%{script_dir} \ + --with-working-dir=%{working_dir} \ + --with-pid-dir=%{pid_dir} \ --enable-smartalloc \ --enable-client-only \ %if %{mdk} @@ -971,8 +988,10 @@ make %configure \ --prefix=/usr \ --sbindir=/usr/sbin \ - --sysconfdir=/etc/bacula \ - --with-scriptdir=/etc/bacula \ + --sysconfdir=%{sysconf_dir} \ + --with-scriptdir=%{script_dir} \ + --with-working-dir=%{working_dir} \ + --with-pid-dir=%{pid_dir} \ --enable-smartalloc \ %if %{gconsole} --enable-gnome \ @@ -999,8 +1018,6 @@ make --enable-client-only \ %endif --mandir=%{_mandir} \ - --with-working-dir=%{working_dir} \ - --with-pid-dir=/var/run \ --with-subsys-dir=/var/lock/subsys \ --with-dir-user=%{director_daemon_user} \ --with-dir-group=%{daemon_group} \ @@ -1027,7 +1044,7 @@ mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services -mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb +mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb %if %{gconsole} || %{wxconsole} mkdir -p $RPM_BUILD_ROOT/usr/share/applications @@ -1053,9 +1070,10 @@ mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir} make \ prefix=$RPM_BUILD_ROOT/usr \ sbindir=$RPM_BUILD_ROOT/usr/sbin \ - sysconfdir=$RPM_BUILD_ROOT/etc/bacula \ - scriptdir=$RPM_BUILD_ROOT/etc/bacula \ + 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 @@ -1064,8 +1082,10 @@ cd %{depkgs} make \ prefix=$RPM_BUILD_ROOT/usr \ sbindir=$RPM_BUILD_ROOT/usr/sbin \ - sysconfdir=$RPM_BUILD_ROOT/etc/bacula \ + 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} \ mtx-install cd ${cwd} @@ -1094,20 +1114,20 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.gz # fixme - make installs the mysql scripts for sqlite build %if %{sqlite} -rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges +rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges %endif # fixme - make installs the mysql scripts for postgresql build %if %{postgresql} -rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql %endif # fixme - make installs gconsole script for build without gconsole %if ! %{gconsole} -rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole +rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole %endif rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd @@ -1196,7 +1216,7 @@ cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula # install the updatedb scripts -cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/ +cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/ # install the logwatch scripts %if ! %{client_only} @@ -1209,43 +1229,43 @@ chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf %endif # install the rescue files -mkdir $RPM_BUILD_ROOT/etc/bacula/rescue -cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/ -touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release -cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd +mkdir $RPM_BUILD_ROOT%{sysconf_dir}/rescue +cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +touch $RPM_BUILD_ROOT%{sysconf_dir}/rescue/linux/cdrom/rpm_release +cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT%{sysconf_dir}/rescue/linux/cdrom/bacula/bin/bacula-fd rm -f src/filed/static-bacula-fd %if %{wxconsole} mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole -mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf +mv $RPM_BUILD_ROOT%{sysconf_dir}/wx-console.conf $RPM_BUILD_ROOT%{sysconf_dir}/wxconsole.conf %endif # now clean up permissions that are left broken by the install %if ! %{client_only} -chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql +chmod o-r $RPM_BUILD_ROOT%{script_dir}/query.sql %endif chmod o-rwx $RPM_BUILD_ROOT%{working_dir} %if %{gconsole} && ! %{rh8} chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor -chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf +chmod 644 $RPM_BUILD_ROOT%{sysconf_dir}/tray-monitor.conf %endif # fix me - building enable-client-only installs files not included in bacula-client package %if %{client_only} -rm -f $RPM_BUILD_ROOT/etc/bacula/bacula -rm -f $RPM_BUILD_ROOT/etc/bacula/bacula-ctl-dir -rm -f $RPM_BUILD_ROOT/etc/bacula/bacula-ctl-sd -rm -f $RPM_BUILD_ROOT/etc/bacula/disk-changer -rm -f $RPM_BUILD_ROOT/etc/bacula/dvd-handler -rm -f $RPM_BUILD_ROOT/etc/bacula/mtx-changer -rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql -rm -rf $RPM_BUILD_ROOT/etc/bacula/updatedb +rm -f $RPM_BUILD_ROOT%{script_dir}/bacula +rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir +rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd +rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer +rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler +rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer +rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql +rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb %endif %clean @@ -1259,25 +1279,25 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt # MySQL specific files %files mysql %defattr(-, root, root) -%attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database -%attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges -%attr(-, root, %{daemon_group}) /etc/bacula/startmysql -%attr(-, root, %{daemon_group}) /etc/bacula/stopmysql +%attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database +%attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database +%attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables +%attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables +%attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables +%attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/startmysql +%attr(-, root, %{daemon_group}) %{script_dir}/stopmysql %endif %if %{sqlite} %files sqlite %defattr(-,root,root) -%attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database -%attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges -%attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables +%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 %{sqlite_bindir}/libsqlite.a %{sqlite_bindir}/sqlite.h %{sqlite_bindir}/sqlite @@ -1286,52 +1306,52 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %if %{postgresql} %files postgresql %defattr(-,root,root) -%attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database -%attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database +%attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database +%attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables +%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 %endif # The rest is DB backend independent %if ! %{client_only} -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/bconsole -%attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database -%attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges -%attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables -%attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup -%attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb -%attr(-, root, %{daemon_group}) /etc/bacula/rescue -%attr(-, root, %{daemon_group}) /etc/bacula/disk-changer -%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir -%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd -%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd +%attr(-, root, %{daemon_group}) %dir %{script_dir} +%attr(-, root, %{daemon_group}) %{script_dir}/bacula +%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 +%attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables +%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}/delete_catalog_backup +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb +%attr(-, root, %{daemon_group}) %{sysconf_dir}/rescue +%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 +%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd -%attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler +%attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd -%attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer +%attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt /etc/logrotate.d/bacula /etc/log.d/scripts/services/bacula -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf -%attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf +%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/log.d/conf/logfiles/bacula.conf %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/query.sql +%attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir} @@ -1388,7 +1408,7 @@ if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "9" ]; then echo "This bacula upgrade will update a bacula database from version 9 to 10." 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 "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current" + 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." exit 1 @@ -1400,9 +1420,9 @@ fi %endif %if ! %{client_only} -# check for and copy /etc/bacula/console.conf to bconsole.conf -if [ -s /etc/bacula/console.conf ];then - cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf +# check for and copy %{sysconf_dir}/console.conf to bconsole.conf +if [ -s %{sysconf_dir}/console.conf ];then + cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf fi # create the daemon users and groups @@ -1484,11 +1504,11 @@ DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1` if [ -z "$DB_VER" ]; then echo "Hmm, doesn't look like you have an existing database." echo "Granting privileges for MySQL user bacula..." - /etc/bacula/grant_mysql_privileges + %{script_dir}/grant_mysql_privileges echo "Creating MySQL bacula database..." - /etc/bacula/create_mysql_database + %{script_dir}/create_mysql_database echo "Creating bacula tables..." - /etc/bacula/make_mysql_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 @@ -1496,7 +1516,7 @@ elif [ "$DB_VER" -lt "10" ]; then echo "Backing up your current database..." mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - /etc/bacula/update_mysql_tables + %{script_dir}/update_mysql_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi @@ -1512,16 +1532,16 @@ if [ -s %{working_dir}/bacula.db ]; then echo "Backing up your current database..." echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - /etc/bacula/update_sqlite_tables + %{script_dir}/update_sqlite_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, doesn't look like you have an existing database." echo "Creating SQLite database..." - /etc/bacula/create_sqlite_database + %{script_dir}/create_sqlite_database echo "Creating the SQLite tables..." - /etc/bacula/make_sqlite_tables + %{script_dir}/make_sqlite_tables fi %endif @@ -1534,11 +1554,11 @@ DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head if [ -z "$DB_VER" ]; then echo "Hmm, doesn't look like you have an existing database." echo "Creating PostgreSQL bacula database..." - /etc/bacula/create_postgresql_database + %{script_dir}/create_postgresql_database echo "Creating bacula tables..." - /etc/bacula/make_postgresql_tables + %{script_dir}/make_postgresql_tables echo "Granting privileges for PostgreSQL user bacula..." - /etc/bacula/grant_postgresql_privileges + %{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 @@ -1546,7 +1566,7 @@ elif [ "$DB_VER" -lt "10" ]; then echo "Backing up your current database..." pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - /etc/bacula/update_postgresql_tables + %{script_dir}/update_postgresql_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi @@ -1554,8 +1574,8 @@ fi %if ! %{client_only} # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1602,29 +1622,28 @@ fi %{_mandir}/man1/tapeinfo.1.%{manpage_ext} %endif - %files client %defattr(-,root,root) -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/bconsole -/etc/bacula/bacula-ctl-fd +%attr(-, root, %{daemon_group}) %dir %{script_dir} +%attr(-, root, %{daemon_group}) %{script_dir}/bconsole +%{script_dir}/bacula-ctl-fd /etc/init.d/bacula-fd -%attr(-, root, %{daemon_group}) /etc/bacula/rescue +%attr(-, root, %{daemon_group}) %{sysconf_dir}/rescue %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt /etc/logrotate.d/bacula -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf %attr(-, root, %{daemon_group}) %dir %{working_dir} /usr/sbin/bacula-fd /usr/sbin/btraceback -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx /usr/sbin/bconsole %{_mandir}/man8/bacula-fd.8.%{manpage_ext} %{_mandir}/man8/bacula.8.%{manpage_ext} @@ -1662,8 +1681,8 @@ if [ "$1" -ge 1 ] ; then fi # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1685,7 +1704,7 @@ fi %if ! %{client_only} %files updatedb %defattr(-,root,%{daemon_group}) -/etc/bacula/updatedb/* +%{script_dir}/updatedb/* %pre updatedb # create the daemon group @@ -1697,16 +1716,16 @@ if [ -z "$HAVE_BACULA" ]; then fi %post updatedb -echo "The database update scripts were installed to /etc/bacula/updatedb" +echo "The database update scripts were installed to %{script_dir}/updatedb" %endif %if %{gconsole} %files gconsole %defattr(-,root,root) /usr/sbin/gnome-console -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/gconsole -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf +%attr(-, root, %{daemon_group}) %dir %{script_dir} +%attr(-, root, %{daemon_group}) %{script_dir}/gconsole +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/gnome-console.conf /usr/share/pixmaps/bacula.png /usr/share/applications/bacula.desktop %{_mandir}/man1/bacula-console-gnome.1.%{manpage_ext} @@ -1714,7 +1733,7 @@ echo "The database update scripts were installed to /etc/bacula/updatedb" %if %{gconsole} && ! %{rh8} /usr/sbin/bacula-tray-monitor -%config(noreplace) /etc/bacula/tray-monitor.conf +%config(noreplace) %{sysconf_dir}/tray-monitor.conf /usr/share/pixmaps/bacula-tray-monitor.xpm /usr/share/applications/bacula-tray-monitor.desktop %{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext} @@ -1739,8 +1758,8 @@ fi %post gconsole # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1758,8 +1777,8 @@ fi %files wxconsole %defattr(-,root,root) /usr/sbin/wxconsole -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf +%attr(-, root, %{daemon_group}) %dir %{sysconf_dir} +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/wxconsole.conf /usr/share/pixmaps/wxwin16x16.xpm /usr/share/applications/wxconsole.desktop %{_mandir}/man1/bacula-wxconsole.1.%{manpage_ext} @@ -1784,8 +1803,8 @@ fi %post wxconsole # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1800,6 +1819,13 @@ fi %endif %changelog +* Sat Apr 08 2007 D. Scott Barninger +- merge Otto Mueller's patch but keep script dir set to /etc/bacula +- add build tag for Scientific Linux per Jon Peatfield +* Tue Mar 27 2007 Otto Mueller +- adjust directory locations for FHS-compatibility + sysconf_dir (/etc/bacula), script_dir (/usr/lib/bacula), + working_dir (/var/lib/bacula) and pid_dir (/var/run) * Mon Feb 26 2007 D. Scott Barninger - add SuSE 10.2 target * Sat Jan 20 2007 D. Scott Barninger diff --git a/bacula/platforms/suse/bacula.spec.in b/bacula/platforms/suse/bacula.spec.in index 63d2ae8f0e..6eb90603b4 100644 --- a/bacula/platforms/suse/bacula.spec.in +++ b/bacula/platforms/suse/bacula.spec.in @@ -51,12 +51,17 @@ Packager: %{_packager} # directory locations %define sqlite_bindir /usr/lib/bacula/sqlite -%define working_dir /var/bacula %define _docsrc ../%{name}-docs-%{docs_version} %define _rescuesrc ../%{name}-rescue-%{_rescuever} %define depkgs ../depkgs %define _mandir /usr/share/man +# directory locations for FHS-compatibility +%define sysconf_dir /etc/bacula +%define script_dir /etc/bacula +%define working_dir /var/lib/bacula +%define pid_dir /var/run + # NOTE these defines are used in some rather complex useradd and groupadd # commands. If you change them examine the post scripts for consequences. %define director_daemon_user bacula @@ -109,6 +114,13 @@ Packager: %{_packager} %define centos4 0 %{?build_centos4:%define centos4 1} %{?build_centos4:%define fc3 1} +# SL build +%define sl3 0 +%{?build_sl3:%define sl3 1} +%{?build_sl3:%define wb3 1} +%define sl4 0 +%{?build_sl4:%define sl4 1} +%{?build_sl4:%define fc3 1} # SuSE build %define su9 0 %{?build_su9:%define su9 1} @@ -182,10 +194,13 @@ exit 1 %if %{centos4} || %{centos3} %define _dist %(grep CentOS /etc/redhat-release) %endif -%if %{fc3} && ! %{rhel4} && ! %{centos4} +%if %{sl4} || %{sl3} +%define _dist %(grep 'Scientific Linux' /etc/redhat-release) +%endif +%if %{fc3} && ! %{rhel4} && ! %{centos4} && ! %{sl4} %define _dist %(grep Fedora /etc/redhat-release) %endif -%if %{wb3} && ! %{rhel3} && ! %{centos3} +%if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3} %define _dist %(grep White /etc/whitebox-release) %endif %if %{su9} || %{su10} || %{su102} @@ -957,8 +972,10 @@ export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}" %configure \ --prefix=/usr \ --sbindir=/usr/sbin \ - --sysconfdir=/etc/bacula \ - --with-scriptdir=/etc/bacula \ + --sysconfdir=%{sysconf_dir} \ + --with-scriptdir=%{script_dir} \ + --with-working-dir=%{working_dir} \ + --with-pid-dir=%{pid_dir} \ --enable-smartalloc \ --enable-client-only \ %if %{mdk} @@ -971,8 +988,10 @@ make %configure \ --prefix=/usr \ --sbindir=/usr/sbin \ - --sysconfdir=/etc/bacula \ - --with-scriptdir=/etc/bacula \ + --sysconfdir=%{sysconf_dir} \ + --with-scriptdir=%{script_dir} \ + --with-working-dir=%{working_dir} \ + --with-pid-dir=%{pid_dir} \ --enable-smartalloc \ %if %{gconsole} --enable-gnome \ @@ -999,8 +1018,6 @@ make --enable-client-only \ %endif --mandir=%{_mandir} \ - --with-working-dir=%{working_dir} \ - --with-pid-dir=/var/run \ --with-subsys-dir=/var/lock/subsys \ --with-dir-user=%{director_daemon_user} \ --with-dir-group=%{daemon_group} \ @@ -1027,7 +1044,7 @@ mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services -mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb +mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb %if %{gconsole} || %{wxconsole} mkdir -p $RPM_BUILD_ROOT/usr/share/applications @@ -1053,9 +1070,10 @@ mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir} make \ prefix=$RPM_BUILD_ROOT/usr \ sbindir=$RPM_BUILD_ROOT/usr/sbin \ - sysconfdir=$RPM_BUILD_ROOT/etc/bacula \ - scriptdir=$RPM_BUILD_ROOT/etc/bacula \ + 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 @@ -1064,8 +1082,10 @@ cd %{depkgs} make \ prefix=$RPM_BUILD_ROOT/usr \ sbindir=$RPM_BUILD_ROOT/usr/sbin \ - sysconfdir=$RPM_BUILD_ROOT/etc/bacula \ + 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} \ mtx-install cd ${cwd} @@ -1094,20 +1114,20 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.gz # fixme - make installs the mysql scripts for sqlite build %if %{sqlite} -rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges +rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges %endif # fixme - make installs the mysql scripts for postgresql build %if %{postgresql} -rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql %endif # fixme - make installs gconsole script for build without gconsole %if ! %{gconsole} -rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole +rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole %endif rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd @@ -1196,7 +1216,7 @@ cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula # install the updatedb scripts -cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/ +cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/ # install the logwatch scripts %if ! %{client_only} @@ -1209,43 +1229,43 @@ chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf %endif # install the rescue files -mkdir $RPM_BUILD_ROOT/etc/bacula/rescue -cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/ -cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/ -touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release -cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd +mkdir $RPM_BUILD_ROOT%{sysconf_dir}/rescue +cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT%{sysconf_dir}/rescue/ +touch $RPM_BUILD_ROOT%{sysconf_dir}/rescue/linux/cdrom/rpm_release +cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT%{sysconf_dir}/rescue/linux/cdrom/bacula/bin/bacula-fd rm -f src/filed/static-bacula-fd %if %{wxconsole} mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole -mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf +mv $RPM_BUILD_ROOT%{sysconf_dir}/wx-console.conf $RPM_BUILD_ROOT%{sysconf_dir}/wxconsole.conf %endif # now clean up permissions that are left broken by the install %if ! %{client_only} -chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql +chmod o-r $RPM_BUILD_ROOT%{script_dir}/query.sql %endif chmod o-rwx $RPM_BUILD_ROOT%{working_dir} %if %{gconsole} && ! %{rh8} chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor -chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf +chmod 644 $RPM_BUILD_ROOT%{sysconf_dir}/tray-monitor.conf %endif # fix me - building enable-client-only installs files not included in bacula-client package %if %{client_only} -rm -f $RPM_BUILD_ROOT/etc/bacula/bacula -rm -f $RPM_BUILD_ROOT/etc/bacula/bacula-ctl-dir -rm -f $RPM_BUILD_ROOT/etc/bacula/bacula-ctl-sd -rm -f $RPM_BUILD_ROOT/etc/bacula/disk-changer -rm -f $RPM_BUILD_ROOT/etc/bacula/dvd-handler -rm -f $RPM_BUILD_ROOT/etc/bacula/mtx-changer -rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql -rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql -rm -rf $RPM_BUILD_ROOT/etc/bacula/updatedb +rm -f $RPM_BUILD_ROOT%{script_dir}/bacula +rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir +rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd +rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer +rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler +rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer +rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql +rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql +rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb %endif %clean @@ -1259,25 +1279,25 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt # MySQL specific files %files mysql %defattr(-, root, root) -%attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database -%attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges -%attr(-, root, %{daemon_group}) /etc/bacula/startmysql -%attr(-, root, %{daemon_group}) /etc/bacula/stopmysql +%attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database +%attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database +%attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables +%attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables +%attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables +%attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/startmysql +%attr(-, root, %{daemon_group}) %{script_dir}/stopmysql %endif %if %{sqlite} %files sqlite %defattr(-,root,root) -%attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database -%attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges -%attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables +%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 %{sqlite_bindir}/libsqlite.a %{sqlite_bindir}/sqlite.h %{sqlite_bindir}/sqlite @@ -1286,52 +1306,52 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %if %{postgresql} %files postgresql %defattr(-,root,root) -%attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database -%attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables -%attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database +%attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database +%attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables +%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 %endif # The rest is DB backend independent %if ! %{client_only} -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/bconsole -%attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database -%attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database -%attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges -%attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables -%attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables -%attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables -%attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup -%attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb -%attr(-, root, %{daemon_group}) /etc/bacula/rescue -%attr(-, root, %{daemon_group}) /etc/bacula/disk-changer -%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir -%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd -%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd +%attr(-, root, %{daemon_group}) %dir %{script_dir} +%attr(-, root, %{daemon_group}) %{script_dir}/bacula +%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 +%attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables +%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}/delete_catalog_backup +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb +%attr(-, root, %{daemon_group}) %{sysconf_dir}/rescue +%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 +%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd -%attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler +%attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd -%attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer +%attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt /etc/logrotate.d/bacula /etc/log.d/scripts/services/bacula -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf -%attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf +%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/log.d/conf/logfiles/bacula.conf %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/query.sql +%attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir} @@ -1388,7 +1408,7 @@ if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "9" ]; then echo "This bacula upgrade will update a bacula database from version 9 to 10." 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 "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current" + 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." exit 1 @@ -1400,9 +1420,9 @@ fi %endif %if ! %{client_only} -# check for and copy /etc/bacula/console.conf to bconsole.conf -if [ -s /etc/bacula/console.conf ];then - cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf +# check for and copy %{sysconf_dir}/console.conf to bconsole.conf +if [ -s %{sysconf_dir}/console.conf ];then + cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf fi # create the daemon users and groups @@ -1484,11 +1504,11 @@ DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1` if [ -z "$DB_VER" ]; then echo "Hmm, doesn't look like you have an existing database." echo "Granting privileges for MySQL user bacula..." - /etc/bacula/grant_mysql_privileges + %{script_dir}/grant_mysql_privileges echo "Creating MySQL bacula database..." - /etc/bacula/create_mysql_database + %{script_dir}/create_mysql_database echo "Creating bacula tables..." - /etc/bacula/make_mysql_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 @@ -1496,7 +1516,7 @@ elif [ "$DB_VER" -lt "10" ]; then echo "Backing up your current database..." mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - /etc/bacula/update_mysql_tables + %{script_dir}/update_mysql_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi @@ -1512,16 +1532,16 @@ if [ -s %{working_dir}/bacula.db ]; then echo "Backing up your current database..." echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - /etc/bacula/update_sqlite_tables + %{script_dir}/update_sqlite_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, doesn't look like you have an existing database." echo "Creating SQLite database..." - /etc/bacula/create_sqlite_database + %{script_dir}/create_sqlite_database echo "Creating the SQLite tables..." - /etc/bacula/make_sqlite_tables + %{script_dir}/make_sqlite_tables fi %endif @@ -1534,11 +1554,11 @@ DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head if [ -z "$DB_VER" ]; then echo "Hmm, doesn't look like you have an existing database." echo "Creating PostgreSQL bacula database..." - /etc/bacula/create_postgresql_database + %{script_dir}/create_postgresql_database echo "Creating bacula tables..." - /etc/bacula/make_postgresql_tables + %{script_dir}/make_postgresql_tables echo "Granting privileges for PostgreSQL user bacula..." - /etc/bacula/grant_postgresql_privileges + %{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 @@ -1546,7 +1566,7 @@ elif [ "$DB_VER" -lt "10" ]; then echo "Backing up your current database..." pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - /etc/bacula/update_postgresql_tables + %{script_dir}/update_postgresql_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi @@ -1554,8 +1574,8 @@ fi %if ! %{client_only} # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1602,29 +1622,28 @@ fi %{_mandir}/man1/tapeinfo.1.%{manpage_ext} %endif - %files client %defattr(-,root,root) -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/bconsole -/etc/bacula/bacula-ctl-fd +%attr(-, root, %{daemon_group}) %dir %{script_dir} +%attr(-, root, %{daemon_group}) %{script_dir}/bconsole +%{script_dir}/bacula-ctl-fd /etc/init.d/bacula-fd -%attr(-, root, %{daemon_group}) /etc/bacula/rescue +%attr(-, root, %{daemon_group}) %{sysconf_dir}/rescue %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt /etc/logrotate.d/bacula -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf %attr(-, root, %{daemon_group}) %dir %{working_dir} /usr/sbin/bacula-fd /usr/sbin/btraceback -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb -%attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb +%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx /usr/sbin/bconsole %{_mandir}/man8/bacula-fd.8.%{manpage_ext} %{_mandir}/man8/bacula.8.%{manpage_ext} @@ -1662,8 +1681,8 @@ if [ "$1" -ge 1 ] ; then fi # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1685,7 +1704,7 @@ fi %if ! %{client_only} %files updatedb %defattr(-,root,%{daemon_group}) -/etc/bacula/updatedb/* +%{script_dir}/updatedb/* %pre updatedb # create the daemon group @@ -1697,16 +1716,16 @@ if [ -z "$HAVE_BACULA" ]; then fi %post updatedb -echo "The database update scripts were installed to /etc/bacula/updatedb" +echo "The database update scripts were installed to %{script_dir}/updatedb" %endif %if %{gconsole} %files gconsole %defattr(-,root,root) /usr/sbin/gnome-console -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) /etc/bacula/gconsole -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf +%attr(-, root, %{daemon_group}) %dir %{script_dir} +%attr(-, root, %{daemon_group}) %{script_dir}/gconsole +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/gnome-console.conf /usr/share/pixmaps/bacula.png /usr/share/applications/bacula.desktop %{_mandir}/man1/bacula-console-gnome.1.%{manpage_ext} @@ -1714,7 +1733,7 @@ echo "The database update scripts were installed to /etc/bacula/updatedb" %if %{gconsole} && ! %{rh8} /usr/sbin/bacula-tray-monitor -%config(noreplace) /etc/bacula/tray-monitor.conf +%config(noreplace) %{sysconf_dir}/tray-monitor.conf /usr/share/pixmaps/bacula-tray-monitor.xpm /usr/share/applications/bacula-tray-monitor.desktop %{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext} @@ -1739,8 +1758,8 @@ fi %post gconsole # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1758,8 +1777,8 @@ fi %files wxconsole %defattr(-,root,root) /usr/sbin/wxconsole -%attr(-, root, %{daemon_group}) %dir /etc/bacula -%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf +%attr(-, root, %{daemon_group}) %dir %{sysconf_dir} +%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/wxconsole.conf /usr/share/pixmaps/wxwin16x16.xpm /usr/share/applications/wxconsole.desktop %{_mandir}/man1/bacula-wxconsole.1.%{manpage_ext} @@ -1784,8 +1803,8 @@ fi %post wxconsole # generate passwords if needed -if [ -d /etc/bacula ]; then - cd /etc/bacula +if [ -d %{sysconf_dir} ]; then + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -1800,6 +1819,13 @@ fi %endif %changelog +* Sat Apr 08 2007 D. Scott Barninger +- merge Otto Mueller's patch but keep script dir set to /etc/bacula +- add build tag for Scientific Linux per Jon Peatfield +* Tue Mar 27 2007 Otto Mueller +- adjust directory locations for FHS-compatibility + sysconf_dir (/etc/bacula), script_dir (/usr/lib/bacula), + working_dir (/var/lib/bacula) and pid_dir (/var/run) * Mon Feb 26 2007 D. Scott Barninger - add SuSE 10.2 target * Sat Jan 20 2007 D. Scott Barninger