Merge ~raharper/cloud-init:redhat-fix-spec-systemd into cloud-init:master

Proposed by Ryan Harper
Status: Merged
Merged at revision: b9cd8a82ee41e235df66801a02b2244226bee5ee
Proposed branch: ~raharper/cloud-init:redhat-fix-spec-systemd
Merge into: cloud-init:master
Diff against target: 51 lines (+20/-5)
1 file modified
packages/redhat/cloud-init.spec.in (+20/-5)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Scott Moser Approve
Review via email: mp+325402@code.launchpad.net

Description of the change

Update redhat spec to use distro release version to determine if we use systemd

The typical rpm build process will examine the spec file to determine
which packages should be installed in the boot root. This requires
the specfile to declare that it needs system. Provide this information
by checking which version in which the rpm is being built and exporting
requirements for systemd.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

This looks fine. Go ahead and commit and push
But please make subject line of commit to be 74 chars or less.

(It might be the mobile view that makes me think it is. I did not count)

review: Approve
7e919ae... by Ryan Harper

Merge branch 'redhat-fix-spec-systemd' of git.launchpad.net:~raharper/cloud-init into redhat-fix-spec-systemd

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/packages/redhat/cloud-init.spec.in b/packages/redhat/cloud-init.spec.in
index 1939ca8..3e92c98 100644
--- a/packages/redhat/cloud-init.spec.in
+++ b/packages/redhat/cloud-init.spec.in
@@ -1,10 +1,12 @@
1## template: cheetah1## template: cheetah
2%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}2%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
33
4%if %{undefined systemd_requires}4%define use_systemd (0%{?fedora} && 0%{?fedora} >= 18) || (0%{?rhel} && 0%{?rhel} >= 7)
5%define init_system sysvinit5
6%else6%if %{use_systemd}
7%define init_system systemd7%define init_system systemd
8%else
9%define init_system sysvinit
8%endif10%endif
911
10# See: http://www.zarb.org/~jasonc/macros.php12# See: http://www.zarb.org/~jasonc/macros.php
@@ -29,6 +31,18 @@ BuildRequires: python-setuptools
29%if "%{?el6}" == "1"31%if "%{?el6}" == "1"
30BuildRequires: python-argparse32BuildRequires: python-argparse
31%endif33%endif
34%if %{use_systemd}
35Requires: systemd
36BuildRequires: systemd
37Requires: systemd-units
38BuildRequires: systemd-units
39%else
40Requires: initscripts >= 8.36
41Requires(postun): initscripts
42Requires(post): chkconfig
43Requires(preun): chkconfig
44%endif
45
32# These are runtime dependencies, but declared as BuildRequires so that46# These are runtime dependencies, but declared as BuildRequires so that
33# - tests can be run here.47# - tests can be run here.
34# - parts of cloud-init such (setup.py) use these dependencies.48# - parts of cloud-init such (setup.py) use these dependencies.
@@ -68,8 +82,9 @@ Patch${size}: $p
68#end for82#end for
6983
70%if "%{init_system}" == "systemd"84%if "%{init_system}" == "systemd"
71BuildRequires: systemd-units85Requires(post): systemd
72%{systemd_requires}86Requires(preun): systemd
87Requires(postun): systemd
73%else88%else
74Requires(post): chkconfig89Requires(post): chkconfig
75Requires(postun): initscripts90Requires(postun): initscripts

Subscribers

People subscribed via source and target branches