core/nss/PKGBUILD
2014-06-11 23:31:23 +02:00

99 lines
2.9 KiB
Bash

# Maintainer: abveritas@chakra-project.org
# Contributor: Jan de Groot <jgc@archlinux.org>
pkgname=nss
pkgver=3.16.1
pkgrel=2
pkgdesc="Mozilla Network Security Services"
arch=('x86_64')
url="http://www.mozilla.org/projects/security/pki/nss/"
license=('MPL' 'GPL')
_nsprver=4.10.5
depends=("nspr>=${_nsprver}" 'sqlite3' 'zlib' 'sh')
makedepends=('perl')
options=('!strip' '!makeflags' 'staticlibs')
source=("ftp://ftp.mozilla.org/pub/security/nss/releases/NSS_${pkgver//./_}_RTM/src/${pkgname}-${pkgver}.tar.gz"
'nss.pc.in'
'nss-config.in'
'add_spi+cacert_ca_certs.patch'
'ssl-renegotiate-transitional.patch')
md5sums=('97ccaa5d27aa59faf07c8b968dbaea1d'
'c547b030c57fe1ed8b77c73bf52b3ded'
'46bee81908f1e5b26d6a7a2e14c64d9f'
'effe53b5de35e2efecef9f2c0893d54f'
'd83c7b61abb7e9f8f7bcd157183d1ade')
prepare() {
cd $pkgname-$pkgver
# Add CAcert and spi-inc.org CA certificates.
# See http://wiki.cacert.org/NSSLib for how to generate
patch -Np1 -i ../add_spi+cacert_ca_certs.patch
# Adds transitional SSL renegotiate support - patch from Debian
patch -Np3 -i ../ssl-renegotiate-transitional.patch
# Respect LDFLAGS
sed -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/' \
-i nss/coreconf/rules.mk
}
build() {
cd $pkgname-$pkgver/nss
export BUILD_OPT=1
export NSS_USE_SYSTEM_SQLITE=1
export NSS_ENABLE_ECC=1
export NSPR_INCLUDE_DIR="`nspr-config --includedir`"
export NSPR_LIB_DIR="`nspr-config --libdir`"
export XCFLAGS="${CFLAGS}"
export USE_64=1
make -C coreconf
make -C lib/dbm
make
}
package() {
cd $pkgname-$pkgver
install -d "$pkgdir"/usr/{bin,include/nss,lib/pkgconfig}
NSS_VMAJOR=$(grep '#define.*NSS_VMAJOR' nss/lib/nss/nss.h | awk '{print $3}')
NSS_VMINOR=$(grep '#define.*NSS_VMINOR' nss/lib/nss/nss.h | awk '{print $3}')
NSS_VPATCH=$(grep '#define.*NSS_VPATCH' nss/lib/nss/nss.h | awk '{print $3}')
sed ../nss.pc.in \
-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" \
-e "s,%NSPR_VERSION%,${_nsprver},g" \
-e "s,%NSS_VERSION%,${pkgver},g" \
> "$pkgdir/usr/lib/pkgconfig/nss.pc"
ln -s nss.pc "$pkgdir/usr/lib/pkgconfig/mozilla-nss.pc"
sed ../nss-config.in \
-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" \
-e "s,@MOD_MAJOR_VERSION@,${NSS_VMAJOR},g" \
-e "s,@MOD_MINOR_VERSION@,${NSS_VMINOR},g" \
-e "s,@MOD_PATCH_VERSION@,${NSS_VPATCH},g" \
> "$pkgdir/usr/bin/nss-config"
chmod 755 "$pkgdir/usr/bin/nss-config"
cd dist/*.OBJ/bin
install -t "$pkgdir/usr/bin" *util shlibsign signtool signver ssltap
cd ../lib
install -t "$pkgdir/usr/lib" *.so
install -t "$pkgdir/usr/lib" -m644 libcrmf.a *.chk
cd ../../public/nss
install -t "$pkgdir/usr/include/nss" -m644 *.h
}
# vim:set ts=2 sw=2 et: