pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

nss-hg: add nss-config script.



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By:	wiz
Date:		Fri May 20 13:30:48 2016 +0200
Changeset:	7c0ec8af9ee3e9d2dffa55e91b94e9fe53921660

Modified Files:
	nss-hg/Makefile
	nss-hg/PLIST
Added Files:
	nss-hg/files/nss-config.in
	nss-hg/files/nss.pc.in

Log Message:
nss-hg: add nss-config script.

While here, create nss.pc file earlier, and do some cleanup.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=7c0ec8af9ee3e9d2dffa55e91b94e9fe53921660

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 nss-hg/Makefile            |  43 ++++++++------
 nss-hg/PLIST               |   1 +
 nss-hg/files/nss-config.in | 142 +++++++++++++++++++++++++++++++++++++++++++++
 nss-hg/files/nss.pc.in     |  11 ++++
 4 files changed, 180 insertions(+), 17 deletions(-)

diffs:
diff --git a/nss-hg/Makefile b/nss-hg/Makefile
index 60ccc80..4b6fa1f 100644
--- a/nss-hg/Makefile
+++ b/nss-hg/Makefile
@@ -1,9 +1,10 @@
 # $NetBSD: Makefile,v 1.3 2015/01/24 16:48:48 thomasklausner Exp $
 
-DISTNAME=		nss-${NSS_RELEASE:S/.0$//}
-NSS_RELEASE=		3.18beta5
+DISTNAME=		nss-${NSS_RELEASE}
+# see lib/nss/nss.h
+NSS_RELEASE=		3.25.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@localhost
 HOMEPAGE=		http://www.mozilla.org/projects/security/pki/nss/
@@ -67,12 +68,29 @@ MAKE_ENV+=	INCLUDES=-I${BUILDLINK_PREFIX.nspr}/include/nspr
 MAKE_ENV+=	NSS_USE_SYSTEM_SQLITE=1
 MAKE_ENV+=	EXTRA_SHARED_LIBS="-Wl,-R${BUILDLINK_PREFIX.nspr}/lib/nspr -Wl,-R,${PREFIX}/lib/nss -L${BUILDLINK_PREFIX.nspr}/lib/nspr -lplc4 -lplds4 -lnspr4"
 
+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=	${WRKDIR}/dist
+
 post-extract:
 	find ${WRKSRC} -type f | xargs ${CHMOD} 644
 	find ${WRKSRC} -type d | xargs ${CHMOD} 755
-
-INSTALLATION_DIRS=	include/nss lib/nss lib/pkgconfig
-DIST=	${WRKDIR}/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/ )
@@ -80,17 +98,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.10.3"; \
-	  ${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
 
 .include "../../databases/sqlite3/buildlink3.mk"
 .include "../../wip/nspr-hg/buildlink3.mk"
diff --git a/nss-hg/PLIST b/nss-hg/PLIST
index 0b33d9c..34144ff 100644
--- a/nss-hg/PLIST
+++ b/nss-hg/PLIST
@@ -1,4 +1,5 @@
 @comment $NetBSD: PLIST,v 1.4 2015/08/12 11:34:44 thomasklausner Exp $
+bin/nss-config
 include/nss/dbm/mcom_db.h
 include/nss/dbm/ncompat.h
 include/nss/dbm/winfile.h
diff --git a/nss-hg/files/nss-config.in b/nss-hg/files/nss-config.in
new file mode 100644
index 0000000..6b8c631
--- /dev/null
+++ b/nss-hg/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/nss-hg/files/nss.pc.in b/nss-hg/files/nss.pc.in
new file mode 100644
index 0000000..945dffb
--- /dev/null
+++ b/nss-hg/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@


Home | Main Index | Thread Index | Old Index