wok-next view cacerts/receipt @ rev 21031
Random updates
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Nov 03 15:42:26 2018 +0200 (2018-11-03) |
parents | 3e3205b3b68f |
children | 0cbe4b1f2230 |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="cacerts"
4 VERSION="latest"
5 CATEGORY="security"
6 SHORT_DESC="Certificate Authority Certificates"
7 MAINTAINER="al.bobylev@gmail.com"
8 LICENSE="MPL2"
9 WEB_SITE="http://www.linuxfromscratch.org/blfs/view/svn/postlfs/make-ca.html"
11 wget_url="https://hg.mozilla.org/releases/mozilla-release/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt"
13 BUILD_DEPENDS="perl openssl locale-en-base"
15 compile_rules() {
16 mkdir -p $src
17 cd $src
18 wget $wget_url
20 # Insert header (or process will fail)
21 sed -i "1i\
22 #CVS_ID @# \$ RCSfile: certdata.txt \$ \$Revision: $date_Ymd \$ \$Date: \$" \
23 certdata.txt
25 # Process...
26 cp -a $stuff/* $src
27 ./make-ca.sh &&
28 ./remove-expired-certs.sh $src/certs
30 # "Installing"
31 mkdir -p $install/etc/ssl/certs
32 cp -a $src/certs/*.pem $install/etc/ssl/certs
33 cp -a $src/ca-bundle.crt $install/etc/ssl
34 ln -s ../ca-bundle.crt $install/etc/ssl/certs/ca-certificates.crt
35 }
37 genpkg_rules() {
38 # Determine date of certdata.txt
39 # FIXME: please point me to elegant way to determine this file timestamp
40 # in Mercurial.
41 string=$(wget -O- -q ${wget_url/raw-/} | fgrep 'date age')
42 # string example:
43 # <td class="date age">Thu, 28 Sep 2017 10:02:22 -0700</td>
44 date_d=$(echo "$string" | cut -d' ' -f5)
45 case $(echo "$string" | cut -d' ' -f6) in
46 Jan) date_m='01';;
47 Feb) date_m='02';;
48 Mar) date_m='03';;
49 Apr) date_m='04';;
50 May) date_m='05';;
51 Jun) date_m='06';;
52 Jul) date_m='07';;
53 Aug) date_m='08';;
54 Sep) date_m='09';;
55 Oct) date_m='10';;
56 Nov) date_m='11';;
57 Dec) date_m='12';;
58 esac
59 date_Y=$(echo "$string" | cut -d' ' -f7)
61 VERSION="$date_Y$date_m$date_d"
63 copy @std
64 DEPENDS="openssl"
65 }
67 # Rehash certificates.
68 # Use simplified plain shell equivalent to the Perl `c_rehash`
69 # (see openssl package). Normal no output here.
70 post_install() {
71 cd "$1/etc/ssl/certs"
72 find . -type l -delete
73 for i in $(ls *.pem); do
74 j="$(openssl x509 -hash -noout -in $i)"
75 [ -n "$j" ] && ln -s $i $j.0
76 done
77 }
79 # Remove broken symlinks
80 post_remove() {
81 find "$1/etc/ssl/certs" -type l ! -exec test -e '{}' \; -delete
82 }