You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

250 lines
6.6 KiB

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