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