wok-next view cacerts/receipt @ rev 21538
updated cacerts
author | Hans-G?nter Theisgen |
---|---|
date | Sun Jun 21 16:01:58 2020 +0100 (2020-06-21) |
parents | 0cbe4b1f2230 |
children |
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"
10 HOST_ARCH="any"
12 wget_url="https://hg.mozilla.org/releases/mozilla-release/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt"
14 BUILD_DEPENDS="locale-en-base openssl perl"
16 compile_rules()
17 {
18 mkdir -p $src
19 cd $src
20 wget $wget_url
22 # Insert header (or process will fail)
23 sed -i "1i\
24 #CVS_ID @# \$ RCSfile: certdata.txt \$ \$Revision: $date_Ymd \$ \$Date: \$" \
25 certdata.txt
27 # Process...
28 cp -a $stuff/* $src
29 ./make-ca.sh &&
30 ./remove-expired-certs.sh $src/certs
32 # "Installing"
33 mkdir -p $install/etc/ssl/certs
35 cp -a $src/certs/*.pem $install/etc/ssl/certs
36 cp -a $src/ca-bundle.crt $install/etc/ssl
37 ln -s ../ca-bundle.crt $install/etc/ssl/certs/ca-certificates.crt
38 }
40 genpkg_rules()
41 {
42 # Determine date of certdata.txt
43 # FIXME: please point me to elegant way to determine this file timestamp
44 # in Mercurial.
45 string=$(wget -O- -q ${wget_url/raw-/} | fgrep 'date age')
46 # string example:
47 # <td class="date age">Thu, 28 Sep 2017 10:02:22 -0700</td>
48 date_d=$(echo "$string" | cut -d' ' -f5)
49 case $(echo "$string" | cut -d' ' -f6) in
50 Jan) date_m='01';;
51 Feb) date_m='02';;
52 Mar) date_m='03';;
53 Apr) date_m='04';;
54 May) date_m='05';;
55 Jun) date_m='06';;
56 Jul) date_m='07';;
57 Aug) date_m='08';;
58 Sep) date_m='09';;
59 Oct) date_m='10';;
60 Nov) date_m='11';;
61 Dec) date_m='12';;
62 esac
63 date_Y=$(echo "$string" | cut -d' ' -f7)
65 VERSION="$date_Y$date_m$date_d"
67 copy @std
68 DEPENDS="openssl"
69 }
71 # Rehash certificates.
72 # Use simplified plain shell equivalent to the Perl `c_rehash`
73 # (see openssl package). Normal no output here.
74 post_install()
75 {
76 cd "$1/etc/ssl/certs"
77 find . -type l -delete
78 for i in $(ls *.pem)
79 do
80 j="$(openssl x509 -hash -noout -in $i)"
81 [ -n "$j" ] && ln -s $i $j.0
82 done
83 }
85 # Remove broken symbolic links
86 post_remove()
87 {
88 find "$1/etc/ssl/certs" -type l ! -exec test -e '{}' \; -delete
89 }