Change in vdsm[ovirt-3.2]: vdsm.spec: Adding with_systemd macro
fsimonce at redhat.com
fsimonce at redhat.com
Thu Apr 11 14:13:24 UTC 2013
Hello Douglas Schilling Landgraf, Yaniv Bronhaim, oVirt Jenkins CI Server, Vinzenz Feenstra, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/13814
to review the following change.
Change subject: vdsm.spec: Adding with_systemd macro
......................................................................
vdsm.spec: Adding with_systemd macro
This patch adds the macro with_systemd which can be used
to validate if the system uses Systemd.
Change-Id: Ibcd8567868e16453ed6633f143a6b1fff8e9c454
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/12086
Tested-by: oVirt Jenkins CI Server
Reviewed-by: Vinzenz Feenstra <vfeenstr at redhat.com>
Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm.spec.in
1 file changed, 37 insertions(+), 22 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/13814/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 7d1b001..daf29f6 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -20,6 +20,15 @@
%global _polkitdir %{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d
%endif
+# Systemd macro
+%if 0%{?fedora} >= 15
+%global with_systemd 1
+%endif
+
+%if 0%{?rhel} >= 7
+%global with_systemd 1
+%endif
+
# Default to skipping autoreconf. Distros can change just this one line
# (or provide a command-line override) if they backport any patches that
# touch configure.ac or Makefile.am.
@@ -66,6 +75,9 @@
%if !0%{?rhel}
BuildRequires: pyflakes
BuildRequires: python-pep8
+%endif
+
+%if 0%{?with_systemd}
BuildRequires: systemd-units
%endif
@@ -454,21 +466,7 @@
install -Dm 0644 vdsm/limits.conf \
%{buildroot}/etc/security/limits.d/99-vdsm.conf
-%if 0%{?rhel}
-# Install the SysV init scripts
-install -Dm 0755 vdsm/vdsmd.init %{buildroot}%{_initrddir}/vdsmd
-install -Dm 0755 vdsm_reg/vdsm-reg.init %{buildroot}%{_initrddir}/vdsm-reg
-install -Dm 0755 vdsm/vdsm-restore-net-config.init \
- %{buildroot}%{_initrddir}/vdsm-restore-net-config
-
-# This is not commonplace, but we want /var/log/core to be a world-writable
-# dropbox for core dumps
-install -dDm 1777 %{buildroot}%{_localstatedir}/log/core
-%else
-# Install the configuration sample
-install -Dm 0644 vdsm/vdsm.conf.sample \
- %{buildroot}%{_sysconfdir}/vdsm/vdsm.conf
-
+%if 0%{?with_systemd}
# Install the systemd scripts
install -Dm 0755 vdsm/vdsmd.init %{buildroot}/lib/systemd/systemd-vdsmd
install -Dm 0644 vdsm/vdsmd.service %{buildroot}%{_unitdir}/vdsmd.service
@@ -478,6 +476,22 @@
%{buildroot}/lib/systemd/systemd-vdsm-reg
install -Dm 0644 vdsm_reg/vdsm-reg.service \
%{buildroot}%{_unitdir}/vdsm-reg.service
+%else
+# Install the SysV init scripts
+install -Dm 0755 vdsm/vdsmd.init %{buildroot}%{_initrddir}/vdsmd
+install -Dm 0755 vdsm_reg/vdsm-reg.init %{buildroot}%{_initrddir}/vdsm-reg
+install -Dm 0755 vdsm/vdsm-restore-net-config.init \
+ %{buildroot}%{_initrddir}/vdsm-restore-net-config
+%endif
+
+%if 0%{?rhel}
+# This is not commonplace, but we want /var/log/core to be a world-writable
+# dropbox for core dumps
+install -dDm 1777 %{buildroot}%{_localstatedir}/log/core
+%else
+# Install the configuration sample
+install -Dm 0644 vdsm/vdsm.conf.sample \
+ %{buildroot}%{_sysconfdir}/vdsm/vdsm.conf
# Install the polkit for libvirt
%if 0%{?fedora} >= 18
@@ -636,14 +650,15 @@
%files
%defattr(-, root, root, -)
%doc COPYING README vdsm/vdsm.conf.sample
-%if 0%{?rhel}
-%{_initrddir}/vdsmd
-%{_initrddir}/vdsm-restore-net-config
-%else
+%if 0%{?with_systemd}
/lib/systemd/systemd-vdsmd
%{_unitdir}/vdsmd.service
%{_unitdir}/vdsm-restore-net-config.service
+%else
+%{_initrddir}/vdsmd
+%{_initrddir}/vdsm-restore-net-config
%endif
+
%dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/hsm-tasks
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/mnt
@@ -990,11 +1005,11 @@
%config(noreplace) %{_sysconfdir}/%{vdsm_reg}/logger.conf
%ghost %dir /data
%ghost %dir %attr(0775, root, root) /data/updates
-%if 0%{?rhel}
-%{_initrddir}/vdsm-reg
-%else
+%if 0%{?with_systemd}
/lib/systemd/systemd-vdsm-reg
%{_unitdir}/vdsm-reg.service
+%else
+%{_initrddir}/vdsm-reg
%endif
%{_datadir}/%{vdsm_reg}/vdsm-reg-setup
%{_datadir}/%{vdsm_reg}/vdsm-complete
--
To view, visit http://gerrit.ovirt.org/13814
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcd8567868e16453ed6633f143a6b1fff8e9c454
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.2
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list