[avahi/f14/master] replace systemd-install by systemctl enable

Lennart Poettering lennart at fedoraproject.org
Wed Aug 4 01:31:25 UTC 2010


commit 5bc6de5b680bd2654be27621f5a9ed8a4677ee09
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Aug 4 03:31:17 2010 +0200

    replace systemd-install by systemctl enable

 avahi.spec |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/avahi.spec b/avahi.spec
index 8af5527..0b23bfa 100644
--- a/avahi.spec
+++ b/avahi.spec
@@ -6,7 +6,7 @@
 %endif
 Name:           avahi
 Version:        0.6.27
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Local network service discovery
 Group:          System Environment/Base
 License:        LGPLv2
@@ -37,7 +37,7 @@ BuildRequires:  expat-devel
 BuildRequires:  python
 BuildRequires:  gdbm-devel
 BuildRequires:  pygtk2
-BuildRequires:	intltool
+BuildRequires:  intltool
 BuildRequires:  perl-XML-Parser
 %if %{WITH_MONO}
 BuildRequires:  mono-devel >= 1.1.13
@@ -330,7 +330,7 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/avahi/services/sftp-ssh.service
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/avahi-daemon
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/avahi-autoipd
 
-# remove the documentation directory - let \%doc handle it:
+# remove the documentation directory - let % doc handle it:
 rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
 
 # Make /etc/avahi/etc/localtime owned by avahi:
@@ -371,27 +371,28 @@ getent passwd avahi >/dev/null 2>&1 || useradd \
 %post
 /sbin/ldconfig
 dbus-send --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig >/dev/null 2>&1 || :
-# Run avahi-daemon by default:
 /sbin/chkconfig --add avahi-daemon >/dev/null 2>&1 || :
-/usr/bin/systemd-install --realize=minimal enable avahi-daemon.service >/dev/null 2>&1 || :
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
 if [ "$1" -eq 1 ]; then
    if [ -s /etc/localtime ]; then
         cp -cfp /etc/localtime /etc/avahi/etc/localtime || :
    fi
 fi
 
+%triggerin -- avahi < 0.6.26-1
+if /sbin/chkconfig avahi-daemon ; then
+    /bin/systemctl enable avahi-daemon.service >/dev/null 2>&1 || :
+fi
+
 %preun
 if [ "$1" -eq 0 ]; then
+    /bin/systemctl disable avahi-daemon.service >/dev/null 2>&1 || :
     /sbin/service avahi-daemon stop >/dev/null 2>&1 || :
     /sbin/chkconfig --del avahi-daemon >/dev/null 2>&1 || :
-    /usr/bin/systemd-install --realize disable avahi-daemon.service >/dev/null 2>&1 || :
 fi
 
 %postun
 /sbin/ldconfig || :
-if [ "$1" -ge "1" ]; then
-   /sbin/service avahi-daemon condrestart >/dev/null 2>&1 || :
-fi
 
 %pre autoipd
 getent group avahi-autoipd >/dev/null 2>&1 || groupadd \
@@ -409,15 +410,14 @@ getent passwd avahi-autoipd >/dev/null 2>&1 || useradd \
 :;
 
 %post dnsconfd
-# avahi-dnsconfd NOT run by default in any runlevel; add it
-# so system-config-services can see it
 /sbin/chkconfig --add avahi-dnsconfd >/dev/null 2>&1 || :
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
 
 %preun dnsconfd
 if [ "$1" -eq 0 ]; then
+    /bin/systemctl disable avahi-dnsconfd.service >/dev/null 2>&1 || :
     /sbin/service avahi-dnsconfd stop >/dev/null 2>&1 || :
     /sbin/chkconfig --del avahi-dnsconfd >/dev/null 2>&1 || :
-    /usr/bin/systemd-install --realize disable avahi-dnsconfd.service >/dev/null 2>&1 || :
 fi
 
 %postun dnsconfd
@@ -425,6 +425,11 @@ if [ "$1" -ge "1" ]; then
    /sbin/service avahi-dnsconfd condrestart >/dev/null 2>&1 || :
 fi
 
+%triggerin dnsconfd -- avahi-dnsconfd < 0.6.26-1
+if /sbin/chkconfig avahi-dnsconfd ; then
+    /bin/systemctl enable avahi-dnsconfd.service >/dev/null 2>&1 || :
+fi
+
 %post glib -p /sbin/ldconfig
 %postun glib -p /sbin/ldconfig
 
@@ -639,6 +644,9 @@ fi
 %endif
 
 %changelog
+* Wed Aug  4 2010 Lennart Poettering <lpoetter at redhat.com> - 0.6.27-3
+- convert from systemd-install to systemctl enable
+
 * Wed Jul 21 2010 David Malcolm <dmalcolm at redhat.com> - 0.6.27-2
 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
 


More information about the scm-commits mailing list