wok-next view cacerts/receipt @ rev 19936
mate-common: automake-1.15 support, mate-desktop, mate-icon-theme, mate-system-monitor: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Oct 15 17:04:15 2017 +0200 (2017-10-15) |
parents | 8f22b3b666d1 |
children | 7d96b53ab037 |
line source
1 # SliTaz package receipt v2.
3 # This receipt will follow actual version on each recook
4 PACKAGE="cacerts"
5 VERSION="20170928"
6 CATEGORY="security"
7 SHORT_DESC="Certificate Authority Certificates"
8 MAINTAINER="al.bobylev@gmail.com"
9 LICENSE="MPL2"
10 WEB_SITE="http://www.linuxfromscratch.org/blfs/view/svn/postlfs/cacerts.html"
11 HOST_ARCH="any"
13 wget_url="https://hg.mozilla.org/releases/mozilla-release/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt"
14 #wget_url="http://anduin.linuxfromscratch.org/BLFS/other/certdata.txt"
16 BUILD_DEPENDS="perl openssl locale-en"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 # Determine date of certdata.txt
22 # FIXME: please point me to elegant way to determine this file timestamp
23 # in Mercurial.
24 string=$(wget -O- ${wget_url/raw-/} | fgrep 'date age')
25 # string example:
26 # <td class="date age">Thu, 28 Sep 2017 10:02:22 -0700</td>
27 date_d=$(echo "$string" | cut -d' ' -f5)
28 case $(echo "$string" | cut -d' ' -f6) in
29 Jan) date_m='01';;
30 Feb) date_m='02';;
31 Mar) date_m='03';;
32 Apr) date_m='04';;
33 May) date_m='05';;
34 Jun) date_m='06';;
35 Jul) date_m='07';;
36 Aug) date_m='08';;
37 Sep) date_m='09';;
38 Oct) date_m='10';;
39 Nov) date_m='11';;
40 Dec) date_m='12';;
41 esac
42 date_Y=$(echo "$string" | cut -d' ' -f7)
43 date_Ymd="$date_Y$date_m$date_d"
45 [ -f '/tmp/certdata.txt' ] && rm /tmp/certdata.txt
46 wget -P/tmp $wget_url
48 # Insert header (or process will fail)
49 sed -i "1i\
50 #CVS_ID @# \$ RCSfile: certdata.txt \$ \$Revision: $date_Ymd \$ \$Date: \$" \
51 /tmp/certdata.txt
53 # VERSION=$(sed -n '/\$Revision:/s|.*Revision: \([0-9]*\).*$|\1|p' /tmp/certdata.txt)
54 VERSION="$date_Ymd"
55 echo -e "\nActual version: $VERSION\n"
57 # Update receipt version
58 sed -i "s|^VERSION=.*|VERSION=\"$VERSION\"|" $WOK/cacerts/receipt
60 src="$WOK/cacerts/source/cacerts-$VERSION"
61 mkdir -p $src
62 mv /tmp/certdata.txt $src
63 cd $src
65 # Save certdata in $SRC
66 TARBALL="$PACKAGE-$VERSION.txt"
67 [ -e "$SRC/$TARBALL" ] || cp $src/certdata.txt $SRC/$TARBALL
69 # Process...
70 cp -a $stuff/* $src
71 ./make-ca.sh &&
72 ./remove-expired-certs.sh $src/certs
74 # "Installing"
75 mkdir -p $install/etc/ssl/certs
76 cp -a $src/certs/*.pem $install/etc/ssl/certs
77 cp -a $src/ca-bundle.crt $install/etc/ssl
78 ln -s ../ca-bundle.crt $install/etc/ssl/certs/ca-certificates.crt
79 }
81 # Rules to gen a SliTaz package suitable for Tazpkg.
82 genpkg_rules()
83 {
84 copy @std
85 DEPENDS="openssl"
86 }
88 # Rehash certificates.
89 # Use simplified plain shell equivalent to the Perl `c_rehash`
90 # (see openssl package). Normal no output here.
91 post_install() {
92 cd "$1/etc/ssl/certs"
93 find . -type l -delete
94 for i in $(ls *.pem); do
95 j="$(openssl x509 -hash -noout -in $i)"
96 [ -n "$j" ] && ln -s $i $j.0
97 done
98 }
100 # Remove broken symlinks
101 post_remove() {
102 find "$1/etc/ssl/certs" -type l ! -exec test -e '{}' \; -delete
103 }