wok-current rev 5107

Added nss
author Liu Peng <rocky@slitaz.org>
date Thu Mar 18 02:19:04 2010 +0000 (2010-03-18)
parents 83044428b484
children 4447397fd144
files nss-dev/receipt nss/receipt nss/stuff/nss-config.in nss/stuff/nss.pc.in
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/nss-dev/receipt	Thu Mar 18 02:19:04 2010 +0000
     1.3 @@ -0,0 +1,18 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="nss-dev"
     1.7 +VERSION="3.12.4"
     1.8 +CATEGORY="development"
     1.9 +SHORT_DESC="nspr devel library."
    1.10 +MAINTAINER="rocky@slitaz.org"
    1.11 +WANTED="nss"
    1.12 +WEB_SITE="http://www.mozilla.org/projects/security/pki/nss/"
    1.13 +
    1.14 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.15 +genpkg_rules()
    1.16 +{
    1.17 +    mkdir -p $fs/usr/bin
    1.18 +    cp $_pkg/usr/bin/nss-config $fs/usr/bin
    1.19 +    cp -a $_pkg/usr/lib $fs/usr
    1.20 +    cp -a $_pkg/usr/include $fs/usr
    1.21 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/nss/receipt	Thu Mar 18 02:19:04 2010 +0000
     2.3 @@ -0,0 +1,73 @@
     2.4 +# SliTaz package receipt.
     2.5 +
     2.6 +PACKAGE="nss"
     2.7 +VERSION="3.12.4"
     2.8 +CATEGORY="utilities"
     2.9 +SHORT_DESC="Mozilla Network Security Services (NSS)."
    2.10 +MAINTAINER="rocky@slitaz.org"
    2.11 +DEPENDS="libfirefox"
    2.12 +BUILD_DEPENDS="firefox-dev sqlite-dev zlib-dev perl"
    2.13 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    2.14 +WEB_SITE="http://www.mozilla.org/projects/security/pki/nss/"
    2.15 +WGET_URL="ftp://ftp.mozilla.org/pub/security/nss/releases/NSS_${VERSION//./_}_RTM/src/${TARBALL}"
    2.16 +
    2.17 +# Rules to configure and make the package.
    2.18 +compile_rules()
    2.19 +{
    2.20 +    cd $src
    2.21 +    export NSPR_INCLUDE_DIR=$(ls -d /usr/include/firefox-*/stable)
    2.22 +    export NSPR_LIB_DIR=$(ls -d /usr/lib/firefox-*/lib)
    2.23 +    export NSS_USE_SYSTEM_SQLITE=1
    2.24 +    export BUILD_OPT=1
    2.25 +
    2.26 +    make -j1 -C mozilla/security/nss build_coreconf build_dbm all
    2.27 +
    2.28 +    mkdir -p $PWD/_pkg/usr/bin
    2.29 +    mkdir -p $PWD/_pkg/usr/lib/pkgconfig
    2.30 +    mkdir -p $PWD/_pkg/usr/include/nss
    2.31 +
    2.32 +    NSS_VMAJOR=`grep "#define.*NSS_VMAJOR" mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'`
    2.33 +    NSS_VMINOR=`grep "#define.*NSS_VMINOR" mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'`
    2.34 +    NSS_VPATCH=`grep "#define.*NSS_VPATCH" mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'`
    2.35 +
    2.36 +    sed ../stuff/nss.pc.in -e "s,%libdir%,/usr/lib,g" \
    2.37 +                             -e "s,%prefix%,/usr,g" \
    2.38 +                             -e "s,%exec_prefix%,/usr/bin,g" \
    2.39 +                             -e "s,%includedir%,/usr/include/nss,g" \
    2.40 +                             -e "s,%NSPR_VERSION%,${VERSION},g" \
    2.41 +                             -e "s,%NSS_VERSION%,${VERSION},g" \
    2.42 +                    > $PWD/_pkg/usr/lib/pkgconfig/nss.pc || return 1
    2.43 +
    2.44 +    sed ../stuff/nss-config.in -e "s,@libdir@,/usr/lib,g" \
    2.45 +                                 -e "s,@prefix@,/usr/bin,g" \
    2.46 +                                 -e "s,@exec_prefix@,/usr/bin,g" \
    2.47 +                                 -e "s,@includedir@,/usr/include/nss,g" \
    2.48 +                                 -e "s,@MOD_MAJOR_VERSION@,${NSS_VMAJOR},g" \
    2.49 +                                 -e "s,@MOD_MINOR_VERSION@,${NSS_VMINOR},g" \
    2.50 +                                 -e "s,@MOD_PATCH_VERSION@,${NSS_VPATCH},g" \
    2.51 +                            > $PWD/_pkg/usr/bin/nss-config || return 1
    2.52 +    chmod 755 $PWD/_pkg/usr/bin/nss-config || return 1
    2.53 +
    2.54 +    for file in libsoftokn3.so libfreebl3.so libnss3.so libnssutil3.so \
    2.55 +              libssl3.so libsmime3.so libnssckbi.so libnssdbm3.so
    2.56 +    do
    2.57 +      cp mozilla/dist/*.OBJ/lib/${file} $PWD/_pkg/usr/lib/ || return 1
    2.58 +    done
    2.59 +    for file in libcrmf.a libnssb.a libnssckfw.a; do
    2.60 +      cp mozilla/dist/*.OBJ/lib/${file} $PWD/_pkg/usr/lib/ || return 1
    2.61 +    done
    2.62 +
    2.63 +    for file in certutil cmsutil crlutil modutil pk12util signtool signver ssltap; do
    2.64 +      cp mozilla/dist/*.OBJ/bin/${file} $PWD/_pkg/usr/bin/ || return 1
    2.65 +    done
    2.66 +
    2.67 +    cp mozilla/dist/public/nss/*.h $PWD/_pkg/usr/include/nss || return 1
    2.68 +}
    2.69 +
    2.70 +# Rules to gen a SliTaz package suitable for Tazpkg.
    2.71 +genpkg_rules()
    2.72 +{
    2.73 +    mkdir -p $fs/usr
    2.74 +    cp -a $_pkg/usr/bin $fs/usr
    2.75 +    rm $fs/usr/bin/nss-config
    2.76 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/nss/stuff/nss-config.in	Thu Mar 18 02:19:04 2010 +0000
     3.3 @@ -0,0 +1,145 @@
     3.4 +#!/bin/sh
     3.5 +
     3.6 +prefix=@prefix@
     3.7 +
     3.8 +major_version=@MOD_MAJOR_VERSION@
     3.9 +minor_version=@MOD_MINOR_VERSION@
    3.10 +patch_version=@MOD_PATCH_VERSION@
    3.11 +
    3.12 +usage()
    3.13 +{
    3.14 +	cat <<EOF
    3.15 +Usage: nss-config [OPTIONS] [LIBRARIES]
    3.16 +Options:
    3.17 +	[--prefix[=DIR]]
    3.18 +	[--exec-prefix[=DIR]]
    3.19 +	[--includedir[=DIR]]
    3.20 +	[--libdir[=DIR]]
    3.21 +	[--version]
    3.22 +	[--libs]
    3.23 +	[--cflags]
    3.24 +Dynamic Libraries:
    3.25 +	nss
    3.26 +	nssutil
    3.27 +	ssl
    3.28 +	smime
    3.29 +EOF
    3.30 +	exit $1
    3.31 +}
    3.32 +
    3.33 +if test $# -eq 0; then
    3.34 +	usage 1 1>&2
    3.35 +fi
    3.36 +
    3.37 +lib_ssl=yes
    3.38 +lib_smime=yes
    3.39 +lib_nss=yes
    3.40 +lib_nssutil=yes
    3.41 +
    3.42 +while test $# -gt 0; do
    3.43 +  case "$1" in
    3.44 +  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    3.45 +  *) optarg= ;;
    3.46 +  esac
    3.47 +
    3.48 +  case $1 in
    3.49 +    --prefix=*)
    3.50 +      prefix=$optarg
    3.51 +      ;;
    3.52 +    --prefix)
    3.53 +      echo_prefix=yes
    3.54 +      ;;
    3.55 +    --exec-prefix=*)
    3.56 +      exec_prefix=$optarg
    3.57 +      ;;
    3.58 +    --exec-prefix)
    3.59 +      echo_exec_prefix=yes
    3.60 +      ;;
    3.61 +    --includedir=*)
    3.62 +      includedir=$optarg
    3.63 +      ;;
    3.64 +    --includedir)
    3.65 +      echo_includedir=yes
    3.66 +      ;;
    3.67 +    --libdir=*)
    3.68 +      libdir=$optarg
    3.69 +      ;;
    3.70 +    --libdir)
    3.71 +      echo_libdir=yes
    3.72 +      ;;
    3.73 +    --version)
    3.74 +      echo ${major_version}.${minor_version}.${patch_version}
    3.75 +      ;;
    3.76 +    --cflags)
    3.77 +      echo_cflags=yes
    3.78 +      ;;
    3.79 +    --libs)
    3.80 +      echo_libs=yes
    3.81 +      ;;
    3.82 +    ssl)
    3.83 +      lib_ssl=yes
    3.84 +      ;;
    3.85 +    smime)
    3.86 +      lib_smime=yes
    3.87 +      ;;
    3.88 +    nss)
    3.89 +      lib_nss=yes
    3.90 +      ;;
    3.91 +    nssutil)
    3.92 +      lib_nssutil=yes
    3.93 +      ;;
    3.94 +    *)
    3.95 +      usage 1 1>&2
    3.96 +      ;;
    3.97 +  esac
    3.98 +  shift
    3.99 +done
   3.100 +
   3.101 +# Set variables that may be dependent upon other variables
   3.102 +if test -z "$exec_prefix"; then
   3.103 +    exec_prefix=`pkg-config --variable=exec_prefix nss`
   3.104 +fi
   3.105 +if test -z "$includedir"; then
   3.106 +    includedir=`pkg-config --variable=includedir nss`
   3.107 +fi
   3.108 +if test -z "$libdir"; then
   3.109 +    libdir=`pkg-config --variable=libdir nss`
   3.110 +fi
   3.111 +
   3.112 +if test "$echo_prefix" = "yes"; then
   3.113 +    echo $prefix
   3.114 +fi
   3.115 +
   3.116 +if test "$echo_exec_prefix" = "yes"; then
   3.117 +    echo $exec_prefix
   3.118 +fi
   3.119 +
   3.120 +if test "$echo_includedir" = "yes"; then
   3.121 +    echo $includedir
   3.122 +fi
   3.123 +
   3.124 +if test "$echo_libdir" = "yes"; then
   3.125 +    echo $libdir
   3.126 +fi
   3.127 +
   3.128 +if test "$echo_cflags" = "yes"; then
   3.129 +    echo -I$includedir
   3.130 +fi
   3.131 +
   3.132 +if test "$echo_libs" = "yes"; then
   3.133 +      libdirs="-Wl,-rpath-link,$libdir -L$libdir"
   3.134 +      if test -n "$lib_ssl"; then
   3.135 +	libdirs="$libdirs -lssl${major_version}"
   3.136 +      fi
   3.137 +      if test -n "$lib_smime"; then
   3.138 +	libdirs="$libdirs -lsmime${major_version}"
   3.139 +      fi
   3.140 +      if test -n "$lib_nss"; then
   3.141 +	libdirs="$libdirs -lnss${major_version}"
   3.142 +      fi
   3.143 +      if test -n "$lib_nssutil"; then
   3.144 +	libdirs="$libdirs -lnssutil${major_version}"
   3.145 +      fi
   3.146 +      echo $libdirs
   3.147 +fi      
   3.148 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/nss/stuff/nss.pc.in	Thu Mar 18 02:19:04 2010 +0000
     4.3 @@ -0,0 +1,11 @@
     4.4 +prefix=%prefix%
     4.5 +exec_prefix=%exec_prefix%
     4.6 +libdir=%libdir%
     4.7 +includedir=%includedir%
     4.8 +
     4.9 +Name: NSS
    4.10 +Description: Network Security Services
    4.11 +Version: %NSS_VERSION%
    4.12 +Requires: nspr >= %NSPR_VERSION%
    4.13 +Libs: -lssl3 -lsmime3 -lnss3 -lnssutil3
    4.14 +Cflags: -I${includedir}