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
5.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. --- a/nss/Makefile
  13. +++ b/nss/Makefile
  14. @@ -48,7 +48,6 @@ include $(CORE_DEPTH)/coreconf/rules.mk
  15. #######################################################################
  16. nss_build_all:
  17. - $(MAKE) build_nspr
  18. $(MAKE) all
  19. $(MAKE) latest
  20. --- /dev/null
  21. +++ b/nss/config/Makefile
  22. @@ -0,0 +1,40 @@
  23. +CORE_DEPTH = ..
  24. +DEPTH = ..
  25. +
  26. +include $(CORE_DEPTH)/coreconf/config.mk
  27. +
  28. +NSS_MAJOR_VERSION = `grep "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}'`
  29. +NSS_MINOR_VERSION = `grep "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}'`
  30. +NSS_PATCH_VERSION = `grep "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}'`
  31. +PREFIX = /usr
  32. +
  33. +all: export libs
  34. +
  35. +export:
  36. + # Create the nss.pc file
  37. + mkdir -p $(DIST)/lib/pkgconfig
  38. + sed -e "s,@prefix@,$(PREFIX)," \
  39. + -e "s,@exec_prefix@,\$${prefix}," \
  40. + -e "s,@libdir@,\$${prefix}/lib," \
  41. + -e "s,@includedir@,\$${prefix}/include/nss," \
  42. + -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \
  43. + -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
  44. + -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
  45. + nss.pc.in > nss.pc
  46. + chmod 0644 nss.pc
  47. + ln -sf ../../../../nss/config/nss.pc $(DIST)/lib/pkgconfig
  48. +
  49. + # Create the nss-config script
  50. + mkdir -p $(DIST)/bin
  51. + sed -e "s,@prefix@,$(PREFIX)," \
  52. + -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \
  53. + -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
  54. + -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
  55. + nss-config.in > nss-config
  56. + chmod 0755 nss-config
  57. + ln -sf ../../../nss/config/nss-config $(DIST)/bin
  58. +
  59. +libs:
  60. +
  61. +dummy: all export libs
  62. +
  63. --- /dev/null
  64. +++ b/nss/config/nss-config.in
  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. --- /dev/null
  220. +++ b/nss/config/nss.pc.in
  221. @@ -0,0 +1,12 @@
  222. +prefix=@prefix@
  223. +exec_prefix=@exec_prefix@
  224. +libdir=@libdir@
  225. +includedir=@includedir@
  226. +
  227. +Name: NSS
  228. +Description: Network Security Services
  229. +Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
  230. +Requires: nspr >= 4.25
  231. +Libs: -L@libdir@ -lnss@NSS_MAJOR_VERSION@ -lnssutil@NSS_MAJOR_VERSION@ -lsmime@NSS_MAJOR_VERSION@ -lssl@NSS_MAJOR_VERSION@ -lsoftokn@NSS_MAJOR_VERSION@
  232. +Cflags: -I${includedir}
  233. +
  234. --- a/nss/manifest.mn
  235. +++ b/nss/manifest.mn
  236. @@ -10,7 +10,7 @@ IMPORTS = nspr20/v4.8 \
  237. RELEASE = nss
  238. -DIRS = coreconf lib cmd cpputil gtests
  239. +DIRS = coreconf lib cmd cpputil config
  240. HAVE_ALL_TARGET := 1