db-move: moved libdex from [staging] to [testing] (x86_64)
[arch-packages.git] / nss / trunk / PKGBUILD
blobf8598b9f0a8710c5f70f3b9f0e8c90a42ea5e154
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.89
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=(
12   GPL
13   MPL
15 depends=(
16   'nspr>=4.35'
17   'p11-kit>=0.23.19'
18   sh
19   sqlite
20   zlib
22 makedepends=(
23   gyp
24   mercurial
25   perl
26   python
28 _revision=4e4ebb9ad0d4391035c76c26967682c148ff0fd7
29 source=(
30   "hg+https://hg.mozilla.org/projects/nss#revision=$_revision"
31   bundle.sh
32   certdata2pem.py
34 b2sums=('SKIP'
35         '4be5dd836c844fdd7b63302a6994d62149082c3bc81eef70f373f416fed80a61a923960e4390d1c391b81ab01b409370d788818a30ffdd3a4ed467b670f990f6'
36         '6bb59dcc9289916dcbf8fb6d73db0c0cd7582dc12a3aa4e8be19ec62c9ede65fdd9470a2d92ec5a114506b78d2d21b8ae0a1b45a17dc1f90f7d75434a93da510')
38 pkgver() {
39   cd nss
40   hg id -t -r. | sed 's/^NSS_//;s/_RTM$//;s/_/./g'
43 prepare() {
44   mkdir -p certs
45   ln -srft certs nss/lib/ckfw/builtins/{certdata.txt,nssckbi.h}
48 build() {
49   cd certs
50   ../certdata2pem.py
52   cd ..
53   ./bundle.sh
55   cd nss
56   ./build.sh \
57     --target x64 \
58     --opt \
59     --system-sqlite \
60     --system-nspr \
61     --enable-libpkix \
62     --disable-tests
65 package_nss() {
66   local nsprver="$(pkg-config --modversion nspr)"
67   local libdir=/usr/lib
69   sed nss/pkg/pkg-config/nss.pc.in \
70     -e "s,%libdir%,$libdir,g" \
71     -e "s,%prefix%,/usr,g" \
72     -e "s,%exec_prefix%,/usr/bin,g" \
73     -e "s,%includedir%,/usr/include/nss,g" \
74     -e "s,%NSPR_VERSION%,$nsprver,g" \
75     -e "s,%NSS_VERSION%,$pkgver,g" |
76     install -Dm644 /dev/stdin "$pkgdir$libdir/pkgconfig/nss.pc"
78   ln -s nss.pc "$pkgdir$libdir/pkgconfig/mozilla-nss.pc"
80   install -Dt "$pkgdir$libdir" dist/Release/lib/*.so
82   local vmajor vminor vpatch
83   { read vmajor; read vminor; read vpatch; } \
84     < <(awk '/#define.*NSS_V(MAJOR|MINOR|PATCH)/ {print $3}' nss/lib/nss/nss.h)
86   sed nss/pkg/pkg-config/nss-config.in \
87     -e "s,@libdir@,$libdir,g" \
88     -e "s,@prefix@,/usr/bin,g" \
89     -e "s,@exec_prefix@,/usr/bin,g" \
90     -e "s,@includedir@,/usr/include/nss,g" \
91     -e "s,@MOD_MAJOR_VERSION@,$vmajor,g" \
92     -e "s,@MOD_MINOR_VERSION@,$vminor,g" \
93     -e "s,@MOD_PATCH_VERSION@,$vpatch,g" |
94     install -D /dev/stdin "$pkgdir/usr/bin/nss-config"
96   install -Dt "$pkgdir/usr/bin" \
97     dist/Release/bin/{*util,shlibsign,signtool,signver,ssltap}
99   install -Dt "$pkgdir/usr/include/nss" -m644 dist/public/nss/*.h
101   install -Dt "$pkgdir/usr/share/man/man1" -m644 \
102     nss/doc/nroff/{*util,signtool,signver,ssltap}.1
104   # Replace built-in trust with p11-kit connection
105   ln -s pkcs11/p11-kit-trust.so "$pkgdir$libdir/p11-kit-trust.so"
106   ln -sf p11-kit-trust.so "$pkgdir$libdir/libnssckbi.so"
109 package_ca-certificates-mozilla() {
110   pkgdesc="Mozilla's set of trusted CA certificates"
111   depends=('ca-certificates-utils>=20181109-3')
113   install -Dm644 ca-bundle.trust.p11-kit \
114     "$pkgdir/usr/share/ca-certificates/trust-source/mozilla.trust.p11-kit"
117 # vim:set sw=2 sts=-1 et: