Skip to content

Commit 6979999

Browse files
committed
chore: update developer specfile and build for opensuse (#6326)
tools/read-dependencies DISTRO_PKG_MAP values are only one of ubuntu, redhat, suse or fedora. Simplify value check when adding rpm-build package dependency.
1 parent 232e8c1 commit 6979999

File tree

3 files changed

+12
-28
lines changed

3 files changed

+12
-28
lines changed

packages/pkg-deps.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@
9494
"pyyaml" : "python3-PyYAML"
9595
},
9696
"build-requires" : [
97+
"meson",
98+
"pkgconf",
99+
"bash-completion-devel",
97100
"fdupes",
98101
"filesystem",
99-
"python3-devel",
100-
"python3-setuptools"
102+
"python3-devel"
101103
],
102104
"requires" : [
103105
"iproute2",

packages/suse/cloud-init.spec.in

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,15 @@ end for
4848
{% endfor %}
4949

5050
%build
51-
%{__python} setup.py build
51+
%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
52+
%meson_build
5253

5354
%install
54-
%{__python} setup.py install \
55-
--skip-build --root=%{buildroot} --prefix=%{_prefix} \
56-
--record-rpm=INSTALLED_FILES --install-lib=%{python_sitelib} \
57-
--init-system=systemd
58-
59-
# Move udev rules
60-
mkdir -p %{buildroot}/usr/lib/udev/rules.d/
61-
mv %{buildroot}/lib/udev/rules.d/* %{buildroot}/usr/lib/udev/rules.d/
62-
63-
# Remove non-SUSE templates
64-
rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.debian.*
65-
rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.redhat.*
66-
rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.ubuntu.*
55+
%meson_install
6756

6857
# Move documentation
6958
mkdir -p %{buildroot}/%{_defaultdocdir}
59+
mkdir -p %{buildroot}/%{_sysconfdir}/cloud/clean.d
7060
mv %{buildroot}/usr/share/doc/cloud-init %{buildroot}/%{_defaultdocdir}
7161
for doc in LICENSE ChangeLog requirements.txt; do
7262
cp ${doc} %{buildroot}/%{_defaultdocdir}/cloud-init
@@ -102,6 +92,7 @@ version_pys=$(cd "%{buildroot}" && find . -name version.py -type f)
10292
# There doesn't seem to be an agreed upon place for these
10393
# although it appears the standard says /usr/lib but rpmbuild
10494
# will try /usr/lib64 ??
95+
/usr/lib/%{name}/hook-hotplug
10596
/usr/lib/%{name}/uncloud-init
10697
/usr/lib/%{name}/write-ssh-key-fingerprints
10798
/usr/lib/%{name}/ds-identify
@@ -114,7 +105,7 @@ version_pys=$(cd "%{buildroot}" && find . -name version.py -type f)
114105
%doc %{_defaultdocdir}/cloud-init/*
115106

116107
# Configs
117-
%dir %{_sysconfdir}/cloud/clean.d
108+
%dir %{_sysconfdir}/cloud/clean.d
118109
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg
119110
%dir %{_sysconfdir}/cloud/cloud.cfg.d
120111
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/*.cfg
@@ -124,8 +115,7 @@ version_pys=$(cd "%{buildroot}" && find . -name version.py -type f)
124115

125116
# Bash completion script
126117
%{_datadir}/bash-completion/completions/cloud-init
127-
128-
%{_sysconfdir}/systemd/system/[email protected]/disable-sshd-keygen-if-cloud-init-active.conf
118+
/usr/share/man/man1/cloud-*gz
129119

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

tools/read-dependencies

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,7 @@ def pkg_install(pkg_list, distro, test_distro=False, dry_run=False):
387387
subprocess.call(
388388
["dnf", "config-manager", "--set-disabled", "epel-cisco-openh264"]
389389
)
390-
if distro in [
391-
"suse",
392-
"opensuse",
393-
"fedora",
394-
"redhat",
395-
"rocky",
396-
"centos",
397-
"eurolinux",
398-
]:
390+
if DISTRO_PKG_TYPE_MAP.get(distro) in ["redhat", "suse", "fedora"]:
399391
pkg_list.append("rpm-build")
400392
subprocess.check_call(install_cmd + pkg_list)
401393

0 commit comments

Comments
 (0)