aboutsummaryrefslogtreecommitdiffstats
path: root/main/ca-certificates/APKBUILD
blob: 6b5ee01c0581f511e26b7286f9b79275f5719470 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ca-certificates
pkgver=20150426

_date=${pkgver%_p*}
_nmu="+nmu${pkgver#*_p}"
[ "$_nmu" = "+nmu${pkgver}" ] && _nmu=""
_ver=${pkgver}

pkgrel=2
pkgdesc="Common CA certificates PEM files"
url="http://packages.debian.org/sid/ca-certificates"
arch="all"
license="MPL 2.0 GPL2+"
depends="openssl"
makedepends="python"
subpackages="$pkgname-doc"
options="!fhs"
triggers="ca-certificates.trigger=/usr/share/ca-certificates:/usr/local/share/ca-certificates:/etc/ssl/certs"
source="http://ftp.no.debian.org/debian/pool/main/c/$pkgname/${pkgname}_${_ver}.tar.xz
	update-ca.c
	"

_builddir="$srcdir"/$pkgname-$_ver
build () {
	cd "$_builddir"
	make || return 1

	${CC:-gcc} ${CFLAGS} -o update-ca-certificates "$srcdir"/update-ca.c \
		${LDFLAGS} || return 1
}

package() {
	cd "$_builddir"
	install -d -m755 "$pkgdir"/etc/ca-certificates/update.d \
		"$pkgdir"/usr/sbin \
		"$pkgdir"/usr/share/ca-certificates \
		"$pkgdir"/usr/local/share/ca-certificates \
		"$pkgdir"/etc/ssl/certs \
		|| return 1
	make DESTDIR="$pkgdir" install || return 1
	install -D -m644 sbin/update-ca-certificates.8 \
		"$pkgdir"/usr/share/man/man8/update-ca-certificates.8 \
		|| return 1

	(
	echo "# Automatically generated by ${pkgname}-${pkgver}-${pkgrel}"
	echo "# $(date -u)"
	echo "# Do not edit."
	cd "$pkgdir"/usr/share/ca-certificates
	find . -name '*.crt' | sort | cut -b3-
	) > "$pkgdir"/etc/ca-certificates.conf

	# http://bugs.alpinelinux.org/issues/2715
	# http://bugs.alpinelinux.org/issues/2846
	install -m755 update-ca-certificates "$pkgdir"/usr/sbin \
		|| return 1

	mkdir -p "$pkgdir"/etc/apk/protected_paths.d
	cat <<EOF > "$pkgdir"/etc/apk/protected_paths.d/ca-certificates.list
-etc/ssl/certs/ca-certificates.crt
-etc/ssl/certs/ca-cert-*.pem
-etc/ssl/certs/[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].[r0-9]*
EOF
}

md5sums="717455f13fb31fd014a11a468ea3895d  ca-certificates_20150426.tar.xz
0fb7db0c3c2fb694ad80b71a3093f57d  update-ca.c"
sha256sums="37dbaa93ed64cc4ae93ac295f9248fbc741bd51376438cfb1257f17efab5494f  ca-certificates_20150426.tar.xz
2bf5b1455e95026cf0a946526b398fc4512e7a9f1daeb7b949c8c0ce12d54761  update-ca.c"
sha512sums="920dfc512c018c5338bf07b6a6afcb664d9bfba659d4233ca9e87471d5e0ed05de054c96f3d7e6091549aa6deb46106a79f7f982696081f9b2164e18133eb34d  ca-certificates_20150426.tar.xz
8c9cfad84039f089f990862cf1b7624a73ec0f600707834e0c05a6d1910a4779ecd7c685884d25fc8597563539ea8860235784f1d6878be0e2393ba02b2e04ed  update-ca.c"