mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-06-08 13:30:09 +02:00
214 lines
5.9 KiB
Text
214 lines
5.9 KiB
Text
# Contributor: Matt Dainty <matt+alpine@bodgit-n-scarper.com>
|
|
# Contributor: Dermot Bradley <dermot_bradley@yahoo.com>
|
|
maintainer="fossdd <fossdd@pwned.life>"
|
|
pkgname=cloud-init
|
|
pkgver=24.3.1
|
|
pkgrel=1
|
|
pkgdesc="Cloud instance init scripts"
|
|
url="https://cloud-init.io"
|
|
# s390x: blocked by cloud-utils-growpart
|
|
arch="noarch !s390x"
|
|
license="Apache-2.0 OR GPL-3.0-only"
|
|
depends="
|
|
blkid
|
|
cloud-utils-growpart
|
|
iproute2-minimal
|
|
python3
|
|
py3-configobj
|
|
py3-jinja2
|
|
py3-jsonpatch
|
|
py3-jsonschema
|
|
py3-requests
|
|
py3-yaml
|
|
shadow
|
|
tzdata
|
|
"
|
|
# eudev is only used for "pkg-config --variable=udevdir udev" to work
|
|
makedepends="
|
|
eudev-dev
|
|
py3-setuptools
|
|
"
|
|
checkdepends="
|
|
bash
|
|
coreutils
|
|
grep
|
|
lsblk
|
|
parted
|
|
procps-ng
|
|
py3-netifaces
|
|
py3-passlib
|
|
py3-pyserial
|
|
py3-pytest
|
|
py3-pytest-mock
|
|
py3-responses
|
|
py3-tox
|
|
sfdisk
|
|
sgdisk
|
|
"
|
|
subpackages="
|
|
$pkgname-bash-completion
|
|
$pkgname-doc
|
|
$pkgname-logrotate
|
|
$pkgname-pyc
|
|
$pkgname-openrc
|
|
"
|
|
source="cloud-init-$pkgver.tar.gz::https://github.com/canonical/cloud-init/archive/refs/tags/$pkgver.tar.gz
|
|
01-oauthlib-remove.patch
|
|
04-set-default-datasource-list.patch
|
|
cloud-init-hotplugd
|
|
cloud-init-hotplugd.initd
|
|
cloud-init.logrotate
|
|
interfaces
|
|
setup-cloud-init
|
|
README.Alpine
|
|
"
|
|
install="$pkgname.post-install"
|
|
|
|
# secfixes:
|
|
# 23.1.2-r0:
|
|
# - CVE-2023-1786
|
|
# 22.2.2-r0:
|
|
# - CVE-2022-2084
|
|
# 21.1-r1:
|
|
# - CVE-2021-3429
|
|
|
|
prepare() {
|
|
default_prepare
|
|
}
|
|
|
|
build() {
|
|
python3 setup.py build
|
|
}
|
|
|
|
check() {
|
|
# https://github.com/canonical/cloud-init/issues/5158
|
|
local k="not test_parse_unexpected_timestamp_format_with_date_command"
|
|
k="$k and not test_parse_logline_returns_event_for_amazon_linux_2_line"
|
|
|
|
python3 -m pytest -k "$k"
|
|
}
|
|
|
|
package() {
|
|
python3 setup.py install \
|
|
--prefix=/usr --root="$pkgdir" --init-system=sysvinit_openrc
|
|
|
|
install -m644 \
|
|
-D \
|
|
"$srcdir"/interfaces \
|
|
"$pkgdir"/etc/network/interfaces
|
|
|
|
install -m755 \
|
|
-D \
|
|
"$srcdir"/cloud-init-hotplugd.initd \
|
|
"$pkgdir"/etc/init.d/cloud-init-hotplugd
|
|
|
|
install -m644 \
|
|
-D \
|
|
"$srcdir"/cloud-init.logrotate \
|
|
"$pkgdir"/etc/logrotate.d/cloud-init
|
|
|
|
mkdir -p \
|
|
"$pkgdir"/sbin
|
|
install -m755 \
|
|
"$srcdir"/setup-cloud-init \
|
|
"$pkgdir"/sbin/
|
|
|
|
mkdir -p \
|
|
"$pkgdir"/usr/sbin
|
|
install -m755 \
|
|
"$srcdir"/cloud-init-hotplugd \
|
|
"$pkgdir"/usr/sbin/
|
|
|
|
install -m644 \
|
|
"$srcdir"/README.Alpine \
|
|
"$pkgdir"/usr/share/doc/"$pkgname"/
|
|
|
|
# Delete non-Alpine distribution template files
|
|
for distro in \
|
|
arch centos cos debian fedora freebsd gentoo mariner openbsd \
|
|
opensuse opensuse-leap opensuse-microos opensuse-tumbleweed \
|
|
photon redhat rhel sle_hpc sle-micro sles suse ubuntu
|
|
do
|
|
for file in \
|
|
"$pkgdir"/etc/cloud/templates/*."$distro".tmpl
|
|
do
|
|
rm "$file"
|
|
done
|
|
done
|
|
rm "$pkgdir"/etc/cloud/templates/sources.list.*.tmpl
|
|
|
|
# Delete non-Alpine os-specific files
|
|
for distro in \
|
|
almalinux amazon arch bsd centos cloudlinux cos debian \
|
|
dragonflybsd eurolinux fedora freebsd gentoo mariner \
|
|
miraclelinux netbsd openeuler openbsd OpenCloudOS \
|
|
openmandriva opensuse opensuse-leap opensuse-microos \
|
|
opensuse-tumbleweed photon rhel rhel_util rocky sle-micro \
|
|
sle_hpc sles suse TencentOS ubuntu virtuozzo
|
|
do
|
|
rm "$pkgdir"/usr/lib/python3.*/site-packages/cloudinit/distros/"$distro".py
|
|
rm "$pkgdir"/usr/lib/python3.*/site-packages/cloudinit/distros/__pycache__/"$distro".*.pyc
|
|
done
|
|
rm "$pkgdir"/usr/lib/python3.*/site-packages/cloudinit/distros/parsers/sys_conf.py
|
|
rm "$pkgdir"/usr/lib/python3.*/site-packages/cloudinit/distros/parsers/__pycache__/sys_conf.*.pyc
|
|
|
|
# Delete systemd-related files
|
|
rm \
|
|
"$pkgdir"/etc/cloud/templates/timesyncd.conf.tmpl \
|
|
"$pkgdir"/etc/cloud/templates/systemd.resolved.conf.tmpl
|
|
rm -Rf "$pkgdir"/etc/systemd
|
|
|
|
# Delete NetworkManager-related files
|
|
rm -Rf "$pkgdir"/etc/NetworkManager
|
|
|
|
# Delete cloud-init modules not relevant to Alpine
|
|
for module in \
|
|
apt_* \
|
|
byobu \
|
|
fan \
|
|
grub_dpkg \
|
|
landscape \
|
|
lxd \
|
|
reset_rmc \
|
|
rh_subscription \
|
|
snap \
|
|
spacewalk \
|
|
ubuntu_autoinstall \
|
|
ubuntu_drivers \
|
|
yum_add_repo \
|
|
zypper_add_repo
|
|
do
|
|
rm "$pkgdir"/usr/lib/python3.*/site-packages/cloudinit/config/cc_$module.py
|
|
rm "$pkgdir"/usr/lib/python3.*/site-packages/cloudinit/config/__pycache__/cc_$module.*.pyc
|
|
done
|
|
|
|
# Delete cloud-init docs not relevant to Alpine
|
|
for doc in \
|
|
cloud-config-add-apt-repos.txt \
|
|
cloud-config-apt.txt \
|
|
cloud-config-update-apt.txt \
|
|
cloud-config-yum-repo.txt
|
|
do
|
|
rm "$pkgdir"/usr/share/doc/cloud-init/examples/$doc
|
|
done
|
|
}
|
|
|
|
logrotate() {
|
|
pkgdesc="Cloud instance init scripts (logrotate configuration)"
|
|
depends=""
|
|
install_if="$pkgname=$pkgver-r$pkgrel logrotate"
|
|
|
|
amove etc/logrotate.d/cloud-init
|
|
}
|
|
|
|
sha512sums="
|
|
01b798d67328ecd66229568233fb674f45c055ac469adb31a55a909b6b2c8fd1901a833accb66423923b8945210aa4dc6a0d61945787aabe414c01b501b1416d cloud-init-24.3.1.tar.gz
|
|
cc187fc8772b3faa3d31f21e4dc270b5922f153a34879f7fa7c3f5a601b5eca8d9e8c1f9a70d97406c38ba82acd07b13c132868d2c857922b5a4f75fd692edfc 01-oauthlib-remove.patch
|
|
8174411925f40f7e0eabb43cfdc273dfd0cf069e3713a3883ed128df7a5cc80b7d19e2643629cf17ae65c3d8e59cc8a074ca5932a6a4fe0e8299fad9ce861686 04-set-default-datasource-list.patch
|
|
2d7b80fc248ec18f20c4ed2fbe0f8d6ea85ae57a0ece8ecf8a095cf910c576807c19ab0453c00160b85253df5725cba90abec731cb54f441a509611115519b46 cloud-init-hotplugd
|
|
ab44fc51979a5da8569b08ed2f290a6610de6c36cf147af20f30e9224847623d3594c056a1f64c614598ac130e9bec92d566fb901024f806b768a89190c45f59 cloud-init-hotplugd.initd
|
|
3c6c5189859633012fd389a8d8370cbd46ddd07f206d61bcf872f12105f340552073cbf28f28096109c158b641de1c8199afcfc7f751166a27d4089355e1dd7d cloud-init.logrotate
|
|
48b25ec4457c2b3772a7d210033551d041749a0d1869818d888030e6df7fd9bbc13a38b95cf465de3d46d96881a722f94a337584ce48f280c4a52b819586563a interfaces
|
|
9340e30b6c95f66cb2cdc68c0c5d765e4ce879d2f2bfb042c4b45996cf2b5c542b3762c6abfd213b4b9610f290d6ca734c28c7240fea76fb5cf58253570d2e8f setup-cloud-init
|
|
748b828de1f21cc30c9c13c4ebfbec5ba542ed882ddd04906661ffd7e50ef3d575f67d5650e99aac01fb8c84a9dc84cc73d2c8f232f0d4cfe86136f3097676cf README.Alpine
|
|
"
|