summaryrefslogtreecommitdiff
path: root/devel/nss
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2016-05-20 11:53:18 +0000
committerwiz <wiz@pkgsrc.org>2016-05-20 11:53:18 +0000
commit75aded37163ba878c61f0ba2473f1138c019b6d1 (patch)
treef77c716b41de7144a9feea50b6b859e48a481f2e /devel/nss
parentdfd1c0b2a362a657fa2847f3eaf8f2c9f16be5be (diff)
downloadpkgsrc-75aded37163ba878c61f0ba2473f1138c019b6d1.tar.gz
Add nss-config script to match most Linux distributions.
Create nss.pc file earlier, not during installation. Bump PKGREVISION.
Diffstat (limited to 'devel/nss')
-rw-r--r--devel/nss/Makefile44
-rw-r--r--devel/nss/PLIST3
-rw-r--r--devel/nss/files/nss-config.in142
-rw-r--r--devel/nss/files/nss.pc.in11
4 files changed, 182 insertions, 18 deletions
diff --git a/devel/nss/Makefile b/devel/nss/Makefile
index 7fd9bf195dd..81a1ad6a00e 100644
--- a/devel/nss/Makefile
+++ b/devel/nss/Makefile
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.113 2016/04/17 19:27:10 ryoon Exp $
+# $NetBSD: Makefile,v 1.114 2016/05/20 11:53:18 wiz Exp $
DISTNAME= nss-${NSS_RELEASE:S/.0$//}
+PKGREVISION= 1
NSS_RELEASE= 3.23.0
CATEGORIES= security
-MASTER_SITES= ${MASTER_SITE_MOZILLA_ALL:=security/nss/releases/NSS_${NSS_RELEASE:S/.0$//:S/./_/g}_RTM/src/}
+MASTER_SITES= ${MASTER_SITE_MOZILLA_ALL:=security/nss/releases/NSS_${NSS_MAJOR_VERSION}_${NSS_MINOR_VERSION}_RTM/src/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.mozilla.org/projects/security/pki/nss/
@@ -19,6 +20,8 @@ USE_GCC_RUNTIME= yes
USE_TOOLS+= gmake perl pax pkg-config
MAKE_JOBS_SAFE= no
+BUILD_DIRS= nss
+
.include "../../mk/bsd.prefs.mk"
SUBST_CLASSES.Darwin+= exec_path
@@ -70,13 +73,29 @@ MAKE_ENV+= NSS_DISABLE_GTESTS=yes
CFLAGS+= -DNSS_NO_GCC48
.endif
+NSS_MAJOR_VERSION= ${NSS_RELEASE:C/\.[0-9.]*//}
+NSS_MINOR_VERSION= ${NSS_RELEASE:S/3.//:C/\.[0-9]*//}
+NSS_PATCH_VERSION= ${NSS_RELEASE:C/[0-9.]*\.//}
+
+SUBST_CLASSES+= config
+SUBST_SED.config+= -e "s,@PREFIX@,${PREFIX},g"
+SUBST_SED.config+= -e "s,@NSS_MAJOR_VERSION@,${NSS_MAJOR_VERSION},"
+SUBST_SED.config+= -e "s,@NSS_MINOR_VERSION@,${NSS_MINOR_VERSION},"
+SUBST_SED.config+= -e "s,@NSS_PATCH_VERSION@,${NSS_PATCH_VERSION},"
+SUBST_SED.config+= -e "s!@COMPILER_RPATH_FLAG@!${COMPILER_RPATH_FLAG}!"
+SUBST_SED.config+= -e "s,@PTHREAD@,${BUILDLINK_LIBS.pthread:Q},"
+SUBST_STAGE.config= pre-build
+SUBST_MESSAGE.config= Preparing *-config files.
+SUBST_FILES.config+= nss.pc nss-config
+
+INSTALLATION_DIRS= bin include/nss lib/nss lib/pkgconfig
+DIST= ${WRKSRC}/dist
+
post-extract:
find ${WRKSRC} -type f | xargs ${CHMOD} 644
find ${WRKSRC} -type d | xargs ${CHMOD} 755
-
-BUILD_DIRS= nss
-INSTALLATION_DIRS= include/nss lib/nss lib/pkgconfig
-DIST= ${WRKSRC}/dist
+ ${CP} ${FILESDIR}/nss.pc.in ${WRKSRC}/nss.pc
+ ${CP} ${FILESDIR}/nss-config.in ${WRKSRC}/nss-config
do-install:
(cd ${DIST}/public && pax -Lrw . ${DESTDIR}${PREFIX}/include/nss/ )
@@ -84,17 +103,8 @@ do-install:
pax -Lrw *.${SO_SUFFIX} ${DESTDIR}${PREFIX}/lib/nss/ )
${INSTALL_LIB} ${DIST}/*_OPT.OBJ/lib/libcrmf.a \
${DESTDIR}${PREFIX}/lib/nss/
- set -e; \
- { ${ECHO} "Name: NSS"; \
- ${ECHO} "Description: Mozilla Network Security Services"; \
- ${ECHO} "Version: ${NSS_RELEASE}"; \
- ${ECHO} "Requires: nspr >= 4.11.0"; \
- ${ECHO} "Cflags: -I${PREFIX}/include/nss/nss -I${PREFIX}/include/nss"; \
- ${ECHO} "Libs: -L${PREFIX}/lib/nss" \
- "${COMPILER_RPATH_FLAG}${PREFIX}/lib/nss" \
- "-lnss3 -lsmime3 -lssl3 -lsoftokn3 -lnssutil3" \
- ${BUILDLINK_LIBS.pthread:Q}; \
- } >${DESTDIR}${PREFIX}/lib/pkgconfig/nss.pc
+ ${INSTALL_DATA} ${WRKSRC}/nss.pc ${DESTDIR}${PREFIX}/lib/pkgconfig/nss.pc
+ ${INSTALL_SCRIPT} ${WRKSRC}/nss-config ${DESTDIR}${PREFIX}/bin/nss-config
# For consistency of libxul.so link in www/firefox.
BUILDLINK_API_DEPENDS.sqlite3+= sqlite3>=3.8.4.2
diff --git a/devel/nss/PLIST b/devel/nss/PLIST
index c25f272df23..5d6042a23b1 100644
--- a/devel/nss/PLIST
+++ b/devel/nss/PLIST
@@ -1,4 +1,5 @@
-@comment $NetBSD: PLIST,v 1.15 2015/08/20 10:54:24 ryoon Exp $
+@comment $NetBSD: PLIST,v 1.16 2016/05/20 11:53:18 wiz Exp $
+bin/nss-config
include/nss/dbm/mcom_db.h
include/nss/dbm/ncompat.h
include/nss/dbm/winfile.h
diff --git a/devel/nss/files/nss-config.in b/devel/nss/files/nss-config.in
new file mode 100644
index 00000000000..6b8c6312037
--- /dev/null
+++ b/devel/nss/files/nss-config.in
@@ -0,0 +1,142 @@
+#!/bin/sh
+
+prefix=@PREFIX@
+
+major_version=@NSS_MAJOR_VERSION@
+minor_version=@NSS_MINOR_VERSION@
+patch_version=@NSS_PATCH_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
+ ssl
+ smime
+ nssutil
+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 ${major_version}.${minor_version}.${patch_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=`pkg-config --variable=exec_prefix nss`
+ if test -z "$exec_prefix"; then
+ exec_prefix=`pkg-config --variable=prefix nss`/bin
+ fi
+fi
+if test -z "$includedir"; then
+ includedir=`pkg-config --variable=includedir nss`
+fi
+if test -z "$libdir"; then
+ libdir=`pkg-config --variable=libdir nss`
+fi
+
+if test -z "$cflags"; then
+ cflags=`pkg-config --cflags nss`
+fi
+
+if test -z "$libs"; then
+ libs=`pkg-config --libs nss`
+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 $cflags
+fi
+
+if test "$echo_libs" = "yes"; then
+ echo $libs
+fi
diff --git a/devel/nss/files/nss.pc.in b/devel/nss/files/nss.pc.in
new file mode 100644
index 00000000000..945dffb2462
--- /dev/null
+++ b/devel/nss/files/nss.pc.in
@@ -0,0 +1,11 @@
+prefix=@PREFIX@
+exec_prefix=@PREFIX@/bin
+libdir=@PREFIX@/lib/nss
+includedir=@PREFIX@/include/nss
+
+Name: NSS
+Description: Mozilla Network Security Services
+Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
+Requires: nspr >= 4.10.3
+Cflags: -I${includedir}
+Libs: @COMPILER_RPATH_FLAG@${libdir} -L${libdir} -lnss3 -lsmime3 -lssl3 -lsoftokn3 -lnssutil3 @PTHREAD@