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