nss.guncellendi

This commit is contained in:
milisarge 2017-05-16 05:29:58 +03:00
parent a09ab2e8c8
commit b033c5c2b2
3 changed files with 201 additions and 24 deletions

View File

@ -0,0 +1,142 @@
#!/bin/sh
prefix=/usr
version=@VERSION@
usage()
{
cat <<EOF
Usage: nss-config [OPTIONS] [LIBRARIES]
Options:
[--prefix[=DIR]]
[--exec-prefix[=DIR]]
[--includedir[=DIR]]
[--libdir[=DIR]]
[--version]
[--libs]
[--cflags]
Dynamic Libraries:
nss
nssutil
ssl
smime
EOF
exit $1
}
if test $# -eq 0; then
usage 1 1>&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

View File

@ -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%

View File

@ -5,31 +5,55 @@
name=nss name=nss
version=3.30.2 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 \ build() {
http://www.linuxfromscratch.org/patches/blfs/svn/nss-$version-standalone-1.patch) cd $name-$version/
build () { sed -i nss/coreconf/Linux.mk \
cd $name-$version -e 's|^CC.*=.*gcc$|#&|' \
patch -Np1 -i ../nss-$version-standalone-1.patch -e 's|^CCC.*=.*g++$|#&|'
cd nss
# Compilation export NSPR_INCLUDE_DIR=/usr/include/nspr
make -j1 nss_build_all BUILD_OPT=1 \ export NSPR_LIB_DIR=/usr/lib
NSPR_INCLUDE_DIR=/usr/include/nspr \ export NSS_USE_SYSTEM_SQLITE=1
USE_SYSTEM_ZLIB=1 \ export NSS_ENABLE_ECC=1
ZLIB_LIBS=-lz \ export NSS_ENABLE_TLS_1_3=1
$([ $(uname -m) = x86_64 ] && echo USE_64=1) \ export BUILD_OPT=1
$([ -f /usr/include/sqlite3.h ] && echo NSS_USE_SYSTEM_SQLITE=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
} }