From ea25762b6b4cb1f3b605e41cbd63bf8bf74cdf7ebe936322092921e903b4b4ca Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 15 Nov 2012 00:51:48 +0000 Subject: [PATCH] Systemd service file OBS-URL: https://build.opensuse.org/package/show/filesystems/glusterfs?expand=0&rev=16 --- glusterfs.changes | 1 + glusterfs.spec | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/glusterfs.changes b/glusterfs.changes index f903d64..6b36229 100644 --- a/glusterfs.changes +++ b/glusterfs.changes @@ -4,6 +4,7 @@ Fri Nov 9 21:47:11 UTC 2012 - jengelh@inai.de - Update to new upstream release 3.4.0qa2 * No changelog provided by upstream - Remove glusterfs-init.diff, merged upstream +- Provide systemd service file ------------------------------------------------------------------- Wed Oct 31 12:19:47 UTC 2012 - jengelh@inai.de diff --git a/glusterfs.spec b/glusterfs.spec index 33b990e..6cfc644 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -31,6 +31,7 @@ Url: http://gluster.org/ #Git-Clone: git://github.com/gluster/glusterfs Source: %name-%rversion.tar.xz +Source3: glusterd.service Patch1: glusterfs-date.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: automake @@ -53,6 +54,9 @@ BuildRequires: pkgconfig(libcrypto) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(uuid) %endif +%if 0%{?suse_version} >= 1210 +BuildRequires: systemd +%endif Requires: python %description @@ -161,19 +165,24 @@ find "$b/%_libdir" -maxdepth 1 -type f -name "*.la" -delete; # W: wrong-file-end-of-line-encoding perl -i -pe 's{\x0d\x0a}{\x0a}gs' %_docdir/%name/glusterfs-mode.el; +%if 0%{?_unitdir:1} +mkdir -p "$b/%_unitdir"; +install -pm0644 "%{S:3}" "$b/%_unitdir/"; +%endif + %fdupes %buildroot +%pre +%service_add_pre glusterd.service + %post -/sbin/ldconfig -%insserv_cleanup -%restart_on_update glusterd +%service_add_post glusterd.service %preun -%stop_on_removal glusterd +%service_del_preun glusterd.service %postun -/sbin/ldconfig -%insserv_cleanup +%service_del_postun glusterd.service %post -n %lname_api -p /sbin/ldconfig %postun -n %lname_api -p /sbin/ldconfig @@ -199,6 +208,9 @@ perl -i -pe 's{\x0d\x0a}{\x0a}gs' %_docdir/%name/glusterfs-mode.el; %_docdir/%name %_localstatedir/lib/glusterd %_localstatedir/log/%name +%if 0%{?_unitdir:1} +%_unitdir/glusterd.service +%endif %files -n %lname_api %defattr(-,root,root)