recipes: xorg/mesa: upgraded to version 18.3.2
[dragora.git] / recipes / networking / ca-certificates / recipe
blob70aef242224c9509800e1c6e19280b2cc22a5c38
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
20 release=5
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/networking"
25 tarname=${program}-${version}.tar.bz2
27 # Remote source(s)
28 fetch=http://git.alpinelinux.org/cgit/ca-certificates/snapshot/$tarname
30 description="
31 Common CA certificates PEM files.
33 This package comes from the CA certificates version found in Alpine
34 Linux.
37 homepage=http://git.alpinelinux.org/cgit/ca-certificates/
38 license="GPLv2+ | MPLv2.0"
40 # Source documentation
41 docs="VERSION"
42 docsdir="${docdir}/${program}-${version}"
44 # Limit parallel jobs for this build
45 jobs=1
47 build()
49     set -e
51     unpack "${tardir}/$tarname"
53     cd "$srcdir"
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 .
62     make -j${jobs} V=1
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
70     do
71         if test -L "$file" && test ! -e "$file"
72         then
73             echo "Deleting dangling symlink: $file"
74             rm -f -- "$file"
75         fi
76     done
78     mkdir -p "${destdir}"/etc/ca-certificates/update.d
80     # To populate config file
81     (
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"
90 #! /bin/sh -
91 exec /usr/bin/c_rehash /etc/ssl/certs
93 EOF
94     chmod 755 "${destdir}/etc/ca-certificates/update.d/certhash"
96     # Compress and link man pages (if needed)
97     if test -d "${destdir}/$mandir"
98     then
99         (
100             cd "${destdir}/$mandir"
101             find . -type f -exec lzip -9 '{}' +
102             find . -type l | while read -r file
103             do
104                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
105                 rm -- "$file"
106             done
107         )
108     fi
110     # Copy documentation
111     mkdir -p "${destdir}${docsdir}"
112     cp -p $docs "${destdir}${docsdir}"