aboutsummaryrefslogtreecommitdiffstats
path: root/community/containers-common/APKBUILD
blob: 9ed17052160dcbda21abb1a3345900ed9c289346 (plain)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=containers-common
pkgver=0.38.5
pkgrel=0
pkgdesc="Configuration files for container tools"
url="https://github.com/containers/common"
license="Apache-2.0"
arch="noarch"
options="!check" # no test suite
makedepends="go-md2man"
subpackages="$pkgname-doc"
# Pick the newest versions of common/storage/image vendored
# in podman, skopeo and buildah (but there is no strict rule).
# Check them with the list_vendors function. Ideally, they
# should be the same.
_common_ver=$pkgver
_storage_ver=1.31.3
_image_ver=5.12.0
_podman_ver=3.2.0
_skopeo_ver=1.3.0
_buildah_ver=1.21.1
source="https://github.com/containers/common/archive/v$_common_ver/common-$_common_ver.tar.gz
	https://github.com/containers/storage/archive/v$_storage_ver/storage-$_storage_ver.tar.gz
	https://github.com/containers/image/archive/v$_image_ver/image-$_image_ver.tar.gz
	https://github.com/containers/podman/archive/v$_podman_ver/podman-$_podman_ver.tar.gz
	https://github.com/containers/skopeo/archive/v$_skopeo_ver/skopeo-$_skopeo_ver.tar.gz
	https://github.com/containers/buildah/archive/v$_buildah_ver/buildah-$_buildah_ver.tar.gz
	"

list_vendors() {
	unpack

	for tool in podman-$_podman_ver skopeo-$_skopeo_ver buildah-$_buildah_ver
	do
		cd "$srcdir"/$tool
		msg $tool
		grep github.com/containers/common go.mod
		grep github.com/containers/storage go.mod
		grep github.com/containers/image go.mod
	done
}

prepare() {
	default_prepare

	# fix go-md2man path in containers/storage
	sed -E 's/(GOMD2MAN =).*/\1 go-md2man/' -i "$srcdir"/storage-$_storage_ver/docs/Makefile

	# set default storage driver
	sed -E 's/(driver =) ""/\1 "overlay"/' -i "$srcdir"/storage-$_storage_ver/storage.conf

	# set unqualified-search-registries
	sed -E 's/# (unqualified-search-registries =).*/\1 ["docker.io"]/' -i "$srcdir"/image-$_image_ver/registries.conf
}

build() {
	cd "$srcdir"/common-$_common_ver
	make -C docs

	cd "$srcdir"/storage-$_storage_ver
	make -C docs

	cd "$srcdir"/image-$_image_ver
	make docs

	cd "$srcdir"/podman-$_podman_ver
	go-md2man -in pkg/hooks/docs/oci-hooks.5.md -out pkg/hooks/docs/oci-hooks.5
}

package() {
	install -d "$pkgdir"/etc/containers/certs.d
	install -d "$pkgdir"/etc/containers/oci/hooks.d
	install -d "$pkgdir"/var/lib/containers/sigstore

	cd "$srcdir"/common-$_common_ver
	install -Dm644 pkg/config/containers.conf "$pkgdir"/etc/containers/containers.conf
	install -Dm644 pkg/config/containers.conf "$pkgdir"/usr/share/containers/containers.conf
	install -Dm644 pkg/seccomp/seccomp.json "$pkgdir"/etc/containers/seccomp.json
	install -Dm644 pkg/seccomp/seccomp.json "$pkgdir"/usr/share/containers/seccomp.json
	make -C docs install PREFIX=/usr DESTDIR="$pkgdir"

	cd "$srcdir"/storage-$_storage_ver
	install -Dm644 storage.conf "$pkgdir"/etc/containers/storage.conf
	install -Dm644 storage.conf "$pkgdir"/usr/share/containers/storage.conf
	make -C docs install DESTDIR="$pkgdir"

	cd "$srcdir"/image-$_image_ver
	install -Dm644 registries.conf "$pkgdir"/etc/containers/registries.conf
	make install DESTDIR="$pkgdir"

	cd "$srcdir"/podman-$_podman_ver
	install -Dm644 pkg/hooks/docs/oci-hooks.5 "pkgdir"/usr/share/man/man5/oci-hooks.5

	cd "$srcdir"/skopeo-$_skopeo_ver
	install -Dm644 default-policy.json "$pkgdir"/etc/containers/policy.json
	install -Dm644 default.yaml "$pkgdir"/etc/containers/registries.d/default.yaml
}

doc() {
	default_doc
	pkgdesc="Man pages for container tools"
}

sha512sums="
d25c06e002cf840e4486ac8b84e9037777b5edd5d40a605c5f1c8a7283fc6f2920588fee851d408e4d275a3673e4fdfef30f9229c01db593f293411a58e8b577  common-0.38.5.tar.gz
79e5dd7373d3c018f8d635b5f5f4f31f1f967d80854552c97cdf874d0caf3dcf7c1323880abefea2ec079383f97c85d05561bf1d8077fc219b29544612f1346b  storage-1.31.3.tar.gz
c690b1c4fd67754c41cc590279382a8f4228e3160db5ba482455b4c0ef4b6bd40ea92d0ca7662b2cc1504d82afdb33bdce8d60552ba3e216102ed34e1418d8c0  image-5.12.0.tar.gz
7db6145e5b303b29b600e9393d0d872931bbe39c385c4e9904b59b1b9a9b87f0191374cc8a13e021d4446c31e461f7be3765c2d18bcb8461df732c89fc848c96  podman-3.2.0.tar.gz
5b6e96fff4670d8dcbc787cd5a568112337a111e7c44111226fa5684edffa880a1d632660238c55b6193ba26496697dd7e38d7d015cdfd61ce5efb119f0e12eb  skopeo-1.3.0.tar.gz
8fb30ed0948f898aef9a32c34d4b2a2e04a376257a73184ec01b67c770be1c3c87e46987ad001ececf2235cb5e17f9d0ff9e9f34be61ddd0935859c4e5b37d1f  buildah-1.21.1.tar.gz
"