[hekafs] hekafs-0.7-17 fix BZ 748443, convert init.d to native systemd for f17 and later

Kaleb S. KEITHLEY kkeithle at fedoraproject.org
Tue Nov 8 14:09:43 UTC 2011


commit 04562b0bafce72fc004d6e393e86613bfed5c92d
Author: Kaleb S. KEITHLEY <kkeithle at redhat.com>
Date:   Tue Nov 8 09:08:42 2011 -0500

    hekafs-0.7-17
    fix BZ 748443, convert init.d to native systemd for f17 and later

 hekafs.spec |   42 ++++++++++++++++++++++++++++++++++--------
 sources     |    1 +
 2 files changed, 35 insertions(+), 8 deletions(-)
---
diff --git a/hekafs.spec b/hekafs.spec
index 487a55e..e9e51ba 100644
--- a/hekafs.spec
+++ b/hekafs.spec
@@ -2,7 +2,7 @@
 Summary:          Heka File System
 Name:             hekafs
 Version:          0.7
-Release:          16%{?dist}
+Release:          17%{?dist}
 License:          AGPLv3+
 Group:            System Environment/Base
 Vendor:           Red Hat
@@ -19,10 +19,25 @@ BuildRequires:    libtool
 Requires:         glusterfs = 3.2.4
 Requires:         openssl
 Requires:         python
+%if 0%{?fedora} < 17
 Requires(post):   /sbin/chkconfig
 Requires(preun):  /sbin/service
 Requires(preun):  /sbin/chkconfig
 Requires(postun): /sbin/service
+%define _daemon_enable()  /sbin/chkconfig --add %1 ;
+%define _daemon_disable() /sbin/chkconfig --del %1 ;
+%define _daemon_restart() /sbin/service %1 condrestart &>/dev/null ;
+%define _daemon_stop()    /sbin/service %1 stop &>/dev/null ;
+%else
+BuildRequires:    systemd-units
+Requires(post):   systemd-units
+Requires(preun):  systemd-units
+Requires(postun): systemd-units
+%define _daemon_enable()  /bin/systemctl enable %1.service ;
+%define _daemon_disable() /bin/systemctl disable %1.service ;
+%define _daemon_restart() /bin/systemctl try-restart %1.service ;
+%define _daemon_stop()    /bin/systemctl stop %1.service ;
+%endif
 Obsoletes:        cloudfs <= 0:0.7-6
 
 %description
@@ -61,12 +76,16 @@ with additional authentication/encryption/multi-tenancy features.
 %{__ln_s} %{python_sitelib}/hfs_stop_volume.py %{buildroot}%{_bindir}/hfs_stop_volume
 %{__ln_s} %{python_sitelib}/hfs_update_cert.py %{buildroot}%{_bindir}/hfs_update_cert
 %{__mkdir} %{buildroot}%{_sysconfdir}/
+%if 0%{?fedora} < 17
 %{__install} -D -p -m0755 hekafsd %{buildroot}%{_sysconfdir}/init.d/hekafsd
+%else
+%{__install} -D -p -m 0644 hekafsd.service %{buildroot}%{_unitdir}/hekafsd.service
+%endif
 %{__mkdir} -p %{buildroot}%{_var}/log/hekafs
 %{__mkdir} -p %{buildroot}%{_var}/lib/hekafs
-%{__mkdir} -p %{buildroot}%{_var}/run/hekafs
-%{__mkdir} %{buildroot}%{_var}/run/hekafs/idle_ports
-%{__mkdir} %{buildroot}%{_var}/run/hekafs/used_ports
+%{__mkdir} -p %{buildroot}/run/hekafs
+%{__mkdir} %{buildroot}/run/hekafs/idle_ports
+%{__mkdir} %{buildroot}/run/hekafs/used_ports
 %{__mkdir} -p %{buildroot}%{_mandir}/man8
 %{__gzip} -c doc/hfs_add_directory.8 > %{buildroot}%{_mandir}/man8/hfs_add_directory.8.gz
 %{__gzip} -c doc/hfs_add_node.8 > %{buildroot}%{_mandir}/man8/hfs_add_node.8.gz
@@ -96,22 +115,29 @@ find %{buildroot}%{_libdir}/glusterfs -name '*.la' -delete
 %{_libdir}/glusterfs/3.2.4/rpc-transport/*.so*
 %{python_sitelib}/*
 %{_bindir}/*
+%if 0%{?fedora} < 17
 %{_sysconfdir}/init.d/hekafsd
+%else
+%{_unitdir}/hekafsd.service
+%endif
 %{_var}/log/hekafs/
 %{_var}/lib/hekafs/
-%{_var}/run/hekafs/
+/run/hekafs/
 %{_mandir}/man8/*
 
 %post
-/sbin/chkconfig --add hekafsd
+%_daemon_enable hekafsd
 
 %preun
 if [ $1 = 0 ]; then
-/sbin/service hekafsd stop &>/dev/null || :
-/sbin/chkconfig --del hekafsd
+%_daemon_stop hekafsd
+%_daemon_disable hekafsd
 fi
 
 %changelog
+* Tue Nov 8 2011 Kaleb S. KEITHLEY <kkeithle at redhat.com> - 0.7-17
+- fix for BZ 748443, convert init.d to systemd
+
 * Fri Oct 21 2011 Kaleb S. KEITHLEY <kkeithle at redhat.com> - 0.7-16
 - fix for BZ 747112
 
diff --git a/sources b/sources
index b76ef97..629b373 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
 466eefa3b8d8664f83f7f785ad4f0b97  hekafs-0.7.tgz
+13c84b88d3e10b3dd657c0cf6c190f42  hekafs-0.7.tgz


More information about the scm-commits mailing list