Add devel subpackage + minor spec changes

This commit is contained in:
Simone Caronni 2012-01-05 18:01:01 +01:00
parent 3edd26e8cd
commit 3b6cb34f9a

View File

@ -28,7 +28,8 @@ Source15: bacula-fd.sysconfig
Source16: bacula-dir.sysconfig
Source17: bacula-sd.sysconfig
Source18: bacula-checkconf
# Bug: hostname is ignored during configure, always picks "uname -n"
# bugs.bacula.org #1805: hostname is ignored during configure, always picks "uname -n"
Patch1: bacula-5.2.2-hostname.patch
Patch2: bacula-5.0.2-openssl.patch
Patch3: bacula-5.2.2-queryfile.patch
@ -260,6 +261,19 @@ different computers. It is based on a client/server architecture.
This package contains the documentation for most of the bacula-packages.
%endif
%package devel
Summary: Bacula development files
Group: Development/Libraries
%description devel
Bacula is a set of programs that allow you to manage the backup,
recovery, and verification of computer data across a network of
different computers. It is based on a client/server architecture.
This development package contains static libraries and header files.
%package -n nagios-plugins-bacula
Summary: Nagios Plugin - check_bacula
Group: Applications/System
@ -354,7 +368,7 @@ popd
# Build the docs
pushd bacula-docs-%{version}
%configure --with-bacula=%{_builddir}/bacula-%{version}
make
%{__make}
popd
for manual in problems console utility developers main misc; do
mkdir $manual
@ -370,72 +384,70 @@ rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
# install the nagios plugin
%{__mkdir_p} %{buildroot}%{_libdir}/nagios/plugins
%{__install} -m0755 examples/nagios/check_bacula/.libs/check_bacula %{buildroot}%{_libdir}/nagios/plugins/
# Nagios plugin
%{__install} -m 755 -D examples/nagios/check_bacula/.libs/check_bacula %{buildroot}%{_libdir}/nagios/plugins/check_bacula
# Remove unused stuff
rm -f %{buildroot}%{_mandir}/man1/bacula-bwxconsole.1*
rm -f %{buildroot}%{_mandir}/man1/bacula-tray-monitor.1*
# Install catalogue dummy
# Catalogue dummy
rm -f %{buildroot}%{_libdir}/libbaccats-%{version}.so
%{__install} -m0755 src/cats/.libs/libbaccats-%{version}.so %{buildroot}%{_libdir}/
%{__install} -m 755 src/cats/.libs/libbaccats-%{version}.so %{buildroot}%{_libdir}/
# Install sample query file
%{__install} -m0640 examples/sample-query.sql %{buildroot}%{_sysconfdir}/bacula/query.sql
# Sample query file
%{__install} -m 640 -D examples/sample-query.sql %{buildroot}%{_sysconfdir}/bacula/query.sql
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
# Bat
install -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat.png
%{__install} -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat.png
desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE13}
# QT Tray monitor
install -m 755 -D src/qt-console/tray-monitor/.libs/bacula-tray-monitor %{buildroot}%{_sbindir}/bacula-tray-monitor
install -m 644 -D src/qt-console/tray-monitor/tray-monitor.conf %{buildroot}%{_sysconfdir}/bacula/tray-monitor.conf
install -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bacula-tray-monitor.png
%{__install} -m 755 -D src/qt-console/tray-monitor/.libs/bacula-tray-monitor %{buildroot}%{_sbindir}/bacula-tray-monitor
%{__install} -m 644 -D src/qt-console/tray-monitor/tray-monitor.conf %{buildroot}%{_sysconfdir}/bacula/tray-monitor.conf
%{__install} -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bacula-tray-monitor.png
desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE14}
%else
rm -f %{buildroot}%{_mandir}/man1/bat.1*
%endif
# logrotate
mkdir -p %{buildroot}%{_localstatedir}/log/bacula
install -m 644 -D %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/bacula
# Logrotate
%{__mkdir_p} %{buildroot}%{_localstatedir}/log/bacula
%{__install} -m 644 -D %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/bacula
# And logwatch
install -m 755 -D scripts/logwatch/bacula %{buildroot}%{_sysconfdir}/logwatch/scripts/services/bacula
install -m 755 -D scripts/logwatch/applybaculadate %{buildroot}%{_sysconfdir}/logwatch/scripts/shared/applybaculadate
install -m 644 -D scripts/logwatch/logfile.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/logfiles/bacula.conf
install -m 644 -D scripts/logwatch/services.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/services/bacula.conf
# Logwatch
%{__install} -m 755 -D scripts/logwatch/bacula %{buildroot}%{_sysconfdir}/logwatch/scripts/services/bacula
%{__install} -m 755 -D scripts/logwatch/applybaculadate %{buildroot}%{_sysconfdir}/logwatch/scripts/shared/applybaculadate
%{__install} -m 644 -D scripts/logwatch/logfile.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/logfiles/bacula.conf
%{__install} -m 644 -D scripts/logwatch/services.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/services/bacula.conf
install -m 755 -D %{SOURCE18} %{buildroot}%{_sbindir}/bacula-checkconf
%{__install} -m 755 -D %{SOURCE18} %{buildroot}%{_sbindir}/bacula-checkconf
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
# Systemd unit files
mkdir -p ${buildroot}%{_unitdir}
install -m 755 -D %{SOURCE10} %{buildroot}%{_unitdir}/bacula-fd.service
install -m 755 -D %{SOURCE11} %{buildroot}%{_unitdir}/bacula-dir.service
install -m 755 -D %{SOURCE12} %{buildroot}%{_unitdir}/bacula-sd.service
%{__mkdir_p} ${buildroot}%{_unitdir}
%{__install} -m 755 -D %{SOURCE10} %{buildroot}%{_unitdir}/bacula-fd.service
%{__install} -m 755 -D %{SOURCE11} %{buildroot}%{_unitdir}/bacula-dir.service
%{__install} -m 755 -D %{SOURCE12} %{buildroot}%{_unitdir}/bacula-sd.service
%else
# Initscripts
install -m 755 -D %{SOURCE7} %{buildroot}%{_initrddir}/bacula-fd
install -m 755 -D %{SOURCE8} %{buildroot}%{_initrddir}/bacula-dir
install -m 755 -D %{SOURCE9} %{buildroot}%{_initrddir}/bacula-sd
%{__install} -m 755 -D %{SOURCE7} %{buildroot}%{_initrddir}/bacula-fd
%{__install} -m 755 -D %{SOURCE8} %{buildroot}%{_initrddir}/bacula-dir
%{__install} -m 755 -D %{SOURCE9} %{buildroot}%{_initrddir}/bacula-sd
%endif
# Sysconfig
install -m 644 -D %{SOURCE15} %{buildroot}%{_sysconfdir}/sysconfig/bacula-fd
install -m 644 -D %{SOURCE16} %{buildroot}%{_sysconfdir}/sysconfig/bacula-dir
install -m 644 -D %{SOURCE17} %{buildroot}%{_sysconfdir}/sysconfig/bacula-sd
%{__install} -m 644 -D %{SOURCE15} %{buildroot}%{_sysconfdir}/sysconfig/bacula-fd
%{__install} -m 644 -D %{SOURCE16} %{buildroot}%{_sysconfdir}/sysconfig/bacula-dir
%{__install} -m 644 -D %{SOURCE17} %{buildroot}%{_sysconfdir}/sysconfig/bacula-sd
# Create the spooling
mkdir -p %{buildroot}%{_localstatedir}/spool/bacula
# Spool directory
%{__mkdir_p} %{buildroot}%{_localstatedir}/spool/bacula
# Nuke the startup scripts we do not need
# Remove stuff we do not need
rm -f %{buildroot}%{_libexecdir}/bacula/{bacula,bacula-ctl-*,startmysql,stopmysql,bconsole}
rm -f %{buildroot}%{_sbindir}/bacula
rm -f %{buildroot}%{_mandir}/man8/bacula.8.gz
rm -f %{buildroot}%{_mandir}/man1/bacula-bwxconsole.1*
rm -f %{buildroot}%{_mandir}/man1/bacula-tray-monitor.1*
rm -rf %{buildroot}%{_datadir}/doc/bacula/
# Fix up some perms so rpmlint does not complain too much
chmod 755 %{buildroot}%{_sbindir}/*
@ -443,11 +455,13 @@ chmod 755 %{buildroot}%{_libdir}/bacula/*
chmod 755 %{buildroot}%{_libexecdir}/bacula/*
chmod 644 %{buildroot}%{_libexecdir}/bacula/btraceback.*
# Remove extra docs
rm -rf %{buildroot}%{_datadir}/doc/bacula/
# Remove local archives
rm -f %{buildroot}%{_libdir}/*.la
# Install headers
%{__mkdir_p} %{buildroot}%{_includedir}/bacula
%{__install} -m 644 src/*.h %{buildroot}%{_includedir}/bacula
for dir in cats console dird filed findlib lib plugins/sd plugins/fd stored; do
%{__mkdir_p} %{buildroot}%{_includedir}/bacula/$dir
%{__install} -m 644 src/$dir/*.h %{buildroot}%{_includedir}/bacula/$dir
done
%clean
@ -460,6 +474,7 @@ rm -rf %{buildroot}
/usr/sbin/alternatives --install %{_libdir}/libbaccats-%{version}.so libbaccats-%{version}.so %{_libdir}/libbaccats-postgresql-%{version}.so 60
/sbin/ldconfig
%preun libs
if [ "$1" = 0 ]; then
/usr/sbin/alternatives --remove libbaccats-%{version}.so %{_libdir}/libbaccats-mysql-%{version}.so
@ -468,12 +483,14 @@ if [ "$1" = 0 ]; then
fi
/sbin/ldconfig
%pre common
getent group %username >/dev/null || groupadd -g %uid -r %username &>/dev/null || :
getent passwd %username >/dev/null || useradd -u %uid -r -s /sbin/nologin \
-d /var/spool/bacula -M -c 'Bacula Backup System' -g %username %username &>/dev/null || :
exit 0
%postun common
test "$1" != 0 || userdel %username &>/dev/null || :
test "$1" != 0 || groupdel %username &>/dev/null || :
@ -796,6 +813,20 @@ fi
%doc problems* console* utility* developers* main* misc*
%endif
%files devel
%defattr(-,root,root,-)
%{_includedir}/bacula
%{_libdir}/libbac.la
%{_libdir}/libbaccats.la
%{_libdir}/libbaccats-mysql.la
%{_libdir}/libbaccats-postgresql.la
%{_libdir}/libbaccats-sqlite3.la
%{_libdir}/libbacsql.la
%{_libdir}/libbaccfg.la
%{_libdir}/libbacfind.la
%{_libdir}/libbacpy.la
%files -n nagios-plugins-bacula
%defattr(-,root,root)
%{_libdir}/nagios/plugins/check_bacula
@ -804,6 +835,7 @@ fi
%changelog
* Thu Jan 05 2012 Simone Caronni <negativo17@gmail.com> - 5.2.3-6
- Make docs conditional at build for testing.
- Add devel subpackage.
* Tue Jan 03 2012 Simone Caronni <negativo17@gmail.com> - 5.2.3-5
- Trim changelog.