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