Ravenports generated: 19 Jan 2018 10:23
[ravenports.git] / bucket_95 / nss
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               nss
4 VERSION=                3.35
5 REVISION=               1
6 KEYWORDS=               security
7 VARIANTS=               standard
8 SDESC[standard]=        Application security development libraries
9 HOMEPAGE=               http://www.mozilla.org/projects/security/pki/nss/
10 CONTACT=                nobody
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            MOZILLA/security/nss/releases/NSS_3_35_RTM/src
14 DISTFILE[1]=            nss-3.35.tar.gz:main
15 DF_INDEX=               1
16 SPKGS[standard]=        complete
17                         primary
18                         caroot
19
20 OPTIONS_AVAILABLE=      ETCSYMLINK
21 OPTIONS_STANDARD=       ETCSYMLINK
22 OPT_ON[all]=            ETCSYMLINK
23
24 BUILD_DEPENDS=          libressl:single:static
25 BUILDRUN_DEPENDS=       nspr:single:standard
26
27 USES=                   cpe gmake perl:build sqlite zlib
28
29 DISTNAME=               nss-3.35/nss
30
31 LICENSE=                MPL:primary
32 LICENSE_SCHEME=         solo
33 LICENSE_FILE=           MPL:{{WRKSRC}}/COPYING
34
35 CPE_PRODUCT=            network_security_services
36 CPE_VENDOR=             mozilla
37 FPC_EQUIVALENT=         security/nss
38
39 MAKE_ENV=               LIBRARY_PATH="{{LOCALBASE}}/lib"
40                         SQLITE_INCLUDE_DIR="{{LOCALBASE}}/include"
41                         FREEBL_LOWHASH=1
42                         NSS_DISABLE_GTESTS=1
43                         NSS_DISABLE_DBM=1
44                         NSS_USE_SYSTEM_SQLITE=1
45                         USE_64=1
46                         BUILD_OPT=1
47 SINGLE_JOB=             yes
48
49 PLIST_SUB=              CERTDIR=share/certs
50 SUB_FILES=              nss-config
51                         nss.pc
52                         pkg-message-caroot
53                         MAca-bundle.pl
54 SUB_LIST=               VERSION_NSS=3.35
55
56 CFLAGS=                 -I{{LOCALBASE}}/include/nspr
57 LDFLAGS=                -Wl,-rpath,{{PREFIX}}/lib/nss
58 VAR_OPSYS[sunos]=       MAKE_ENV=NS_USE_GCC=1
59                         MAKE_ENV=NO_MDUPDATE=1
60                         MAKE_ENV=LINKER=gold
61                         CONFIGURE_ENV=LINKER=gold
62
63 [ETCSYMLINK].DESCRIPTION=               Add symlink to /etc/ssl/cert.pem
64
65 post-patch:
66         @${REINPLACE_CMD} '/NSS_DEFAULT_SYSTEM/s,/etc,${PREFIX}&,' \
67                 ${WRKSRC}/lib/sysinit/nsssysinit.c
68         @cd ${WRKSRC} && \
69                 ${FIND} . -name "*.c" -o -name "*.h" | \
70                 ${XARGS} ${GREP} -l -F '"nspr.h"' | \
71                 ${XARGS} ${REINPLACE_CMD} -e 's|"nspr.h"|<nspr.h>|'
72         ${FIND} ${WRKSRC}/tests -name '*.sh' | \
73                 ${XARGS} ${GREP} -l -F '/bin/bash' | \
74                 ${XARGS} ${REINPLACE_CMD} -e 's|#! */bin/bash|#!${SH}|'
75         ${REINPLACE_CMD} -e 's/@OS_RELEASE@/${OSREL}/' ${WRKSRC}/coreconf/arch.mk
76
77 post-build:
78         ${SETENV} ${MAKE_ENV} ${PERL} ${WRKDIR}/MAca-bundle.pl \
79                 < ${WRKSRC}/lib/ckfw/builtins/certdata.txt > ${WRKDIR}/ca-root-nss.crt
80
81 do-install:
82         @${MKDIR} ${STAGEDIR}${PREFIX}/include/nss/nss \
83                 ${STAGEDIR}${PREFIX}/lib/nss \
84                 ${STAGEDIR}${PREFIX}/share/certs \
85                 ${STAGEDIR}${PREFIX}/etc/ssl \
86                 ${STAGEDIR}${PREFIX}/openssl
87         ${FIND} ${WRKDIR}/nss-3.35/dist/public/nss -type l \
88                 -exec ${INSTALL_DATA} {} ${STAGEDIR}${PREFIX}/include/nss/nss \;
89         ${INSTALL_LIB} ${WRKDIR}/nss-3.35/dist/${OPSYS}*_OPT.OBJ/lib/*.so \
90                 ${STAGEDIR}${PREFIX}/lib/nss
91         ${INSTALL_DATA} ${WRKDIR}/nss-3.35/dist/${OPSYS}*_OPT.OBJ/lib/libcrmf.a \
92                 ${STAGEDIR}${PREFIX}/lib/nss
93 .for bin in certcgi certutil cmsutil crlutil derdump makepqg mangle modutil ocspclnt oidcalc p7content p7env p7sign p7verify pk12util rsaperf shlibsign signtool signver ssltap strsclnt symkeyutil vfychain vfyserv
94         ${INSTALL_PROGRAM} ${WRKDIR}/nss-3.35/dist/${OPSYS}*_OPT.OBJ/bin/${bin} \
95                 ${STAGEDIR}${PREFIX}/bin
96 .endfor
97         ${INSTALL_SCRIPT} ${WRKDIR}/nss-config ${STAGEDIR}${PREFIX}/bin
98         ${INSTALL_DATA} ${WRKDIR}/nss.pc ${STAGEDIR}${PREFIX}/lib/pkgconfig
99         # CA ROOT CERT
100         ${INSTALL_DATA} ${WRKDIR}/ca-root-nss.crt ${STAGEDIR}${PREFIX}/share/certs
101         ${INSTALL_DATA} ${WRKDIR}/ca-root-nss.crt \
102                 ${STAGEDIR}${PREFIX}/etc/ssl/cert.pem.sample
103         ${INSTALL_DATA} ${WRKDIR}/ca-root-nss.crt \
104                 ${STAGEDIR}${PREFIX}/openssl/cert.pem.sample
105
106 post-install-ETCSYMLINK-ON:
107         @${MKDIR} ${STAGEDIR}/etc/ssl
108         ${LN} -sf ../../share/certs/ca-root-nss.crt \
109                 ${STAGEDIR}/etc/ssl/cert.pem
110
111 [FILE:301:descriptions/desc.primary]
112 Network Security Services (NSS) is a set of libraries designed to support
113 cross-platform development of security-enabled server applications.
114 Applications built with NSS can support SSL v2 and v3, TLS, PKCS #5,
115 PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other
116 security standards.
117
118
119 [FILE:120:descriptions/desc.caroot]
120 Root certificates from certificate authorities included in the Mozilla
121 NSS library and thus in Firefox and Thunderbird.
122
123
124 [FILE:94:distinfo]
125 f4127de09bede39f5fd0f789d33c3504c5d261e69ea03022d46b319b3e32f6fa      9620041 nss-3.35.tar.gz
126
127
128 [FILE:1523:manifests/plist.primary]
129 bin/
130  certcgi
131  certutil
132  cmsutil
133  crlutil
134  derdump
135  makepqg
136  mangle
137  modutil
138  nss-config
139  ocspclnt
140  oidcalc
141  p7content
142  p7env
143  p7sign
144  p7verify
145  pk12util
146  rsaperf
147  shlibsign
148  signtool
149  signver
150  ssltap
151  strsclnt
152  symkeyutil
153  vfychain
154  vfyserv
155 include/nss/nss/
156  sslexp.h
157  base64.h
158  blapit.h
159  cert.h
160  certdb.h
161  certt.h
162  ciferfam.h
163  cmmf.h
164  cmmft.h
165  cms.h
166  cmsreclist.h
167  cmst.h
168  crmf.h
169  crmft.h
170  cryptohi.h
171  cryptoht.h
172  eccutil.h
173  ecl-exp.h
174  hasht.h
175  jar-ds.h
176  jar.h
177  jarfile.h
178  key.h
179  keyhi.h
180  keyt.h
181  keythi.h
182  lowkeyi.h
183  lowkeyti.h
184  nss.h
185  nssb64.h
186  nssb64t.h
187  nssbase.h
188  nssbaset.h
189  nssck.api
190  nssckbi.h
191  nssckepv.h
192  nssckft.h
193  nssckfw.h
194  nssckfwc.h
195  nssckfwt.h
196  nssckg.h
197  nssckmdt.h
198  nssckt.h
199  nssilckt.h
200  nssilock.h
201  nsslocks.h
202  nsslowhash.h
203  nssrwlk.h
204  nssrwlkt.h
205  nssutil.h
206  ocsp.h
207  ocspt.h
208  p12.h
209  p12plcy.h
210  p12t.h
211  pk11func.h
212  pk11pqg.h
213  pk11priv.h
214  pk11pub.h
215  pk11sdr.h
216  pkcs11.h
217  pkcs1sig.h
218  pkcs11f.h
219  pkcs11n.h
220  pkcs11p.h
221  pkcs11t.h
222  pkcs11u.h
223  pkcs11uri.h
224  pkcs12.h
225  pkcs12t.h
226  pkcs7t.h
227  portreg.h
228  preenc.h
229  secasn1.h
230  secasn1t.h
231  seccomon.h
232  secder.h
233  secdert.h
234  secdig.h
235  secdigt.h
236  secerr.h
237  sechash.h
238  secitem.h
239  secmime.h
240  secmod.h
241  secmodt.h
242  secoid.h
243  secoidt.h
244  secpkcs5.h
245  secpkcs7.h
246  secport.h
247  shsign.h
248  smime.h
249  ssl.h
250  sslerr.h
251  sslproto.h
252  sslt.h
253  utilmodt.h
254  utilpars.h
255  utilparst.h
256  utilrename.h
257 lib/nss/
258  libcrmf.a
259  libfreebl3.so
260  libfreeblpriv3.so
261  libnss3.so
262  libnssckbi.so
263 %%ONLY-LINUX%%lib/nss/libnsssysinit.so
264  libnssutil3.so
265  libsmime3.so
266  libsoftokn3.so
267  libssl3.so
268 lib/pkgconfig/nss.pc
269
270
271 [FILE:127:manifests/plist.caroot]
272 %%CERTDIR%%/ca-root-nss.crt
273 @sample etc/ssl/cert.pem.sample
274 @sample openssl/cert.pem.sample
275 %%ETCSYMLINK-ON%%/etc/ssl/cert.pem
276
277
278 [FILE:449:patches/patch-bug301986]
279 --- lib/util/nssilckt.h.orig    2018-01-18 14:19:59 UTC
280 +++ lib/util/nssilckt.h
281 @@ -163,7 +163,7 @@ typedef enum {
282  ** Declare the trace record
283  */
284  struct pzTrace_s {
285 -    PRUint32 threadID;       /* PR_GetThreadID() */
286 +    pthread_t threadID;      /* PR_GetThreadID() */
287      nssILockOp op;           /* operation being performed */
288      nssILockType ltype;      /* lock type identifier */
289      PRIntervalTime callTime; /* time spent in function */
290
291
292 [FILE:2109:patches/patch-const]
293 --- cmd/modutil/modutil.h.orig  2018-01-18 14:19:59 UTC
294 +++ cmd/modutil/modutil.h
295 @@ -22,8 +22,8 @@
296  #include "error.h"
297  
298  Error LoadMechanismList(void);
299 -Error FipsMode(char *arg);
300 -Error ChkFipsMode(char *arg);
301 +Error FipsMode(const char *arg);
302 +Error ChkFipsMode(const char *arg);
303  Error AddModule(char *moduleName, char *libFile, char *ciphers,
304                  char *mechanisms, char *modparms);
305  Error DeleteModule(char *moduleName);
306 --- cmd/modutil/pk11.c.orig     2018-01-18 14:19:59 UTC
307 +++ cmd/modutil/pk11.c
308 @@ -16,7 +16,7 @@
309   * disable FIPS mode on the internal module.
310   */
311  Error
312 -FipsMode(char *arg)
313 +FipsMode(const char *arg)
314  {
315      char *internal_name;
316  
317 @@ -25,16 +25,18 @@ FipsMode(char *arg)
318              internal_name = PR_smprintf("%s",
319                                          SECMOD_GetInternalModule()->commonName);
320              if (SECMOD_DeleteInternalModule(internal_name) != SECSuccess) {
321 -                PR_fprintf(PR_STDERR, "%s\n", SECU_Strerror(PORT_GetError()));
322 +                PR_fprintf(PR_STDERR, "FipsMode(true): %s (%s)\n", SECU_Strerror(PORT_GetError()), internal_name);
323                  PR_smprintf_free(internal_name);
324                  PR_fprintf(PR_STDERR, errStrings[FIPS_SWITCH_FAILED_ERR]);
325                  return FIPS_SWITCH_FAILED_ERR;
326              }
327 -            PR_smprintf_free(internal_name);
328              if (!PK11_IsFIPS()) {
329 +                PR_fprintf(PR_STDERR, "FipsMode(true): in module %s", internal_name);
330 +                PR_smprintf_free(internal_name);
331                  PR_fprintf(PR_STDERR, errStrings[FIPS_SWITCH_FAILED_ERR]);
332                  return FIPS_SWITCH_FAILED_ERR;
333              }
334 +            PR_smprintf_free(internal_name);
335              PR_fprintf(PR_STDOUT, msgStrings[FIPS_ENABLED_MSG]);
336          } else {
337              PR_fprintf(PR_STDERR, errStrings[FIPS_ALREADY_ON_ERR]);
338 @@ -75,7 +77,7 @@ FipsMode(char *arg)
339   * If arg=="false", verify FIPS mode is disabled on the internal module.
340   */
341  Error
342 -ChkFipsMode(char *arg)
343 +ChkFipsMode(const char *arg)
344  {
345      if (!PORT_Strcasecmp(arg, "true")) {
346          if (PK11_IsFIPS()) {
347
348
349 [FILE:1313:patches/patch-coreconf_DragonFly.mk]
350 --- /dev/null   2018-01-19 14:58:14 UTC
351 +++ coreconf/DragonFly.mk
352 @@ -0,0 +1,54 @@
353 +#
354 +# This Source Code Form is subject to the terms of the Mozilla Public
355 +# License, v. 2.0. If a copy of the MPL was not distributed with this
356 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
357 +
358 +include $(CORE_DEPTH)/coreconf/UNIX.mk
359 +
360 +DEFAULT_COMPILER       = gcc
361 +CC                     = gcc
362 +CCC                    = g++
363 +RANLIB                 = ranlib
364 +
365 +CPU_ARCH               = $(OS_TEST)
366 +ifeq ($(CPU_ARCH),i386)
367 +CPU_ARCH               = x86
368 +endif
369 +ifeq ($(CPU_ARCH),amd64)
370 +CPU_ARCH               = x86_64
371 +endif
372 +
373 +ifneq (,$(filter %64, $(OS_TEST)))
374 +USE_64                 = 1
375 +endif
376 +
377 +OS_CFLAGS              = $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
378 +
379 +DSO_CFLAGS             = -fPIC
380 +DSO_LDOPTS             = -shared -Wl,-soname -Wl,$(notdir $@)
381 +
382 +#
383 +# The default implementation strategy for FreeBSD is pthreads.
384 +#
385 +ifndef CLASSIC_NSPR
386 +USE_PTHREADS           = 1
387 +DEFINES                        += -D_THREAD_SAFE -D_REENTRANT
388 +OS_LIBS                        += -pthread
389 +DSO_LDOPTS             += -pthread
390 +endif
391 +
392 +ARCH                   = freebsd
393 +MOZ_OBJFORMAT          = elf
394 +DLL_SUFFIX             = so
395 +
396 +MKSHLIB                        = $(CC) $(DSO_LDOPTS)
397 +ifdef MAPFILE
398 +       MKSHLIB += -Wl,--version-script,$(MAPFILE)
399 +endif
400 +PROCESS_MAP_FILE = grep -v ';-' $< | \
401 +        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
402 +
403 +G++INCLUDES            = -I/usr/include/c++
404 +
405 +USE_SYSTEM_ZLIB                = 1
406 +ZLIB_LIBS              = -lz
407
408
409 [FILE:1125:patches/patch-coreconf_FreeBSD.mk]
410 --- coreconf/FreeBSD.mk.orig    2018-01-18 14:19:59 UTC
411 +++ coreconf/FreeBSD.mk
412 @@ -5,9 +5,9 @@
413  
414  include $(CORE_DEPTH)/coreconf/UNIX.mk
415  
416 -DEFAULT_COMPILER       = gcc
417 -CC                     = gcc
418 -CCC                    = g++
419 +DEFAULT_COMPILER       = $(CC)
420 +CC                     ?= gcc
421 +CCC                    = $(CXX)
422  RANLIB                 = ranlib
423  
424  CPU_ARCH               = $(OS_TEST)
425 @@ -20,6 +20,16 @@ endif
426  ifeq ($(CPU_ARCH),amd64)
427  CPU_ARCH               = x86_64
428  endif
429 +ifneq (,$(filter arm%, $(CPU_ARCH)))
430 +CPU_ARCH               = arm
431 +endif
432 +ifneq (,$(filter powerpc%, $(CPU_ARCH)))
433 +CPU_ARCH               = ppc
434 +endif
435 +
436 +ifneq (,$(filter %64, $(OS_TEST)))
437 +USE_64                 = 1
438 +endif
439  
440  OS_CFLAGS              = $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
441  
442 @@ -46,7 +56,11 @@ else
443  DLL_SUFFIX             = so.1.0
444  endif
445  
446 -MKSHLIB                        = $(CC) $(DSO_LDOPTS)
447 +ifneq (,$(filter alpha ia64,$(OS_TEST)))
448 +MKSHLIB                        = $(CC) -Wl,-Bsymbolic -lc $(DSO_LDOPTS)
449 +else
450 +MKSHLIB                        = $(CC) -Wl,-Bsymbolic $(DSO_LDOPTS)
451 +endif
452  ifdef MAPFILE
453         MKSHLIB += -Wl,--version-script,$(MAPFILE)
454  endif
455 @@ -55,4 +69,5 @@ PROCESS_MAP_FILE = grep -v ';-' $< | \
456  
457  G++INCLUDES            = -I/usr/include/g++
458  
459 -INCLUDES               += -I/usr/X11R6/include
460 +USE_SYSTEM_ZLIB                = 1
461 +ZLIB_LIBS              = -lz
462
463
464 [FILE:1995:patches/patch-coreconf_SunOS5.mk]
465 --- coreconf/SunOS5.mk.orig     2018-01-18 14:19:59 UTC
466 +++ coreconf/SunOS5.mk
467 @@ -14,14 +14,14 @@ ifeq ($(USE_64), 1)
468    ifdef NS_USE_GCC
469        ARCHFLAG=-m64
470    else
471 -      ifeq ($(OS_TEST),i86pc)
472 +      ifeq ($(OS_TEST),x86_64)
473          ARCHFLAG=-xarch=amd64
474        else
475          ARCHFLAG=-xarch=v9
476        endif
477    endif
478  else
479 -  ifneq ($(OS_TEST),i86pc)
480 +  ifneq ($(OS_TEST),x86_64)
481      ifdef NS_USE_GCC
482        ARCHFLAG=-mcpu=v9
483      else
484 @@ -33,9 +33,9 @@ endif
485  DEFAULT_COMPILER = cc
486  
487  ifdef NS_USE_GCC
488 -       CC         = gcc
489 +       CC         ?= gcc
490         OS_CFLAGS += -Wall -Wno-format -Werror-implicit-function-declaration -Wno-switch
491 -       CCC        = g++
492 +       CCC        ?= g++
493         CCC       += -Wall -Wno-format
494         ASFLAGS   += -x assembler-with-cpp
495         OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
496 @@ -67,7 +67,7 @@ RANLIB      = echo
497  CPU_ARCH    = sparc
498  OS_DEFINES += -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT
499  
500 -ifeq ($(OS_TEST),i86pc)
501 +ifeq ($(OS_TEST),x86_64)
502  ifeq ($(USE_64),1)
503      CPU_ARCH           = x86_64
504  else
505 @@ -109,15 +109,11 @@ endif
506         DSO_LDOPTS += -shared -h $(notdir $@)
507  else
508  ifeq ($(USE_64), 1)
509 -       ifeq ($(OS_TEST),i86pc)
510 -           DSO_LDOPTS +=-xarch=amd64
511 -       else
512 -           DSO_LDOPTS +=-xarch=v9
513 -       endif
514 +       DSO_LDOPTS += -m64
515  endif
516         DSO_LDOPTS += -G -h $(notdir $@)
517  endif
518 -DSO_LDOPTS += -z combreloc -z defs -z ignore
519 +# DSO_LDOPTS += -Wl,-z,origin
520  
521  # -KPIC generates position independent code for use in shared libraries.
522  # (Similarly for -fPIC in case of gcc.)
523 @@ -129,16 +125,4 @@ endif
524  
525  NOSUCHFILE   = /solaris-rm-f-sucks
526  
527 -ifeq ($(BUILD_SUN_PKG), 1)
528 -# The -R '$ORIGIN' linker option instructs this library to search for its
529 -# dependencies in the same directory where it resides.
530 -ifeq ($(USE_64), 1)
531 -RPATH = -R '$$ORIGIN:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
532 -else
533 -RPATH = -R '$$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps'
534 -endif
535 -else
536 -RPATH = -R '$$ORIGIN'
537 -endif
538 -
539 -OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc
540 +RPATH = $(LDFLAGS) #-Wl,-rpath,$(PREFIX)/lib/nss
541
542
543 [FILE:370:patches/patch-coreconf_UNIX.mk]
544 --- coreconf/UNIX.mk.orig       2018-01-18 14:19:59 UTC
545 +++ coreconf/UNIX.mk
546 @@ -10,10 +10,8 @@ AR          = ar cr $@
547  LDOPTS     += -L$(SOURCE_LIB_DIR)
548  
549  ifdef BUILD_OPT
550 -       OPTIMIZER  += -O
551         DEFINES    += -UDEBUG -DNDEBUG
552  else
553 -       OPTIMIZER  += -g
554         USERNAME   := $(shell whoami)
555         USERNAME   := $(subst -,_,$(USERNAME))
556         DEFINES    += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
557
558
559 [FILE:611:patches/patch-coreconf_arch.mk]
560 --- coreconf/arch.mk.orig       2018-01-18 14:19:59 UTC
561 +++ coreconf/arch.mk
562 @@ -26,7 +26,7 @@ OS_ARCH := $(subst /,_,$(shell uname -s)
563  # Attempt to differentiate between sparc and x86 Solaris
564  #
565  
566 -OS_TEST := $(shell uname -m)
567 +OS_TEST := $(shell uname -p)
568  ifeq ($(OS_TEST),i86pc)
569      OS_RELEASE := $(shell uname -r)_$(OS_TEST)
570  else
571 @@ -118,6 +118,10 @@ ifeq ($(OS_ARCH),Linux)
572      KERNEL = Linux
573  endif
574  
575 +ifeq ($(OS_ARCH),DragonFly)
576 +OS_RELEASE := @OS_RELEASE@
577 +endif
578 +
579  # Since all uses of OS_ARCH that follow affect only userland, we can
580  # merge other Glibc systems with Linux here.
581  ifeq ($(OS_ARCH),GNU)
582
583
584 [FILE:486:patches/patch-coreconf_command.mk]
585 --- coreconf/command.mk.orig    2018-01-18 14:19:59 UTC
586 +++ coreconf/command.mk
587 @@ -12,7 +12,7 @@ AS            = $(CC)
588  ASFLAGS      += $(CFLAGS)
589  CCF           = $(CC) $(CFLAGS)
590  LINK_DLL      = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS) $(XLDFLAGS)
591 -CFLAGS        = $(OPTIMIZER) $(OS_CFLAGS) $(WARNING_CFLAGS) $(XP_DEFINE) \
592 +CFLAGS       += $(OPTIMIZER) $(OS_CFLAGS) $(WARNING_CFLAGS) $(XP_DEFINE) \
593                  $(DEFINES) $(INCLUDES) $(XCFLAGS)
594  PERL          = perl
595  RANLIB        = echo
596
597
598 [FILE:465:patches/patch-coreconf_config.mk]
599 --- coreconf/config.mk.orig     2018-01-18 14:19:59 UTC
600 +++ coreconf/config.mk
601 @@ -31,7 +31,7 @@ endif
602  #######################################################################
603  
604  TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \
605 -              AIX RISCOS WINNT WIN95 Linux Android
606 +              AIX RISCOS WINNT WIN95 Linux Android DragonFly
607  
608  ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET)))
609  include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk
610
611
612 [FILE:248:patches/patch-coreconf_location.mk]
613 --- coreconf/location.mk.orig   2018-01-18 14:19:59 UTC
614 +++ coreconf/location.mk
615 @@ -40,7 +40,7 @@ ifdef NSPR_INCLUDE_DIR
616  endif
617  
618  ifndef NSPR_LIB_DIR
619 -    NSPR_LIB_DIR = $(DIST)/lib
620 +    NSPR_LIB_DIR = $(PREFIX)/lib
621  endif
622  
623  ifdef NSS_INCLUDE_DIR
624
625
626 [FILE:308:patches/patch-coreconf_ruleset.mk]
627 --- coreconf/ruleset.mk.orig    2018-01-18 14:19:59 UTC
628 +++ coreconf/ruleset.mk
629 @@ -53,7 +53,7 @@
630  #
631  
632  ifndef COMPILER_TAG
633 -    ifneq ($(DEFAULT_COMPILER), $(notdir $(firstword $(CC))))
634 +    ifneq ($(DEFAULT_COMPILER), $(CC))
635  #
636  # Temporary define for the Client; to be removed when binary release is used
637  #
638
639
640 [FILE:720:patches/patch-lib_freebl_Makefile]
641 --- lib/freebl/Makefile.orig    2018-01-18 14:19:59 UTC
642 +++ lib/freebl/Makefile
643 @@ -215,7 +215,7 @@ ifeq ($(CPU_ARCH),x86)
644  endif
645  endif # Darwin
646  
647 -ifeq ($(OS_TARGET),Linux)
648 +ifeq (,$(filter-out Linux DragonFly FreeBSD, $(OS_TARGET)))
649  ifeq ($(CPU_ARCH),x86_64)
650      ASFILES  = arcfour-amd64-gas.s mpi_amd64_gas.s
651      ASFLAGS += -fPIC -Wa,--noexecstack
652 @@ -298,7 +298,7 @@ endif
653  # to bind the blapi function references in FREEBLVector vector
654  # (ldvector.c) to the blapi functions defined in the freebl
655  # shared libraries.
656 -ifeq (,$(filter-out BSD_OS FreeBSD Linux NetBSD OpenBSD, $(OS_TARGET)))
657 +ifeq (,$(filter-out BSD_OS DragonFly FreeBSD Linux NetBSD OpenBSD, $(OS_TARGET)))
658      MKSHLIB += -Wl,-Bsymbolic
659  endif
660  
661
662
663 [FILE:1041:patches/patch-lib_freebl_mpi_mpcpucache.c]
664 --- lib/freebl/mpi/mpcpucache.c.orig    2018-01-18 14:19:59 UTC
665 +++ lib/freebl/mpi/mpcpucache.c
666 @@ -705,6 +705,32 @@ s_mpi_getProcessorLineSize()
667  #endif
668  
669  #if defined(__ppc64__)
670 +
671 +#if defined(__FreeBSD__)
672 +#include <sys/stddef.h>
673 +#include <sys/sysctl.h>
674 +
675 +#include <machine/cpu.h>
676 +#include <machine/md_var.h>
677 +
678 +unsigned long
679 +s_mpi_getProcessorLineSize()
680 +{
681 +       static int cacheline_size = 0;
682 +       static int cachemib[] = { CTL_MACHDEP, CPU_CACHELINE };
683 +       int clen;
684 +       
685 +       if (cacheline_size > 0)
686 +               return cacheline_size;
687 +
688 +       clen = sizeof(cacheline_size);
689 +       if (sysctl(cachemib, sizeof(cachemib) / sizeof(cachemib[0]),
690 +           &cacheline_size, &clen, NULL, 0) < 0 || !cacheline_size)
691 +               return 128; /* guess */
692 +
693 +       return cacheline_size;
694 +}
695 +#else
696  /*
697   *  Sigh, The PPC has some really nice features to help us determine cache
698   *  size, since it had lots of direct control functions to do so. The POWER
699 @@ -758,6 +784,7 @@ s_mpi_getProcessorLineSize()
700      }
701      return 0;
702  }
703 +#endif
704  
705  #define MPI_GET_PROCESSOR_LINE_SIZE_DEFINED 1
706  #endif
707
708
709 [FILE:474:patches/patch-lib_freebl_verified_kremlib.h]
710 --- lib/freebl/verified/kremlib.h.orig  2018-01-18 14:19:59 UTC
711 +++ lib/freebl/verified/kremlib.h
712 @@ -184,7 +184,10 @@ typedef const char *Prims_string;
713  /* ... for Linux */
714  #if defined(__linux__) || defined(__CYGWIN__)
715  #include <endian.h>
716 -
717 +/* ... for BSDs */
718 +#elif defined(__DragonFly__) || defined(__FreeBSD__) \
719 +   || defined(__NetBSD__) || defined(__OpenBSD__)
720 +#include <sys/endian.h>
721  /* ... for OSX */
722  #elif defined(__APPLE__)
723  #include <libkern/OSByteOrder.h>
724
725
726 [FILE:1023:patches/patch-lib_softoken_pkcs11c.c]
727 --- lib/softoken/pkcs11c.c.orig 2018-01-18 14:19:59 UTC
728 +++ lib/softoken/pkcs11c.c
729 @@ -5727,9 +5727,6 @@ sftk_unwrapPrivateKey(SFTKObject *key, S
730              break;
731          case NSSLOWKEYDSAKey:
732              keyType = CKK_DSA;
733 -            crv = (sftk_hasAttribute(key, CKA_NETSCAPE_DB)) ? CKR_OK : CKR_KEY_TYPE_INCONSISTENT;
734 -            if (crv != CKR_OK)
735 -                break;
736              crv = sftk_AddAttributeType(key, CKA_KEY_TYPE, &keyType,
737                                          sizeof(keyType));
738              if (crv != CKR_OK)
739 @@ -5769,9 +5766,6 @@ sftk_unwrapPrivateKey(SFTKObject *key, S
740          /* what about fortezza??? */
741          case NSSLOWKEYECKey:
742              keyType = CKK_EC;
743 -            crv = (sftk_hasAttribute(key, CKA_NETSCAPE_DB)) ? CKR_OK : CKR_KEY_TYPE_INCONSISTENT;
744 -            if (crv != CKR_OK)
745 -                break;
746              crv = sftk_AddAttributeType(key, CKA_KEY_TYPE, &keyType,
747                                          sizeof(keyType));
748              if (crv != CKR_OK)
749
750
751 [FILE:3413:patches/patch-sysdb]
752 --- lib/softoken/legacydb/cdbhdl.h.orig 2018-01-18 14:19:59 UTC
753 +++ lib/softoken/legacydb/cdbhdl.h
754 @@ -9,7 +9,8 @@
755  #define _CDBHDL_H_
756  
757  #include "nspr.h"
758 -#include "mcom_db.h"
759 +#include <db.h>
760 +#include <fcntl.h>
761  #include "pcertt.h"
762  #include "prtypes.h"
763  
764 --- lib/softoken/legacydb/dbmshim.c.orig        2018-01-18 14:19:59 UTC
765 +++ lib/softoken/legacydb/dbmshim.c
766 @@ -5,7 +5,8 @@
767  /*
768   * Berkeley DB 1.85 Shim code to handle blobs.
769   */
770 -#include "mcom_db.h"
771 +#include <db.h>
772 +#include <fcntl.h>
773  #include "secitem.h"
774  #include "nssb64.h"
775  #include "blapi.h"
776 --- lib/softoken/legacydb/keydb.c.orig  2018-01-18 14:19:59 UTC
777 +++ lib/softoken/legacydb/keydb.c
778 @@ -9,7 +9,6 @@
779  #include "blapi.h"
780  #include "secitem.h"
781  #include "pcert.h"
782 -#include "mcom_db.h"
783  #include "secerr.h"
784  
785  #include "keydbi.h"
786 --- lib/softoken/legacydb/keydbi.h.orig 2018-01-18 14:19:59 UTC
787 +++ lib/softoken/legacydb/keydbi.h
788 @@ -10,7 +10,7 @@
789  
790  #include "nspr.h"
791  #include "seccomon.h"
792 -#include "mcom_db.h"
793 +#include <db.h>
794  
795  /*
796   * Handle structure for open key databases
797 --- lib/softoken/legacydb/pcertdb.c.orig        2018-01-18 14:19:59 UTC
798 +++ lib/softoken/legacydb/pcertdb.c
799 @@ -7,7 +7,8 @@
800   */
801  #include "lowkeyti.h"
802  #include "pcert.h"
803 -#include "mcom_db.h"
804 +#include <db.h>
805 +#include <fcntl.h>
806  #include "pcert.h"
807  #include "secitem.h"
808  #include "secder.h"
809 --- lib/softoken/legacydb/pk11db.c.orig 2018-01-18 14:19:59 UTC
810 +++ lib/softoken/legacydb/pk11db.c
811 @@ -8,7 +8,8 @@
812   */
813  
814  #include "lgdb.h"
815 -#include "mcom_db.h"
816 +#include <db.h>
817 +#include <fcntl.h>
818  #include "secerr.h"
819  #include "utilpars.h"
820  
821 --- lib/ckfw/dbm/ckdbm.h.orig   2018-01-18 14:19:59 UTC
822 +++ lib/ckfw/dbm/ckdbm.h
823 @@ -23,7 +23,7 @@
824  #include "ckt.h"
825  #endif /* CKT_H */
826  
827 -#include "mcom_db.h"
828 +#include <db.h>
829  
830  NSS_EXTERN_DATA NSSCKMDInstance nss_dbm_mdInstance;
831  
832 --- lib/softoken/legacydb/config.mk.orig        2018-01-18 14:19:59 UTC
833 +++ lib/softoken/legacydb/config.mk
834 @@ -8,7 +8,6 @@ CRYPTOLIB=$(DIST)/lib/$(LIB_PREFIX)freeb
835  
836  EXTRA_LIBS += \
837         $(CRYPTOLIB) \
838 -       $(DIST)/lib/$(LIB_PREFIX)dbm.$(LIB_SUFFIX) \
839         $(NULL)
840  
841  # can't do this in manifest.mn because OS_TARGET isn't defined there.
842 --- lib/certdb/xauthkid.c.orig  2018-01-18 14:19:59 UTC
843 +++ lib/certdb/xauthkid.c
844 @@ -7,7 +7,7 @@
845   *
846   */
847  
848 -#include "prtypes.h"
849 +#include <prtypes.h>
850  #include "seccomon.h"
851  #include "secdert.h"
852  #include "secoidt.h"
853 --- lib/certdb/xbsconst.c.orig  2018-01-18 14:19:59 UTC
854 +++ lib/certdb/xbsconst.c
855 @@ -6,7 +6,7 @@
856   * X.509 v3 Basic Constraints Extension
857   */
858  
859 -#include "prtypes.h"
860 +#include <prtypes.h>
861  #include <limits.h> /* for LONG_MAX */
862  #include "seccomon.h"
863  #include "secdert.h"
864 --- lib/certdb/xconst.c.orig    2018-01-18 14:19:59 UTC
865 +++ lib/certdb/xconst.c
866 @@ -6,7 +6,7 @@
867   * X.509 Extension Encoding
868   */
869  
870 -#include "prtypes.h"
871 +#include <prtypes.h>
872  #include "seccomon.h"
873  #include "secdert.h"
874  #include "secoidt.h"
875 --- lib/manifest.mn.orig        2018-01-18 14:19:59 UTC
876 +++ lib/manifest.mn
877 @@ -20,7 +20,7 @@ ifndef NSS_BUILD_UTIL_ONLY
878  SOFTOKEN_SRCDIRS = \
879         $(FREEBL_SRCDIR) \
880         $(SQLITE_SRCDIR) \
881 -       $(DBM_SRCDIR) \
882 +       $(NULL) \
883         $(SOFTOKEN_SRCDIR) \
884         $(NULL)
885  ifndef NSS_BUILD_SOFTOKEN_ONLY
886 --- cmd/platlibs.mk.orig        2018-01-18 14:19:59 UTC
887 +++ cmd/platlibs.mk
888 @@ -29,7 +29,7 @@ endif # BUILD_SUN_PKG
889  ifdef NSS_DISABLE_DBM
890  DBMLIB = $(NULL)
891  else
892 -DBMLIB = $(DIST)/lib/$(LIB_PREFIX)dbm.$(LIB_SUFFIX) 
893 +DBMLIB = $(NULL)
894  endif
895  
896  ifeq ($(NSS_BUILD_UTIL_ONLY),1)
897
898
899 [FILE:484:patches/patch-tests]
900 --- tests/common/init.sh.orig   2018-01-18 14:19:59 UTC
901 +++ tests/common/init.sh
902 @@ -366,7 +366,8 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOU
903              if [ -z "${DOMSUF}" ]; then
904                  DOMSUF=`echo $HOST | sed -e "s/^[^.]*\.//"`
905              fi
906 -            HOST=`echo $HOST | sed -e "s/\..*//"`
907 +           DOMSUF=${HOST#*.}   # remove Smallest Prefix matching ``*.''
908 +           HOST=${HOST%%.*}    # remove Largest Suffix ``.*''. See sh(1)
909              ;;
910          ?*)
911              ;;
912
913
914 [FILE:6041:files/MAca-bundle.pl.in]
915 ##
916 ##  MAca-bundle.pl -- Regenerate ca-root-nss.crt from the Mozilla certdata.txt
917 ##
918 ##  Rewritten in September 2011 by Matthias Andree to heed untrust
919 ##
920
921 ##  Copyright (c) 2011, 2013 Matthias Andree <mandree@FreeBSD.org>
922 ##  All rights reserved.
923 ##
924 ##  Redistribution and use in source and binary forms, with or without
925 ##  modification, are permitted provided that the following conditions are
926 ##  met:
927 ##
928 ##  * Redistributions of source code must retain the above copyright
929 ##  notice, this list of conditions and the following disclaimer.
930 ##
931 ##  * Redistributions in binary form must reproduce the above copyright
932 ##  notice, this list of conditions and the following disclaimer in the
933 ##  documentation and/or other materials provided with the distribution.
934 ##
935 ##  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
936 ##  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
937 ##  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
938 ##  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
939 ##  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
940 ##  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
941 ##  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
942 ##  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
943 ##  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
944 ##  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
945 ##  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
946 ##  POSSIBILITY OF SUCH DAMAGE.
947
948 use strict;
949 use Carp;
950 use MIME::Base64;
951
952 my $VERSION = '$FreeBSD: head/security/ca_root_nss/files/MAca-bundle.pl.in 325572 2013-08-29 08:10:09Z mandree $';
953
954 #   configuration
955 print <<EOH;
956 ##
957 ##  ca-root-nss.crt -- Bundle of CA Root Certificates
958 ##
959 ##  This is a bundle of X.509 certificates of public Certificate
960 ##  Authorities (CA). These were automatically extracted from Mozilla's
961 ##  root CA list (the file `certdata.txt').
962 ##
963 ##  Extracted from nss-%%VERSION_NSS%%
964 ##  with $VERSION
965 ##
966 EOH
967 my $debug = 0;
968 $debug++
969     if defined $ENV{'WITH_DEBUG'}
970         and $ENV{'WITH_DEBUG'} !~ m/(?i)^(no|0|false|)$/;
971
972 my %certs;
973 my %trusts;
974
975 sub printcert_plain($$)
976 {
977     my ($label, $certdata) = @_;
978     print "=== $label ===\n" if $label;
979     print
980         "-----BEGIN CERTIFICATE-----\n",
981         MIME::Base64::encode_base64($certdata),
982         "-----END CERTIFICATE-----\n\n";
983 }
984
985 sub printcert_info($$)
986 {
987     my (undef, $certdata) = @_;
988     return unless $certdata;
989     open(OUT, "|openssl x509 -text -inform DER -fingerprint")
990             || die "could not pipe to openssl x509";
991     print OUT $certdata;
992     close(OUT) or die "openssl x509 failed with exit code $?";
993 }
994
995 sub printcert($$) {
996     my ($a, $b) = @_;
997     printcert_info($a, $b);
998 }
999
1000 sub graboct()
1001 {
1002     my $data;
1003
1004     while (<>) {
1005         last if /^END/;
1006         my (undef,@oct) = split /\\/;
1007         my @bin = map(chr(oct), @oct);
1008         $data .= join('', @bin);
1009     }
1010
1011     return $data;
1012 }
1013
1014
1015 sub grabcert()
1016 {
1017     my $certdata;
1018     my $cka_label;
1019     my $serial;
1020
1021     while (<>) {
1022         chomp;
1023         last if ($_ eq '');
1024
1025         if (/^CKA_LABEL UTF8 "([^"]+)"/) {
1026             $cka_label = $1;
1027         }
1028
1029         if (/^CKA_VALUE MULTILINE_OCTAL/) {
1030             $certdata = graboct();
1031         }
1032
1033         if (/^CKA_SERIAL_NUMBER MULTILINE_OCTAL/) {
1034             $serial = graboct();
1035         }
1036     }
1037     return ($serial, $cka_label, $certdata);
1038 }
1039
1040 sub grabtrust() {
1041     my $cka_label;
1042     my $serial;
1043     my $maytrust = 0;
1044     my $distrust = 0;
1045
1046     while (<>) {
1047         chomp;
1048         last if ($_ eq '');
1049
1050         if (/^CKA_LABEL UTF8 "([^"]+)"/) {
1051             $cka_label = $1;
1052         }
1053
1054         if (/^CKA_SERIAL_NUMBER MULTILINE_OCTAL/) {
1055             $serial = graboct();
1056         }
1057
1058         if (/^CKA_TRUST_(SERVER_AUTH|EMAIL_PROTECTION|CODE_SIGNING) CK_TRUST (\S+)$/)
1059         {
1060             if ($2 eq      'CKT_NSS_NOT_TRUSTED') {
1061                 $distrust = 1;
1062             } elsif ($2 eq 'CKT_NSS_TRUSTED_DELEGATOR') {
1063                 $maytrust = 1;
1064             } elsif ($2 ne 'CKT_NSS_MUST_VERIFY_TRUST') {
1065                 confess "Unknown trust setting on line $.:\n"
1066                 . "$_\n"
1067                 . "Script must be updated:";
1068             }
1069         }
1070     }
1071
1072     if (!$maytrust && !$distrust && $debug) {
1073         print STDERR "line $.: no explicit trust/distrust found for $cka_label\n";
1074     }
1075
1076     my $trust = ($maytrust and not $distrust);
1077     return ($serial, $cka_label, $trust);
1078 }
1079
1080 while (<>) {
1081     if (/^CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE/) {
1082         my ($serial, $label, $certdata) = grabcert();
1083         if (defined $certs{$label."\0".$serial}) {
1084             warn "Certificate $label duplicated!\n";
1085         }
1086         $certs{$label."\0".$serial} = $certdata;
1087     } elsif (/^CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST/) {
1088         my ($serial, $label, $trust) = grabtrust();
1089         if (defined $trusts{$label."\0".$serial}) {
1090             warn "Trust for $label duplicated!\n";
1091         }
1092         $trusts{$label."\0".$serial} = $trust;
1093     } elsif (/^CVS_ID.*Revision: ([^ ]*).*/) {
1094         print "##  Source: \"certdata.txt\" CVS revision $1\n##\n\n";
1095     }
1096 }
1097
1098 sub printlabel(@) {
1099     my @res = @_;
1100     map { s/\0.*//; s/[^[:print:]]/_/g; $_ = "\"$_\""; } @res;
1101     return wantarray ? @res : $res[0];
1102 }
1103
1104 # weed out untrusted certificates
1105 my $untrusted = 0;
1106 foreach my $it (keys %trusts) {
1107     if (!$trusts{$it}) {
1108         if (!exists($certs{$it})) {
1109             warn "Found trust for nonexistent certificate ".printlabel($it)."\n" if $debug;
1110         } else {
1111             delete $certs{$it};
1112             warn "Skipping untrusted ".printlabel($it)."\n" if $debug;
1113             $untrusted++;
1114         }
1115     }
1116 }
1117
1118 print           "##  Untrusted certificates omitted from this bundle: $untrusted\n\n";
1119 print STDERR    "##  Untrusted certificates omitted from this bundle: $untrusted\n";
1120
1121 my $certcount = 0;
1122 foreach my $it (sort {uc($a) cmp uc($b)} keys %certs) {
1123     if (!exists($trusts{$it})) {
1124         die "Found certificate without trust block,\naborting";
1125     }
1126     printcert("", $certs{$it});
1127     print "\n\n\n";
1128     $certcount++;
1129     print STDERR "Trusting $certcount: ".printlabel($it)."\n" if $debug;
1130 }
1131
1132 if ($certcount < 25) {
1133     die "Certificate count of $certcount is implausibly low.\nAbort";
1134 }
1135
1136 print           "##  Number of certificates: $certcount\n";
1137 print STDERR    "##  Number of certificates: $certcount\n";
1138 print "##  End of file.\n";
1139
1140
1141 [FILE:2352:files/nss-config.in]
1142 #!/bin/sh
1143
1144 prefix=%%PREFIX%%
1145 version=%%VERSION_NSS%%
1146
1147 usage()
1148 {
1149         cat <<EOF
1150 Usage: nss-config [OPTIONS] [LIBRARIES]
1151 Options:
1152         [--prefix[=DIR]]
1153         [--exec-prefix[=DIR]]
1154         [--includedir[=DIR]]
1155         [--libdir[=DIR]]
1156         [--version]
1157         [--libs]
1158         [--cflags]
1159 Dynamic Libraries:
1160         nss
1161         nssutil
1162         ssl
1163         smime
1164 EOF
1165         exit $1
1166 }
1167
1168 if test $# -eq 0; then
1169         usage 1 1>&2
1170 fi
1171
1172 lib_ssl=yes
1173 lib_smime=yes
1174 lib_nss=yes
1175 lib_nssutil=yes
1176
1177 while test $# -gt 0; do
1178   case "$1" in
1179   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
1180   *) optarg= ;;
1181   esac
1182
1183   case $1 in
1184     --prefix=*)
1185       prefix=$optarg
1186       ;;
1187     --prefix)
1188       echo_prefix=yes
1189       ;;
1190     --exec-prefix=*)
1191       exec_prefix=$optarg
1192       ;;
1193     --exec-prefix)
1194       echo_exec_prefix=yes
1195       ;;
1196     --includedir=*)
1197       includedir=$optarg
1198       ;;
1199     --includedir)
1200       echo_includedir=yes
1201       ;;
1202     --libdir=*)
1203       libdir=$optarg
1204       ;;
1205     --libdir)
1206       echo_libdir=yes
1207       ;;
1208     --version)
1209       case $version in
1210       *.*.*) echo $version ;;
1211       *.*) echo $version.0 ;;
1212       *) echo $version.0.0 ;;
1213       esac
1214       ;;
1215     --cflags)
1216       echo_cflags=yes
1217       ;;
1218     --libs)
1219       echo_libs=yes
1220       ;;
1221     ssl)
1222       lib_ssl=yes
1223       ;;
1224     smime)
1225       lib_smime=yes
1226       ;;
1227     nss)
1228       lib_nss=yes
1229       ;;
1230     nssutil)
1231       lib_nssutil=yes
1232       ;;
1233     *)
1234       usage 1 1>&2
1235       ;;
1236   esac
1237   shift
1238 done
1239
1240 # Set variables that may be dependent upon other variables
1241 if test -z "$exec_prefix"; then
1242     exec_prefix=$prefix
1243 fi
1244 if test -z "$includedir"; then
1245     includedir=$prefix/include/nss
1246 fi
1247 if test -z "$libdir"; then
1248     libdir=$prefix/lib/nss
1249 fi
1250
1251 if test "$echo_prefix" = "yes"; then
1252     echo $prefix
1253 fi
1254
1255 if test "$echo_exec_prefix" = "yes"; then
1256     echo $exec_prefix
1257 fi
1258
1259 if test "$echo_includedir" = "yes"; then
1260     echo $includedir
1261 fi
1262
1263 if test "$echo_libdir" = "yes"; then
1264     echo $libdir
1265 fi
1266
1267 if test "$echo_cflags" = "yes"; then
1268     echo -I$includedir -I$includedir/nss
1269 fi
1270
1271 if test "$echo_libs" = "yes"; then
1272       libdirs="-Wl,-R${libdir} -L$libdir"
1273       if test -n "$lib_ssl"; then
1274         libdirs="$libdirs -lssl3"
1275       fi
1276       if test -n "$lib_smime"; then
1277         libdirs="$libdirs -lsmime3"
1278       fi
1279       if test -n "$lib_nss"; then
1280         libdirs="$libdirs -lnss3"
1281       fi
1282       if test -n "$lib_nssutil"; then
1283         libdirs="$libdirs -lnssutil3"
1284       fi
1285       echo $libdirs
1286 fi      
1287
1288
1289 [FILE:315:files/nss.pc.in]
1290 prefix=%%PREFIX%%
1291 exec_prefix=%%PREFIX%%
1292 libdir=%%PREFIX%%/lib/nss
1293 includedir=%%PREFIX%%/include
1294
1295 Name: NSS
1296 Description: Mozilla Network Security Services
1297 Version: %%VERSION_NSS%%
1298 Requires: nspr
1299 Libs: -Wl,-R${libdir} -L${libdir} -lnss3 -lsmime3 -lssl3 -lnssutil3
1300 Cflags: -I${includedir}/nss -I${includedir}/nss/nss
1301
1302
1303 [FILE:948:files/pkg-message-caroot.in]
1304 ********************************* WARNING *********************************
1305
1306 Ravenports do not, and can not warrant that the certification authorities
1307 whose certificates are included in this package have in any way been
1308 audited for trustworthiness or RFC 3647 compliance.
1309
1310 Assessment and verification of trust is the complete responsibility of the
1311 system administrator.
1312
1313 *********************************** NOTE **********************************
1314
1315 This package installs symlinks to support root certificates discovery by
1316 default for software that uses OpenSSL.
1317
1318 This enables SSL Certificate Verification by client software without manual
1319 intervention.
1320
1321 If you prefer to do this manually, replace the following symlinks with
1322 either an empty file or your site-local certificate bundle.
1323
1324   * /etc/ssl/cert.pem
1325   * %%PREFIX%%/etc/ssl/cert.pem
1326   * %%PREFIX%%/openssl/cert.pem
1327
1328 ***************************************************************************
1329