1 # Build recipe for ca-certificates (a version from Alpine Linux).
3 # Copyright (c) 2018 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 program=ca-certificates
18 version=33042b0af9d4139959a1b9a7179dd3843ea00f0d
19 pkgversion=git33042b0_20180924
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/networking"
25 tarname=${program}-${version}.tar.bz2
28 fetch=http://git.alpinelinux.org/cgit/ca-certificates/snapshot/$tarname
31 Common CA certificates PEM files.
33 This package comes from the CA certificates version found in Alpine
37 homepage=http://git.alpinelinux.org/cgit/ca-certificates/
38 license="GPLv2+ | MPLv2.0"
40 # Source documentation
42 docsdir="${docdir}/${program}-${version}"
44 # Limit parallel jobs for this build
51 unpack "${tardir}/$tarname"
55 # Add updated source file with the included root certificates
56 # http://mxr.mozilla.org/mozilla-central/source/security/nss/lib/ckfw/builtins/certdata.txt
57 cat "${worktree}/archive/ca-certificates/certdata.txt" > certdata.txt
59 # Set sane permissions
60 chmod -R u+w,go-w,a+rX-s .
63 make -j${jobs} V=1 DESTDIR="$destdir" install
64 strip --strip-unneeded \
65 "${destdir}/usr/bin/c_rehash" \
66 "${destdir}/usr/sbin/update-ca-certificates"
68 # Clean up broken symlinks, if any
69 find "$destdir" -print | while read -r file
71 if test -L "$file" && test ! -e "$file"
73 echo "Deleting dangling symlink: $file"
78 mkdir -p "${destdir}"/etc/ca-certificates/update.d
80 # To populate config file
82 echo "# Automatically generated by $full_pkgname"
83 cd "${destdir}/usr/share/ca-certificates"
84 find . -name '*.crt' | sort | cut -b3-
85 ) > "${destdir}/etc/ca-certificates.conf"
87 # Make run-parts script
89 cat << "EOF" > "${destdir}/etc/ca-certificates/update.d/certhash"
91 exec /usr/bin/c_rehash /etc/ssl/certs
94 chmod 755 "${destdir}/etc/ca-certificates/update.d/certhash"
96 # Compress and link man pages (if needed)
97 if test -d "${destdir}/$mandir"
100 cd "${destdir}/$mandir"
101 find . -type f -exec lzip -9 '{}' +
102 find . -type l | while read -r file
104 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
111 mkdir -p "${destdir}${docsdir}"
112 cp -p $docs "${destdir}${docsdir}"