diff options
author | Günther Deschner <gdeschner@redhat.com> | 2012-07-02 14:42:28 +0200 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2013-03-22 14:10:55 -0400 |
commit | a67b2c9c103851a70bc5b89d45e0e8fc046f107b (patch) | |
tree | 0b69a10b09ffd13adf6925bc5469b452766e4cb0 /proxy/contrib | |
parent | e2405b5c507b7711dc7f6a3cd933ed4acd21d2dd (diff) | |
download | gss-proxy-a67b2c9c103851a70bc5b89d45e0e8fc046f107b.tar.gz gss-proxy-a67b2c9c103851a70bc5b89d45e0e8fc046f107b.tar.xz gss-proxy-a67b2c9c103851a70bc5b89d45e0e8fc046f107b.zip |
Add systemd packaging to gssproxy spec file.
Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'proxy/contrib')
-rw-r--r-- | proxy/contrib/gssproxy.spec.in | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/proxy/contrib/gssproxy.spec.in b/proxy/contrib/gssproxy.spec.in index 046dba1..58774a6 100644 --- a/proxy/contrib/gssproxy.spec.in +++ b/proxy/contrib/gssproxy.spec.in @@ -18,6 +18,9 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Requires: krb5-libs >= 1.11.1 Requires: keyutils-libs +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units ### Build Dependencies ### @@ -38,6 +41,7 @@ BuildRequires: iniparser-devel BuildRequires: libverto-devel BuildRequires: popt-devel BuildRequires: findutils +BuildRequires: systemd-units %description @@ -64,7 +68,9 @@ rm -rf $RPM_BUILD_ROOT cd proxy make install DESTDIR=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/gssproxy +mkdir -p $RPM_BUILD_ROOT/%{_unitdir} install -m644 examples/gssproxy-example.conf $RPM_BUILD_ROOT%{_sysconfdir}/gssproxy/gssproxy.conf +install -m644 systemd/gssproxy.service $RPM_BUILD_ROOT%{_unitdir}/gssproxy.service %clean rm -rf $RPM_BUILD_ROOT @@ -72,7 +78,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -#%{_initrddir}/%{name} +%{_unitdir}/gssproxy.service %{_sbindir}/gssproxy %attr(755,root,root) %dir %{pubconfpath} %attr(0600,root,root) %config(noreplace) /%{_sysconfdir}/gssproxy/gssproxy.conf @@ -81,22 +87,29 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man8/gssproxy.8* %post -/sbin/ldconfig -/sbin/chkconfig --add %{servicename} - -if [ $1 -ge 1 ] ; then - /sbin/service %{servicename} condrestart 2>&1 > /dev/null +if [ $1 -eq 1 ] ; then + # Initial installation + /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi %preun -if [ $1 = 0 ]; then - /sbin/service %{servicename} stop 2>&1 > /dev/null - /sbin/chkconfig --del %{servicename} +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl --no-reload disable gssproxy.service > /dev/null 2>&1 || : + /bin/systemctl stop gssproxy.service > /dev/null 2>&1 || : +fi + +%postun +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + /bin/systemctl try-restart gssproxy.service >/dev/null 2>&1 || : fi %changelog * Fri Mar 22 2013 Guenther Deschner <gdeschner@redhat.com> - @PACKAGE_VERSION@-0@PRERELEASE_VERSION@ - Various specfile and packaging fixes +- Add systemd packaging * Mon Dec 12 2011 Simo Sorce <simo@redhat.com> - 0.0.1-0 - Automated build of the gssproxy daemon |