# 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 <barninger@fairfieldcomputers.com>
%{?contrib_packager:%define _packager %{contrib_packager}}
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.
%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.
%endif
%configure \
- --prefix=/usr \
- --sbindir=/usr/sbin \
+ --prefix=%{_prefix} \
+ --sbindir=%{_sbindir} \
--sysconfdir=%{sysconf_dir} \
--with-scriptdir=%{script_dir} \
--with-working-dir=%{working_dir} \
make
%configure \
- --prefix=/usr \
- --sbindir=/usr/sbin \
+ --prefix=%{_prefix} \
+ --sbindir=%{_sbindir} \
--sysconfdir=%{sysconf_dir} \
--with-scriptdir=%{script_dir} \
--with-working-dir=%{working_dir} \
--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} \
%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} \
%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} \
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}
# 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
%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
%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}
%{_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
%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}
%{_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
%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}
%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
%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
%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
%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
%endif
%changelog
+* Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add support for install to /opt/bacula
* Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
- remove libtermcap dependancy for FC9
* Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
# 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 <barninger@fairfieldcomputers.com>
%{?contrib_packager:%define _packager %{contrib_packager}}
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.
%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.
%endif
%configure \
- --prefix=/usr \
- --sbindir=/usr/sbin \
+ --prefix=%{_prefix} \
+ --sbindir=%{_sbindir} \
--sysconfdir=%{sysconf_dir} \
--with-scriptdir=%{script_dir} \
--with-working-dir=%{working_dir} \
make
%configure \
- --prefix=/usr \
- --sbindir=/usr/sbin \
+ --prefix=%{_prefix} \
+ --sbindir=%{_sbindir} \
--sysconfdir=%{sysconf_dir} \
--with-scriptdir=%{script_dir} \
--with-working-dir=%{working_dir} \
--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} \
%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} \
%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} \
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}
# 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
%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
%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}
%{_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
%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}
%{_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
%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}
%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
%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
%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
%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
%endif
%changelog
+* Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add support for install to /opt/bacula
* Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
- remove libtermcap dependancy for FC9
* Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
# 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 <barninger@fairfieldcomputers.com>
%{?contrib_packager:%define _packager %{contrib_packager}}
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.
%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.
%endif
%configure \
- --prefix=/usr \
- --sbindir=/usr/sbin \
+ --prefix=%{_prefix} \
+ --sbindir=%{_sbindir} \
--sysconfdir=%{sysconf_dir} \
--with-scriptdir=%{script_dir} \
--with-working-dir=%{working_dir} \
make
%configure \
- --prefix=/usr \
- --sbindir=/usr/sbin \
+ --prefix=%{_prefix} \
+ --sbindir=%{_sbindir} \
--sysconfdir=%{sysconf_dir} \
--with-scriptdir=%{script_dir} \
--with-working-dir=%{working_dir} \
--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} \
%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} \
%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} \
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}
# 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
%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
%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}
%{_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
%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}
%{_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
%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}
%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
%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
%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
%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
%endif
%changelog
+* Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add support for install to /opt/bacula
* Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
- remove libtermcap dependancy for FC9
* Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>