summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/nss/nss_3.24.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/nss/nss_3.24.bb')
-rw-r--r--meta/recipes-support/nss/nss_3.24.bb239
1 files changed, 239 insertions, 0 deletions
diff --git a/meta/recipes-support/nss/nss_3.24.bb b/meta/recipes-support/nss/nss_3.24.bb
new file mode 100644
index 0000000000..95a33f27d3
--- /dev/null
+++ b/meta/recipes-support/nss/nss_3.24.bb
@@ -0,0 +1,239 @@
1SUMMARY = "Mozilla's SSL and TLS implementation"
2DESCRIPTION = "Network Security Services (NSS) is a set of libraries \
3designed to support cross-platform development of \
4security-enabled client and server applications. \
5Applications built with NSS can support SSL v2 and v3, \
6TLS, PKCS 5, PKCS 7, PKCS 11, PKCS 12, S/MIME, X.509 \
7v3 certificates, and other security standards."
8HOMEPAGE = "http://www.mozilla.org/projects/security/pki/nss/"
9SECTION = "libs"
10
11LICENSE = "MPL-2.0 | (MPL-2.0 & GPL-2.0+) | (MPL-2.0 & LGPL-2.1+)"
12
13LIC_FILES_CHKSUM = "file://nss/COPYING;md5=3b1e88e1b9c0b5a4b2881d46cce06a18 \
14 file://nss/lib/freebl/mpi/doc/LICENSE;md5=491f158d09d948466afce85d6f1fe18f \
15 file://nss/lib/freebl/mpi/doc/LICENSE-MPL;md5=5d425c8f3157dbf212db2ec53d9e5132"
16
17SRC_URI = "\
18 http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_24_RTM/src/${BP}.tar.gz \
19 file://nss-fix-support-cross-compiling.patch \
20 file://nss-no-rpath-for-cross-compiling.patch \
21 file://nss-fix-incorrect-shebang-of-perl.patch \
22 file://nss-fix-nsinstall-build.patch \
23 file://nss.pc.in \
24 file://signlibs.sh \
25"
26SRC_URI[md5sum] = "35854c549cb02100d0f90a6ef328e2e8"
27SRC_URI[sha256sum] = "2f0841492f91cca473b73dec6cab9cf765a485e032d48d2e8ae7261e54c419ed"
28
29UPSTREAM_CHECK_URI = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Releases"
30UPSTREAM_CHECK_REGEX = "NSS_(?P<pver>.+)_release_notes"
31
32inherit siteinfo
33
34DEPENDS = "sqlite3 nspr zlib nss-native"
35DEPENDS_class-native = "sqlite3-native nspr-native zlib-native"
36RDEPENDS_${PN}-smime = "perl"
37
38TD = "${S}/tentative-dist"
39TDS = "${S}/tentative-dist-staging"
40
41TARGET_CC_ARCH += "${LDFLAGS}"
42
43do_configure_prepend_libc-musl () {
44 sed -i -e '/-DHAVE_SYS_CDEFS_H/d' ${S}/nss/lib/dbm/config/config.mk
45}
46
47do_compile_prepend_class-native() {
48 export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}
49 export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
50 export NSS_ENABLE_WERROR=0
51}
52
53do_compile_prepend_class-nativesdk() {
54 export LDFLAGS=""
55}
56
57do_compile_prepend_class-native() {
58 # Need to set RPATH so that chrpath will do its job correctly
59 RPATH="-Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE}"
60}
61
62do_compile() {
63 export CROSS_COMPILE=1
64 export NATIVE_CC="gcc"
65 export BUILD_OPT=1
66
67 export FREEBL_NO_DEPEND=1
68 export FREEBL_LOWHASH=1
69
70 export LIBDIR=${libdir}
71 export MOZILLA_CLIENT=1
72 export NS_USE_GCC=1
73 export NSS_USE_SYSTEM_SQLITE=1
74 export NSS_ENABLE_ECC=1
75
76 export OS_RELEASE=3.4
77 export OS_TARGET=Linux
78 export OS_ARCH=Linux
79
80 if [ "${TARGET_ARCH}" = "powerpc" ]; then
81 OS_TEST=ppc
82 elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
83 OS_TEST=ppc64
84 elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
85 OS_TEST=mips
86 else
87 OS_TEST="${TARGET_ARCH}"
88 fi
89
90 if [ "${SITEINFO_BITS}" = "64" ]; then
91 export USE_64=1
92 elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
93 export USE_X32=1
94 fi
95
96 export NSS_DISABLE_GTESTS=1
97
98 # We can modify CC in the environment, but if we set it via an
99 # argument to make, nsinstall, a host program, will also build with it!
100 #
101 export CC="${CC} -g"
102 make -C ./nss CCC="${CXX} -g" \
103 OS_TEST=${OS_TEST} \
104 RPATH="${RPATH}"
105}
106
107
108do_install_prepend_class-nativesdk() {
109 export LDFLAGS=""
110}
111
112do_install() {
113 export CROSS_COMPILE=1
114 export NATIVE_CC="gcc"
115 export BUILD_OPT=1
116
117 export FREEBL_NO_DEPEND=1
118
119 export LIBDIR=${libdir}
120 export MOZILLA_CLIENT=1
121 export NS_USE_GCC=1
122 export NSS_USE_SYSTEM_SQLITE=1
123 export NSS_ENABLE_ECC=1
124
125 export OS_RELEASE=3.4
126 export OS_TARGET=Linux
127 export OS_ARCH=Linux
128
129 if [ "${TARGET_ARCH}" = "powerpc" ]; then
130 OS_TEST=ppc
131 elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
132 OS_TEST=ppc64
133 elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
134 OS_TEST=mips
135 else
136 OS_TEST="${TARGET_ARCH}"
137 fi
138 if [ "${SITEINFO_BITS}" = "64" ]; then
139 export USE_64=1
140 elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
141 export USE_X32=1
142 fi
143
144 export NSS_DISABLE_GTESTS=1
145
146 make -C ./nss \
147 CCC="${CXX}" \
148 OS_TEST=${OS_TEST} \
149 SOURCE_LIB_DIR="${TD}/${libdir}" \
150 SOURCE_BIN_DIR="${TD}/${bindir}" \
151 install
152
153 install -d ${D}/${libdir}/
154 for file in ${S}/dist/*.OBJ/lib/*.so; do
155 echo "Installing `basename $file`..."
156 cp $file ${D}/${libdir}/
157 done
158
159 for shared_lib in ${TD}/${libdir}/*.so.*; do
160 if [ -f $shared_lib ]; then
161 cp $shared_lib ${D}/${libdir}
162 ln -sf $(basename $shared_lib) ${D}/${libdir}/$(basename $shared_lib .1oe)
163 fi
164 done
165 for shared_lib in ${TD}/${libdir}/*.so; do
166 if [ -f $shared_lib -a ! -e ${D}/${libdir}/$shared_lib ]; then
167 cp $shared_lib ${D}/${libdir}
168 fi
169 done
170
171 install -d ${D}/${includedir}/nss3
172 install -m 644 -t ${D}/${includedir}/nss3 dist/public/nss/*
173
174 install -d ${D}/${bindir}
175 for binary in ${TD}/${bindir}/*; do
176 install -m 755 -t ${D}/${bindir} $binary
177 done
178}
179
180do_install_append() {
181 # Create empty .chk files for the NSS libraries at build time. They could
182 # be regenerated at target's boot time.
183 for file in libsoftokn3.chk libfreebl3.chk libnssdbm3.chk; do
184 touch ${D}/${libdir}/$file
185 chmod 755 ${D}/${libdir}/$file
186 done
187 install -D -m 755 ${WORKDIR}/signlibs.sh ${D}/${bindir}/signlibs.sh
188
189 install -d ${D}${libdir}/pkgconfig/
190 sed 's/%NSS_VERSION%/${PV}/' ${WORKDIR}/nss.pc.in | sed 's/%NSPR_VERSION%/4.9.2/' > ${D}${libdir}/pkgconfig/nss.pc
191 sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nss.pc
192 sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nss.pc
193 sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nss.pc
194 sed -i s:OEINCDIR:${includedir}/nss3:g ${D}${libdir}/pkgconfig/nss.pc
195}
196
197do_install_append_class-target() {
198 # Create a blank certificate
199 mkdir -p ${D}${sysconfdir}/pki/nssdb/
200 touch ./empty_password
201 certutil -N -d ${D}${sysconfdir}/pki/nssdb/ -f ./empty_password
202 chmod 644 ${D}${sysconfdir}/pki/nssdb/*.db
203 rm ./empty_password
204}
205
206pkg_postinst_${PN} () {
207 if [ -n "$D" ]; then
208 for I in $D/${libdir}/lib*.chk; do
209 DN=`dirname $I`
210 BN=`basename $I .chk`
211 FN=$DN/$BN.so
212 shlibsign -i $FN
213 if [ $? -ne 0 ]; then
214 exit 1
215 fi
216 done
217 exit 0
218 fi
219 signlibs.sh
220}
221
222PACKAGES =+ "${PN}-smime"
223FILES_${PN}-smime = "\
224 ${bindir}/smime \
225"
226FILES_${PN} = "\
227 ${sysconfdir} \
228 ${bindir} \
229 ${libdir}/lib*.chk \
230 ${libdir}/lib*.so \
231 "
232FILES_${PN}-dev = "\
233 ${libdir}/nss \
234 ${libdir}/pkgconfig/* \
235 ${includedir}/* \
236 "
237
238BBCLASSEXTEND = "native nativesdk"
239