SPECS: sethdlc.spec - use %service, fix chkconfig deps

glen glen at pld-linux.org
Thu Apr 20 19:39:34 CEST 2006


Author: glen                         Date: Thu Apr 20 17:39:34 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use %service, fix chkconfig deps

---- Files affected:
SPECS:
   sethdlc.spec (1.14 -> 1.15) 

---- Diffs:

================================================================
Index: SPECS/sethdlc.spec
diff -u SPECS/sethdlc.spec:1.14 SPECS/sethdlc.spec:1.15
--- SPECS/sethdlc.spec:1.14	Thu Aug 11 11:46:18 2005
+++ SPECS/sethdlc.spec	Thu Apr 20 19:39:29 2006
@@ -16,6 +16,11 @@
 Source1:	%{name}.init
 Patch0:		%{name}-tahoe.patch
 URL:		http://www.kernel.org/pub/linux/utils/net/hdlc/
+BuildRequires:	rpmbuild(macros) >= 1.268
+%if %{with tahoe}
+Requires(post,preun):	/sbin/chkconfig
+Requires:	rc-scripts
+%endif
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -35,7 +40,7 @@
 %{__make} \
 	CC="%{__cc}" \
 	CFLAGS="%{rpmcflags}"\
-%if !%{with tahoe}
+%if %{without tahoe}
 	INCLUDES=""
 %endif
 
@@ -54,18 +59,12 @@
 %if %{with tahoe}
 %post
 /sbin/chkconfig --add sethdlc
-if [ -r /var/lock/subsys/sethdlc ]; then
-        /etc/rc.d/init.d/sethdlc restart >&2
-else
-        echo "Run \"/etc/rc.d/init.d/sethdlc start\" to start TPNET Frame Relay."
-fi
+%service sethdlc restart "TPNET Frame Relay"
 
 %preun
 if [ "$1" = "0" ]; then
-        if [ -r /var/lock/subsys/sethdlc ]; then
-                /etc/rc.d/init.d/sethdlc stop >&2
-        fi
-        /sbin/chkconfig --del sethdlc
+	%service sethdlc stop
+	/sbin/chkconfig --del sethdlc
 fi
 %endif
 
@@ -82,6 +81,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.15  2006/04/20 17:39:29  glen
+- use %service, fix chkconfig deps
+
 Revision 1.14  2005/08/11 09:46:18  radek
 - bcond_with(out) is followed by one \t, then bcond's name.
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/sethdlc.spec?r1=1.14&r2=1.15&f=u



More information about the pld-cvs-commit mailing list