diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 14:36:22 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 15:32:53 +0200 |
commit | f4cf9fe05bb3f32fabea4e54dd92d368967a80da (patch) | |
tree | 487180fa9866985ea7b28e625651765d86f515c3 /meta/recipes-support/nss | |
download | poky-f4cf9fe05bb3f32fabea4e54dd92d368967a80da.tar.gz |
initial commit for Enea Linux 4.0
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-support/nss')
9 files changed, 564 insertions, 0 deletions
diff --git a/meta/recipes-support/nss/files/nss-3.15.1-fix-CVE-2013-1741.patch b/meta/recipes-support/nss/files/nss-3.15.1-fix-CVE-2013-1741.patch new file mode 100644 index 0000000000..21da0c03b5 --- /dev/null +++ b/meta/recipes-support/nss/files/nss-3.15.1-fix-CVE-2013-1741.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | Upstream-Status: backport | ||
2 | yanjun.zhu <yanjun.zhu@windriver.com> | ||
3 | --- a/nss/lib/util/secport.c | ||
4 | +++ b/nss/lib/util/secport.c | ||
5 | @@ -69,13 +69,22 @@ PORTCharConversionFunc ucs4Utf8ConvertFu | ||
6 | PORTCharConversionFunc ucs2Utf8ConvertFunc; | ||
7 | PORTCharConversionWSwapFunc ucs2AsciiConvertFunc; | ||
8 | |||
9 | +/* NSPR memory allocation functions (PR_Malloc, PR_Calloc, and PR_Realloc) | ||
10 | + * use the PRUint32 type for the size parameter. Before we pass a size_t or | ||
11 | + * unsigned long size to these functions, we need to ensure it is <= half of | ||
12 | + * the maximum PRUint32 value to avoid truncation and catch a negative size. | ||
13 | + */ | ||
14 | +#define MAX_SIZE (PR_UINT32_MAX >> 1) | ||
15 | + | ||
16 | void * | ||
17 | PORT_Alloc(size_t bytes) | ||
18 | { | ||
19 | - void *rv; | ||
20 | + void *rv = NULL; | ||
21 | |||
22 | - /* Always allocate a non-zero amount of bytes */ | ||
23 | - rv = (void *)PR_Malloc(bytes ? bytes : 1); | ||
24 | + if (bytes <= MAX_SIZE) { | ||
25 | + /* Always allocate a non-zero amount of bytes */ | ||
26 | + rv = PR_Malloc(bytes ? bytes : 1); | ||
27 | + } | ||
28 | if (!rv) { | ||
29 | ++port_allocFailures; | ||
30 | PORT_SetError(SEC_ERROR_NO_MEMORY); | ||
31 | @@ -86,9 +95,11 @@ PORT_Alloc(size_t bytes) | ||
32 | void * | ||
33 | PORT_Realloc(void *oldptr, size_t bytes) | ||
34 | { | ||
35 | - void *rv; | ||
36 | + void *rv = NULL; | ||
37 | |||
38 | - rv = (void *)PR_Realloc(oldptr, bytes); | ||
39 | + if (bytes <= MAX_SIZE) { | ||
40 | + rv = PR_Realloc(oldptr, bytes); | ||
41 | + } | ||
42 | if (!rv) { | ||
43 | ++port_allocFailures; | ||
44 | PORT_SetError(SEC_ERROR_NO_MEMORY); | ||
45 | @@ -99,10 +110,12 @@ PORT_Realloc(void *oldptr, size_t bytes) | ||
46 | void * | ||
47 | PORT_ZAlloc(size_t bytes) | ||
48 | { | ||
49 | - void *rv; | ||
50 | + void *rv = NULL; | ||
51 | |||
52 | - /* Always allocate a non-zero amount of bytes */ | ||
53 | - rv = (void *)PR_Calloc(1, bytes ? bytes : 1); | ||
54 | + if (bytes <= MAX_SIZE) { | ||
55 | + /* Always allocate a non-zero amount of bytes */ | ||
56 | + rv = PR_Calloc(1, bytes ? bytes : 1); | ||
57 | + } | ||
58 | if (!rv) { | ||
59 | ++port_allocFailures; | ||
60 | PORT_SetError(SEC_ERROR_NO_MEMORY); | ||
61 | @@ -209,6 +222,10 @@ PORT_NewArena(unsigned long chunksize) | ||
62 | { | ||
63 | PORTArenaPool *pool; | ||
64 | |||
65 | + if (chunksize > MAX_SIZE) { | ||
66 | + PORT_SetError(SEC_ERROR_NO_MEMORY); | ||
67 | + return NULL; | ||
68 | + } | ||
69 | pool = PORT_ZNew(PORTArenaPool); | ||
70 | if (!pool) { | ||
71 | return NULL; | ||
72 | @@ -224,8 +241,6 @@ PORT_NewArena(unsigned long chunksize) | ||
73 | return(&pool->arena); | ||
74 | } | ||
75 | |||
76 | -#define MAX_SIZE 0x7fffffffUL | ||
77 | - | ||
78 | void * | ||
79 | PORT_ArenaAlloc(PLArenaPool *arena, size_t size) | ||
80 | { | ||
81 | @@ -330,6 +345,11 @@ PORT_ArenaGrow(PLArenaPool *arena, void | ||
82 | PORTArenaPool *pool = (PORTArenaPool *)arena; | ||
83 | PORT_Assert(newsize >= oldsize); | ||
84 | |||
85 | + if (newsize > MAX_SIZE) { | ||
86 | + PORT_SetError(SEC_ERROR_NO_MEMORY); | ||
87 | + return NULL; | ||
88 | + } | ||
89 | + | ||
90 | if (ARENAPOOL_MAGIC == pool->magic ) { | ||
91 | PZ_Lock(pool->lock); | ||
92 | /* Do we do a THREADMARK check here? */ | ||
diff --git a/meta/recipes-support/nss/files/nss-3.15.1-fix-CVE-2013-5605.patch b/meta/recipes-support/nss/files/nss-3.15.1-fix-CVE-2013-5605.patch new file mode 100644 index 0000000000..7203d02c78 --- /dev/null +++ b/meta/recipes-support/nss/files/nss-3.15.1-fix-CVE-2013-5605.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | signed-off-by: Ryan Sleevi <ryan.sleevi@gmail.com> | ||
2 | Upstream-Status: Backport | ||
3 | reference:https://hg.mozilla.org/projects/nss/rev/e79a09364b5e | ||
4 | |||
5 | --- a/nss/lib/ssl/ssl3con.c | ||
6 | +++ b/nss/lib/ssl/ssl3con.c | ||
7 | @@ -781,6 +781,11 @@ static SECStatus | ||
8 | Null_Cipher(void *ctx, unsigned char *output, int *outputLen, int maxOutputLen, | ||
9 | const unsigned char *input, int inputLen) | ||
10 | { | ||
11 | + if (inputLen > maxOutputLen) { | ||
12 | + *outputLen = 0; /* Match PK11_CipherOp in setting outputLen */ | ||
13 | + PORT_SetError(SEC_ERROR_OUTPUT_LEN); | ||
14 | + return SECFailure; | ||
15 | + } | ||
16 | *outputLen = inputLen; | ||
17 | if (input != output) | ||
18 | PORT_Memcpy(output, input, inputLen); | ||
diff --git a/meta/recipes-support/nss/files/nss-fix-incorrect-shebang-of-perl.patch b/meta/recipes-support/nss/files/nss-fix-incorrect-shebang-of-perl.patch new file mode 100644 index 0000000000..547594d5b6 --- /dev/null +++ b/meta/recipes-support/nss/files/nss-fix-incorrect-shebang-of-perl.patch | |||
@@ -0,0 +1,110 @@ | |||
1 | nss: fix incorrect shebang of perl | ||
2 | |||
3 | Replace incorrect shebang of perl with `#!/usr/bin/env perl'. | ||
4 | |||
5 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
6 | Upstream-Status: Pending | ||
7 | --- | ||
8 | nss/cmd/smimetools/smime | 2 +- | ||
9 | nss/coreconf/cpdist.pl | 2 +- | ||
10 | nss/coreconf/import.pl | 2 +- | ||
11 | nss/coreconf/jniregen.pl | 2 +- | ||
12 | nss/coreconf/outofdate.pl | 2 +- | ||
13 | nss/coreconf/release.pl | 2 +- | ||
14 | nss/coreconf/version.pl | 2 +- | ||
15 | nss/tests/clean_tbx | 2 +- | ||
16 | nss/tests/path_uniq | 2 +- | ||
17 | 9 files changed, 9 insertions(+), 9 deletions(-) | ||
18 | |||
19 | diff --git a/nss/cmd/smimetools/smime b/nss/cmd/smimetools/smime | ||
20 | --- a/nss/cmd/smimetools/smime | ||
21 | +++ b/nss/cmd/smimetools/smime | ||
22 | @@ -1,4 +1,4 @@ | ||
23 | -#!/usr/local/bin/perl | ||
24 | +#!/usr/bin/env perl | ||
25 | |||
26 | # This Source Code Form is subject to the terms of the Mozilla Public | ||
27 | # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
28 | diff --git a/nss/coreconf/cpdist.pl b/nss/coreconf/cpdist.pl | ||
29 | index 800edfb..652187f 100755 | ||
30 | --- a/nss/coreconf/cpdist.pl | ||
31 | +++ b/nss/coreconf/cpdist.pl | ||
32 | @@ -1,4 +1,4 @@ | ||
33 | -#! /usr/local/bin/perl | ||
34 | +#!/usr/bin/env perl | ||
35 | # | ||
36 | # This Source Code Form is subject to the terms of the Mozilla Public | ||
37 | # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
38 | diff --git a/nss/coreconf/import.pl b/nss/coreconf/import.pl | ||
39 | index dd2d177..428eaa5 100755 | ||
40 | --- a/nss/coreconf/import.pl | ||
41 | +++ b/nss/coreconf/import.pl | ||
42 | @@ -1,4 +1,4 @@ | ||
43 | -#! /usr/local/bin/perl | ||
44 | +#!/usr/bin/env perl | ||
45 | # | ||
46 | # This Source Code Form is subject to the terms of the Mozilla Public | ||
47 | # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
48 | diff --git a/nss/coreconf/jniregen.pl b/nss/coreconf/jniregen.pl | ||
49 | index 2039180..5f4f69c 100755 | ||
50 | --- a/nss/coreconf/jniregen.pl | ||
51 | +++ b/nss/coreconf/jniregen.pl | ||
52 | @@ -1,4 +1,4 @@ | ||
53 | -#!/usr/local/bin/perl | ||
54 | +#!/usr/bin/env perl | ||
55 | # | ||
56 | # This Source Code Form is subject to the terms of the Mozilla Public | ||
57 | # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
58 | diff --git a/nss/coreconf/outofdate.pl b/nss/coreconf/outofdate.pl | ||
59 | index 33d80bb..01fc097 100755 | ||
60 | --- a/nss/coreconf/outofdate.pl | ||
61 | +++ b/nss/coreconf/outofdate.pl | ||
62 | @@ -1,4 +1,4 @@ | ||
63 | -#!/usr/local/bin/perl | ||
64 | +#!/usr/bin/env perl | ||
65 | # | ||
66 | # This Source Code Form is subject to the terms of the Mozilla Public | ||
67 | # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
68 | diff --git a/nss/coreconf/release.pl b/nss/coreconf/release.pl | ||
69 | index 7cde19d..b5df2f6 100755 | ||
70 | --- a/nss/coreconf/release.pl | ||
71 | +++ b/nss/coreconf/release.pl | ||
72 | @@ -1,4 +1,4 @@ | ||
73 | -#! /usr/local/bin/perl | ||
74 | +#!/usr/bin/env perl | ||
75 | # | ||
76 | # This Source Code Form is subject to the terms of the Mozilla Public | ||
77 | # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
78 | diff --git a/nss/coreconf/version.pl b/nss/coreconf/version.pl | ||
79 | index d2a4942..79359fe 100644 | ||
80 | --- a/nss/coreconf/version.pl | ||
81 | +++ b/nss/coreconf/version.pl | ||
82 | @@ -1,4 +1,4 @@ | ||
83 | -#!/usr/sbin/perl | ||
84 | +#!/usr/bin/env perl | ||
85 | # | ||
86 | # This Source Code Form is subject to the terms of the Mozilla Public | ||
87 | # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
88 | diff --git a/nss/tests/clean_tbx b/nss/tests/clean_tbx | ||
89 | index 4de9555..a7def9f 100755 | ||
90 | --- a/nss/tests/clean_tbx | ||
91 | +++ b/nss/tests/clean_tbx | ||
92 | @@ -1,4 +1,4 @@ | ||
93 | -#! /bin/perl | ||
94 | +#!/usr/bin/env perl | ||
95 | |||
96 | ####################################################################### | ||
97 | # | ||
98 | diff --git a/nss/tests/path_uniq b/nss/tests/path_uniq | ||
99 | index f29f60a..08fbffa 100755 | ||
100 | --- a/nss/tests/path_uniq | ||
101 | +++ b/nss/tests/path_uniq | ||
102 | @@ -1,4 +1,4 @@ | ||
103 | -#! /bin/perl | ||
104 | +#!/usr/bin/env perl | ||
105 | |||
106 | ######################################################################## | ||
107 | # | ||
108 | -- | ||
109 | 1.8.1.2 | ||
110 | |||
diff --git a/meta/recipes-support/nss/files/nss-fix-support-cross-compiling.patch b/meta/recipes-support/nss/files/nss-fix-support-cross-compiling.patch new file mode 100644 index 0000000000..f0b3550bff --- /dev/null +++ b/meta/recipes-support/nss/files/nss-fix-support-cross-compiling.patch | |||
@@ -0,0 +1,71 @@ | |||
1 | nss: fix support cross compiling | ||
2 | |||
3 | Let some make variables be assigned from outside makefile. | ||
4 | |||
5 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
6 | Upstream-Status: Inappropriate [configuration] | ||
7 | --- | ||
8 | nss/coreconf/Linux.mk | 12 +++++++++++- | ||
9 | nss/coreconf/arch.mk | 2 +- | ||
10 | nss/lib/freebl/Makefile | 6 ++++++ | ||
11 | 3 files changed, 18 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/nss/coreconf/Linux.mk b/nss/coreconf/Linux.mk | ||
14 | --- a/nss/coreconf/Linux.mk | ||
15 | +++ b/nss/coreconf/Linux.mk | ||
16 | @@ -16,11 +16,21 @@ ifeq ($(USE_PTHREADS),1) | ||
17 | IMPL_STRATEGY = _PTH | ||
18 | endif | ||
19 | |||
20 | +ifndef CC | ||
21 | CC = gcc | ||
22 | +endif | ||
23 | + | ||
24 | +ifdef CXX | ||
25 | +CCC = $(CXX) | ||
26 | +else | ||
27 | CCC = g++ | ||
28 | +endif | ||
29 | + | ||
30 | +ifndef RANLIB | ||
31 | RANLIB = ranlib | ||
32 | +endif | ||
33 | |||
34 | -DEFAULT_COMPILER = gcc | ||
35 | +DEFAULT_COMPILER = $(CC) | ||
36 | |||
37 | ifeq ($(OS_TARGET),Android) | ||
38 | ifndef ANDROID_NDK | ||
39 | diff --git a/nss/coreconf/arch.mk b/nss/coreconf/arch.mk | ||
40 | index 6557348..b722412 100644 | ||
41 | --- a/nss/coreconf/arch.mk | ||
42 | +++ b/nss/coreconf/arch.mk | ||
43 | @@ -37,7 +37,7 @@ OS_TEST := $(shell uname -m) | ||
44 | ifeq ($(OS_TEST),i86pc) | ||
45 | OS_RELEASE := $(shell uname -r)_$(OS_TEST) | ||
46 | else | ||
47 | - OS_RELEASE := $(shell uname -r) | ||
48 | + OS_RELEASE ?= $(shell uname -r) | ||
49 | endif | ||
50 | |||
51 | # | ||
52 | diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile | ||
53 | index 0d293f1..678f506 100644 | ||
54 | --- a/nss/lib/freebl/Makefile | ||
55 | +++ b/nss/lib/freebl/Makefile | ||
56 | @@ -36,6 +36,12 @@ ifdef USE_64 | ||
57 | DEFINES += -DNSS_USE_64 | ||
58 | endif | ||
59 | |||
60 | +ifeq ($(OS_TEST),mips) | ||
61 | +ifndef USE_64 | ||
62 | + DEFINES += -DNS_PTR_LE_32 | ||
63 | +endif | ||
64 | +endif | ||
65 | + | ||
66 | ifdef USE_ABI32_FPU | ||
67 | DEFINES += -DNSS_USE_ABI32_FPU | ||
68 | endif | ||
69 | -- | ||
70 | 1.8.1.2 | ||
71 | |||
diff --git a/meta/recipes-support/nss/files/nss-no-rpath-for-cross-compiling.patch b/meta/recipes-support/nss/files/nss-no-rpath-for-cross-compiling.patch new file mode 100644 index 0000000000..7661dc93a0 --- /dev/null +++ b/meta/recipes-support/nss/files/nss-no-rpath-for-cross-compiling.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | nss:no rpath for cross compiling | ||
2 | |||
3 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
4 | Upstream-Status: Inappropriate [configuration] | ||
5 | --- | ||
6 | nss/cmd/platlibs.mk | 4 ++-- | ||
7 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
8 | |||
9 | diff --git a/nss/cmd/platlibs.mk b/nss/cmd/platlibs.mk | ||
10 | --- a/nss/cmd/platlibs.mk | ||
11 | +++ b/nss/cmd/platlibs.mk | ||
12 | @@ -18,9 +18,9 @@ endif | ||
13 | |||
14 | ifeq ($(OS_ARCH), Linux) | ||
15 | ifeq ($(USE_64), 1) | ||
16 | -EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib' | ||
17 | +#EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib' | ||
18 | else | ||
19 | -EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib' | ||
20 | +#EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib' | ||
21 | endif | ||
22 | endif | ||
23 | |||
24 | -- | ||
25 | 1.8.1.2 | ||
26 | |||
diff --git a/meta/recipes-support/nss/files/nss.pc.in b/meta/recipes-support/nss/files/nss.pc.in new file mode 100644 index 0000000000..200f635c65 --- /dev/null +++ b/meta/recipes-support/nss/files/nss.pc.in | |||
@@ -0,0 +1,11 @@ | |||
1 | prefix=OEPREFIX | ||
2 | exec_prefix=OEEXECPREFIX | ||
3 | libdir=OELIBDIR | ||
4 | includedir=OEINCDIR | ||
5 | |||
6 | Name: NSS | ||
7 | Description: Network Security Services | ||
8 | Version: %NSS_VERSION% | ||
9 | Requires: nspr >= %NSPR_VERSION% | ||
10 | Libs: -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lnssutil3 | ||
11 | Cflags: -IOEINCDIR | ||
diff --git a/meta/recipes-support/nss/files/signlibs.sh b/meta/recipes-support/nss/files/signlibs.sh new file mode 100644 index 0000000000..1ec79f4576 --- /dev/null +++ b/meta/recipes-support/nss/files/signlibs.sh | |||
@@ -0,0 +1,20 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # signlibs.sh | ||
4 | # | ||
5 | # (c)2010 Wind River Systems, Inc. | ||
6 | # | ||
7 | # regenerates the .chk files for the NSS libraries that require it | ||
8 | # since the ones that are built have incorrect checksums that were | ||
9 | # calculated on the host where they really need to be done on the | ||
10 | # target | ||
11 | |||
12 | CHK_FILES=`find /lib* /usr/lib* -name "*.chk"` | ||
13 | SIGN_BINARY=`which shlibsign` | ||
14 | for I in $CHK_FILES | ||
15 | do | ||
16 | DN=`dirname $I` | ||
17 | BN=`basename $I .chk` | ||
18 | FN=$DN/$BN.so | ||
19 | $SIGN_BINARY -i $FN | ||
20 | done | ||
diff --git a/meta/recipes-support/nss/nss.inc b/meta/recipes-support/nss/nss.inc new file mode 100644 index 0000000000..404deccd8a --- /dev/null +++ b/meta/recipes-support/nss/nss.inc | |||
@@ -0,0 +1,207 @@ | |||
1 | SUMMARY = "Mozilla's SSL and TLS implementation" | ||
2 | DESCRIPTION = "Network Security Services (NSS) is a set of libraries \ | ||
3 | designed to support cross-platform development of \ | ||
4 | security-enabled client and server applications. \ | ||
5 | Applications built with NSS can support SSL v2 and v3, \ | ||
6 | TLS, PKCS 5, PKCS 7, PKCS 11, PKCS 12, S/MIME, X.509 \ | ||
7 | v3 certificates, and other security standards." | ||
8 | HOMEPAGE = "http://www.mozilla.org/projects/security/pki/nss/" | ||
9 | SECTION = "libs" | ||
10 | |||
11 | LICENSE = "MPL-1.1 GPL-2.0 LGPL-2.1" | ||
12 | |||
13 | LIC_FILES_CHKSUM = "file://nss/lib/freebl/mpi/doc/LICENSE;md5=491f158d09d948466afce85d6f1fe18f \ | ||
14 | file://nss/lib/freebl/mpi/doc/LICENSE-MPL;md5=6bf96825e3d7ce4de25621ae886cc859" | ||
15 | SRC_URI = "\ | ||
16 | file://nss-fix-support-cross-compiling.patch \ | ||
17 | file://nss-no-rpath-for-cross-compiling.patch \ | ||
18 | file://nss-fix-incorrect-shebang-of-perl.patch \ | ||
19 | file://nss-3.15.1-fix-CVE-2013-1741.patch \ | ||
20 | file://nss-3.15.1-fix-CVE-2013-5605.patch \ | ||
21 | " | ||
22 | SRC_URI_append_class-target = "\ | ||
23 | file://nss.pc.in \ | ||
24 | file://signlibs.sh \ | ||
25 | " | ||
26 | inherit siteinfo | ||
27 | PR = "r0" | ||
28 | DEPENDS = "sqlite3 nspr zlib nss-native" | ||
29 | DEPENDS_class-native = "sqlite3-native nspr-native zlib-native" | ||
30 | RDEPENDS_${PN} = "perl" | ||
31 | |||
32 | TD = "${S}/tentative-dist" | ||
33 | TDS = "${S}/tentative-dist-staging" | ||
34 | |||
35 | TARGET_CC_ARCH += "${LDFLAGS}" | ||
36 | |||
37 | do_compile_prepend_class-native() { | ||
38 | export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE} | ||
39 | export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE} | ||
40 | } | ||
41 | |||
42 | do_compile_prepend_class-nativesdk() { | ||
43 | export LDFLAGS="" | ||
44 | } | ||
45 | |||
46 | do_compile() { | ||
47 | export CROSS_COMPILE=1 | ||
48 | export NATIVE_CC="gcc" | ||
49 | export BUILD_OPT=1 | ||
50 | |||
51 | export FREEBL_NO_DEPEND=1 | ||
52 | export FREEBL_LOWHASH=1 | ||
53 | |||
54 | export LIBDIR=${libdir} | ||
55 | export MOZILLA_CLIENT=1 | ||
56 | export NS_USE_GCC=1 | ||
57 | export NSS_USE_SYSTEM_SQLITE=1 | ||
58 | export NSS_ENABLE_ECC=1 | ||
59 | |||
60 | export OS_RELEASE=3.4 | ||
61 | export OS_TARGET=Linux | ||
62 | export OS_ARCH=Linux | ||
63 | |||
64 | if [ "${TARGET_ARCH}" = "powerpc" ]; then | ||
65 | OS_TEST=ppc | ||
66 | elif [ "${TARGET_ARCH}" = "powerpc64" ]; then | ||
67 | OS_TEST=ppc64 | ||
68 | elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then | ||
69 | OS_TEST=mips | ||
70 | else | ||
71 | OS_TEST="${TARGET_ARCH}" | ||
72 | fi | ||
73 | |||
74 | if [ "${SITEINFO_BITS}" = "64" ]; then | ||
75 | export USE_64=1 | ||
76 | fi | ||
77 | |||
78 | make -C ./nss CCC="${CXX}" \ | ||
79 | OS_TEST=${OS_TEST} \ | ||
80 | } | ||
81 | |||
82 | |||
83 | do_install_prepend_class-nativesdk() { | ||
84 | export LDFLAGS="" | ||
85 | } | ||
86 | |||
87 | do_install() { | ||
88 | export CROSS_COMPILE=1 | ||
89 | export NATIVE_CC="gcc" | ||
90 | export BUILD_OPT=1 | ||
91 | |||
92 | export FREEBL_NO_DEPEND=1 | ||
93 | |||
94 | export LIBDIR=${libdir} | ||
95 | export MOZILLA_CLIENT=1 | ||
96 | export NS_USE_GCC=1 | ||
97 | export NSS_USE_SYSTEM_SQLITE=1 | ||
98 | export NSS_ENABLE_ECC=1 | ||
99 | |||
100 | export OS_RELEASE=3.4 | ||
101 | export OS_TARGET=Linux | ||
102 | export OS_ARCH=Linux | ||
103 | |||
104 | if [ "${TARGET_ARCH}" = "powerpc" ]; then | ||
105 | OS_TEST=ppc | ||
106 | elif [ "${TARGET_ARCH}" = "powerpc64" ]; then | ||
107 | OS_TEST=ppc64 | ||
108 | elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then | ||
109 | OS_TEST=mips | ||
110 | else | ||
111 | OS_TEST="${TARGET_ARCH}" | ||
112 | fi | ||
113 | if [ "${SITEINFO_BITS}" = "64" ]; then | ||
114 | export USE_64=1 | ||
115 | fi | ||
116 | |||
117 | make -C ./nss \ | ||
118 | CCC="${CXX}" \ | ||
119 | OS_TEST=${OS_TEST} \ | ||
120 | SOURCE_LIB_DIR="${TD}/${libdir}" \ | ||
121 | SOURCE_BIN_DIR="${TD}/${bindir}" \ | ||
122 | install | ||
123 | |||
124 | install -d ${D}/${libdir}/ | ||
125 | for file in ${S}/dist/*.OBJ/lib/*.so; do | ||
126 | echo "Installing `basename $file`..." | ||
127 | cp $file ${D}/${libdir}/ | ||
128 | done | ||
129 | |||
130 | for shared_lib in ${TD}/${libdir}/*.so.*; do | ||
131 | if [ -f $shared_lib ]; then | ||
132 | cp $shared_lib ${D}/${libdir} | ||
133 | ln -sf $(basename $shared_lib) ${D}/${libdir}/$(basename $shared_lib .1oe) | ||
134 | fi | ||
135 | done | ||
136 | for shared_lib in ${TD}/${libdir}/*.so; do | ||
137 | if [ -f $shared_lib -a ! -e ${D}/${libdir}/$shared_lib ]; then | ||
138 | cp $shared_lib ${D}/${libdir} | ||
139 | fi | ||
140 | done | ||
141 | |||
142 | install -d ${D}/${includedir}/nss3 | ||
143 | install -m 644 -t ${D}/${includedir}/nss3 dist/public/nss/* | ||
144 | |||
145 | install -d ${D}/${bindir} | ||
146 | for binary in ${TD}/${bindir}/*; do | ||
147 | install -m 755 -t ${D}/${bindir} $binary | ||
148 | done | ||
149 | } | ||
150 | |||
151 | do_install_append_class-target() { | ||
152 | # Create empty .chk files for the NSS libraries at build time. They could | ||
153 | # be regenerated at target's boot time. | ||
154 | for file in libsoftokn3.chk libfreebl3.chk libnssdbm3.chk; do | ||
155 | touch ${D}/${libdir}/$file | ||
156 | chmod 755 ${D}/${libdir}/$file | ||
157 | done | ||
158 | install -D -m 755 ${WORKDIR}/signlibs.sh ${D}/${bindir}/signlibs.sh | ||
159 | |||
160 | install -d ${D}${libdir}/pkgconfig/ | ||
161 | sed 's/%NSS_VERSION%/${PV}/' ${WORKDIR}/nss.pc.in | sed 's/%NSPR_VERSION%/4.9.2/' > ${D}${libdir}/pkgconfig/nss.pc | ||
162 | sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nss.pc | ||
163 | sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nss.pc | ||
164 | sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nss.pc | ||
165 | sed -i s:OEINCDIR:${includedir}/nss3:g ${D}${libdir}/pkgconfig/nss.pc | ||
166 | |||
167 | # Create a blank certificate | ||
168 | mkdir -p ${D}/etc/pki/nssdb/ | ||
169 | touch ./empty_password | ||
170 | certutil -N -d ${D}/etc/pki/nssdb/ -f ./empty_password | ||
171 | chmod 644 ${D}/etc/pki/nssdb/*.db | ||
172 | rm ./empty_password | ||
173 | } | ||
174 | |||
175 | pkg_postinst_${PN} () { | ||
176 | if [ -n "$D" ]; then | ||
177 | for I in $D/${libdir}/lib*.chk; do | ||
178 | DN=`dirname $I` | ||
179 | BN=`basename $I .chk` | ||
180 | FN=$DN/$BN.so | ||
181 | shlibsign -i $FN | ||
182 | if [ $? -ne 0 ]; then | ||
183 | exit 1 | ||
184 | fi | ||
185 | done | ||
186 | exit 0 | ||
187 | fi | ||
188 | signlibs.sh | ||
189 | } | ||
190 | |||
191 | FILES_${PN} = "\ | ||
192 | ${sysconfdir} \ | ||
193 | ${bindir} \ | ||
194 | ${libdir}/lib*.chk \ | ||
195 | ${libdir}/lib*.so \ | ||
196 | " | ||
197 | FILES_${PN}-dev = "\ | ||
198 | ${libdir}/nss \ | ||
199 | ${libdir}/pkgconfig/* \ | ||
200 | ${includedir}/* \ | ||
201 | " | ||
202 | FILES_${PN}-dbg = "\ | ||
203 | ${bindir}/.debug/* \ | ||
204 | ${libdir}/.debug/* \ | ||
205 | " | ||
206 | |||
207 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-support/nss/nss_3.15.1.bb b/meta/recipes-support/nss/nss_3.15.1.bb new file mode 100644 index 0000000000..7b06f00cde --- /dev/null +++ b/meta/recipes-support/nss/nss_3.15.1.bb | |||
@@ -0,0 +1,9 @@ | |||
1 | require nss.inc | ||
2 | |||
3 | SRC_URI += "\ | ||
4 | http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_15_1_RTM/src/${BPN}-${PV}.tar.gz \ | ||
5 | " | ||
6 | |||
7 | SRC_URI[md5sum] = "fb68f4d210ac9397dd0d3c39c4f938eb" | ||
8 | SRC_URI[sha256sum] = "f994106a33d1f3210f4151bbb3419a1c28fd1cb545caa7dc9afdebd6da626284" | ||
9 | |||