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: I7b0318a6ddd4067751c796e4ab0fa150b6091204 Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com> (cherry picked from commit 2be55f3b4111c1e8331a1e17fa5b5826bc7bec1f) --- 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/62/12862/1 diff --git a/packaging/fedora/spec/ovirt-engine.spec.in b/packaging/fedora/spec/ovirt-engine.spec.in index d8c77af..3863878 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} @@ -335,10 +343,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 @@ -399,7 +415,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} @@ -411,7 +429,12 @@ %dir %{_sysconfdir}/sysconfig/%{engine_name}.d %{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/12862 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7b0318a6ddd4067751c796e4ab0fa150b6091204 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: engine_3.2 Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches