From 49e88355e357cd92c499c1fdfd418ef9c9b85dcd Mon Sep 17 00:00:00 2001 From: Bernard Johnson Date: Sep 26 2011 22:35:17 +0000 Subject: Merge branch 'master' into el5 --- diff --git a/BackupPC.spec b/BackupPC.spec index 15398a2..1bcfb59 100644 --- a/BackupPC.spec +++ b/BackupPC.spec @@ -2,13 +2,21 @@ %global _without_selinux 1 %endif +# tmpfiles.d support starts in Fedora 15 +%if 0%{?fedora} && 0%{?fedora} > 14 +%global _with_tmpfilesd 1 +%endif + +# systemd was introduced in Fedora 15, but we don't support it until Fedora 16 %if 0%{?fedora} && 0%{?fedora} > 15 %global _with_systemd 1 %endif +%global _updatedb_conf /etc/updatedb.conf + Name: BackupPC Version: 3.2.1 -Release: 1%{?dist} +Release: 6%{?dist} Summary: High-performance backup system Group: Applications/System @@ -95,7 +103,7 @@ cp %{SOURCE4} BackupPC_Admin.c pushd selinux cat >%{name}.te <%{name}.fc < /dev/null +if [ -w %{_updatedb_conf} ]; then + grep ^PRUNEPATHS %{_updatedb_conf} | grep %{_sharedstatedir}/%{name} > /dev/null if [ $? -eq 1 ]; then - sed -i '\@PRUNEPATHS@s@"$@ '%{_sharedstatedir}/%{name}'"@' $UPDATEDB + sed -i '\@PRUNEPATHS@s@"$@ '%{_sharedstatedir}/%{name}'"@' %{_updatedb_conf} fi fi +: %postun +# clear out any BackupPC configuration in apache service httpd condrestart > /dev/null 2>&1 || : -%if ! 0%{?_without_selinux} -if [ "$1" -eq "0" ]; then - ( - # Remove the SElinux policy. - semodule -r %{name} || : - )&>/dev/null - - # remove BackupPC backup directories from PRUNEPATHS in locate database - if [ -w $UPDATEDB ]; then - sed -i '\@PRUNEPATHS@s@[ ]*'%{_sharedstatedir}/%{name}'@@' $UPDATEDB - fi + +if [ $1 -eq 0 ]; then + # uninstall + %if ! 0%{?_without_selinux} + # Remove the SElinux policy. + semodule -r %{name} &> /dev/null || : + %endif + + # remove BackupPC backup directories from PRUNEPATHS in locate database + if [ -w %{_updatedb_conf} ]; then + sed -i '\@PRUNEPATHS@s@[ ]*'%{_sharedstatedir}/%{name}'@@' %{_updatedb_conf} || : + fi fi -%endif -if [ $1 -ge 1 ]; then - # Package upgrade, not uninstall + +if [ $1 -eq 1 ]; then + # package upgrade, not uninstall %if 0%{?_with_systemd} /bin/systemctl try-restart backuppc.service > /dev/null 2>&1 || : %endif + # at least one command required + : fi - %files %defattr(-,root,root,-) %doc README README.fedora ChangeLog LICENSE doc/ @@ -293,12 +311,16 @@ fi %dir %{_datadir}/%{name}/sbin %{_datadir}/%{name}/[^s]* +%if 0%{?_with_tmpfilesd} +%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf +%else +%dir %attr(0775,backuppc,backuppc) %{_localstatedir}/run/%{name} +%endif + %if 0%{?_with_systemd} %{_unitdir}/backuppc.service -%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf %else %attr(0755,root,root) %{_initrddir}/backuppc -%dir %attr(0775,backuppc,backuppc) %{_localstatedir}/run/%{name} %endif %attr(4750,backuppc,apache) %{_datadir}/%{name}/sbin/BackupPC_Admin @@ -310,6 +332,17 @@ fi %endif %changelog +* Wed Sep 21 2011 Bernard Johnson - 3.2.1-6 +- fix postun scriptlet error (bz #736946) +- make postun scriptlet more coherent +- change selinux context on log files to httpd_log_t and allow access + to them (bz #730704) + +* Fri Aug 12 2011 Bernard Johnson - 3.2.1-4 +- change macro conditionals to include tmpfiles.d support starting at + Fedora 15 (bz #730053) +- change install lines to preserve timestamps + * Fri Jul 08 2011 Bernard Johnson - 3.2.1-1 - v 3.2.1 - add lower case script URL alias for typing impaired diff --git a/BackupPC.tmpfiles b/BackupPC.tmpfiles index 9d940cc..3df527d 100644 --- a/BackupPC.tmpfiles +++ b/BackupPC.tmpfiles @@ -1 +1 @@ -D /var/run/BackupPC backukppc backuppc 775 - +D /var/run/BackupPC 0775 root backuppc -