summaryrefslogtreecommitdiff
path: root/nss/Pkgfile
blob: 98fd709ec7854429508138e0ffac796facc57be2 (plain)
    1 # Description: Mozilla Network Security Services (NSS)
    2 # URL: http://www.mozilla.org/projects/security/pki/nss/
    3 # Maintainer: Brett Goulder, predatorfreak at dcaf-security dot org
    4 # Packager: Simone Rota, sip at varlock dot com
    5 
    6 name=nss
    7 version=3.11.9
    8 nspr_version=4.7
    9 release=2
   10 source=(ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_11_9_RTM/src/nss-$version.tar.gz \
   11 	ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v$nspr_version/src/nspr-$nspr_version.tar.gz \
   12 	nspr.pc.in nss.pc.in nss-config.in)
   13 
   14 build() {
   15 	local file files NSPR_LIBS NSPR_CFLAGS NSPR_VERSION \
   16 	NSS_VMAJOR NSS_VMINOR NSS_VPATCH
   17 
   18 	export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
   19 	export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
   20 
   21 	cd nss-$version
   22 	mv $SRC/nspr-$nspr_version/mozilla/* mozilla/
   23 
   24 	./mozilla/nsprpub/configure \
   25 		--prefix=/usr \
   26 		--libdir=/usr/lib \
   27 		--includedir=/usr/include/nspr \
   28 		--enable-optimize="$CFLAGS" \
   29 		--disable-debug
   30 
   31 	make
   32 	export MINOR_VERSION=7
   33 	make DESTDIR=$PKG install
   34 
   35 	pushd $PKG/usr/lib
   36 	for file in *.so; do
   37 		mv $file "$file.$MINOR_VERSION"
   38 		ln -s "$file.$MINOR_VERSION" $file
   39 	done
   40 	popd
   41 
   42 	export NSPR_INCLUDE_DIR="$SRC/nss-$version/dist/include/nspr"
   43 	export NSPR_LIB_DIR="$SRC/nss-$version/dist/lib"
   44 
   45 	NSPR_LIBS=`./config/nspr-config --libs`
   46 	NSPR_CFLAGS=`./config/nspr-config --cflags`
   47 	NSPR_VERSION=`./config/nspr-config --version`
   48 
   49 	install -d $PKG/usr/lib/pkgconfig
   50 
   51 	sed $SRC/nspr.pc.in \
   52 		-e "s,@libdir@,/usr/lib," \
   53 		-e "s,@prefix@,/usr," \
   54 		-e "s,@exec_prefix@,/usr/bin," \
   55 		-e "s,@includedir@,/usr/include/nspr," \
   56 		-e "s,@NSPR_VERSION@,$NSPR_VERSION," \
   57 		-e "s,@FULL_NSPR_LIBS@,$NSPR_LIBS," \
   58 		-e "s,@FULL_NSPR_CFLAGS@,$NSPR_CFLAGS," > \
   59 		$PKG/usr/lib/pkgconfig/nspr.pc
   60 
   61 	pushd $PKG/usr/lib/pkgconfig
   62 	popd
   63 	install -D -m 0755 config/nspr-config $PKG/usr/bin/nspr-config
   64 
   65 	make -j 1 BUILD_OPT=1 XCFLAGS="$CFLAGS" -C mozilla/security/coreconf
   66 	make -j 1 BUILD_OPT=1 XCFLAGS="$CFLAGS" -C mozilla/security/dbm
   67 	make -j 1 BUILD_OPT=1 XCFLAGS="$CFLAGS" -C mozilla/security/nss
   68 
   69 	find $PKG/usr/lib/ -type f -exec chmod a-x {} \;
   70 	install -d $PKG/usr/include/nss
   71 	file='mozilla/security/nss/lib/nss/nss.h'
   72 	NSS_VMAJOR=`grep "#define.*NSS_VMAJOR" $file | awk '{print $3}'`
   73 	NSS_VMINOR=`grep "#define.*NSS_VMINOR" $file | awk '{print $3}'`
   74 	NSS_VPATCH=`grep "#define.*NSS_VPATCH" $file | awk '{print $3}'`
   75 
   76 	sed $SRC/nss.pc.in \
   77 		-e "s,@libdir@,/usr/lib,g" \
   78 		-e "s,@prefix@,/usr,g" \
   79 		-e "s,@exec_prefix@,/usr/bin,g" \
   80 		-e "s,@includedir@,/usr/include/nss,g" \
   81 		-e "s,@NSPR_VERSION@,$NSPR_VERSION,g" \
   82 		-e "s,@NSS_VERSION@,$version,g" > \
   83 		$PKG/usr/lib/pkgconfig/nss.pc
   84 
   85 	chmod 0644 $PKG/usr/lib/pkgconfig/*.pc
   86 
   87 	sed $SRC/nss-config.in \
   88 		-e "s,@libdir@,/usr/lib,g" \
   89 		-e "s,@prefix@,/usr/bin,g" \
   90 		-e "s,@exec_prefix@,/usr/bin,g" \
   91 		-e "s,@includedir@,/usr/include/nss,g" \
   92 		-e "s,@MOD_MAJOR_VERSION@,$NSS_VMAJOR,g" \
   93 		-e "s,@MOD_MINOR_VERSION@,$NSS_VMINOR,g" \
   94 		-e "s,@MOD_PATCH_VERSION@,$NSS_VPATCH,g" \
   95 		> $PKG/usr/bin/nss-config
   96 
   97 	chmod 0755 $PKG/usr/bin/nss-config
   98 
   99 	files="libnss3.so libssl3.so libsmime3.so libsoftokn3.so \
  100 		libsoftokn3.chk libnssckbi.so libfreebl3.so libfreebl3.chk \
  101 		libcrmf.a libnssb.a libnssckfw.a"
  102 	
  103 	for file in $files; do
  104 		install -m 0644 mozilla/dist/*.OBJ/lib/$file $PKG/usr/lib/
  105 	done
  106 
  107 	for file in certutil modutil pk12util signtool ssltap; do
  108 		install -m 0755 mozilla/dist/*.OBJ/bin/$file $PKG/usr/bin/
  109 	done
  110 
  111 	install -m 0644 mozilla/dist/public/nss/*.h $PKG/usr/include/nss/
  112 
  113 	rm \
  114 		$PKG/usr/bin/compile-et.pl \
  115 		$PKG/usr/bin/prerr.properties \
  116 		$PKG/usr/share/aclocal/nspr.m4
  117 
  118 	rm -r \
  119 		$PKG/usr/include/nspr/md \
  120 		$PKG/usr/share
  121 }

Generated by cgit