Dermot Bradley 9feea4e93d community/cloud-init: disable modules irrelevant to Alpine
Add patch file 03-disable-irrelevant-modules.patch to disable
cloud-init modules that are irrelevant for/unsupported on Alpine.
2021-05-12 19:41:30 +00:00

130 lines
3.6 KiB
Plaintext

# Contributor: Matt Dainty <matt+alpine@bodgit-n-scarper.com>
# Contributor: Dermot Bradley <dermot_bradley@yahoo.com>
# Maintainer: Dermot Bradley <dermot_bradley@yahoo.com>
pkgname=cloud-init
pkgver=21.2
pkgrel=1
pkgdesc="Cloud instance init scripts"
url="https://cloud-init.io"
# Dependant package "cloud-utils-growpart" is not available for mips,
# mips64, or s390x so disable these archs for this package too.
arch="noarch !mips !mips64 !s390x"
license="Apache-2.0 OR GPL-3.0-only"
depends="
blkid
cloud-utils-growpart
e2fsprogs-extra
eudev
ifupdown-ng
iproute2-minimal
logger
lsblk
parted
python3
py3-configobj
py3-jinja2
py3-jsonpatch
py3-jsonschema
py3-requests
py3-yaml
sfdisk
sgdisk
shadow
sudo
"
makedepends="py3-setuptools"
subpackages="$pkgname-doc $pkgname-bash-completion $pkgname-openrc"
source="cloud-init-$pkgver.tar.gz::https://github.com/canonical/cloud-init/archive/$pkgver.tar.gz
01-oauthlib-remove.patch
02-hosts-template-fix.patch
03-disable-irrelevant-modules.patch
interfaces
setup-cloud-init
README.Alpine
"
install="$pkgname.post-install"
# secfixes:
# 21.1-r1:
# - CVE-2021-3429
prepare() {
default_prepare
}
build() {
python3 setup.py build
}
check() {
python3 setup.py check
}
package() {
python3 setup.py install \
--prefix=/usr --root="$pkgdir" --init-system=sysvinit_openrc
# Delete __pycache__ directories containing PYC files
find "$pkgdir" -name '__pycache__' -type d -print0 | xargs -0 rm -Rf
mkdir -p \
"$pkgdir"/etc/network
install -m644 \
"$srcdir"/interfaces \
"$pkgdir"/etc/network/
mkdir -p \
"$pkgdir"/sbin
install -m755 \
"$srcdir"/setup-cloud-init \
"$pkgdir"/sbin/
install -m644 \
"$srcdir"/README.Alpine \
"$pkgdir"/usr/share/doc/"$pkgname"/
# Delete non-Alpine distribution template files
for distro in \
debian fedora freebsd opensuse redhat rhel sles suse ubuntu
do
for file in \
"$pkgdir"/etc/cloud/templates/*."$distro".tmpl
do
rm "$file"
done
done
# Delete cloud-init modules not relevant to Alpine
for module in \
cc_apt_*.py \
cc_emit_upstart.py \
cc_fan.py \
cc_foo.py \
cc_grub_dpkg.py \
cc_landscape.py \
cc_refresh_rmc_and_interface.py \
cc_reset_rmc.py \
cc_rh_subscription.py \
cc_snap.py \
cc_ssh_import_id.py \
cc_spacewalk.py \
cc_ubuntu_advantage.py \
cc_ubuntu_drivers.py \
cc_yum_add_repo.py \
cc_zypper_add_repo.py
do
rm "$pkgdir"/usr/lib/python3.*/site-packages/cloudinit/config/$module
done
# Delete systemd template file
rm "$pkgdir"/etc/cloud/templates/timesyncd.conf.tmpl
}
sha512sums="0c67fd66b60a904d2dfddab563657c7028cc0bab9d2a195ce55e092f1c8e7cc8b0da2d2436146f1a1e545483f21f5658eeea2f6b224c1a253fdf467bd2b63145 cloud-init-21.2.tar.gz
c14ce3b27c55d1c381e27b2898bb73da8a74c53480d496bdfc87318b69fb612678205ab5a686c1ce703ef5c2c7a8529f629c8f908aeff39524d36870a83c1929 01-oauthlib-remove.patch
444b15f0d81138f7f3767bc10b0bee29ff10fa8b74dfc3542e1abe20d745f09bb2e36cb30ef8035a677ba81af80743207fbd9973d7cb4f33ca37891ae7493916 02-hosts-template-fix.patch
bf6da0948f655ced970f97036db9df4d4027deb0fe2a6575b7d68ddefc3b474948b31edd0f3fb2aa6c8eba07466634bc5b7c948d12eb687fe852761c15485f35 03-disable-irrelevant-modules.patch
48b25ec4457c2b3772a7d210033551d041749a0d1869818d888030e6df7fd9bbc13a38b95cf465de3d46d96881a722f94a337584ce48f280c4a52b819586563a interfaces
f32b90f26d1df0d88fbea7a1a9ab6704a20babdb750b933484bb7c4e91cc19a587d4bfbc95489a354003ecd00795d1592e71b4b93eccd41e392bb7170bfebb0e setup-cloud-init
bb31b78e8f563d8b9d2bb896e28a51862e6479a399ac57cb69fa86f8c0704d05ec79023bd090706359259569ac1d2cc7939950be0d0490fb36c9ec396254b7de README.Alpine"