1 Description: Create nss.pc and nss-config
2 Author: Lars Wendler <polynomial-c@gentoo.org>
3 Source: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/nss/files/nss-3.17.1-gentoo-fixups.patch
6 Change libdir from ${prefix}/lib64 to ${prefix}/lib/nss.
7 Remove optional patching in nss/Makefile.
8 Include -L$libdir in output from "nss-config --libs".
10 Later adapted to apply cleanly to nss-3.53.
12 --- nss-3.21/nss/config/Makefile
13 +++ nss-3.21/nss/config/Makefile
18 +include $(CORE_DEPTH)/coreconf/config.mk
20 +NSS_MAJOR_VERSION = `grep "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}'`
21 +NSS_MINOR_VERSION = `grep "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}'`
22 +NSS_PATCH_VERSION = `grep "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}'`
28 + # Create the nss.pc file
29 + mkdir -p $(DIST)/lib/pkgconfig
30 + sed -e "s,@prefix@,$(PREFIX)," \
31 + -e "s,@exec_prefix@,\$${prefix}," \
32 + -e "s,@libdir@,\$${prefix}/lib/nss," \
33 + -e "s,@includedir@,\$${prefix}/include/nss," \
34 + -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \
35 + -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
36 + -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
39 + cp nss.pc $(DIST)/lib/pkgconfig
41 + # Create the nss-config script
42 + mkdir -p $(DIST)/bin
43 + sed -e "s,@prefix@,$(PREFIX)," \
44 + -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \
45 + -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
46 + -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
47 + nss-config.in > nss-config
48 + chmod 0755 nss-config
49 + cp nss-config $(DIST)/bin
53 +dummy: all export libs
55 --- nss-3.21/nss/config/nss-config.in
56 +++ nss-3.21/nss/config/nss-config.in
62 +major_version=@NSS_MAJOR_VERSION@
63 +minor_version=@NSS_MINOR_VERSION@
64 +patch_version=@NSS_PATCH_VERSION@
69 +Usage: nss-config [OPTIONS] [LIBRARIES]
72 + [--exec-prefix[=DIR]]
73 + [--includedir[=DIR]]
87 +if test $# -eq 0; then
96 +while test $# -gt 0; do
98 + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
110 + exec_prefix=$optarg
113 + echo_exec_prefix=yes
119 + echo_includedir=yes
128 + echo ${major_version}.${minor_version}.${patch_version}
155 +# Set variables that may be dependent upon other variables
156 +if test -z "$exec_prefix"; then
157 + exec_prefix=`pkg-config --variable=exec_prefix nss`
159 +if test -z "$includedir"; then
160 + includedir=`pkg-config --variable=includedir nss`
162 +if test -z "$libdir"; then
163 + libdir=`pkg-config --variable=libdir nss`
166 +if test "$echo_prefix" = "yes"; then
170 +if test "$echo_exec_prefix" = "yes"; then
174 +if test "$echo_includedir" = "yes"; then
178 +if test "$echo_libdir" = "yes"; then
182 +if test "$echo_cflags" = "yes"; then
186 +if test "$echo_libs" = "yes"; then
188 + if test -n "$lib_ssl"; then
189 + libdirs="$libdirs -lssl${major_version}"
191 + if test -n "$lib_smime"; then
192 + libdirs="$libdirs -lsmime${major_version}"
194 + if test -n "$lib_nss"; then
195 + libdirs="$libdirs -lnss${major_version}"
197 + if test -n "$lib_nssutil"; then
198 + libdirs="$libdirs -lnssutil${major_version}"
203 --- nss-3.21/nss/config/nss.pc.in
204 +++ nss-3.21/nss/config/nss.pc.in
207 +exec_prefix=@exec_prefix@
209 +includedir=@includedir@
212 +Description: Network Security Services
213 +Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
214 +Requires: nspr >= 4.8
215 +Libs: -L${libdir} -lssl3 -lsmime3 -lnss3 -lnssutil3
216 +Cflags: -I${includedir}
218 --- nss-3.21/nss/manifest.mn
219 +++ nss-3.21/nss/manifest.mn
224 -DIRS = coreconf lib cmd cpputil gtests
225 +DIRS = coreconf lib cmd cpputil gtests config