1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2 # Contributor: Jan de Groot <jgc@archlinux.org>
5 pkgname=(nss ca-certificates-mozilla)
8 pkgdesc="Network Security Services"
9 url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS"
12 depends=(nspr sqlite zlib sh 'p11-kit>=0.23.19')
13 makedepends=(perl python gyp mercurial)
14 _revision=a2050bd67f05e8af5984baca03078d69b3874b85
15 source=("hg+https://hg.mozilla.org/projects/nss#revision=$_revision"
16 certdata2pem.py bundle.sh)
18 'd2a1579dae05fd16175fac27ef08b54731ecefdf414085c610179afcf62b096c'
19 '3bfadf722da6773bdabdd25bdf78158648043d1b7e57615574f189a88ca865dd')
23 hg id -t | sed 's/^NSS_//;s/_RTM$//;s/_/./g'
28 ln -srft certs nss/lib/ckfw/builtins/{certdata.txt,nssckbi.h}
49 local nsprver="$(pkg-config --modversion nspr)"
52 sed nss/pkg/pkg-config/nss.pc.in \
53 -e "s,%libdir%,$libdir,g" \
54 -e "s,%prefix%,/usr,g" \
55 -e "s,%exec_prefix%,/usr/bin,g" \
56 -e "s,%includedir%,/usr/include/nss,g" \
57 -e "s,%NSPR_VERSION%,$nsprver,g" \
58 -e "s,%NSS_VERSION%,$pkgver,g" |
59 install -Dm644 /dev/stdin "$pkgdir$libdir/pkgconfig/nss.pc"
61 ln -s nss.pc "$pkgdir$libdir/pkgconfig/mozilla-nss.pc"
63 install -Dt "$pkgdir$libdir" dist/Release/lib/*.so
65 local vmajor vminor vpatch
66 { read vmajor; read vminor; read vpatch; } \
67 < <(awk '/#define.*NSS_V(MAJOR|MINOR|PATCH)/ {print $3}' nss/lib/nss/nss.h)
69 sed nss/pkg/pkg-config/nss-config.in \
70 -e "s,@libdir@,$libdir,g" \
71 -e "s,@prefix@,/usr/bin,g" \
72 -e "s,@exec_prefix@,/usr/bin,g" \
73 -e "s,@includedir@,/usr/include/nss,g" \
74 -e "s,@MOD_MAJOR_VERSION@,$vmajor,g" \
75 -e "s,@MOD_MINOR_VERSION@,$vminor,g" \
76 -e "s,@MOD_PATCH_VERSION@,$vpatch,g" |
77 install -D /dev/stdin "$pkgdir/usr/bin/nss-config"
79 install -Dt "$pkgdir/usr/bin" \
80 dist/Release/bin/{*util,shlibsign,signtool,signver,ssltap}
82 install -Dt "$pkgdir/usr/include/nss" -m644 dist/public/nss/*.h
84 install -Dt "$pkgdir/usr/share/man/man1" -m644 \
85 nss/doc/nroff/{*util,signtool,signver,ssltap}.1
87 # Replace built-in trust with p11-kit connection
88 ln -s pkcs11/p11-kit-trust.so "$pkgdir$libdir/p11-kit-trust.so"
89 ln -sf p11-kit-trust.so "$pkgdir$libdir/libnssckbi.so"
92 package_ca-certificates-mozilla() {
93 pkgdesc="Mozilla's set of trusted CA certificates"
94 depends=('ca-certificates-utils>=20181109-3')
96 install -Dm644 ca-bundle.trust.p11-kit \
97 "$pkgdir/usr/share/ca-certificates/trust-source/mozilla.trust.p11-kit"