aboutsummaryrefslogtreecommitdiffstats
path: root/main/ca-certificates/APKBUILD
blob: ed7118ca4a6f7f173ce9683d78b67f7a094d6157 (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
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ca-certificates
pkgver=20160104
pkgrel=1
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:/etc/ca-certificates/update.d"
source="http://ftp.no.debian.org/debian/pool/main/c/$pkgname/${pkgname}_${pkgver}.tar.xz
	fix-manpage.patch
	update-ca.c
	"

_builddir="$srcdir"/$pkgname
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

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

	cat > "$pkgdir"/etc/ca-certificates/update.d/c_rehash <<EOF
#!/bin/sh
exec /usr/bin/c_rehash /etc/ssl/certs
EOF
	chmod +x "$pkgdir"/etc/ca-certificates/update.d/c_rehash || return 1
}

md5sums="d9665a83d0d3ef8176a38e6aa20458e9  ca-certificates_20160104.tar.xz
0c3d9f5d795c7475b997e18498b7aec8  fix-manpage.patch
755477aff09e1b5909e4e6ef49671992  update-ca.c"
sha256sums="09eb770122e23260316120c0cbbddc8a1d33e7147210ce44e146084d5d5abcdd  ca-certificates_20160104.tar.xz
60b36c4881bb367891df038a0736456c2d170496de8c339026671008b1caa09b  fix-manpage.patch
e6b4a05a363f131f3dab1d3c41c315b61be3de91a77aef8b98ea2ef8f28cadc4  update-ca.c"
sha512sums="4291ba58057b66d56853162b71862832135eab6f444a5e2cf3dd1089495d44624246dc0c540871851fe9aaceb42054516309402525c8f16a88911d3af9c3518a  ca-certificates_20160104.tar.xz
690d6bb434fb3ccce931d7ee6a167124f9c2d2e7e7a016d85f7b72a5f7f7c34db8c6133f3575e962a91981a32a88f8961776fe5fd907e57f59c03a32f2fcced3  fix-manpage.patch
c8e14636b238fb5c2c50125530219425e23c7e78fca6e2de56a0057f8d86511ce2d95f6ced326d3395a574a2872ce09dea6d6b0651fd5b78e75e5f8aa404b378  update-ca.c"