1 # Build recipe for ca-certificates (a version from Alpine Linux).
3 # Copyright (c) 2018-2019 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=20190108_431b3fc
21 # Define hash tag to categorize the package name output
24 tarname=${program}-${version}.tar.lz
28 http://rsync.dragora.org/current/sources/$tarname
29 http://mirror.cedia.org.ec/dragora/current/sources/$tarname
33 Common CA certificates PEM files.
35 This package comes from the CA certificates version found in
39 homepage=http://git.alpinelinux.org/cgit/ca-certificates/
40 license="GPLv2+ | MPLv2.0"
42 # Source documentation
44 docsdir="${docdir}/${program}-${version}"
46 # Limit parallel jobs for this build
53 unpack "${tardir}/$tarname"
57 # Add updated source file with the included root certificates
58 # http://mxr.mozilla.org/mozilla-central/source/security/nss/lib/ckfw/builtins/certdata.txt
59 cat "${worktree}/archive/ca-certificates/certdata.txt" > certdata.txt
61 # Set sane permissions
62 chmod -R u+w,go-w,a+rX-s .
65 make -j${jobs} V=1 DESTDIR="$destdir" install
66 strip --strip-unneeded \
67 "${destdir}/usr/bin/c_rehash" \
68 "${destdir}/usr/sbin/update-ca-certificates"
70 # Clean up broken symlinks, if any
71 find "$destdir" -print | while read -r file
73 if test -L "$file" && test ! -e "$file"
75 echo "Deleting dangling symlink: $file"
80 mkdir -p "${destdir}"/etc/ca-certificates/update.d
82 # To populate config file
84 echo "# Automatically generated by $full_pkgname"
85 cd "${destdir}/usr/share/ca-certificates"
86 find . -name '*.crt' | sort | cut -b3-
87 ) > "${destdir}/etc/ca-certificates.conf"
89 # Make run-parts script
91 cat << "EOF" > "${destdir}/etc/ca-certificates/update.d/certhash"
93 exec /usr/bin/c_rehash /etc/ssl/certs
96 chmod 755 "${destdir}/etc/ca-certificates/update.d/certhash"
98 # Compress and link man pages (if needed)
99 if test -d "${destdir}/$mandir"
102 cd "${destdir}/$mandir"
103 find . -type f -exec lzip -9 '{}' +
104 find . -type l | while read -r file
106 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
113 mkdir -p "${destdir}${docsdir}"
114 cp -p $docs "${destdir}${docsdir}"