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 (123 lines) | stat: -rw-r--r-- 3,267 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
## 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 init scripts

Group:          System/Management
License:        Dual licensed GPLv3 or Apache 2.0
URL:            http://launchpad.net/cloud-init

Source0:        {{archive_name}}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildArch:      noarch


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

# Install pypi 'dynamic' requirements
{% for r in requires %}
Requires:       {{r}}
{% endfor %}

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

%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
end for
{% endfor %}

%build
%meson -Dinit_system=systemd --libexecdir=/usr/lib -Ddistro_templates=chef_client.rb.tmpl,chrony.conf.opensuse.tmpl,hosts.suse.tmpl,ntp.conf.opensuse.tmpl,resolv.conf.tmpl,timesyncd.conf.tmpl
%meson_build

%install
%meson_install

# Move documentation
mkdir -p %{buildroot}/%{_defaultdocdir}
mkdir -p %{buildroot}/%{_sysconfdir}/cloud/clean.d
mv %{buildroot}/usr/share/doc/cloud-init %{buildroot}/%{_defaultdocdir}
for doc in LICENSE ChangeLog requirements.txt; do
   cp ${doc} %{buildroot}/%{_defaultdocdir}/cloud-init
done

# Remove duplicate files
%if 0%{?suse_version}
   %fdupes %{buildroot}/%{python_sitelib}
%endif

mkdir -p %{buildroot}/var/lib/cloud

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

%postun
%insserv_cleanup

%files

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

# systemd files
/usr/lib/systemd/system-generators/*
/usr/lib/systemd/system/*

# There doesn't seem to be an agreed upon place for these
# although it appears the standard says /usr/lib but rpmbuild
# will try /usr/lib64 ??
/usr/lib/%{name}/hook-hotplug
/usr/lib/%{name}/uncloud-init
/usr/lib/%{name}/write-ssh-key-fingerprints
/usr/lib/%{name}/ds-identify

# udev rules
/usr/lib/udev/rules.d/66-azure-ephemeral.rules


# Docs
%doc %{_defaultdocdir}/cloud-init/*

# Configs
%dir               %{_sysconfdir}/cloud/clean.d
%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/*

# Bash completion script
%{_datadir}/bash-completion/completions/cloud-init
/usr/share/man/man1/cloud-*gz

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

/var/lib/cloud