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