[android-tools] Use systemd macros
Ivan Afonichev
van at fedoraproject.org
Tue Jan 29 22:15:52 UTC 2013
commit a7b422e4c3447757c0f475b36a5b23057d3f4453
Author: Ivan Afonichev <ivan.afonichev at gmail.com>
Date: Wed Jan 30 02:15:13 2013 +0400
Use systemd macros
android-tools.spec | 25 +++++++------------------
1 files changed, 7 insertions(+), 18 deletions(-)
---
diff --git a/android-tools.spec b/android-tools.spec
index dd7cd8f..bd747b7 100644
--- a/android-tools.spec
+++ b/android-tools.spec
@@ -30,13 +30,13 @@ Source4: fastboot-Makefile
Source5: 51-android.rules
Source6: adb.service
-Requires(post): systemd-units
-Requires(preun): systemd-units
-Requires(postun): systemd-units
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
BuildRequires: zlib-devel
BuildRequires: openssl-devel
BuildRequires: libselinux-devel
-BuildRequires: systemd-units
+BuildRequires: systemd
Provides: adb
Provides: fastboot
@@ -79,24 +79,13 @@ install -p -D -m 0644 %{SOURCE6} \
%{buildroot}%{_unitdir}/adb.service
%post
-if [ "$1" -eq "1" ] ; then
- # Initial installation
- /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post adb.service
%preun
-if [ "$1" -eq "0" ] ; then
- # Package removal, not upgrade
- /bin/systemctl --no-reload disable adb.service > /dev/null 2>&1 || :
- /bin/systemctl stop adb.service > /dev/null 2>&1 || :
-fi
+%systemd_preun adb.service
%postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ "$1" -ge "1" ] ; then
- # Package upgrade, not uninstall
- /bin/systemctl try-restart adb.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart adb.service
%files
%doc adb/OVERVIEW.TXT adb/SERVICES.TXT adb/NOTICE adb/protocol.txt 51-android.rules
More information about the scm-commits
mailing list