aboutsummaryrefslogtreecommitdiffstats
path: root/community/cloud-utils/APKBUILD
blob: e5c3a6ebc407fd56a8cfd67e90bf1ffadd9ba543 (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
# Contributor: Vladimir Avinkin <mouzfun@gmail.com>
# Contributor: Dermot Bradley <dermot_bradley@yahoo.com>
# Maintainer: Dermot Bradley <dermot_bradley@yahoo.com>
pkgname=cloud-utils
pkgver=0.32
pkgrel=2
pkgdesc="Utilities for interacting with cloud VM images"
url="https://launchpad.net/cloud-utils/"
arch="noarch !mips !mips64 !s390x" # tests are broken on big-endian
license="GPL-3.0-or-later"
depends="
	bash
	cdrkit
	coreutils
	e2fsprogs
	e2fsprogs-extra
	eudev
	mtools
	python3
	qemu-img
	tar
	util-linux
	"
subpackages="$pkgname-doc $pkgname-ec2metadata $pkgname-growpart"
source="cloud-utils-$pkgver.tar.gz::https://github.com/canonical/cloud-utils/archive/$pkgver.tar.gz
	01-minor-corrections.patch
	02-make-udev-optional.patch
	03-growpart-flock.patch
	"

build() {
	make
}

check() {
	# the other tests require root permissions
	PATH=$PATH:$builddir/bin TMPDIR="$srcdir" ./test/test-growpart-fsimage
}

package() {
	# Delete a "broken" script and 3 irrelevant manpages.
	# These changes are addressed by upstream PR 20 which didn't make
	# the 0.32 release. This can hopefully be remove upon the next
	# upstream release.
	rm bin/cloud-publish-ubuntu \
	   man/cloud-publish-image.1 \
	   man/cloud-publish-tarball.1 \
	   man/cloud-run-instances.1

	# Delete an unnecessary script
	rm bin/vcs-run

	make DESTDIR="$pkgdir" install

	cp README.md $pkgdir/usr/share/doc/$pkgname/
}

ec2metadata() {
	pkgdesc="Retrieve metadata on AWS EC2 (and compatible) VMs"
	depends="
		python3
		"
	amove usr/bin/ec2metadata
}

growpart() {
	pkgdesc="Grow the size of disk partitions"
	depends="
		blkid
		partx
		sfdisk
		"
	amove usr/bin/growpart
}

sha512sums="62bc07759c9c74397cd16a6a0781efb50803efc9f59969e16943fcab0d73ef96966c6abfe21edd17c15ac96dbffaaffa594b3abc0d3fab23102d2d6e7f380a7d  cloud-utils-0.32.tar.gz
0efa8170b41cb5b6799fda9de3d3054aab1f765dfc46d1bada11edb103797ddd8153582dbfa1b4c22fd088d4cbf3a1f0729ff708f128d899645f988a8bc4c35e  01-minor-corrections.patch
83275289265f9a754bc49262133c3cbb42683f42e58de05fc446e9411be457f012edad7058325bbaae2ba8aa7fb7e42698df94f28682b0869d7f15956bde8f2a  02-make-udev-optional.patch
2a3802364f46c3144d06736dc5719378e6e7bd8635e2a625387d4b5ad0f9e8d1e76c3e9bccd3b87a224e3b8a6563cb4c61f41be6d4c3fc23780f538d56b733b4  03-growpart-flock.patch"