1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
7 # Version of NSPR that we depend on.
8 %define nspr_version 4.7
10 # Tests cause strange Wine failures ...
16 Summary: MinGW Windows port of NSS (Network Security Services)
18 License: MPLv1.1 or GPLv2+ or LGPLv2+
19 Group: Development/Libraries
20 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
23 URL: http://www.mozilla.org/projects/security/pki/nss/
25 # Extracted from the Fedora native package. There is no upstream
26 # location for the tarballs.
27 Source0: nss-%{version}-stripped.tar.bz2
29 Source2: nss-config.in
30 Source3: blank-cert8.db
31 Source4: blank-key3.db
32 Source5: blank-secmod.db
33 Source8: nss-prelink.conf
34 Source12: nss-pem-20080124.tar.bz2
38 Patch1: nss-no-rpath.patch
39 Patch2: nss-nolocalsql.patch
40 Patch5: nss-pem-bug429175.patch
41 Patch6: nss-enable-pem.patch
43 Patch1000: nss-cross-compile.patch
45 BuildRequires: mingw32-filesystem >= 33
46 BuildRequires: mingw32-gcc
47 BuildRequires: mingw32-binutils
49 BuildRequires: mingw32-nspr >= %{nspr_version}
50 BuildRequires: mingw32-sqlite
51 BuildRequires: mingw32-zlib
53 BuildRequires: pkgconfig
60 Network Security Services (NSS) is a set of libraries designed to
61 support cross-platform development of security-enabled client and
62 server applications. Applications built with NSS can support SSL v2
63 and v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509
64 v3 certificates, and other security standards.
68 %setup -q -n nss-%{version}
69 %setup -q -T -D -n nss-%{version} -a 12
73 %patch5 -p0 -b .429175
74 %patch6 -p0 -b .libpem
78 # Notes on the naming:
79 # (1) "2.6" is the Linux version number which is appended to the name
80 # also by NSS Makefiles.
81 # (2) OS_TARGET must be set to the basename (w/o 2.6).
82 cp %{SOURCE1000} mozilla/security/coreconf/FedoraCross2.6.mk
86 # For cross-compilation, make sure pkg-config picks up the cross-compiled
88 PKG_CONFIG_LIBDIR="%{_mingw32_libdir}/pkgconfig"
89 export PKG_CONFIG_LIBDIR
93 NATIVE_FLAGS="-DLINUX -Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR"
102 # Enable compiler optimizations and disable debugging code
106 # Generate symbolic info for debuggers
107 XCFLAGS="%{_mingw32_cflags}"
110 export NSPR_INCLUDE_DIR=%{_mingw32_includedir}/nspr
111 export NSPR_LIB_DIR=%{_mingw32_bindir}
113 # Target is Win32 (32 bit):
114 #%ifarch x86_64 ppc64 ia64 s390x sparc64
120 # export NSS_ENABLE_ECC
122 %{__make} -C ./mozilla/security/coreconf
123 %{__make} -C ./mozilla/security/dbm
124 %{__make} -C ./mozilla/security/nss
126 # enable the following line to force a test failure
127 # find ./mozilla -name \*.chk | xargs rm -f
131 # In order to support multiple concurrent executions of the test suite
132 # (caused by concurrent RPM builds) on a single host,
133 # we'll use a random port. Also, we want to clean up any stuck
134 # selfserv processes. If process name "selfserv" is used everywhere,
135 # we can't simply do a "killall selfserv", because it could disturb
136 # concurrent builds. Therefore we'll do a search and replace and use
137 # a different process name.
138 # Using xargs doesn't mix well with spaces in filenames, in order to
139 # avoid weird quoting we'll require that no spaces are being used.
141 SPACEISBAD=`find ./mozilla/security/nss/tests | grep -c ' '` ||:
142 if [ SPACEISBAD -ne 0 ]; then
143 echo "error: filenames containing space are not supported (xargs)"
146 MYRAND=`perl -e 'print 9000 + int rand 1000'`; echo $MYRAND ||:
147 RANDSERV=selfserv_${MYRAND}; echo $RANDSERV ||:
148 DISTBINDIR=`ls -d ./mozilla/dist/*.OBJ/bin`; echo $DISTBINDIR ||:
151 ln -s selfserv $RANDSERV
153 # man perlrun, man perlrequick
154 # replace word-occurrences of selfserv with selfserv_$MYRAND
155 find ./mozilla/security/nss/tests -type f |\
156 grep -v "\.db$" |grep -v "\.crl$" | grep -v "\.crt$" |\
157 grep -vw CVS |xargs grep -lw selfserv |\
158 xargs -l perl -pi -e "s/\bselfserv\b/$RANDSERV/g" ||:
160 killall $RANDSERV || :
162 rm -rf ./mozilla/tests_results
163 cd ./mozilla/security/nss/tests/
164 # all.sh is the test suite script
165 HOST=localhost DOMSUF=localdomain PORT=$MYRAND ./all.sh
168 killall $RANDSERV || :
170 TEST_FAILURES=`grep -c FAILED ./mozilla/tests_results/security/localhost.1/output.log` || :
171 if [ $TEST_FAILURES -ne 0 ]; then
172 echo "error: test suite returned failure(s)"
175 echo "test suite completed"
180 rm -rf $RPM_BUILD_ROOT
182 # There is no make install target so we'll do it ourselves.
184 %{__mkdir_p} $RPM_BUILD_ROOT/%{_mingw32_includedir}/nss3
185 %{__mkdir_p} $RPM_BUILD_ROOT/%{_mingw32_bindir}
186 %{__mkdir_p} $RPM_BUILD_ROOT/%{_mingw32_libdir}
187 %{__mkdir_p} $RPM_BUILD_ROOT/%{_mingw32_libdir}/nss/unsupported-tools
189 # Set up our package file
190 %{__mkdir_p} $RPM_BUILD_ROOT/%{_mingw32_libdir}/pkgconfig
191 %{__cat} %{SOURCE1} | sed -e "s,%%libdir%%,%{_mingw32_libdir},g" \
192 -e "s,%%prefix%%,%{_mingw32_prefix},g" \
193 -e "s,%%exec_prefix%%,%{_mingw32_prefix},g" \
194 -e "s,%%includedir%%,%{_mingw32_includedir}/nss3,g" \
195 -e "s,%%NSPR_VERSION%%,%{nspr_version},g" \
196 -e "s,%%NSS_VERSION%%,%{version},g" > \
197 $RPM_BUILD_ROOT/%{_mingw32_libdir}/pkgconfig/nss.pc
198 NSS_VMAJOR=`cat mozilla/security/nss/lib/nss/nss.h | grep "#define.*NSS_VMAJOR" | awk '{print $3}'`
199 NSS_VMINOR=`cat mozilla/security/nss/lib/nss/nss.h | grep "#define.*NSS_VMINOR" | awk '{print $3}'`
200 NSS_VPATCH=`cat mozilla/security/nss/lib/nss/nss.h | grep "#define.*NSS_VPATCH" | awk '{print $3}'`
206 %{__mkdir_p} $RPM_BUILD_ROOT/%{_mingw32_bindir}
207 %{__cat} %{SOURCE2} | sed -e "s,@libdir@,%{_mingw32_libdir},g" \
208 -e "s,@prefix@,%{_mingw32_prefix},g" \
209 -e "s,@exec_prefix@,%{_mingw32_prefix},g" \
210 -e "s,@includedir@,%{_mingw32_includedir}/nss3,g" \
211 -e "s,@MOD_MAJOR_VERSION@,$NSS_VMAJOR,g" \
212 -e "s,@MOD_MINOR_VERSION@,$NSS_VMINOR,g" \
213 -e "s,@MOD_PATCH_VERSION@,$NSS_VPATCH,g" \
214 > $RPM_BUILD_ROOT/%{_mingw32_bindir}/nss-config
216 chmod 755 $RPM_BUILD_ROOT/%{_mingw32_bindir}/nss-config
218 # Copy the binary libraries we want
219 for file in libsoftokn3.dll libfreebl3.dll libnss3.dll libnssutil3.dll \
220 libssl3.dll libsmime3.dll libnssckbi.dll libnsspem.dll libnssdbm3.dll
222 %{__install} -m 755 mozilla/dist/*.OBJ/lib/$file $RPM_BUILD_ROOT/%{_mingw32_bindir}
225 # These ghost files will be generated in the post step
226 # Make sure chk files can be found in both places
227 #for file in libsoftokn3.chk libfreebl3.chk
229 # touch $RPM_BUILD_ROOT/%{_lib}/$file
230 # ln -s ../../%{_lib}/$file $RPM_BUILD_ROOT/%{_mingw32_libdir}/$file
233 # Install the empty NSS db files
234 %{__mkdir_p} $RPM_BUILD_ROOT/%{_mingw32_sysconfdir}/pki/nssdb
235 %{__install} -m 644 %{SOURCE3} $RPM_BUILD_ROOT/%{_mingw32_sysconfdir}/pki/nssdb/cert8.db
236 %{__install} -m 644 %{SOURCE4} $RPM_BUILD_ROOT/%{_mingw32_sysconfdir}/pki/nssdb/key3.db
237 %{__install} -m 644 %{SOURCE5} $RPM_BUILD_ROOT/%{_mingw32_sysconfdir}/pki/nssdb/secmod.db
238 %{__mkdir_p} $RPM_BUILD_ROOT/%{_mingw32_sysconfdir}/prelink.conf.d
239 %{__install} -m 644 %{SOURCE8} $RPM_BUILD_ROOT/%{_mingw32_sysconfdir}/prelink.conf.d/nss-prelink.conf
241 # Copy the development libraries we want
242 for file in libcrmf.a libnssb.a libnssckfw.a
244 %{__install} -m 644 mozilla/dist/*.OBJ/lib/$file $RPM_BUILD_ROOT/%{_mingw32_libdir}
247 # Copy the binaries we want
248 for file in certutil cmsutil crlutil modutil pk12util signtool signver ssltap
250 %{__install} -m 755 mozilla/dist/*.OBJ/bin/$file $RPM_BUILD_ROOT/%{_mingw32_bindir}
253 # Copy the binaries we ship as unsupported
254 for file in atob btoa derdump ocspclnt pp selfserv shlibsign strsclnt symkeyutil tstclnt vfyserv vfychain
256 %{__install} -m 755 mozilla/dist/*.OBJ/bin/$file $RPM_BUILD_ROOT/%{_mingw32_libdir}/nss/unsupported-tools
259 # Copy the include files we want
260 for file in mozilla/dist/public/nss/*.h
262 %{__install} -m 644 $file $RPM_BUILD_ROOT/%{_mingw32_includedir}/nss3
267 rm -rf $RPM_BUILD_ROOT
271 %defattr(-,root,root)
272 %{_mingw32_bindir}/nss-config
273 %{_mingw32_bindir}/certutil
274 %{_mingw32_bindir}/cmsutil
275 %{_mingw32_bindir}/crlutil
276 %{_mingw32_bindir}/modutil
277 %{_mingw32_bindir}/pk12util
278 %{_mingw32_bindir}/signtool
279 %{_mingw32_bindir}/signver
280 %{_mingw32_bindir}/ssltap
281 %{_mingw32_bindir}/libsoftokn3.dll
282 %{_mingw32_bindir}/libfreebl3.dll
283 %{_mingw32_bindir}/libnss3.dll
284 %{_mingw32_bindir}/libnssutil3.dll
285 %{_mingw32_bindir}/libssl3.dll
286 %{_mingw32_bindir}/libsmime3.dll
287 %{_mingw32_bindir}/libnssckbi.dll
288 %{_mingw32_bindir}/libnsspem.dll
289 %{_mingw32_bindir}/libnssdbm3.dll
290 %{_mingw32_sysconfdir}/pki/nssdb/cert8.db
291 %{_mingw32_sysconfdir}/pki/nssdb/key3.db
292 %{_mingw32_sysconfdir}/pki/nssdb/secmod.db
293 %{_mingw32_sysconfdir}/prelink.conf.d/nss-prelink.conf
294 %{_mingw32_includedir}/nss3/
295 %{_mingw32_libdir}/libcrmf.a
296 %{_mingw32_libdir}/libnssb.a
297 %{_mingw32_libdir}/libnssckfw.a
298 %{_mingw32_libdir}/nss/unsupported-tools/atob
299 %{_mingw32_libdir}/nss/unsupported-tools/btoa
300 %{_mingw32_libdir}/nss/unsupported-tools/derdump
301 %{_mingw32_libdir}/nss/unsupported-tools/ocspclnt
302 %{_mingw32_libdir}/nss/unsupported-tools/pp
303 %{_mingw32_libdir}/nss/unsupported-tools/selfserv
304 %{_mingw32_libdir}/nss/unsupported-tools/shlibsign
305 %{_mingw32_libdir}/nss/unsupported-tools/strsclnt
306 %{_mingw32_libdir}/nss/unsupported-tools/symkeyutil
307 %{_mingw32_libdir}/nss/unsupported-tools/tstclnt
308 %{_mingw32_libdir}/nss/unsupported-tools/vfychain
309 %{_mingw32_libdir}/nss/unsupported-tools/vfyserv
310 %{_mingw32_libdir}/pkgconfig/nss.pc
314 * Tue Feb 17 2009 Richard W.M. Jones <rjones@redhat.com> - 3.12.2.0-4
317 * Fri Feb 6 2009 Richard W.M. Jones <rjones@redhat.com> - 3.12.2.0-3
318 - Include license file.
320 * Fri Jan 30 2009 Richard W.M. Jones <rjones@redhat.com> - 3.12.2.0-2
321 - Initial RPM release.