Fri May 20 11:53:18 2016 UTC ()
Add nss-config script to match most Linux distributions.

Create nss.pc file earlier, not during installation.

Bump PKGREVISION.


(wiz)
diff -r1.113 -r1.114 pkgsrc/devel/nss/Makefile
diff -r1.15 -r1.16 pkgsrc/devel/nss/PLIST
diff -r0 -r1.1 pkgsrc/devel/nss/files/nss-config.in
diff -r0 -r1.1 pkgsrc/devel/nss/files/nss.pc.in

cvs diff -r1.113 -r1.114 pkgsrc/devel/nss/Makefile (expand / switch to context diff)
--- pkgsrc/devel/nss/Makefile 2016/04/17 19:27:10 1.113
+++ pkgsrc/devel/nss/Makefile 2016/05/20 11:53:18 1.114
@@ -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_TOOLS+=		gmake perl pax pkg-config
 MAKE_JOBS_SAFE=		no
 
+BUILD_DIRS=		nss
+
 .include "../../mk/bsd.prefs.mk"
 
 SUBST_CLASSES.Darwin+=		exec_path
@@ -70,31 +73,38 @@
 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
+	${CP} ${FILESDIR}/nss.pc.in ${WRKSRC}/nss.pc
+	${CP} ${FILESDIR}/nss-config.in ${WRKSRC}/nss-config
 
-BUILD_DIRS=		nss
-INSTALLATION_DIRS=	include/nss lib/nss lib/pkgconfig
-DIST=	${WRKSRC}/dist
-
 do-install:
 	(cd ${DIST}/public && pax -Lrw . ${DESTDIR}${PREFIX}/include/nss/ )
 	(cd ${DIST}/*_OPT.OBJ/lib && \
 		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

cvs diff -r1.15 -r1.16 pkgsrc/devel/nss/PLIST (expand / switch to context diff)
--- pkgsrc/devel/nss/PLIST 2015/08/20 10:54:24 1.15
+++ pkgsrc/devel/nss/PLIST 2016/05/20 11:53:18 1.16
@@ -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

File Added: pkgsrc/devel/nss/files/Attic/nss-config.in
#!/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

File Added: pkgsrc/devel/nss/files/Attic/nss.pc.in
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@