aboutsummaryrefslogtreecommitdiffstats
path: root/community/cloud-init/APKBUILD
blob: 365745e2c18f940f0921cb50dafe6b5ed476947e (plain) (blame)
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
# 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=20.4
pkgrel=0
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
	lsblk
	python3
	py3-configobj
	py3-jinja2
	py3-jsonpatch
	py3-jsonschema
	py3-oauthlib
	py3-requests
	py3-yaml
	shadow
	sudo
	util-linux
	"
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
	interfaces
	setup-cloud-init
	README.Alpine
	"
install="$pkgname.post-install"

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 systemd template file
	rm "$pkgdir"/etc/cloud/templates/timesyncd.conf.tmpl
}

sha512sums="c5acf4843504a20d1d0d92c42dceb82b2b979af9e105ad9a84a60732dcde9335af4535cb1fd21a45914a37b8d93e0a0a6b899c05ab5eb1fc34d6cc24f490dc83  cloud-init-20.4.tar.gz
48b25ec4457c2b3772a7d210033551d041749a0d1869818d888030e6df7fd9bbc13a38b95cf465de3d46d96881a722f94a337584ce48f280c4a52b819586563a  interfaces
f32b90f26d1df0d88fbea7a1a9ab6704a20babdb750b933484bb7c4e91cc19a587d4bfbc95489a354003ecd00795d1592e71b4b93eccd41e392bb7170bfebb0e  setup-cloud-init
3cfba05374bc13eb83c8cec03ae91e0bd0093643e5d9b66f12fb1d9dfd7a097534f989d7f6b1d42cf0acca5352f34b31271eeb63c265ea8e5f763c4bb7e85d32  README.Alpine"