Francesco Romani has uploaded a new change for review.

Change subject: build: packaging: ship systemd service file
......................................................................

build: packaging: ship systemd service file

On recent RHELs and Fedoras, ship systemd service files
instead of legacy systemv scripts, to have better integration
with the system.

Change-Id: I1a119506142ad16032a3fef7ccdf10f3f873a8fa
Signed-off-by: Francesco Romani <[email protected]>
---
M mom.spec.in
1 file changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/mom refs/changes/40/37740/1

diff --git a/mom.spec.in b/mom.spec.in
index accfce0..458162a 100644
--- a/mom.spec.in
+++ b/mom.spec.in
@@ -2,6 +2,10 @@
 %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
 %{!?with_check: %global with_check 0}
 
+%if 0%{?fedora} || 0%{?rhel} >= 7
+%global with_systemd 1
+%endif
+
 %global                package_version @PACKAGE_VERSION@
 %global                package_name @PACKAGE_NAME@
 
@@ -58,10 +62,15 @@
 rm -rf "%{buildroot}"
 make DESTDIR="%{buildroot}" install
 
+%if 0%{?with_systemd}
+install -Dm 0644 contrib/momd.service %{buildroot}%{_unitdir}/momd.service
+%else
+# Install the SysV init scripts
 install -d -m 0755 "%{buildroot}/%{_initrddir}"
 install -m 0755 contrib/momd.init "%{buildroot}/%{_initrddir}/momd"
 install -d -m 0755 "%{buildroot}/%{_sysconfdir}"
 install -m 0644 doc/mom-balloon+ksm.conf 
"%{buildroot}/%{_sysconfdir}/momd.conf"
+%endif
 
 %check
 %if 0%{with_check}
@@ -86,7 +95,11 @@
 %config(noreplace) %{_sysconfdir}/momd.conf
 %doc COPYING
 %doc README
+%if 0%{?with_systemd}
+%{_unitdir}/momd.service
+%else
 %{_initrddir}/momd
+%endif
 %{_sbindir}/momd
 %{python_sitelib}/mom/
 


-- 
To view, visit http://gerrit.ovirt.org/37740
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a119506142ad16032a3fef7ccdf10f3f873a8fa
Gerrit-PatchSet: 1
Gerrit-Project: mom
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to