From e84710ea5afd5e195d581f59e8953b3f027fa37f Mon Sep 17 00:00:00 2001 From: Scott Barninger Date: Sun, 24 Aug 2008 18:20:12 +0000 Subject: [PATCH] Add support for install to /opt/bacula git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7505 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/platforms/mandrake/bacula.spec.in | 159 ++++++++++++++++------- bacula/platforms/redhat/bacula.spec.in | 159 ++++++++++++++++------- bacula/platforms/suse/bacula.spec.in | 159 ++++++++++++++++------- 3 files changed, 333 insertions(+), 144 deletions(-) diff --git a/bacula/platforms/mandrake/bacula.spec.in b/bacula/platforms/mandrake/bacula.spec.in index 91fe879ce5..0a019e2925 100644 --- a/bacula/platforms/mandrake/bacula.spec.in +++ b/bacula/platforms/mandrake/bacula.spec.in @@ -18,6 +18,14 @@ # except for patch macros in the setup section #-------------------------------------------------------------------------- +%define single_dir 0 +%{?single_dir_install:%define single_dir 1} +%if %{single_dir} +%define _prefix /opt/bacula +%else +%define _prefix /usr +%endif + # third party packagers %define _packager D. Scott Barninger %{?contrib_packager:%define _packager %{contrib_packager}} @@ -38,6 +46,7 @@ BuildRoot: %{_tmppath}/%{name}-root URL: http://www.bacula.org/ Vendor: The Bacula Team Packager: %{_packager} +Prefix: %{_prefix} # define the basic package description %define blurb Bacula - It comes by night and sucks the vital essence from your computers. @@ -49,18 +58,31 @@ Packager: %{_packager} %define blurb7 features that make it easy to find and recover lost or damaged files. %define blurb8 Bacula source code has been released under the GPL version 2 license. -# directory locations -%define sqlite_bindir %_libdir/bacula/sqlite +# source directory locations %define _docsrc ../%{name}-docs-%{docs_version} %define _rescuesrc ../%{name}-rescue-%{_rescuever} %define depkgs ../depkgs -%define _mandir /usr/share/man -# directory locations for FHS-compatibility +# directory locations +%if %{single_dir} +%define _sbindir /opt/bacula +%define _subsysdir /opt/bacula/working +%define sqlite_bindir /opt/bacula/sqlite +%define _mandir /opt/bacula +%define sysconf_dir /opt/bacula +%define script_dir /opt/bacula +%define working_dir /opt/bacula/working +%define pid_dir /opt/bacula/working +%else +%define _sbindir %_prefix/sbin +%define _subsysdir /var/lock/subsys +%define sqlite_bindir %_libdir/bacula/sqlite +%define _mandir %_prefix/share/man %define sysconf_dir /etc/bacula %define script_dir %_libdir/bacula %define working_dir /var/lib/bacula %define pid_dir /var/run +%endif # NOTE these defines are used in some rather complex useradd and groupadd # commands. If you change them examine the post scripts for consequences. @@ -1399,8 +1421,8 @@ export QTLIB=/usr/lib64/qt4/ %endif %configure \ - --prefix=/usr \ - --sbindir=/usr/sbin \ + --prefix=%{_prefix} \ + --sbindir=%{_sbindir} \ --sysconfdir=%{sysconf_dir} \ --with-scriptdir=%{script_dir} \ --with-working-dir=%{working_dir} \ @@ -1415,8 +1437,8 @@ export QTLIB=/usr/lib64/qt4/ make %configure \ - --prefix=/usr \ - --sbindir=/usr/sbin \ + --prefix=%{_prefix} \ + --sbindir=%{_sbindir} \ --sysconfdir=%{sysconf_dir} \ --with-scriptdir=%{script_dir} \ --with-working-dir=%{working_dir} \ @@ -1454,7 +1476,7 @@ make --disable-batch-insert \ %endif --mandir=%{_mandir} \ - --with-subsys-dir=/var/lock/subsys \ + --with-subsys-dir=%{_subsysdir} \ --with-dir-user=%{director_daemon_user} \ --with-dir-group=%{daemon_group} \ --with-sd-user=%{storage_daemon_user} \ @@ -1504,8 +1526,8 @@ mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir} %endif make \ - prefix=$RPM_BUILD_ROOT/usr \ - sbindir=$RPM_BUILD_ROOT/usr/sbin \ + 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} \ @@ -1516,8 +1538,8 @@ make \ %if ! %{client_only} && %{mtx} cd %{depkgs} make \ - prefix=$RPM_BUILD_ROOT/usr \ - sbindir=$RPM_BUILD_ROOT/usr/sbin \ + 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} \ @@ -1569,7 +1591,7 @@ rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole %endif -rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd +rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd # install the init scripts %if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} @@ -1725,14 +1747,28 @@ rm -f src/filed/static-bacula-fd # install bat since make doesn't at the moment %if %{bat} -cp -p src/qt-console/bat $RPM_BUILD_ROOT/usr/sbin/bat +cp -p src/qt-console/bat $RPM_BUILD_ROOT%{_sbindir}/bat cp -p src/qt-console/bat.conf $RPM_BUILD_ROOT%{sysconf_dir}/bat.conf %endif +# install docs for single dir installation +%if %{single_dir} +mkdir $RPM_BUILD_ROOT%{_prefix}/doc +cp COPYING $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 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/ +cp -r %{_docsrc}/manual/bacula $RPM_BUILD_ROOT%{_prefix}/doc/ +cp ../Release_Notes-%{version}-%{release}.txt $RPM_BUILD_ROOT%{_prefix}/doc/ +%endif + # now clean up permissions that are left broken by the install chmod o-rwx $RPM_BUILD_ROOT%{working_dir} %if %{gconsole} && ! %{rh8} -chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor +chmod 755 $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor chmod 644 $RPM_BUILD_ROOT%{sysconf_dir}/tray-monitor.conf %endif @@ -1821,9 +1857,6 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd %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) %{sysconf_dir}/bacula-dir.conf @@ -1836,20 +1869,20 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir} -/usr/sbin/bacula-dir -/usr/sbin/bacula-fd -/usr/sbin/bacula-sd -/usr/sbin/bcopy -/usr/sbin/bextract -/usr/sbin/bls -/usr/sbin/bscan -/usr/sbin/btape -/usr/sbin/btraceback -/usr/sbin/bconsole -/usr/sbin/dbcheck -/usr/sbin/bsmtp -/usr/sbin/bregex -/usr/sbin/bwild +%{_sbindir}/bacula-dir +%{_sbindir}/bacula-fd +%{_sbindir}/bacula-sd +%{_sbindir}/bcopy +%{_sbindir}/bextract +%{_sbindir}/bls +%{_sbindir}/bscan +%{_sbindir}/btape +%{_sbindir}/btraceback +%{_sbindir}/bconsole +%{_sbindir}/dbcheck +%{_sbindir}/bsmtp +%{_sbindir}/bregex +%{_sbindir}/bwild %{_mandir}/man8/bacula-fd.8.%{manpage_ext} %{_mandir}/man8/bacula-dir.8.%{manpage_ext} %{_mandir}/man8/bacula-sd.8.%{manpage_ext} @@ -1865,6 +1898,15 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %{_mandir}/man1/bsmtp.1.%{manpage_ext} %endif +%if ! %{client_only} && ! %{single_dir} +%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo +%doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt +%endif + +%if %{single_dir} +%{_prefix}/doc +%endif + %if %{mysql} %pre mysql # test for bacula database older than version 9 @@ -2113,15 +2155,15 @@ fi %endif -%if ! %{client_only} && %{mtx} +%if ! %{client_only} && %{mtx} && ! %{single_dir} %files mtx %defattr(-,root,root) -%attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo -%attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx -%attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape -%attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo -%attr(-, root, %{storage_daemon_group}) /usr/sbin/nsmhack -%attr(-, root, %{storage_daemon_group}) /usr/sbin/scsieject +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/loaderinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/mtx +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsitape +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/tapeinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/nsmhack +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsieject %{_mandir}/man1/loaderinfo.1.%{manpage_ext} %{_mandir}/man1/mtx.1.%{manpage_ext} %{_mandir}/man1/scsitape.1.%{manpage_ext} @@ -2129,16 +2171,35 @@ fi %{_mandir}/man1/scsieject.1.%{manpage_ext} %endif +%if ! %{client_only} && %{mtx} && %{single_dir} +%files mtx +%defattr(-,root,root) +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/loaderinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/mtx +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsitape +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/tapeinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/nsmhack +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsieject +%{_mandir}/man1/loaderinfo.1 +%{_mandir}/man1/mtx.1 +%{_mandir}/man1/scsitape.1 +%{_mandir}/man1/tapeinfo.1 +%{_mandir}/man1/scsieject.1 +%endif + %files client %defattr(-,root,root) %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}) %{script_dir}/rescue +%if ! %{single_dir} %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt +%else +%{_prefix}/doc +%endif /etc/logrotate.d/bacula @@ -2147,11 +2208,11 @@ fi %attr(-, root, %{daemon_group}) %dir %{working_dir} -/usr/sbin/bacula-fd -/usr/sbin/btraceback +%{_sbindir}/bacula-fd +%{_sbindir}/btraceback %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx -/usr/sbin/bconsole +%{_sbindir}/bconsole %{_mandir}/man8/bacula-fd.8.%{manpage_ext} %{_mandir}/man8/bacula.8.%{manpage_ext} %{_mandir}/man8/bconsole.8.%{manpage_ext} @@ -2229,7 +2290,7 @@ echo "The database update scripts were installed to %{script_dir}/updatedb" %if %{gconsole} %files gconsole %defattr(-,root,root) -/usr/sbin/bgnome-console +%{_sbindir}/bgnome-console %attr(-, root, %{daemon_group}) %dir %{script_dir} %attr(-, root, %{daemon_group}) %{script_dir}/gconsole %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bgnome-console.conf @@ -2239,7 +2300,7 @@ echo "The database update scripts were installed to %{script_dir}/updatedb" %endif %if %{gconsole} && ! %{rh8} -/usr/sbin/bacula-tray-monitor +%{_sbindir}/bacula-tray-monitor %config(noreplace) %{sysconf_dir}/tray-monitor.conf /usr/share/pixmaps/bacula-tray-monitor.xpm /usr/share/applications/bacula-tray-monitor.desktop @@ -2283,7 +2344,7 @@ fi %if %{wxconsole} %files wxconsole %defattr(-,root,root) -/usr/sbin/bwx-console +%{_sbindir}/bwx-console %attr(-, root, %{daemon_group}) %dir %{sysconf_dir} %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bwx-console.conf /usr/share/pixmaps/wxwin16x16.xpm @@ -2328,7 +2389,7 @@ fi %if %{bat} %files bat %defattr(-,root,root) -/usr/sbin/bat +%{_sbindir}/bat %attr(-, root, %{daemon_group}) %dir %{sysconf_dir} %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bat.conf /usr/share/pixmaps/bat_icon.png @@ -2371,6 +2432,8 @@ fi %endif %changelog +* Sun Aug 24 2008 D. Scott Barninger +- add support for install to /opt/bacula * Sun Aug 17 2008 D. Scott Barninger - remove libtermcap dependancy for FC9 * Mon Aug 04 2008 D. Scott Barninger diff --git a/bacula/platforms/redhat/bacula.spec.in b/bacula/platforms/redhat/bacula.spec.in index 91fe879ce5..0a019e2925 100644 --- a/bacula/platforms/redhat/bacula.spec.in +++ b/bacula/platforms/redhat/bacula.spec.in @@ -18,6 +18,14 @@ # except for patch macros in the setup section #-------------------------------------------------------------------------- +%define single_dir 0 +%{?single_dir_install:%define single_dir 1} +%if %{single_dir} +%define _prefix /opt/bacula +%else +%define _prefix /usr +%endif + # third party packagers %define _packager D. Scott Barninger %{?contrib_packager:%define _packager %{contrib_packager}} @@ -38,6 +46,7 @@ BuildRoot: %{_tmppath}/%{name}-root URL: http://www.bacula.org/ Vendor: The Bacula Team Packager: %{_packager} +Prefix: %{_prefix} # define the basic package description %define blurb Bacula - It comes by night and sucks the vital essence from your computers. @@ -49,18 +58,31 @@ Packager: %{_packager} %define blurb7 features that make it easy to find and recover lost or damaged files. %define blurb8 Bacula source code has been released under the GPL version 2 license. -# directory locations -%define sqlite_bindir %_libdir/bacula/sqlite +# source directory locations %define _docsrc ../%{name}-docs-%{docs_version} %define _rescuesrc ../%{name}-rescue-%{_rescuever} %define depkgs ../depkgs -%define _mandir /usr/share/man -# directory locations for FHS-compatibility +# directory locations +%if %{single_dir} +%define _sbindir /opt/bacula +%define _subsysdir /opt/bacula/working +%define sqlite_bindir /opt/bacula/sqlite +%define _mandir /opt/bacula +%define sysconf_dir /opt/bacula +%define script_dir /opt/bacula +%define working_dir /opt/bacula/working +%define pid_dir /opt/bacula/working +%else +%define _sbindir %_prefix/sbin +%define _subsysdir /var/lock/subsys +%define sqlite_bindir %_libdir/bacula/sqlite +%define _mandir %_prefix/share/man %define sysconf_dir /etc/bacula %define script_dir %_libdir/bacula %define working_dir /var/lib/bacula %define pid_dir /var/run +%endif # NOTE these defines are used in some rather complex useradd and groupadd # commands. If you change them examine the post scripts for consequences. @@ -1399,8 +1421,8 @@ export QTLIB=/usr/lib64/qt4/ %endif %configure \ - --prefix=/usr \ - --sbindir=/usr/sbin \ + --prefix=%{_prefix} \ + --sbindir=%{_sbindir} \ --sysconfdir=%{sysconf_dir} \ --with-scriptdir=%{script_dir} \ --with-working-dir=%{working_dir} \ @@ -1415,8 +1437,8 @@ export QTLIB=/usr/lib64/qt4/ make %configure \ - --prefix=/usr \ - --sbindir=/usr/sbin \ + --prefix=%{_prefix} \ + --sbindir=%{_sbindir} \ --sysconfdir=%{sysconf_dir} \ --with-scriptdir=%{script_dir} \ --with-working-dir=%{working_dir} \ @@ -1454,7 +1476,7 @@ make --disable-batch-insert \ %endif --mandir=%{_mandir} \ - --with-subsys-dir=/var/lock/subsys \ + --with-subsys-dir=%{_subsysdir} \ --with-dir-user=%{director_daemon_user} \ --with-dir-group=%{daemon_group} \ --with-sd-user=%{storage_daemon_user} \ @@ -1504,8 +1526,8 @@ mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir} %endif make \ - prefix=$RPM_BUILD_ROOT/usr \ - sbindir=$RPM_BUILD_ROOT/usr/sbin \ + 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} \ @@ -1516,8 +1538,8 @@ make \ %if ! %{client_only} && %{mtx} cd %{depkgs} make \ - prefix=$RPM_BUILD_ROOT/usr \ - sbindir=$RPM_BUILD_ROOT/usr/sbin \ + 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} \ @@ -1569,7 +1591,7 @@ rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole %endif -rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd +rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd # install the init scripts %if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} @@ -1725,14 +1747,28 @@ rm -f src/filed/static-bacula-fd # install bat since make doesn't at the moment %if %{bat} -cp -p src/qt-console/bat $RPM_BUILD_ROOT/usr/sbin/bat +cp -p src/qt-console/bat $RPM_BUILD_ROOT%{_sbindir}/bat cp -p src/qt-console/bat.conf $RPM_BUILD_ROOT%{sysconf_dir}/bat.conf %endif +# install docs for single dir installation +%if %{single_dir} +mkdir $RPM_BUILD_ROOT%{_prefix}/doc +cp COPYING $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 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/ +cp -r %{_docsrc}/manual/bacula $RPM_BUILD_ROOT%{_prefix}/doc/ +cp ../Release_Notes-%{version}-%{release}.txt $RPM_BUILD_ROOT%{_prefix}/doc/ +%endif + # now clean up permissions that are left broken by the install chmod o-rwx $RPM_BUILD_ROOT%{working_dir} %if %{gconsole} && ! %{rh8} -chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor +chmod 755 $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor chmod 644 $RPM_BUILD_ROOT%{sysconf_dir}/tray-monitor.conf %endif @@ -1821,9 +1857,6 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd %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) %{sysconf_dir}/bacula-dir.conf @@ -1836,20 +1869,20 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir} -/usr/sbin/bacula-dir -/usr/sbin/bacula-fd -/usr/sbin/bacula-sd -/usr/sbin/bcopy -/usr/sbin/bextract -/usr/sbin/bls -/usr/sbin/bscan -/usr/sbin/btape -/usr/sbin/btraceback -/usr/sbin/bconsole -/usr/sbin/dbcheck -/usr/sbin/bsmtp -/usr/sbin/bregex -/usr/sbin/bwild +%{_sbindir}/bacula-dir +%{_sbindir}/bacula-fd +%{_sbindir}/bacula-sd +%{_sbindir}/bcopy +%{_sbindir}/bextract +%{_sbindir}/bls +%{_sbindir}/bscan +%{_sbindir}/btape +%{_sbindir}/btraceback +%{_sbindir}/bconsole +%{_sbindir}/dbcheck +%{_sbindir}/bsmtp +%{_sbindir}/bregex +%{_sbindir}/bwild %{_mandir}/man8/bacula-fd.8.%{manpage_ext} %{_mandir}/man8/bacula-dir.8.%{manpage_ext} %{_mandir}/man8/bacula-sd.8.%{manpage_ext} @@ -1865,6 +1898,15 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %{_mandir}/man1/bsmtp.1.%{manpage_ext} %endif +%if ! %{client_only} && ! %{single_dir} +%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo +%doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt +%endif + +%if %{single_dir} +%{_prefix}/doc +%endif + %if %{mysql} %pre mysql # test for bacula database older than version 9 @@ -2113,15 +2155,15 @@ fi %endif -%if ! %{client_only} && %{mtx} +%if ! %{client_only} && %{mtx} && ! %{single_dir} %files mtx %defattr(-,root,root) -%attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo -%attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx -%attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape -%attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo -%attr(-, root, %{storage_daemon_group}) /usr/sbin/nsmhack -%attr(-, root, %{storage_daemon_group}) /usr/sbin/scsieject +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/loaderinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/mtx +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsitape +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/tapeinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/nsmhack +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsieject %{_mandir}/man1/loaderinfo.1.%{manpage_ext} %{_mandir}/man1/mtx.1.%{manpage_ext} %{_mandir}/man1/scsitape.1.%{manpage_ext} @@ -2129,16 +2171,35 @@ fi %{_mandir}/man1/scsieject.1.%{manpage_ext} %endif +%if ! %{client_only} && %{mtx} && %{single_dir} +%files mtx +%defattr(-,root,root) +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/loaderinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/mtx +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsitape +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/tapeinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/nsmhack +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsieject +%{_mandir}/man1/loaderinfo.1 +%{_mandir}/man1/mtx.1 +%{_mandir}/man1/scsitape.1 +%{_mandir}/man1/tapeinfo.1 +%{_mandir}/man1/scsieject.1 +%endif + %files client %defattr(-,root,root) %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}) %{script_dir}/rescue +%if ! %{single_dir} %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt +%else +%{_prefix}/doc +%endif /etc/logrotate.d/bacula @@ -2147,11 +2208,11 @@ fi %attr(-, root, %{daemon_group}) %dir %{working_dir} -/usr/sbin/bacula-fd -/usr/sbin/btraceback +%{_sbindir}/bacula-fd +%{_sbindir}/btraceback %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx -/usr/sbin/bconsole +%{_sbindir}/bconsole %{_mandir}/man8/bacula-fd.8.%{manpage_ext} %{_mandir}/man8/bacula.8.%{manpage_ext} %{_mandir}/man8/bconsole.8.%{manpage_ext} @@ -2229,7 +2290,7 @@ echo "The database update scripts were installed to %{script_dir}/updatedb" %if %{gconsole} %files gconsole %defattr(-,root,root) -/usr/sbin/bgnome-console +%{_sbindir}/bgnome-console %attr(-, root, %{daemon_group}) %dir %{script_dir} %attr(-, root, %{daemon_group}) %{script_dir}/gconsole %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bgnome-console.conf @@ -2239,7 +2300,7 @@ echo "The database update scripts were installed to %{script_dir}/updatedb" %endif %if %{gconsole} && ! %{rh8} -/usr/sbin/bacula-tray-monitor +%{_sbindir}/bacula-tray-monitor %config(noreplace) %{sysconf_dir}/tray-monitor.conf /usr/share/pixmaps/bacula-tray-monitor.xpm /usr/share/applications/bacula-tray-monitor.desktop @@ -2283,7 +2344,7 @@ fi %if %{wxconsole} %files wxconsole %defattr(-,root,root) -/usr/sbin/bwx-console +%{_sbindir}/bwx-console %attr(-, root, %{daemon_group}) %dir %{sysconf_dir} %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bwx-console.conf /usr/share/pixmaps/wxwin16x16.xpm @@ -2328,7 +2389,7 @@ fi %if %{bat} %files bat %defattr(-,root,root) -/usr/sbin/bat +%{_sbindir}/bat %attr(-, root, %{daemon_group}) %dir %{sysconf_dir} %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bat.conf /usr/share/pixmaps/bat_icon.png @@ -2371,6 +2432,8 @@ fi %endif %changelog +* Sun Aug 24 2008 D. Scott Barninger +- add support for install to /opt/bacula * Sun Aug 17 2008 D. Scott Barninger - remove libtermcap dependancy for FC9 * Mon Aug 04 2008 D. Scott Barninger diff --git a/bacula/platforms/suse/bacula.spec.in b/bacula/platforms/suse/bacula.spec.in index 91fe879ce5..0a019e2925 100644 --- a/bacula/platforms/suse/bacula.spec.in +++ b/bacula/platforms/suse/bacula.spec.in @@ -18,6 +18,14 @@ # except for patch macros in the setup section #-------------------------------------------------------------------------- +%define single_dir 0 +%{?single_dir_install:%define single_dir 1} +%if %{single_dir} +%define _prefix /opt/bacula +%else +%define _prefix /usr +%endif + # third party packagers %define _packager D. Scott Barninger %{?contrib_packager:%define _packager %{contrib_packager}} @@ -38,6 +46,7 @@ BuildRoot: %{_tmppath}/%{name}-root URL: http://www.bacula.org/ Vendor: The Bacula Team Packager: %{_packager} +Prefix: %{_prefix} # define the basic package description %define blurb Bacula - It comes by night and sucks the vital essence from your computers. @@ -49,18 +58,31 @@ Packager: %{_packager} %define blurb7 features that make it easy to find and recover lost or damaged files. %define blurb8 Bacula source code has been released under the GPL version 2 license. -# directory locations -%define sqlite_bindir %_libdir/bacula/sqlite +# source directory locations %define _docsrc ../%{name}-docs-%{docs_version} %define _rescuesrc ../%{name}-rescue-%{_rescuever} %define depkgs ../depkgs -%define _mandir /usr/share/man -# directory locations for FHS-compatibility +# directory locations +%if %{single_dir} +%define _sbindir /opt/bacula +%define _subsysdir /opt/bacula/working +%define sqlite_bindir /opt/bacula/sqlite +%define _mandir /opt/bacula +%define sysconf_dir /opt/bacula +%define script_dir /opt/bacula +%define working_dir /opt/bacula/working +%define pid_dir /opt/bacula/working +%else +%define _sbindir %_prefix/sbin +%define _subsysdir /var/lock/subsys +%define sqlite_bindir %_libdir/bacula/sqlite +%define _mandir %_prefix/share/man %define sysconf_dir /etc/bacula %define script_dir %_libdir/bacula %define working_dir /var/lib/bacula %define pid_dir /var/run +%endif # NOTE these defines are used in some rather complex useradd and groupadd # commands. If you change them examine the post scripts for consequences. @@ -1399,8 +1421,8 @@ export QTLIB=/usr/lib64/qt4/ %endif %configure \ - --prefix=/usr \ - --sbindir=/usr/sbin \ + --prefix=%{_prefix} \ + --sbindir=%{_sbindir} \ --sysconfdir=%{sysconf_dir} \ --with-scriptdir=%{script_dir} \ --with-working-dir=%{working_dir} \ @@ -1415,8 +1437,8 @@ export QTLIB=/usr/lib64/qt4/ make %configure \ - --prefix=/usr \ - --sbindir=/usr/sbin \ + --prefix=%{_prefix} \ + --sbindir=%{_sbindir} \ --sysconfdir=%{sysconf_dir} \ --with-scriptdir=%{script_dir} \ --with-working-dir=%{working_dir} \ @@ -1454,7 +1476,7 @@ make --disable-batch-insert \ %endif --mandir=%{_mandir} \ - --with-subsys-dir=/var/lock/subsys \ + --with-subsys-dir=%{_subsysdir} \ --with-dir-user=%{director_daemon_user} \ --with-dir-group=%{daemon_group} \ --with-sd-user=%{storage_daemon_user} \ @@ -1504,8 +1526,8 @@ mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir} %endif make \ - prefix=$RPM_BUILD_ROOT/usr \ - sbindir=$RPM_BUILD_ROOT/usr/sbin \ + 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} \ @@ -1516,8 +1538,8 @@ make \ %if ! %{client_only} && %{mtx} cd %{depkgs} make \ - prefix=$RPM_BUILD_ROOT/usr \ - sbindir=$RPM_BUILD_ROOT/usr/sbin \ + 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} \ @@ -1569,7 +1591,7 @@ rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole %endif -rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd +rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd # install the init scripts %if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} @@ -1725,14 +1747,28 @@ rm -f src/filed/static-bacula-fd # install bat since make doesn't at the moment %if %{bat} -cp -p src/qt-console/bat $RPM_BUILD_ROOT/usr/sbin/bat +cp -p src/qt-console/bat $RPM_BUILD_ROOT%{_sbindir}/bat cp -p src/qt-console/bat.conf $RPM_BUILD_ROOT%{sysconf_dir}/bat.conf %endif +# install docs for single dir installation +%if %{single_dir} +mkdir $RPM_BUILD_ROOT%{_prefix}/doc +cp COPYING $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 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/ +cp -r %{_docsrc}/manual/bacula $RPM_BUILD_ROOT%{_prefix}/doc/ +cp ../Release_Notes-%{version}-%{release}.txt $RPM_BUILD_ROOT%{_prefix}/doc/ +%endif + # now clean up permissions that are left broken by the install chmod o-rwx $RPM_BUILD_ROOT%{working_dir} %if %{gconsole} && ! %{rh8} -chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor +chmod 755 $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor chmod 644 $RPM_BUILD_ROOT%{sysconf_dir}/tray-monitor.conf %endif @@ -1821,9 +1857,6 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd %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) %{sysconf_dir}/bacula-dir.conf @@ -1836,20 +1869,20 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir} -/usr/sbin/bacula-dir -/usr/sbin/bacula-fd -/usr/sbin/bacula-sd -/usr/sbin/bcopy -/usr/sbin/bextract -/usr/sbin/bls -/usr/sbin/bscan -/usr/sbin/btape -/usr/sbin/btraceback -/usr/sbin/bconsole -/usr/sbin/dbcheck -/usr/sbin/bsmtp -/usr/sbin/bregex -/usr/sbin/bwild +%{_sbindir}/bacula-dir +%{_sbindir}/bacula-fd +%{_sbindir}/bacula-sd +%{_sbindir}/bcopy +%{_sbindir}/bextract +%{_sbindir}/bls +%{_sbindir}/bscan +%{_sbindir}/btape +%{_sbindir}/btraceback +%{_sbindir}/bconsole +%{_sbindir}/dbcheck +%{_sbindir}/bsmtp +%{_sbindir}/bregex +%{_sbindir}/bwild %{_mandir}/man8/bacula-fd.8.%{manpage_ext} %{_mandir}/man8/bacula-dir.8.%{manpage_ext} %{_mandir}/man8/bacula-sd.8.%{manpage_ext} @@ -1865,6 +1898,15 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %{_mandir}/man1/bsmtp.1.%{manpage_ext} %endif +%if ! %{client_only} && ! %{single_dir} +%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo +%doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt +%endif + +%if %{single_dir} +%{_prefix}/doc +%endif + %if %{mysql} %pre mysql # test for bacula database older than version 9 @@ -2113,15 +2155,15 @@ fi %endif -%if ! %{client_only} && %{mtx} +%if ! %{client_only} && %{mtx} && ! %{single_dir} %files mtx %defattr(-,root,root) -%attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo -%attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx -%attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape -%attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo -%attr(-, root, %{storage_daemon_group}) /usr/sbin/nsmhack -%attr(-, root, %{storage_daemon_group}) /usr/sbin/scsieject +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/loaderinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/mtx +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsitape +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/tapeinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/nsmhack +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsieject %{_mandir}/man1/loaderinfo.1.%{manpage_ext} %{_mandir}/man1/mtx.1.%{manpage_ext} %{_mandir}/man1/scsitape.1.%{manpage_ext} @@ -2129,16 +2171,35 @@ fi %{_mandir}/man1/scsieject.1.%{manpage_ext} %endif +%if ! %{client_only} && %{mtx} && %{single_dir} +%files mtx +%defattr(-,root,root) +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/loaderinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/mtx +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsitape +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/tapeinfo +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/nsmhack +%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsieject +%{_mandir}/man1/loaderinfo.1 +%{_mandir}/man1/mtx.1 +%{_mandir}/man1/scsitape.1 +%{_mandir}/man1/tapeinfo.1 +%{_mandir}/man1/scsieject.1 +%endif + %files client %defattr(-,root,root) %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}) %{script_dir}/rescue +%if ! %{single_dir} %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt +%else +%{_prefix}/doc +%endif /etc/logrotate.d/bacula @@ -2147,11 +2208,11 @@ fi %attr(-, root, %{daemon_group}) %dir %{working_dir} -/usr/sbin/bacula-fd -/usr/sbin/btraceback +%{_sbindir}/bacula-fd +%{_sbindir}/btraceback %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx -/usr/sbin/bconsole +%{_sbindir}/bconsole %{_mandir}/man8/bacula-fd.8.%{manpage_ext} %{_mandir}/man8/bacula.8.%{manpage_ext} %{_mandir}/man8/bconsole.8.%{manpage_ext} @@ -2229,7 +2290,7 @@ echo "The database update scripts were installed to %{script_dir}/updatedb" %if %{gconsole} %files gconsole %defattr(-,root,root) -/usr/sbin/bgnome-console +%{_sbindir}/bgnome-console %attr(-, root, %{daemon_group}) %dir %{script_dir} %attr(-, root, %{daemon_group}) %{script_dir}/gconsole %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bgnome-console.conf @@ -2239,7 +2300,7 @@ echo "The database update scripts were installed to %{script_dir}/updatedb" %endif %if %{gconsole} && ! %{rh8} -/usr/sbin/bacula-tray-monitor +%{_sbindir}/bacula-tray-monitor %config(noreplace) %{sysconf_dir}/tray-monitor.conf /usr/share/pixmaps/bacula-tray-monitor.xpm /usr/share/applications/bacula-tray-monitor.desktop @@ -2283,7 +2344,7 @@ fi %if %{wxconsole} %files wxconsole %defattr(-,root,root) -/usr/sbin/bwx-console +%{_sbindir}/bwx-console %attr(-, root, %{daemon_group}) %dir %{sysconf_dir} %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bwx-console.conf /usr/share/pixmaps/wxwin16x16.xpm @@ -2328,7 +2389,7 @@ fi %if %{bat} %files bat %defattr(-,root,root) -/usr/sbin/bat +%{_sbindir}/bat %attr(-, root, %{daemon_group}) %dir %{sysconf_dir} %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bat.conf /usr/share/pixmaps/bat_icon.png @@ -2371,6 +2432,8 @@ fi %endif %changelog +* Sun Aug 24 2008 D. Scott Barninger +- add support for install to /opt/bacula * Sun Aug 17 2008 D. Scott Barninger - remove libtermcap dependancy for FC9 * Mon Aug 04 2008 D. Scott Barninger -- 2.39.5