File: cloud-init.spec.in

package info (click to toggle)
cloud-init 25.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,412 kB
  • sloc: python: 135,894; sh: 3,883; makefile: 141; javascript: 30; xml: 22
file content (139 lines) | stat: -rw-r--r-- 4,144 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
## template: jinja

# See: http://www.zarb.org/~jasonc/macros.php
# Or: http://fedoraproject.org/wiki/Packaging:ScriptletSnippets
# Or: http://www.rpm.org/max-rpm/ch-rpm-inside.html

Name:           cloud-init
Version:        {{rpm_upstream_version}}
Release:        1{{subrelease}}%{?dist}
Summary:        Cloud instance initialization tool

Group:          System Environment/Base
License:        Dual-licesed GPLv3 or Apache 2.0
URL:            https://github.com/canonical/cloud-init

Source0:        {{archive_name}}
BuildArch:      noarch
BuildRoot:      %{_tmppath}

Requires:       systemd
BuildRequires:  pkgconfig(systemd)
Requires:       systemd-units
BuildRequires:  systemd-units

{% for r in buildrequires %}
BuildRequires:  {{r}}
{% endfor %}

# System util packages needed
%ifarch %{?ix86} x86_64 ia64
Requires:       dmidecode
%endif


# Install 'dynamic' runtime reqs from *requirements.txt and pkg-deps.json.
# Install them as BuildRequires too as they're used for testing.
{% for r in requires %}
BuildRequires:  {{r}}
Requires:       {{r}}
{% endfor %}

# Custom patches
{% for p in patches %}
Patch{{loop.index0}}: {{p}}
{% endfor %}

Requires(post):       systemd
Requires(preun):      systemd
Requires(postun):     systemd

%description
Cloud-init is a set of init scripts for cloud instances.  Cloud instances
need special scripts to run during initialization to retrieve and install
ssh keys and to let the user run various scripts.

%prep
%setup -q -n {{source_name}}

# Custom patches activation
{% for p in patches %}
%patch{{loop.index0}} -p1
{% endfor %}

%build
%meson -Dinit_system=systemd -Ddistro_templates=chef_client.rb.tmpl,chrony.conf.rhel.tmpl,hosts.redhat.tmpl,ntp.conf.rhel.tmpl,resolv.conf.tmpl,timesyncd.conf.tmpl
%meson_build

%install
%meson_install

# Note that /etc/rsyslog.d didn't exist by default until F15.
# el6 request: https://bugzilla.redhat.com/show_bug.cgi?id=740420
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d
cp -p tools/21-cloudinit.conf \
      $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf

# Required dirs...
mkdir -p $RPM_BUILD_ROOT/%{_sharedstatedir}/cloud
mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}/%{name}

# patch in the full version to version.py
version_pys=$(cd "$RPM_BUILD_ROOT" && find . -name version.py -type f)
[ -n "$version_pys" ] ||
   { echo "failed to find 'version.py' to patch with version." 1>&2; exit 1; }
( cd "$RPM_BUILD_ROOT" &&
  sed -i "s,@@PACKAGED_VERSION@@,%{version}-%{release}," $version_pys )

%clean
rm -rf $RPM_BUILD_ROOT

%post
%systemd_post cloud-init-main.service cloud-config.service cloud-config.target cloud-final.service cloud-init-network.service cloud-init.target cloud-init-local.service


%preun
%systemd_preun cloud-init-main.service cloud-config.service cloud-config.target cloud-final.service cloud-init-network.service cloud-init.target cloud-init-local.service


%postun
%systemd_postun cloud-init-main.service cloud-config.service cloud-config.target cloud-final.service cloud-init-network.service cloud-init.target cloud-init-local.service

%files

%{_udevrulesdir}/66-azure-ephemeral.rules

/usr/lib/systemd/system-generators/cloud-init-generator
/usr/lib/systemd/system/sshd-keygen@.service.d/disable-sshd-keygen-if-cloud-init-active.conf
%{_unitdir}/cloud-*

# Program binaries
%{_bindir}/cloud-init*
%{_bindir}/cloud-id*

# Docs
%doc LICENSE ChangeLog requirements.txt
%doc %{_defaultdocdir}/cloud-init/*

# Configs
%config(noreplace)      %{_sysconfdir}/cloud/cloud.cfg
%dir                    %{_sysconfdir}/cloud/cloud.cfg.d
%config(noreplace)      %{_sysconfdir}/cloud/cloud.cfg.d/*.cfg
%config(noreplace)      %{_sysconfdir}/cloud/cloud.cfg.d/README
%dir                    %{_sysconfdir}/cloud/templates
%config(noreplace)      %{_sysconfdir}/cloud/templates/*
%config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf

# Bash completion script
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/cloud-init

# Man pages
%dir %{_mandir}/man1
%{_mandir}/man1/*.gz

%{_libexecdir}/%{name}
%dir %{_sharedstatedir}/cloud

# Python code is here...
%{python3_sitelib}/*