summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElan Ruusamäe2006-04-20 17:56:02 (GMT)
committercvs2git2012-06-24 12:13:13 (GMT)
commit94beff397b909c4ab7f0e286834211bad7068b6e (patch)
tree8b5f1588ce120600c61cdc37176afc6bde06b4f8
parentab7328e5e6acfef12bccdfbd1aedfbdc9897b8fc (diff)
downloadupsmonitor-94beff397b909c4ab7f0e286834211bad7068b6e.zip
upsmonitor-94beff397b909c4ab7f0e286834211bad7068b6e.tar.gz
- use %service, add chkconfig deps, add missing %preun
Changed files: upsmonitor.spec -> 1.8
-rw-r--r--upsmonitor.spec18
1 files changed, 11 insertions, 7 deletions
diff --git a/upsmonitor.spec b/upsmonitor.spec
index 8f1b33f..3bdbadf 100644
--- a/upsmonitor.spec
+++ b/upsmonitor.spec
@@ -4,16 +4,18 @@ Name: upsmonitor
Version: 1.0.11
Release: 1
License: Free
-Vendor: Artur Miarecki (MAYANET) artur.miarecki@mayanet.pl
Group: Daemons
-Requires: /bin/mail
Source0: http://download.mayanet.pl/ups_monitor/arch/%{version}/%{name}.pl
Source1: http://download.mayanet.pl/ups_monitor/arch/%{version}/%{name}.conf
Source2: http://download.mayanet.pl/ups_monitor/historia.txt
-Source10: %{name}-readme.txt
# http://download.mayanet.pl/ups_monitor/readme.txt
+Source10: %{name}-readme.txt
Source11: %{name}.init
URL: http://download.mayanet.pl/ups_monitor/
+BuildRequires: rpmbuild(macros) >= 1.268
+Requires(post,preun): /sbin/chkconfig
+Requires: /bin/mail
+Requires: rc-scripts
ExclusiveArch: %{ix86}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -42,10 +44,12 @@ rm -rf $RPM_BUILD_ROOT
%post
/sbin/chkconfig --add upsmonitor
-if [ -f /var/lock/subsys/upsmonitor ]; then
- /etc/rc.d/init.d/upsmonitor restart 1>&2
-else
- echo "Run \"/etc/rc.d/init.d/upsmoinitor start\" to start ups_monitor."
+%service upsmonitor restart "ups_monitor"
+
+%preun
+if [ "$1" = "0" ]; then
+ %service upsmonitor stop
+ /sbin/chkconfig --del upsmonitor
fi
%files