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