[apt/f16] add missing systemd scriptlets

Tom Callaway spot at fedoraproject.org
Fri Sep 9 16:27:52 UTC 2011


commit 31fa1aba1cebba7526e6fac035b7732d2db7e9a6
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Fri Sep 9 12:27:39 2011 -0400

    add missing systemd scriptlets

 apt.spec |   32 ++++++++++++++++++++++++++++----
 1 files changed, 28 insertions(+), 4 deletions(-)
---
diff --git a/apt.spec b/apt.spec
index 3b022ee..42cb0ce 100644
--- a/apt.spec
+++ b/apt.spec
@@ -10,7 +10,7 @@
 Summary: Debian's Advanced Packaging Tool with RPM support
 Name: apt
 Version: %{aptver}
-Release: 1.%{snapver}.1%{?dist}
+Release: 2.%{snapver}.1%{?dist}
 Group: System Environment/Base
 URL: http://apt-rpm.org/
 # SourceLicense: GPLv2+ except lua/ which is MIT
@@ -70,6 +70,9 @@ Requires: gnupg
 Requires: bzip2
 Requires: system-release >= 4
 Requires(post): systemd-sysv
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
 %if 0%{!?_with_groupinstall:1}
 Obsoletes: %{name}-plugins-groupinstall < %{version}-%{release}
 %endif
@@ -244,9 +247,27 @@ install -pm 644 contrib/log/log.conf %{buildroot}/%{_sysconfdir}/apt/apt.conf.d/
 # nuke .la files
 rm -f %{buildroot}%{_libdir}/*.la
 
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
+%post
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+/sbin/ldconfig
+
+%preun
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable apt.service > /dev/null 2>&1 || :
+    /bin/systemctl stop apt.service > /dev/null 2>&1 || :
+fi
+
+%postun
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart apt.service >/dev/null 2>&1 || :
+fi
+/sbin/ldconfig
 
 %triggerun -- apt < 0.5.15lorg3.95-1.git522.1
 # Save the current service runlevel info
@@ -334,6 +355,9 @@ rm -f %{buildroot}%{_libdir}/*.la
 
 
 %changelog
+* Fri Sep  9 2011 Tom Callaway <spot at fedoraproject.org> - 0.5.15lorg3.95-2.git522.1
+- add missing systemd scriptlets
+
 * Fri Sep  9 2011 Tom Callaway <spot at fedoraproject.org> - 0.5.15lorg3.95-1.git522.1
 - convert to systemd
 


More information about the scm-commits mailing list