archrelease: copy trunk to testing-x86_64
[arch-packages.git] / nss / trunk / PKGBUILD
blob6660113af3f33309351ddc81584d339e55b1dc72
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2 # Contributor: Jan de Groot <jgc@archlinux.org>
4 pkgbase=nss
5 pkgname=(nss ca-certificates-mozilla)
6 pkgver=3.81
7 pkgrel=1
8 pkgdesc="Network Security Services"
9 url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS"
10 arch=(x86_64)
11 license=(MPL GPL)
12 depends=('nspr>=4.34' sqlite zlib sh 'p11-kit>=0.23.19')
13 makedepends=(perl python gyp mercurial)
14 options=(debug)
15 _revision=01d45a3c6d270940f4514cebdeed150f972b4f2b
16 source=("hg+https://hg.mozilla.org/projects/nss#revision=$_revision"
17         certdata2pem.py bundle.sh)
18 sha256sums=('SKIP'
19             'd2a1579dae05fd16175fac27ef08b54731ecefdf414085c610179afcf62b096c'
20             '3bfadf722da6773bdabdd25bdf78158648043d1b7e57615574f189a88ca865dd')
22 pkgver() {
23   cd nss
24   hg id -t -r. | sed 's/^NSS_//;s/_RTM$//;s/_/./g'
27 prepare() {
28   mkdir -p certs
29   ln -srft certs nss/lib/ckfw/builtins/{certdata.txt,nssckbi.h}
32 build() {
33   cd certs
34   ../certdata2pem.py
36   cd ..
37   ./bundle.sh
39   cd nss
40   ./build.sh \
41     --target x64 \
42     --opt \
43     --system-sqlite \
44     --system-nspr \
45     --enable-libpkix \
46     --disable-tests
49 package_nss() {
50   local nsprver="$(pkg-config --modversion nspr)"
51   local libdir=/usr/lib
53   sed nss/pkg/pkg-config/nss.pc.in \
54     -e "s,%libdir%,$libdir,g" \
55     -e "s,%prefix%,/usr,g" \
56     -e "s,%exec_prefix%,/usr/bin,g" \
57     -e "s,%includedir%,/usr/include/nss,g" \
58     -e "s,%NSPR_VERSION%,$nsprver,g" \
59     -e "s,%NSS_VERSION%,$pkgver,g" |
60     install -Dm644 /dev/stdin "$pkgdir$libdir/pkgconfig/nss.pc"
62   ln -s nss.pc "$pkgdir$libdir/pkgconfig/mozilla-nss.pc"
64   install -Dt "$pkgdir$libdir" dist/Release/lib/*.so
66   local vmajor vminor vpatch
67   { read vmajor; read vminor; read vpatch; } \
68     < <(awk '/#define.*NSS_V(MAJOR|MINOR|PATCH)/ {print $3}' nss/lib/nss/nss.h)
70   sed nss/pkg/pkg-config/nss-config.in \
71     -e "s,@libdir@,$libdir,g" \
72     -e "s,@prefix@,/usr/bin,g" \
73     -e "s,@exec_prefix@,/usr/bin,g" \
74     -e "s,@includedir@,/usr/include/nss,g" \
75     -e "s,@MOD_MAJOR_VERSION@,$vmajor,g" \
76     -e "s,@MOD_MINOR_VERSION@,$vminor,g" \
77     -e "s,@MOD_PATCH_VERSION@,$vpatch,g" |
78     install -D /dev/stdin "$pkgdir/usr/bin/nss-config"
80   install -Dt "$pkgdir/usr/bin" \
81     dist/Release/bin/{*util,shlibsign,signtool,signver,ssltap}
83   install -Dt "$pkgdir/usr/include/nss" -m644 dist/public/nss/*.h
85   install -Dt "$pkgdir/usr/share/man/man1" -m644 \
86     nss/doc/nroff/{*util,signtool,signver,ssltap}.1
88   # Replace built-in trust with p11-kit connection
89   ln -s pkcs11/p11-kit-trust.so "$pkgdir$libdir/p11-kit-trust.so"
90   ln -sf p11-kit-trust.so "$pkgdir$libdir/libnssckbi.so"
93 package_ca-certificates-mozilla() {
94   pkgdesc="Mozilla's set of trusted CA certificates"
95   depends=('ca-certificates-utils>=20181109-3')
97   install -Dm644 ca-bundle.trust.p11-kit \
98     "$pkgdir/usr/share/ca-certificates/trust-source/mozilla.trust.p11-kit"
101 # vim:set sw=2 et: