SHA256
1
0
forked from pool/cloud-init
cloud-init/cloud-init.spec

273 lines
8.8 KiB
RPMSpec
Raw Normal View History

#
# spec file for package cloud-init
#
# Copyright (c) 2023 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# change this whenever config changes incompatible
%global configver 0.7
Name: cloud-init
Version: 23.3
Release: 0
License: GPL-3.0
Summary: Cloud node initialization tool
Url: https://github.com/canonical/cloud-init
Group: System/Management
Source0: %{name}-%{version}.tar.gz
- Update to version 17.1 + Version numbering scheme change now YY.NUMBER_OF_RELESE_THAT_YEAR + Remove cloud.cfg.suse, use generated default config file + Remove addopenSUSEBase.patch, included upstream + Remove suseIntegratedHandler.patch, included upstream + Remove openSUSEhostsTemplate.diff, included upstream + Remove cloud-init-handle-no-carrier.patch, included upstream + Remove cloud-init-digital-ocean-datasource.patch, use upstream implementation + Remove cloud-init-digital-ocean-datasource-enable-by-default.patch, use upstream implementation + Remove cloud-init-fix-unicode-handling-binarydecode.patch, included upstream + Remove cloud-init-no-dmidecode-on-ppc64.patch, included upstream + Remove dataSourceOpenNebula.patch, use upstream implementation + Remove setupSUSEsysVInit.diff, included upstream + Remove SUSEsysVInit.diff, included upstream + Remove cloud-init-finalbeforelogin.patch, don't block login + Remove cloud-init-handle-not-implemented-query.patch, query option removed + Remove cloud-init-spceandtabs-clean.patch, indentation fixed upstream + Remove dynamicInitCmd.diff, different solution from upstream + Added cloud-init-more-tasks.patch, (bsc#1047363) replace cloud-init-finalbeforelogin.patch + Forward port cloud-init-python2-sigpipe.patch + Remove cloud-init-net-eni.patch, included upstream + Remove cloud-init-service.patch, included upstream + Forward port cloud-init-sysconfig-netpathfix.patch + Remove cloud-init-net-sysconfig-lp1665441.patch, included upstream + Remove cloud-init-python26.patch, included upstream + Add cloud-init-tests-set-exec.patch OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=88
2017-10-04 17:50:46 +02:00
Source1: rsyslog-cloud-init.cfg
Source2: hidesensitivedata
Patch1: datasourceLocalDisk.patch
# FIXME (lp#1849296)
Patch2: cloud-init-break-resolv-symlink.patch
# FIXME no proposed solution
Patch3: cloud-init-sysconf-path.patch
# FIXME (lp#1860164)
Patch4: cloud-init-no-tempnet-oci.patch
# FIXME (lp#1812117)
Patch6: cloud-init-write-routes.patch
# FIXME (https://github.com/canonical/cloud-init/issues/4339)
Patch7: cloud-init-keep-flake.patch
Patch8: cloud-init-lint-fixes.patch
# FIXME (https://github.com/canonical/cloud-init/pull/4788)
Patch9: cloud-init-pckg-reboot.patch
# FIXME
Patch10: cloud-init-skip-empty-conf.patch
# FIXME (https://github.com/canonical/cloud-init/commit/d0f00bd54649e527d69ad597cbcad6efa8548e58)
Patch11: cloud-init-ds-deterministic.patch
# FIXME https://github.com/canonical/cloud-init/issues/5152 adn LP#1715241
Patch12: cloud-init-no-openstack-guess.patch
BuildRequires: fdupes
BuildRequires: filesystem
# pkg-config is needed to find correct systemd unit dir
BuildRequires: pkg-config
# needed for /lib/udev
BuildRequires: pkgconfig(udev)
BuildRequires: procps
BuildRequires: python-rpm-macros
BuildRequires: python3-devel
BuildRequires: python3-setuptools
# Test requirements
BuildRequires: python3-Jinja2
BuildRequires: python3-PyYAML
- Update to version 17.1 + Version numbering scheme change now YY.NUMBER_OF_RELESE_THAT_YEAR + Remove cloud.cfg.suse, use generated default config file + Remove addopenSUSEBase.patch, included upstream + Remove suseIntegratedHandler.patch, included upstream + Remove openSUSEhostsTemplate.diff, included upstream + Remove cloud-init-handle-no-carrier.patch, included upstream + Remove cloud-init-digital-ocean-datasource.patch, use upstream implementation + Remove cloud-init-digital-ocean-datasource-enable-by-default.patch, use upstream implementation + Remove cloud-init-fix-unicode-handling-binarydecode.patch, included upstream + Remove cloud-init-no-dmidecode-on-ppc64.patch, included upstream + Remove dataSourceOpenNebula.patch, use upstream implementation + Remove setupSUSEsysVInit.diff, included upstream + Remove SUSEsysVInit.diff, included upstream + Remove cloud-init-finalbeforelogin.patch, don't block login + Remove cloud-init-handle-not-implemented-query.patch, query option removed + Remove cloud-init-spceandtabs-clean.patch, indentation fixed upstream + Remove dynamicInitCmd.diff, different solution from upstream + Added cloud-init-more-tasks.patch, (bsc#1047363) replace cloud-init-finalbeforelogin.patch + Forward port cloud-init-python2-sigpipe.patch + Remove cloud-init-net-eni.patch, included upstream + Remove cloud-init-service.patch, included upstream + Forward port cloud-init-sysconfig-netpathfix.patch + Remove cloud-init-net-sysconfig-lp1665441.patch, included upstream + Remove cloud-init-python26.patch, included upstream + Add cloud-init-tests-set-exec.patch OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=88
2017-10-04 17:50:46 +02:00
BuildRequires: python3-configobj >= 5.0.2
BuildRequires: python3-flake8
BuildRequires: python3-httpretty
BuildRequires: python3-jsonpatch
BuildRequires: python3-jsonschema
BuildRequires: python3-netifaces
BuildRequires: python3-oauthlib
BuildRequires: python3-passlib
- Update to version 20.2 (bsc#1174443, bsc#1174444) + Remove patches included upstream: - 0001-Make-tests-work-with-Python-3.8-139.patch - cloud-init-ostack-metadat-dencode.patch - cloud-init-use-different-random-src.diff - cloud-init-long-pass.patch - cloud-init-mix-static-dhcp.patch + Remove patches build switched to Python 3 for all distributions - cloud-init-python2-sigpipe.patch - cloud-init-template-py2.patch + Add - cloud-init-after-kvp.diff - cloud-init-recognize-hpc.patch + doc/format: reference make-mime.py instead of an inline script (#334) + Add docs about creating parent folders (#330) [Adrian Wilkins] + DataSourceNoCloud/OVF: drop claim to support FTP (#333) (LP: #1875470) + schema: ignore spurious pylint error (#332) + schema: add json schema for write_files module (#152) + BSD: find_devs_with_ refactoring (#298) [Gonéri Le Bouder] + nocloud: drop work around for Linux 2.6 (#324) [Gonéri Le Bouder] + cloudinit: drop dependencies on unittest2 and contextlib2 (#322) + distros: handle a potential mirror filtering error case (#328) + log: remove unnecessary import fallback logic (#327) + .travis.yml: don't run integration test on ubuntu/* branches (#321) + More unit test documentation (#314) + conftest: introduce disable_subp_usage autouse fixture (#304) + YAML align indent sizes for docs readability (#323) [Tak Nishigori] + network_state: add missing space to log message (#325) + tests: add missing mocks for get_interfaces_by_mac (#326) (LP: #1873910) + test_mounts: expand happy path test for both happy paths (#319) OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=173
2020-08-07 18:48:46 +02:00
BuildRequires: python3-pytest
BuildRequires: python3-pytest-cov
BuildRequires: python3-pytest-mock
BuildRequires: python3-requests
BuildRequires: python3-responses
BuildRequires: python3-serial
BuildRequires: system-user-nobody
BuildRequires: distribution-release
BuildRequires: util-linux
Requires: bash
Requires: dhcp-client
Requires: file
Requires: growpart
Requires: e2fsprogs
Requires: net-tools
Requires: openssh
Requires: procps
Requires: python3-configobj >= 5.0.2
Requires: python3-Jinja2
Requires: python3-jsonpatch
- Update to version 17.1 + Version numbering scheme change now YY.NUMBER_OF_RELESE_THAT_YEAR + Remove cloud.cfg.suse, use generated default config file + Remove addopenSUSEBase.patch, included upstream + Remove suseIntegratedHandler.patch, included upstream + Remove openSUSEhostsTemplate.diff, included upstream + Remove cloud-init-handle-no-carrier.patch, included upstream + Remove cloud-init-digital-ocean-datasource.patch, use upstream implementation + Remove cloud-init-digital-ocean-datasource-enable-by-default.patch, use upstream implementation + Remove cloud-init-fix-unicode-handling-binarydecode.patch, included upstream + Remove cloud-init-no-dmidecode-on-ppc64.patch, included upstream + Remove dataSourceOpenNebula.patch, use upstream implementation + Remove setupSUSEsysVInit.diff, included upstream + Remove SUSEsysVInit.diff, included upstream + Remove cloud-init-finalbeforelogin.patch, don't block login + Remove cloud-init-handle-not-implemented-query.patch, query option removed + Remove cloud-init-spceandtabs-clean.patch, indentation fixed upstream + Remove dynamicInitCmd.diff, different solution from upstream + Added cloud-init-more-tasks.patch, (bsc#1047363) replace cloud-init-finalbeforelogin.patch + Forward port cloud-init-python2-sigpipe.patch + Remove cloud-init-net-eni.patch, included upstream + Remove cloud-init-service.patch, included upstream + Forward port cloud-init-sysconfig-netpathfix.patch + Remove cloud-init-net-sysconfig-lp1665441.patch, included upstream + Remove cloud-init-python26.patch, included upstream + Add cloud-init-tests-set-exec.patch OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=88
2017-10-04 17:50:46 +02:00
Requires: python3-jsonschema
Requires: python3-netifaces
Requires: python3-oauthlib
Requires: python3-passlib
Requires: python3-pyserial
Requires: python3-PyYAML
Requires: python3-requests
Requires: python3-serial
Requires: python3-setuptools
Requires: python3-xml
Requires: sudo
Requires: util-linux
Requires: wget
%if 0%{?suse_version} && 0%{?suse_version} <= 1500
- Update to version 20.2 (bsc#1174443, bsc#1174444) + Remove patches included upstream: - 0001-Make-tests-work-with-Python-3.8-139.patch - cloud-init-ostack-metadat-dencode.patch - cloud-init-use-different-random-src.diff - cloud-init-long-pass.patch - cloud-init-mix-static-dhcp.patch + Remove patches build switched to Python 3 for all distributions - cloud-init-python2-sigpipe.patch - cloud-init-template-py2.patch + Add - cloud-init-after-kvp.diff - cloud-init-recognize-hpc.patch + doc/format: reference make-mime.py instead of an inline script (#334) + Add docs about creating parent folders (#330) [Adrian Wilkins] + DataSourceNoCloud/OVF: drop claim to support FTP (#333) (LP: #1875470) + schema: ignore spurious pylint error (#332) + schema: add json schema for write_files module (#152) + BSD: find_devs_with_ refactoring (#298) [Gonéri Le Bouder] + nocloud: drop work around for Linux 2.6 (#324) [Gonéri Le Bouder] + cloudinit: drop dependencies on unittest2 and contextlib2 (#322) + distros: handle a potential mirror filtering error case (#328) + log: remove unnecessary import fallback logic (#327) + .travis.yml: don't run integration test on ubuntu/* branches (#321) + More unit test documentation (#314) + conftest: introduce disable_subp_usage autouse fixture (#304) + YAML align indent sizes for docs readability (#323) [Tak Nishigori] + network_state: add missing space to log message (#325) + tests: add missing mocks for get_interfaces_by_mac (#326) (LP: #1873910) + test_mounts: expand happy path test for both happy paths (#319) OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=173
2020-08-07 18:48:46 +02:00
Requires: wicked-service
%endif
Requires: cloud-init-config = %configver
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define docdir %{_defaultdocdir}/%{name}
%ifarch %ix86 x86_64
Requires: dmidecode
%endif
%define initsys systemd
BuildRequires: pkgconfig(systemd)
%{?systemd_requires}
%if 0%{?suse_version} && 0%{?suse_version} == 1220
%define systemd_prefix /lib
%else
%define systemd_prefix /usr/lib
%endif
%description
Cloud-init is an init script that initializes a cloud node (VM)
according to the fetched configuration data from the admin node.
%package config-suse
Summary: Configuration file for Cloud node initialization tool
Provides: cloud-init-config = %configver
Group: System/Management
Conflicts: otherproviders(cloud-init-config)
%description config-suse
This package contains the product specific configuration file
for cloud-init.
%package doc
Summary: Cloud node initialization tool - Documentation
Group: System/Management
Recommends: cloud-init = %{version}
%description doc
Cloud-init is an init script that initializes a cloud node (VM)
according to the fetched configuration data from the admin node.
Documentation and examples for cloud-init tools
%prep
%setup -q
%patch -P 1 -p0
%patch -P 2
%patch -P 3
%patch -P 4
%patch -P 6
%patch -P 7
%patch -P 8
%patch -P 9
%patch -P 10
%patch -P 11
%patch -P 12
- Update to version 21.2 (bsc#1186004) + Remove patches included upstream: - cloud-init-azure-def-usr-pass.patch - cloud-init-after-kvp.diff - cloud-init-recognize-hpc.patch - use_arroba_to_include_sudoers_directory-bsc_1181283.patch - cloud-init-bonding-opts.patch - cloud-init-log-file-mode.patch - cloud-init-no-pwd-in-log.patch - 0001-templater-drop-Jinja-Python-2-compatibility-shim.patch + Remove cloud-init-sle12-compat.patch, version in SLE 12 is frozen to 20.2 + Remove cloud-init-tests-set-exec.patch no longer needed + Forward port: - cloud-init-write-routes.patch - cloud-init-break-resolv-symlink.patch - cloud-init-sysconf-path.patch - cloud-init-no-tempnet-oci.patch + Add \r\n check for SSH keys in Azure (#889) + Revert "Add support to resize rootfs if using LVM (#721)" (#887) (LP: #1922742) + Add Vultaire as contributor (#881) [Paul Goins] + Azure: adding support for consuming userdata from IMDS (#884) [Anh Vo] + test_upgrade: modify test_upgrade_package to run for more sources (#883) + Fix chef module run failure when chef_license is set (#868) [Ben Hughes] + Azure: Retry net metadata during nic attach for non-timeout errs (#878) [aswinrajamannar] + Azure: Retrieve username and hostname from IMDS (#865) [Thomas Stringer] + Azure: eject the provisioning iso before reporting ready (#861) [Anh Vo] + Use `partprobe` to re-read partition table if available (#856) [Nicolas Bock] (LP: #1920939) OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=189
2021-08-19 14:25:42 +02:00
# patch in the full version to version.py
version_pys=$(find . -name version.py -type f)
[ -n "$version_pys" ] ||
{ echo "failed to find 'version.py' to patch with version." 1>&2; exit 1; }
sed -i "s,@@PACKAGED_VERSION@@,%{version}-%{release}," $version_pys
%build
python3 setup.py build
- Update to version 20.2 (bsc#1174443, bsc#1174444) + Remove patches included upstream: - 0001-Make-tests-work-with-Python-3.8-139.patch - cloud-init-ostack-metadat-dencode.patch - cloud-init-use-different-random-src.diff - cloud-init-long-pass.patch - cloud-init-mix-static-dhcp.patch + Remove patches build switched to Python 3 for all distributions - cloud-init-python2-sigpipe.patch - cloud-init-template-py2.patch + Add - cloud-init-after-kvp.diff - cloud-init-recognize-hpc.patch + doc/format: reference make-mime.py instead of an inline script (#334) + Add docs about creating parent folders (#330) [Adrian Wilkins] + DataSourceNoCloud/OVF: drop claim to support FTP (#333) (LP: #1875470) + schema: ignore spurious pylint error (#332) + schema: add json schema for write_files module (#152) + BSD: find_devs_with_ refactoring (#298) [Gonéri Le Bouder] + nocloud: drop work around for Linux 2.6 (#324) [Gonéri Le Bouder] + cloudinit: drop dependencies on unittest2 and contextlib2 (#322) + distros: handle a potential mirror filtering error case (#328) + log: remove unnecessary import fallback logic (#327) + .travis.yml: don't run integration test on ubuntu/* branches (#321) + More unit test documentation (#314) + conftest: introduce disable_subp_usage autouse fixture (#304) + YAML align indent sizes for docs readability (#323) [Tak Nishigori] + network_state: add missing space to log message (#325) + tests: add missing mocks for get_interfaces_by_mac (#326) (LP: #1873910) + test_mounts: expand happy path test for both happy paths (#319) OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=173
2020-08-07 18:48:46 +02:00
%check
make unittest
make lint
%install
python3 setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python3_sitelib} --init-system=%{initsys} --distro=suse
find %{buildroot} \( -name .gitignore -o -name .placeholder \) -delete
# from debian install script
for x in "%{buildroot}%{_bindir}/"*.py; do
[ -f "${x}" ] && mv "${x}" "${x%.py}"
done
mkdir -p %{buildroot}%{_localstatedir}/lib/cloud
# move documentation
mkdir -p %{buildroot}%{_defaultdocdir}
mv %{buildroot}%{_datadir}/doc/%{name} %{buildroot}%{_defaultdocdir}
# man pages
mkdir -p %{buildroot}%{_mandir}/man1
mv doc/man/* %{buildroot}%{_mandir}/man1
# copy the LICENSE
mkdir -p %{buildroot}%{_defaultlicensedir}/%{name}
cp LICENSE %{buildroot}%{_defaultlicensedir}/%{name}
cp LICENSE-GPLv3 %{buildroot}%{_defaultlicensedir}/%{name}
# Set the distribution indicator
%if 0%{?suse_version}
%if 0%{?is_opensuse}
sed -i s/suse/opensuse/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
%else
sed -i s/suse/sles/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
%endif
%endif
mkdir -p %{buildroot}/%{_sysconfdir}/rsyslog.d
mkdir -p %{buildroot}/usr/lib/udev/rules.d/
cp -a %{SOURCE1} %{buildroot}/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf
mkdir -p %{buildroot}%{_sbindir}
install -m 755 %{SOURCE2} %{buildroot}%{_sbindir}
# remove debian/ubuntu specific profile.d file (bnc#779553)
rm -f %{buildroot}%{_sysconfdir}/profile.d/Z99-cloud-locale-test.sh
# Remove non-SUSE templates
rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.debian.*
rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.redhat.*
rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.ubuntu.*
# remove duplicate files
%if 0%{?suse_version}
%fdupes %{buildroot}%{python3_sitelib}
%endif
%post
/usr/sbin/hidesensitivedata
%files
%defattr(-,root,root)
%license LICENSE LICENSE-GPLv3
- Update to version 18.5 (bsc#1121878, boo#1116767) + Remove 0001-Fix-the-service-order-for-SUSE-distributions.patch 0001-Follow-the-ever-bouncing-ball-for-openSUSE-distribut.patch 0002-Add-tests-for-additional-openSUSE-distro-condition-m.patch included upstream + Forward port cloud-init-sysconf-ethsetup.patch + Add cloud-init-write-routes.patch + tests: add Disco release [Joshua Powers] + net: render 'metric' values in per-subnet routes (LP: #1805871) + write_files: add support for appending to files. [James Baxter] + config: On ubuntu select cloud archive mirrors for armel, armhf, arm64. (LP: #1805854) + dhclient-hook: cleanups, tests and fix a bug on 'down' event. + NoCloud: Allow top level 'network' key in network-config. (LP: #1798117) + ovf: Fix ovf network config generation gateway/routes (LP: #1806103) + azure: detect vnet migration via netlink media change event [Tamilmani Manoharan] + Azure: fix copy/paste error in error handling when reading azure ovf. + [Adam DePue] + tests: fix incorrect order of mocks in test_handle_zfs_root. + doc: Change dns_nameserver property to dns_nameservers. [Tomer Cohen] + OVF: identify label iso9660 filesystems with label 'OVF ENV'. + logs: collect-logs ignore instance-data-sensitive.json on non-root user (LP: #1805201) + net: Ephemeral*Network: add connectivity check via URL + azure: _poll_imds only retry on 404. Fail on Timeout (LP: #1803598) + resizefs: Prefix discovered devpath with '/dev/' when path does not exist [Igor Galić] + azure: retry imds polling on requests.Timeout (LP: #1800223) OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=125
2019-01-18 10:50:54 +01:00
%{_bindir}/cloud-id
%{_bindir}/cloud-init
%{_bindir}/cloud-init-per
%{_sbindir}/hidesensitivedata
%dir %{_sysconfdir}/cloud
%dir %{_sysconfdir}/cloud/clean.d
%{_sysconfdir}/cloud/clean.d/README
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d
%config(noreplace) %{_sysconfdir}/cloud/templates
%{_sysconfdir}/systemd/system/sshd-keygen@.service.d/disable-sshd-keygen-if-cloud-init-active.conf
%{_mandir}/man*/*
%if 0%{?suse_version} && 0%{?suse_version} < 1500
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%endif
%{_datadir}/bash-completion/completions/cloud-init
%{python3_sitelib}/cloudinit
%{python3_sitelib}/cloud_init-%{version}*.egg-info
%{_prefix}/lib/cloud-init
%{systemd_prefix}/systemd/system-generators/cloud-init-generator
%{systemd_prefix}/systemd/system/cloud-config.service
%{systemd_prefix}/systemd/system/cloud-config.target
%{systemd_prefix}/systemd/system/cloud-init-local.service
%{systemd_prefix}/systemd/system/cloud-init.service
%{systemd_prefix}/systemd/system/cloud-init.target
%{systemd_prefix}/systemd/system/cloud-final.service
%dir %{_sysconfdir}/rsyslog.d
%{_sysconfdir}/rsyslog.d/21-cloudinit.conf
/usr/lib/udev/rules.d/66-azure-ephemeral.rules
# We use cloud-netconfig to handle new interfaces added to the instance
%exclude %{systemd_prefix}/systemd/system/cloud-init-hotplugd.service
%exclude %{systemd_prefix}/systemd/system/cloud-init-hotplugd.socket
%dir %attr(0755, root, root) %{_localstatedir}/lib/cloud
%dir %{docdir}
%dir /etc/systemd/system/sshd-keygen@.service.d
%files config-suse
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg
%files doc
%defattr(-,root,root)
%{docdir}/examples/*
%{docdir}/*.txt
%dir %{docdir}/examples
%changelog