From b033c5c2b2d26eb30cd722b79452afd05179840f Mon Sep 17 00:00:00 2001 From: milisarge Date: Tue, 16 May 2017 05:29:58 +0300 Subject: [PATCH] nss.guncellendi --- talimatname/genel/nss/nss-config.in | 142 ++++++++++++++++++++++++++++ talimatname/genel/nss/nss.pc.in | 11 +++ talimatname/genel/nss/talimat | 72 +++++++++----- 3 files changed, 201 insertions(+), 24 deletions(-) create mode 100644 talimatname/genel/nss/nss-config.in create mode 100644 talimatname/genel/nss/nss.pc.in diff --git a/talimatname/genel/nss/nss-config.in b/talimatname/genel/nss/nss-config.in new file mode 100644 index 000000000..1a5aec4cb --- /dev/null +++ b/talimatname/genel/nss/nss-config.in @@ -0,0 +1,142 @@ +#!/bin/sh + +prefix=/usr +version=@VERSION@ + +usage() +{ + cat <&2 +fi + +lib_ssl=yes +lib_smime=yes +lib_nss=yes +lib_nssutil=yes + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + ;; + --prefix) + echo_prefix=yes + ;; + --exec-prefix=*) + exec_prefix=$optarg + ;; + --exec-prefix) + echo_exec_prefix=yes + ;; + --includedir=*) + includedir=$optarg + ;; + --includedir) + echo_includedir=yes + ;; + --libdir=*) + libdir=$optarg + ;; + --libdir) + echo_libdir=yes + ;; + --version) + echo $version + ;; + --cflags) + echo_cflags=yes + ;; + --libs) + echo_libs=yes + ;; + ssl) + lib_ssl=yes + ;; + smime) + lib_smime=yes + ;; + nss) + lib_nss=yes + ;; + nssutil) + lib_nssutil=yes + ;; + *) + usage 1 1>&2 + ;; + esac + shift +done + +# Set variables that may be dependent upon other variables +if test -z "$exec_prefix"; then + exec_prefix=${prefix} +fi +if test -z "$includedir"; then + includedir=${prefix}/include/nss +fi +if test -z "$libdir"; then + libdir=${exec_prefix}/lib +fi + +if test "$echo_prefix" = "yes"; then + echo $prefix +fi + +if test "$echo_exec_prefix" = "yes"; then + echo $exec_prefix +fi + +if test "$echo_includedir" = "yes"; then + echo $includedir +fi + +if test "$echo_libdir" = "yes"; then + echo $libdir +fi + +if test "$echo_cflags" = "yes"; then + echo -I$includedir +fi + +if test "$echo_libs" = "yes"; then + libdirs="-L$libdir" + if test -n "$lib_ssl"; then + libdirs="$libdirs -lssl3" + fi + if test -n "$lib_smime"; then + libdirs="$libdirs -lsmime3" + fi + if test -n "$lib_nss"; then + libdirs="$libdirs -lnss3" + fi + if test -n "$lib_nssutil"; then + libdirs="$libdirs -lnssutil3" + fi + echo $libdirs +fi + diff --git a/talimatname/genel/nss/nss.pc.in b/talimatname/genel/nss/nss.pc.in new file mode 100644 index 000000000..d57f80735 --- /dev/null +++ b/talimatname/genel/nss/nss.pc.in @@ -0,0 +1,11 @@ +prefix=%prefix% +exec_prefix=%exec_prefix% +libdir=%libdir% +includedir=%includedir% + +Name: NSS +Description: Network Security Services +Version: %NSS_VERSION% +Requires: nspr >= %NSPR_VERSION% +Libs: %FULL_NSS_LIBS% +Cflags: %FULL_NSS_CFLAGS% diff --git a/talimatname/genel/nss/talimat b/talimatname/genel/nss/talimat index 65d3cac41..ffb5bbde7 100644 --- a/talimatname/genel/nss/talimat +++ b/talimatname/genel/nss/talimat @@ -5,31 +5,55 @@ name=nss version=3.30.2 -release=1 +release=2 +source=(http://ftp.mozilla.org/pub/security/nss/releases/NSS_${version//./_}_RTM/src/$name-$version.tar.gz \ + nss-config.in nss.pc.in) -source=( http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_${version//./_}_RTM/src/nss-$version.tar.gz \ - http://www.linuxfromscratch.org/patches/blfs/svn/nss-$version-standalone-1.patch) +build() { + cd $name-$version/ -build () { - cd $name-$version - patch -Np1 -i ../nss-$version-standalone-1.patch - cd nss -# Compilation - make -j1 nss_build_all BUILD_OPT=1 \ - NSPR_INCLUDE_DIR=/usr/include/nspr \ - USE_SYSTEM_ZLIB=1 \ - ZLIB_LIBS=-lz \ - $([ $(uname -m) = x86_64 ] && echo USE_64=1) \ - $([ -f /usr/include/sqlite3.h ] && echo NSS_USE_SYSTEM_SQLITE=1) + sed -i nss/coreconf/Linux.mk \ + -e 's|^CC.*=.*gcc$|#&|' \ + -e 's|^CCC.*=.*g++$|#&|' + + export NSPR_INCLUDE_DIR=/usr/include/nspr + export NSPR_LIB_DIR=/usr/lib + export NSS_USE_SYSTEM_SQLITE=1 + export NSS_ENABLE_ECC=1 + export NSS_ENABLE_TLS_1_3=1 + export BUILD_OPT=1 + export XCFLAGS="-Wno-error ${CFLAGS}" + export NSS_DISABLE_GTESTS=1 + export USE_64=1 + + make -j1 -C nss + + install -d $PKG/usr/{bin,lib/pkgconfig,include/nss} + + cd dist/*.OBJ/bin + install -t "$PKG/usr/bin" *util shlibsign signtool signver ssltap + cd ../lib + install -t "$PKG/usr/lib" *.so + install -t "$PKG/usr/lib" -m644 libcrmf.a *.chk + cd ../../public/nss + install -t "$PKG/usr/include/nss" -m644 *.h + install -m 0755 $SRC/nss-config.in $PKG/usr/bin/nss-config + + _version=$(printf "%i.%i.%i" ${version//./ }) + sed -i "s/@VERSION@/$_version/" $PKG/usr/bin/nss-config + + NSS_LIBS=`$PKG/usr/bin/nss-config --libs` + NSS_CFLAGS=`$PKG/usr/bin/nss-config --cflags` + NSPR_VERSION=`pkg-config --modversion nspr` + sed $SRC/nss.pc.in \ + -e "s,%libdir%,/usr/lib," \ + -e "s,%prefix%,/usr," \ + -e "s,%exec_prefix%,/usr/bin," \ + -e "s,%includedir%,/usr/include/nss," \ + -e "s,%NSS_VERSION%,$version," \ + -e "s,%NSPR_VERSION%,$NSPR_VERSION," \ + -e "s,%FULL_NSS_LIBS%,$NSS_LIBS," \ + -e "s,%FULL_NSS_CFLAGS%,$NSS_CFLAGS," > \ + $PKG/usr/lib/pkgconfig/nss.pc -# Installation - mkdir -p $PKG/usr/{bin,lib{,/pkgconfig},include} - cd ../dist - install -v -m755 Linux*/lib/*.so $PKG/usr/lib - install -v -m644 Linux*/lib/{*.chk,libcrmf.a} $PKG/usr/lib - install -v -m755 -d $PKG/usr/include/nss - cp -v -RL {public,private}/nss/* $PKG/usr/include/nss - chmod 644 $PKG/usr/include/nss/* - install -v -m755 Linux*/bin/{certutil,nss-config,pk12util} $PKG/usr/bin - install -v -m644 Linux*/lib/pkgconfig/nss.pc $PKG/usr/lib/pkgconfig }