Juan Hernandez has uploaded a new change for review.

Change subject: packaging: Conditionally use systemd and System V
......................................................................

packaging: Conditionally use systemd and System V

This change introduces two new "install_systemd" and "install_systemv"
macros that control if the service should be controlled by systemd or by
System V init scripts. This is intended to be used when building for
distributions that don't support systemd.

Change-Id: If6b2afe381169943c5fc03f78a6c38bea790dd13
Signed-off-by: Juan Hernandez <[email protected]>
---
M packaging/fedora/spec/ovirt-engine.spec.in
1 file changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/64/12764/1

diff --git a/packaging/fedora/spec/ovirt-engine.spec.in 
b/packaging/fedora/spec/ovirt-engine.spec.in
index 0be49f0..3231ec6 100644
--- a/packaging/fedora/spec/ovirt-engine.spec.in
+++ b/packaging/fedora/spec/ovirt-engine.spec.in
@@ -4,6 +4,14 @@
 %global user_description oVirt Manager
 %global install_poms 1
 
+# This controls if systemd files should be installed, change it to 0 if
+# building for distributions without systemd support:
+%global install_systemd 1
+
+# This controls if System V init scripts should be installed, change it
+# to 1 for distributions without systemd support:
+%global install_systemv 0
+
 # Short names for engine directories:
 %global engine_name ovirt-engine
 %global engine_etc %{_sysconfdir}/%{engine_name}
@@ -327,10 +335,18 @@
 %endif
 
 # Install the systemd files:
+%if %{install_systemd}
 install -dm 755 %{buildroot}%{_unitdir}
 install -m 644 packaging/fedora/engine-service.systemd 
%{buildroot}%{_unitdir}/%{engine_name}.service
 install -dm 755 %{buildroot}%{_sysconfdir}/tmpfiles.d
 install -m 644 packaging/resources/ovirt-tmpfilesd 
%{buildroot}%{_sysconfdir}/tmpfiles.d/ovirt-engine.conf
+%endif
+
+# Install System V init scripts:
+%if %{install_systemv}
+install -dm 755 %{buildroot}%{_sysconfdir}/rc.d/init.d
+ln -s %{engine_data}/service/engine-service.py 
%{buildroot}%{_sysconfdir}/rc.d/init.d/ovirt-engine
+%endif
 
 
 %preun
@@ -391,7 +407,9 @@
 
 # Misc configuration files:
 %{engine_data}/conf
+%if %{install_systemd}
 %{_sysconfdir}/tmpfiles.d/ovirt-engine.conf
+%endif
 
 # Engine configuration files:
 %dir %attr(-, %{engine_user}, %{engine_group}) %{engine_etc}
@@ -405,7 +423,12 @@
 %config(noreplace) %{_sysconfdir}/security/limits.d/10-ovirt-engine.conf
 %{engine_data}/service
 %{_bindir}/engine-service
+%if %{install_systemd}
 %{_unitdir}/%{engine_name}.service
+%endif
+%if %{install_systemv}
+%{_initddir}/ovirt-engine
+%endif
 
 # Jar files used by all the components:
 %dir %{engine_java}


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

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

Reply via email to