wok-next view cacerts/receipt @ rev 21079
emacs: update dependencies
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Dec 22 14:46:21 2018 +0200 (2018-12-22) |
parents | 41860cbdf043 |
children | 97d67e1e0621 |
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="perl openssl locale-en-base"
16 compile_rules() {
17 mkdir -p $src
18 cd $src
19 wget $wget_url
21 # Insert header (or process will fail)
22 sed -i "1i\
23 #CVS_ID @# \$ RCSfile: certdata.txt \$ \$Revision: $date_Ymd \$ \$Date: \$" \
24 certdata.txt
26 # Process...
27 cp -a $stuff/* $src
28 ./make-ca.sh &&
29 ./remove-expired-certs.sh $src/certs
31 # "Installing"
32 mkdir -p $install/etc/ssl/certs
33 cp -a $src/certs/*.pem $install/etc/ssl/certs
34 cp -a $src/ca-bundle.crt $install/etc/ssl
35 ln -s ../ca-bundle.crt $install/etc/ssl/certs/ca-certificates.crt
36 }
38 genpkg_rules() {
39 # Determine date of certdata.txt
40 # FIXME: please point me to elegant way to determine this file timestamp
41 # in Mercurial.
42 string=$(wget -O- -q ${wget_url/raw-/} | fgrep 'date age')
43 # string example:
44 # <td class="date age">Thu, 28 Sep 2017 10:02:22 -0700</td>
45 date_d=$(echo "$string" | cut -d' ' -f5)
46 case $(echo "$string" | cut -d' ' -f6) in
47 Jan) date_m='01';;
48 Feb) date_m='02';;
49 Mar) date_m='03';;
50 Apr) date_m='04';;
51 May) date_m='05';;
52 Jun) date_m='06';;
53 Jul) date_m='07';;
54 Aug) date_m='08';;
55 Sep) date_m='09';;
56 Oct) date_m='10';;
57 Nov) date_m='11';;
58 Dec) date_m='12';;
59 esac
60 date_Y=$(echo "$string" | cut -d' ' -f7)
62 VERSION="$date_Y$date_m$date_d"
64 copy @std
65 DEPENDS="openssl"
66 }
68 # Rehash certificates.
69 # Use simplified plain shell equivalent to the Perl `c_rehash`
70 # (see openssl package). Normal no output here.
71 post_install() {
72 cd "$1/etc/ssl/certs"
73 find . -type l -delete
74 for i in $(ls *.pem); do
75 j="$(openssl x509 -hash -noout -in $i)"
76 [ -n "$j" ] && ln -s $i $j.0
77 done
78 }
80 # Remove broken symlinks
81 post_remove() {
82 find "$1/etc/ssl/certs" -type l ! -exec test -e '{}' \; -delete
83 }