nss-3.54-standalone-2.patch 7.0 KB

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