| 1 | Submitted By: Xi Ruoyao <xry111_AT_mengyan1223_DOT_wang> |
| 2 | Date: 2020-05-31 |
| 3 | Initial Package Version: 3.12.4 |
| 4 | Upstream Status: Not applicable |
| 5 | Origin: Self, rediffed for nss-3.53. |
| 6 | Description: Adds auto-generated nss.pc and nss-config script, and |
| 7 | allows building without nspr in the source tree. |
| 8 | For 3.40.1, Requires: updated to nspr >= 4.20. |
| 9 | For 3.46.1, Requires: updated to nspr >= 4.21. |
| 10 | For 3.48, Requires: updated to nspr >= 4.24. |
| 11 | For 3.51.1, Requires: updated to nspr >= 4.25. |
| 12 | For 3.54, Requires: updated to nspr >= 4.26. |
| 13 | |
| 14 | diff -Nuar nss-3.53.orig/nss/config/Makefile nss-3.53/nss/config/Makefile |
| 15 | --- nss-3.53.orig/nss/config/Makefile 1970-01-01 08:00:00.000000000 +0800 |
| 16 | +++ nss-3.53/nss/config/Makefile 2020-05-31 13:48:14.423566855 +0800 |
| 17 | @@ -0,0 +1,40 @@ |
| 18 | +CORE_DEPTH = .. |
| 19 | +DEPTH = .. |
| 20 | + |
| 21 | +include $(CORE_DEPTH)/coreconf/config.mk |
| 22 | + |
| 23 | +NSS_MAJOR_VERSION = `grep "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}'` |
| 24 | +NSS_MINOR_VERSION = `grep "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}'` |
| 25 | +NSS_PATCH_VERSION = `grep "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}'` |
| 26 | +PREFIX = /usr |
| 27 | + |
| 28 | +all: export libs |
| 29 | + |
| 30 | +export: |
| 31 | + # Create the nss.pc file |
| 32 | + mkdir -p $(DIST)/lib/pkgconfig |
| 33 | + sed -e "s,@prefix@,$(PREFIX)," \ |
| 34 | + -e "s,@exec_prefix@,\$${prefix}," \ |
| 35 | + -e "s,@libdir@,\$${prefix}/lib," \ |
| 36 | + -e "s,@includedir@,\$${prefix}/include/nss," \ |
| 37 | + -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \ |
| 38 | + -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \ |
| 39 | + -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \ |
| 40 | + nss.pc.in > nss.pc |
| 41 | + chmod 0644 nss.pc |
| 42 | + ln -sf ../../../../nss/config/nss.pc $(DIST)/lib/pkgconfig |
| 43 | + |
| 44 | + # Create the nss-config script |
| 45 | + mkdir -p $(DIST)/bin |
| 46 | + sed -e "s,@prefix@,$(PREFIX)," \ |
| 47 | + -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \ |
| 48 | + -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \ |
| 49 | + -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \ |
| 50 | + nss-config.in > nss-config |
| 51 | + chmod 0755 nss-config |
| 52 | + ln -sf ../../../nss/config/nss-config $(DIST)/bin |
| 53 | + |
| 54 | +libs: |
| 55 | + |
| 56 | +dummy: all export libs |
| 57 | + |
| 58 | diff -Nuar nss-3.53.orig/nss/config/nss-config.in nss-3.53/nss/config/nss-config.in |
| 59 | --- nss-3.53.orig/nss/config/nss-config.in 1970-01-01 08:00:00.000000000 +0800 |
| 60 | +++ nss-3.53/nss/config/nss-config.in 2020-05-31 13:48:14.424566860 +0800 |
| 61 | @@ -0,0 +1,153 @@ |
| 62 | +#!/bin/sh |
| 63 | + |
| 64 | +prefix=@prefix@ |
| 65 | + |
| 66 | +major_version=@NSS_MAJOR_VERSION@ |
| 67 | +minor_version=@NSS_MINOR_VERSION@ |
| 68 | +patch_version=@NSS_PATCH_VERSION@ |
| 69 | + |
| 70 | +usage() |
| 71 | +{ |
| 72 | + cat <<EOF |
| 73 | +Usage: nss-config [OPTIONS] [LIBRARIES] |
| 74 | +Options: |
| 75 | + [--prefix[=DIR]] |
| 76 | + [--exec-prefix[=DIR]] |
| 77 | + [--includedir[=DIR]] |
| 78 | + [--libdir[=DIR]] |
| 79 | + [--version] |
| 80 | + [--libs] |
| 81 | + [--cflags] |
| 82 | +Dynamic Libraries: |
| 83 | + nss |
| 84 | + nssutil |
| 85 | + smime |
| 86 | + ssl |
| 87 | + softokn |
| 88 | +EOF |
| 89 | + exit $1 |
| 90 | +} |
| 91 | + |
| 92 | +if test $# -eq 0; then |
| 93 | + usage 1 1>&2 |
| 94 | +fi |
| 95 | + |
| 96 | +lib_nss=yes |
| 97 | +lib_nssutil=yes |
| 98 | +lib_smime=yes |
| 99 | +lib_ssl=yes |
| 100 | +lib_softokn=yes |
| 101 | + |
| 102 | +while test $# -gt 0; do |
| 103 | + case "$1" in |
| 104 | + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
| 105 | + *) optarg= ;; |
| 106 | + esac |
| 107 | + |
| 108 | + case $1 in |
| 109 | + --prefix=*) |
| 110 | + prefix=$optarg |
| 111 | + ;; |
| 112 | + --prefix) |
| 113 | + echo_prefix=yes |
| 114 | + ;; |
| 115 | + --exec-prefix=*) |
| 116 | + exec_prefix=$optarg |
| 117 | + ;; |
| 118 | + --exec-prefix) |
| 119 | + echo_exec_prefix=yes |
| 120 | + ;; |
| 121 | + --includedir=*) |
| 122 | + includedir=$optarg |
| 123 | + ;; |
| 124 | + --includedir) |
| 125 | + echo_includedir=yes |
| 126 | + ;; |
| 127 | + --libdir=*) |
| 128 | + libdir=$optarg |
| 129 | + ;; |
| 130 | + --libdir) |
| 131 | + echo_libdir=yes |
| 132 | + ;; |
| 133 | + --version) |
| 134 | + echo ${major_version}.${minor_version}.${patch_version} |
| 135 | + ;; |
| 136 | + --cflags) |
| 137 | + echo_cflags=yes |
| 138 | + ;; |
| 139 | + --libs) |
| 140 | + echo_libs=yes |
| 141 | + ;; |
| 142 | + nss) |
| 143 | + lib_nss=yes |
| 144 | + ;; |
| 145 | + nssutil) |
| 146 | + lib_nssutil=yes |
| 147 | + ;; |
| 148 | + smime) |
| 149 | + lib_smime=yes |
| 150 | + ;; |
| 151 | + ssl) |
| 152 | + lib_ssl=yes |
| 153 | + ;; |
| 154 | + softokn) |
| 155 | + lib_softokn=yes |
| 156 | + ;; |
| 157 | + *) |
| 158 | + usage 1 1>&2 |
| 159 | + ;; |
| 160 | + esac |
| 161 | + shift |
| 162 | +done |
| 163 | + |
| 164 | +# Set variables that may be dependent upon other variables |
| 165 | +if test -z "$exec_prefix"; then |
| 166 | + exec_prefix=`pkg-config --variable=exec_prefix nss` |
| 167 | +fi |
| 168 | +if test -z "$includedir"; then |
| 169 | + includedir=`pkg-config --variable=includedir nss` |
| 170 | +fi |
| 171 | +if test -z "$libdir"; then |
| 172 | + libdir=`pkg-config --variable=libdir nss` |
| 173 | +fi |
| 174 | + |
| 175 | +if test "$echo_prefix" = "yes"; then |
| 176 | + echo $prefix |
| 177 | +fi |
| 178 | + |
| 179 | +if test "$echo_exec_prefix" = "yes"; then |
| 180 | + echo $exec_prefix |
| 181 | +fi |
| 182 | + |
| 183 | +if test "$echo_includedir" = "yes"; then |
| 184 | + echo $includedir |
| 185 | +fi |
| 186 | + |
| 187 | +if test "$echo_libdir" = "yes"; then |
| 188 | + echo $libdir |
| 189 | +fi |
| 190 | + |
| 191 | +if test "$echo_cflags" = "yes"; then |
| 192 | + echo -I$includedir |
| 193 | +fi |
| 194 | + |
| 195 | +if test "$echo_libs" = "yes"; then |
| 196 | + libdirs="-L$libdir" |
| 197 | + if test -n "$lib_nss"; then |
| 198 | + libdirs="$libdirs -lnss${major_version}" |
| 199 | + fi |
| 200 | + if test -n "$lib_nssutil"; then |
| 201 | + libdirs="$libdirs -lnssutil${major_version}" |
| 202 | + fi |
| 203 | + if test -n "$lib_smime"; then |
| 204 | + libdirs="$libdirs -lsmime${major_version}" |
| 205 | + fi |
| 206 | + if test -n "$lib_ssl"; then |
| 207 | + libdirs="$libdirs -lssl${major_version}" |
| 208 | + fi |
| 209 | + if test -n "$lib_softokn"; then |
| 210 | + libdirs="$libdirs -lsoftokn${major_version}" |
| 211 | + fi |
| 212 | + echo $libdirs |
| 213 | +fi |
| 214 | + |
| 215 | diff -Nuar nss-3.53.orig/nss/config/nss.pc.in nss-3.53/nss/config/nss.pc.in |
| 216 | --- nss-3.53.orig/nss/config/nss.pc.in 1970-01-01 08:00:00.000000000 +0800 |
| 217 | +++ nss-3.53/nss/config/nss.pc.in 2020-05-31 13:48:14.424566860 +0800 |
| 218 | @@ -0,0 +1,12 @@ |
| 219 | +prefix=@prefix@ |
| 220 | +exec_prefix=@exec_prefix@ |
| 221 | +libdir=@libdir@ |
| 222 | +includedir=@includedir@ |
| 223 | + |
| 224 | +Name: NSS |
| 225 | +Description: Network Security Services |
| 226 | +Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@ |
| 227 | +Requires: nspr >= 4.26 |
| 228 | +Libs: -L@libdir@ -lnss@NSS_MAJOR_VERSION@ -lnssutil@NSS_MAJOR_VERSION@ -lsmime@NSS_MAJOR_VERSION@ -lssl@NSS_MAJOR_VERSION@ -lsoftokn@NSS_MAJOR_VERSION@ |
| 229 | +Cflags: -I${includedir} |
| 230 | + |
| 231 | diff -Nuar nss-3.53.orig/nss/Makefile nss-3.53/nss/Makefile |
| 232 | --- nss-3.53.orig/nss/Makefile 2020-05-30 04:34:42.000000000 +0800 |
| 233 | +++ nss-3.53/nss/Makefile 2020-05-31 13:48:51.500733022 +0800 |
| 234 | @@ -4,6 +4,8 @@ |
| 235 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
| 236 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 237 | |
| 238 | +default: nss_build_all |
| 239 | + |
| 240 | ####################################################################### |
| 241 | # (1) Include initial platform-independent assignments (MANDATORY). # |
| 242 | ####################################################################### |
| 243 | @@ -48,12 +50,10 @@ |
| 244 | ####################################################################### |
| 245 | |
| 246 | nss_build_all: |
| 247 | - $(MAKE) build_nspr |
| 248 | $(MAKE) all |
| 249 | $(MAKE) latest |
| 250 | |
| 251 | nss_clean_all: |
| 252 | - $(MAKE) clobber_nspr |
| 253 | $(MAKE) clobber |
| 254 | |
| 255 | NSPR_CONFIG_STATUS = $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)/config.status |
| 256 | diff -Nuar nss-3.53.orig/nss/manifest.mn nss-3.53/nss/manifest.mn |
| 257 | --- nss-3.53.orig/nss/manifest.mn 2020-05-30 04:34:42.000000000 +0800 |
| 258 | +++ nss-3.53/nss/manifest.mn 2020-05-31 13:48:30.652640413 +0800 |
| 259 | @@ -10,7 +10,7 @@ |
| 260 | |
| 261 | RELEASE = nss |
| 262 | |
| 263 | -DIRS = coreconf lib cmd cpputil gtests |
| 264 | +DIRS = coreconf lib cmd cpputil gtests config |
| 265 | |
| 266 | lib: coreconf |
| 267 | cmd: lib |