template-specs: template.spec - added systemd service bits

baggins baggins at pld-linux.org
Fri Apr 20 12:52:57 CEST 2012


Author: baggins                      Date: Fri Apr 20 10:52:57 2012 GMT
Module: template-specs                Tag: HEAD
---- Log message:
- added systemd service bits

---- Files affected:
template-specs:
   template.spec (1.80 -> 1.81) 

---- Diffs:

================================================================
Index: template-specs/template.spec
diff -u template-specs/template.spec:1.80 template-specs/template.spec:1.81
--- template-specs/template.spec:1.80	Wed Mar 28 13:16:34 2012
+++ template-specs/template.spec	Fri Apr 20 12:52:52 2012
@@ -23,6 +23,11 @@
 Requires(post,preun):	/sbin/chkconfig
 Requires:	rc-scripts
 %endif
+%if %{with systemd_service}
+BuildRequires:	rpmbuild(macros) >= 1.647
+Requires(post,preun,postun):	systemd-units >= 38
+Requires:	systemd-units >= 0.38
+%endif
 #BuildRequires:	-
 #BuildRequires:	autoconf
 #BuildRequires:	automake
@@ -163,17 +168,28 @@
 %endif
 
 %if %{with initscript}
-%post init
+%post
 /sbin/chkconfig --add %{name}
 %service %{name} restart
 
-%preun init
+%preun
 if [ "$1" = "0" ]; then
 	%service -q %{name} stop
 	/sbin/chkconfig --del %{name}
 fi
 %endif
 
+%if %{with systemd_service}
+%post
+%systemd_post %{name}.service
+
+%preun
+%systemd_preun %{name}.service
+
+%postun
+%systemd_reload
+%endif
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS CREDITS CHANGES ChangeLog NEWS README THANKS TODO
@@ -192,6 +208,10 @@
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
 %endif
 
+%if %{with systemd_service}
+%{systemdunitdir}/%{name}.service
+%endif
+
 #%{_examplesdir}/%{name}-%{version}
 
 %if %{with subpackage}
@@ -207,6 +227,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.81  2012/04/20 10:52:52  baggins
+- added systemd service bits
+
 Revision 1.80  2012/03/28 11:16:34  baggins
 - trim changelog
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/template-specs/template.spec?r1=1.80&r2=1.81



More information about the pld-cvs-commit mailing list