core/nss/PKGBUILD

96 lines
2.8 KiB
Bash
Raw Normal View History

2015-02-26 20:02:46 +08:00
# TODO: Always remember to build lib32-nss when bumping pkgver
2010-10-31 22:16:43 +08:00
2014-09-25 12:34:51 +08:00
pkgbase=nss
pkgname=(nss ca-certificates-mozilla)
2018-10-17 11:15:26 +08:00
pkgver=3.39
2017-09-29 15:53:07 +08:00
pkgrel=1
2017-08-29 02:33:56 +08:00
pkgdesc="Network Security Services"
url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS"
2018-05-30 11:03:14 +08:00
arch=(x86_64)
2017-08-29 02:33:56 +08:00
license=(MPL GPL)
2018-10-17 11:15:26 +08:00
_nsprver=4.20
2017-08-29 02:33:56 +08:00
depends=("nspr>=${_nsprver}" sqlite3 zlib sh p11-kit)
2018-07-01 04:03:59 +08:00
makedepends=(perl python2 gyp)
2017-08-29 02:33:56 +08:00
options=(!strip !makeflags staticlibs)
source=("https://ftp.mozilla.org/pub/security/nss/releases/NSS_${pkgver//./_}_RTM/src/nss-${pkgver}.tar.gz"
2018-05-16 11:34:19 +08:00
certdata2pem.py bundle.sh)
2018-10-17 11:15:26 +08:00
sha256sums=('6be64dd76f212415cc8bc34343ac1e7389048db4db9a023a84873c411dc5864b'
2017-08-29 02:33:56 +08:00
'512b12a2f13129be62c008b4df0153f527dd7d71c2c5183de99dfa2a1c49dd8a'
2018-07-01 04:07:32 +08:00
'e412463cfa32bd38a97c1c3664e70c8eb211b676d9192e45f44fbccb0422e87d')
2010-03-14 23:48:48 +08:00
2013-09-20 03:50:53 +08:00
prepare() {
2017-08-29 02:33:56 +08:00
mkdir certs path
ln -s /usr/bin/python2 path/python
2014-09-25 12:34:51 +08:00
cd nss-$pkgver
2013-09-20 03:50:53 +08:00
2014-09-25 12:34:51 +08:00
ln -sr nss/lib/ckfw/builtins/certdata.txt ../certs/
ln -sr nss/lib/ckfw/builtins/nssckbi.h ../certs/
2013-09-20 03:50:53 +08:00
}
build() {
2014-09-25 12:34:51 +08:00
cd certs
python2 ../certdata2pem.py
cd ..
sh bundle.sh
cd nss-$pkgver/nss
2018-05-16 11:34:19 +08:00
PATH="$srcdir/path:$PATH" bash -x ./build.sh -v \
--opt --system-sqlite --system-nspr --enable-libpkix --disable-tests
}
2014-09-25 12:34:51 +08:00
package_nss() {
2018-05-16 11:34:19 +08:00
local vmajor vminor vpatch
2014-09-25 12:34:51 +08:00
cd nss-$pkgver
2013-09-20 03:50:53 +08:00
2018-05-16 11:34:19 +08:00
{ read vmajor; read vminor; read vpatch; } \
2017-08-29 02:33:56 +08:00
< <(awk '/#define.*NSS_V(MAJOR|MINOR|PATCH)/ {print $3}' nss/lib/nss/nss.h)
2013-09-20 03:50:53 +08:00
2018-05-16 11:34:19 +08:00
sed nss/pkg/pkg-config/nss.pc.in \
2013-09-20 03:50:53 +08:00
-e "s,%libdir%,/usr/lib,g" \
-e "s,%prefix%,/usr,g" \
-e "s,%exec_prefix%,/usr/bin,g" \
-e "s,%includedir%,/usr/include/nss,g" \
2018-07-01 04:03:59 +08:00
-e "s,%NSPR_VERSION%,$_nsprver,g" \
-e "s,%NSS_VERSION%,$pkgver,g" |
2017-08-29 02:33:56 +08:00
install -Dm644 /dev/stdin "$pkgdir/usr/lib/pkgconfig/nss.pc"
2018-07-01 04:03:59 +08:00
2013-09-20 03:50:53 +08:00
ln -s nss.pc "$pkgdir/usr/lib/pkgconfig/mozilla-nss.pc"
2018-05-16 11:34:19 +08:00
sed nss/pkg/pkg-config/nss-config.in \
2013-09-20 03:50:53 +08:00
-e "s,@libdir@,/usr/lib,g" \
-e "s,@prefix@,/usr/bin,g" \
-e "s,@exec_prefix@,/usr/bin,g" \
-e "s,@includedir@,/usr/include/nss,g" \
2018-05-16 11:34:19 +08:00
-e "s,@MOD_MAJOR_VERSION@,$vmajor,g" \
-e "s,@MOD_MINOR_VERSION@,$vminor,g" \
-e "s,@MOD_PATCH_VERSION@,$vpatch,g" |
2017-08-29 02:33:56 +08:00
install -D /dev/stdin "$pkgdir/usr/bin/nss-config"
2013-09-20 03:50:53 +08:00
2017-08-29 02:33:56 +08:00
cd nss/doc/nroff
install -Dt "$pkgdir/usr/share/man/man1" -m644 *util.1 signtool.1 signver.1 ssltap.1
2013-09-20 03:50:53 +08:00
2017-08-29 02:33:56 +08:00
cd ../../../dist
install -Dt "$pkgdir/usr/include/nss" -m644 public/nss/*.h
cd Release/bin
install -Dt "$pkgdir/usr/bin" *util shlibsign signtool signver ssltap
2013-09-20 03:50:53 +08:00
2017-08-29 02:33:56 +08:00
cd ../lib
install -Dt "$pkgdir/usr/lib" *.so
install -Dt "$pkgdir/usr/lib" -m644 *.chk
2014-09-25 12:34:51 +08:00
2018-05-16 11:34:19 +08:00
# Replace built-in trust with p11-kit connection
2017-08-29 02:33:56 +08:00
ln -sf libnssckbi-p11-kit.so "$pkgdir/usr/lib/libnssckbi.so"
}
2011-12-20 23:51:39 +08:00
2014-09-25 12:34:51 +08:00
package_ca-certificates-mozilla() {
pkgdesc="Mozilla's set of trusted CA certificates"
2017-08-29 02:33:56 +08:00
depends=(ca-certificates-utils)
2014-09-25 12:34:51 +08:00
2017-08-29 02:33:56 +08:00
install -Dm644 ca-bundle.trust.p11-kit \
"$pkgdir/usr/share/ca-certificates/trust-source/mozilla.trust.p11-kit"
2014-09-25 12:34:51 +08:00
}