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.

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