# Maintainer: Natanael Copa pkgname=nss pkgver=3.14.1.1.93 _pkgver=3.14.1 _ver=${pkgver//./_} pkgrel=0 pkgdesc="Mozilla Network Security Services" url="http://www.mozilla.org/projects/security/pki/nss/" arch="all" license="MPL GPL" depends= makedepends="nspr-dev sqlite-dev zlib-dev perl" subpackages="$pkgname-dev $pkgname-tools" #source="ftp://ftp.mozilla.org/pub/security/$pkgname/releases/NSS_${_ver}_RTM/src/$pkgname-$pkgver.tar.gz source="ftp://ftp.mozilla.org/pub/security/nss/releases/NSS_3_14_1_WITH_CKBI_1_93_RTM/src/${pkgname}-3.14.1.with.ckbi.1.93.tar.gz nss.pc.in nss-config.in add_spi+cacert_ca_certs.patch ssl-renegotiate-transitional.patch " depends_dev="nspr-dev" _builddir="$srcdir"/$pkgname-$_pkgver prepare() { cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done # Respect LDFLAGS sed -i -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' \ mozilla/security/coreconf/rules.mk } build() { cd "$_builddir" unset CFLAGS unset CXXFLAGS export BUILD_OPT=1 export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 export FREEBL_NO_DEPEND=0 export NSPR_INCLUDE_DIR=`pkg-config --cflags-only-I nspr | sed 's/-I//'` export NSPR_LIB_DIR=`pkg-config --libs-only-L nspr | sed 's/-L.//'` export XCFLAGS="${CFLAGS}" if [ "$CARCH" = "x86_64" ]; then export USE_64=1 fi make -j 1 -C mozilla/security/coreconf || return 1 make -j 1 -C mozilla/security/dbm || return 1 make -j 1 -C mozilla/security/nss || return 1 } package() { replaces="nss-dev libnss" cd "$_builddir" install -m755 -d "$pkgdir"/usr/lib/pkgconfig install -m755 -d "$pkgdir"/usr/bin install -m755 -d "$pkgdir"/usr/include/nss NSS_VMAJOR=`awk '/#define.*NSS_VMAJOR/ {print $3}' mozilla/security/nss/lib/nss/nss.h ` msg "DEBUG: $NSS_VMAJOR" NSS_VMINOR=`awk '/#define.*NSS_VMINOR/ {print $3}' mozilla/security/nss/lib/nss/nss.h` NSS_VPATCH=`awk '/#define.*NSS_VPATCH"/ {print $3}' mozilla/security/nss/lib/nss/nss.h` # pkgconfig files sed "$srcdir"/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%,$_pkgver,g" \ -e "s,%NSS_VERSION%,$_pkgver,g" \ > "$pkgdir"/usr/lib/pkgconfig/nss.pc \ || return 1 ln -sf nss.pc "$pkgdir"/usr/lib/pkgconfig/mozilla-nss.pc || return 1 chmod 644 "$pkgdir"/usr/lib/pkgconfig/*.pc || return 1 # nss-config sed "$srcdir"/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 || return 1 chmod 755 "$pkgdir"/usr/bin/nss-config || return 1 local minor=${_pkgver#*.} minor=${minor%.*} for file in libsoftokn3.so libfreebl3.so libnss3.so libnssutil3.so \ libssl3.so libsmime3.so libnssckbi.so libnssdbm3.so; do install -m755 mozilla/dist/*.OBJ/lib/${file} \ "$pkgdir"/usr/lib/${file}.$minor || return 1 ln -s $file.$minor "$pkgdir"/usr/lib/$file done install -m644 mozilla/dist/*.OBJ/lib/libcrmf.a "$pkgdir"/usr/lib/ \ || return 1 install -m644 mozilla/dist/*.OBJ/lib/*.chk "$pkgdir"/usr/lib/ \ || return 1 for file in certutil cmsutil crlutil modutil pk12util shlibsign \ signtool signver ssltap; do install -m755 mozilla/dist/*.OBJ/bin/${file} "$pkgdir"/usr/bin/\ || return 1 done install -m644 mozilla/dist/public/nss/*.h "$pkgdir"/usr/include/nss/ \ || return 1 } dev() { local i= j= depends="$pkgname $depends_dev" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/nss-config "$subpkgdir"/usr/bin cd "$pkgdir" || return 0 for i in usr/include usr/lib/pkgconfig usr/lib/*.a; do if [ -e "$pkgdir/$i" ] || [ -L "$pkgdir/$i" ]; then d="$subpkgdir/${i%/*}" # dirname $i mkdir -p "$d" mv "$pkgdir/$i" "$d" rmdir "$pkgdir/${i%/*}" 2>/dev/null fi done return 0 } tools() { pkgdesc="Tools for the Network Security Services" replaces="nss" mkdir -p "$subpkgdir"/usr/ mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ } md5sums="f6f3a942d1eba3e26aa0382a5b5461d9 nss-3.14.1.tar.gz c547b030c57fe1ed8b77c73bf52b3ded nss.pc.in 46bee81908f1e5b26d6a7a2e14c64d9f nss-config.in 7f39c19b1dfd62d7db7d8bf19f156fed add_spi+cacert_ca_certs.patch d83c7b61abb7e9f8f7bcd157183d1ade ssl-renegotiate-transitional.patch"