1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 version = %{ver_major}.%{ver_minor}.%{ver_patch}
13 maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
14 groups = System/Libraries
15 url = http://www.mozilla.org/projects/security/pki/nss/
16 license = MPLv1.1 or GPLv2+ or LGPLv2+
17 summary = Network Security Services.
20 Network Security Services (NSS) is a set of libraries designed to
21 support cross-platform development of security-enabled client and
22 server applications. Applications built with NSS can support SSL v2
23 and v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509
24 v3 certificates, and other security standards.
28 %{name}-pem-20100809.tar.bz2
30 source_dl = ftp://ftp.mozilla.org/pub/security/nss/releases/NSS_%{ver_major}_%{ver_minor}_%{ver_patch}_RTM/src/
43 ## Define some global environment variables
45 export FREEBL_NO_DEPEND=1
47 # Enable compiler optimizations and disable debugging code
49 export XCFLAGS=%{CFLAGS}
51 # Allow the usage of system libraries.
52 export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
53 export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
55 # Define where to find nspr header files and libraries.
56 export NSPR_INCLUDE_DIR=/usr/include/nspr4
57 export NSPR_LIB_DIR=%{libdir}
59 # Disable support for SHA224.
60 export NO_SHA224_AVAILABLE=1
62 # Use sqlite from system.
63 export NSS_USE_SYSTEM_SQLITE=1
65 if "%{DISTRO_ARCH}" == "x86_64"
71 cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{thisapp}.tar.gz
73 # Extract pem tarball into nss directory.
74 cd %{DIR_APP} && %{MACRO_EXTRACT} %{DIR_DL}/%{name}-pem-20100809.tar.bz2
81 make -C ./mozilla/security/coreconf
82 make -C ./mozilla/security/dbm
83 make -C ./mozilla/security/nss
87 # We have to do the complete install stuff self.
89 # Create directory layout.
90 mkdir -pv %{BUILDROOT}/usr/include/nss3
91 mkdir -pv %{BUILDROOT}/usr/{bin,%{lib}}
92 mkdir -pv %{BUILDROOT}%{libdir}/pkgconfig
93 mkdir -pv %{BUILDROOT}%{libdir}/nss/unsupported-tools
95 # Install all libraries.
96 install -p -v -m 755 mozilla/dist/*.OBJ/lib/libnss3.so \
98 install -p -v -m 755 mozilla/dist/*.OBJ/lib/libnssckbi.so \
100 install -p -v -m 755 mozilla/dist/*.OBJ/lib/libnsspem.so \
101 %{BUILDROOT}%{libdir}
102 install -p -v -m 755 mozilla/dist/*.OBJ/lib/libnsssysinit.so \
103 %{BUILDROOT}%{libdir}
104 install -p -v -m 755 mozilla/dist/*.OBJ/lib/libnssutil3.so \
105 %{BUILDROOT}%{libdir}
106 install -p -v -m 755 mozilla/dist/*.OBJ/lib/libsmime3.so \
107 %{BUILDROOT}%{libdir}
108 install -p -v -m 755 mozilla/dist/*.OBJ/lib/libssl3.so \
109 %{BUILDROOT}%{libdir}
110 install -p -v -m 755 mozilla/dist/*.OBJ/lib/libsoftokn3.so \
111 %{BUILDROOT}%{libdir}
112 install -p -v -m 755 mozilla/dist/*.OBJ/lib/libnssdbm3.so \
113 %{BUILDROOT}%{libdir}
114 install -p -v -m 755 mozilla/dist/*.OBJ/lib/libfreebl3.so \
115 %{BUILDROOT}/%{libdir}
117 # Install the empty NSS db files
118 mkdir -pv %{BUILDROOT}/etc/pki/nssdb
119 cp -vf %{DIR_SOURCE}/*.db %{BUILDROOT}/etc/pki/nssdb/
120 install -p -v -m 644 %{DIR_SOURCE}/system-pkcs11.txt \
121 %{BUILDROOT}/etc/pki/nssdb/pkcs11.txt
123 # Copy the binaries we want
124 install -p -v -m 755 mozilla/dist/*.OBJ/bin/certutil %{BUILDROOT}/usr/bin
125 install -p -v -m 755 mozilla/dist/*.OBJ/bin/cmsutil %{BUILDROOT}/usr/bin
126 install -p -v -m 755 mozilla/dist/*.OBJ/bin/crlutil %{BUILDROOT}/usr/bin
127 install -p -v -m 755 mozilla/dist/*.OBJ/bin/modutil %{BUILDROOT}/usr/bin
128 install -p -v -m 755 mozilla/dist/*.OBJ/bin/pk12util %{BUILDROOT}/usr/bin
129 install -p -v -m 755 mozilla/dist/*.OBJ/bin/signtool %{BUILDROOT}/usr/bin
130 install -p -v -m 755 mozilla/dist/*.OBJ/bin/signver %{BUILDROOT}/usr/bin
131 install -p -v -m 755 mozilla/dist/*.OBJ/bin/ssltap %{BUILDROOT}/usr/bin
132 chrpath --delete %{BUILDROOT}/usr/bin/*
134 # Copy the binaries we ship as unsupported
135 install -p -v -m 755 mozilla/dist/*.OBJ/bin/atob %{BUILDROOT}%{libdir}/nss/unsupported-tools
136 install -p -v -m 755 mozilla/dist/*.OBJ/bin/btoa %{BUILDROOT}%{libdir}/nss/unsupported-tools
137 install -p -v -m 755 mozilla/dist/*.OBJ/bin/derdump %{BUILDROOT}%{libdir}/nss/unsupported-tools
138 install -p -v -m 755 mozilla/dist/*.OBJ/bin/ocspclnt %{BUILDROOT}%{libdir}/nss/unsupported-tools
139 install -p -v -m 755 mozilla/dist/*.OBJ/bin/pp %{BUILDROOT}%{libdir}/nss/unsupported-tools
140 install -p -v -m 755 mozilla/dist/*.OBJ/bin/selfserv %{BUILDROOT}%{libdir}/nss/unsupported-tools
141 install -p -v -m 755 mozilla/dist/*.OBJ/bin/shlibsign %{BUILDROOT}%{libdir}/nss/unsupported-tools
142 install -p -v -m 755 mozilla/dist/*.OBJ/bin/strsclnt %{BUILDROOT}%{libdir}/nss/unsupported-tools
143 install -p -v -m 755 mozilla/dist/*.OBJ/bin/symkeyutil %{BUILDROOT}%{libdir}/nss/unsupported-tools
144 install -p -v -m 755 mozilla/dist/*.OBJ/bin/tstclnt %{BUILDROOT}%{libdir}/nss/unsupported-tools
145 install -p -v -m 755 mozilla/dist/*.OBJ/bin/vfyserv %{BUILDROOT}%{libdir}/nss/unsupported-tools
146 install -p -v -m 755 mozilla/dist/*.OBJ/bin/vfychain %{BUILDROOT}%{libdir}/nss/unsupported-tools
147 chrpath --delete %{BUILDROOT}%{libdir}/nss/unsupported-tools/*
149 sed -e "s,@libdir@,%{libdir},g" \
150 -e "s,@prefix@,/usr,g" \
151 -e "s,@exec_prefix@,/usr,g" \
152 -e "s,@includedir@,/usr/include/nss3,g" \
153 -e "s,@MOD_MAJOR_VERSION@,$(grep "#define.*NSS_VMAJOR" mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'),g" \
154 -e "s,@MOD_MINOR_VERSION@,$(grep "#define.*NSS_VMINOR" mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'),g" \
155 -e "s,@MOD_PATCH_VERSION@,$(grep "#define.*NSS_VPATCH" mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'),g" \
156 < %{DIR_SOURCE}/nss-config.in \
157 > %{BUILDROOT}/usr/bin/nss-config
158 chmod -v 755 %{BUILDROOT}/usr/bin/nss-config
160 install -p -v -m 755 %{DIR_SOURCE}/setup-nsssysinit.sh %{BUILDROOT}/usr/bin
162 # Generate file for pkg-config.
164 -e "s,%libdir%,%{libdir},g" \
165 -e "s,%prefix%,/usr,g" \
166 -e "s,%exec_prefix%,/usr,g" \
167 -e "s,%includedir%,/usr/include/nss3,g" \
168 -e "s,%NSS_VERSION%,%{version},g" \
169 -e "s,%NSPR_VERSION%,$(nspr-config --version),g" \
170 < %{DIR_SOURCE}/nss.pc.in \
171 > %{BUILDROOT}%{libdir}/pkgconfig/nss.pc
173 # Copy the include files we want
174 cp -vf mozilla/dist/public/nss/*.h %{BUILDROOT}/usr/include/nss3
175 cp -vf mozilla/dist/private/nss/blapi.h %{BUILDROOT}/usr/include/nss3
176 chmod -v 644 %{BUILDROOT}/usr/include/nss3/*.h
187 nss-softokn=%{thisver}
188 nss-softokn-freebl=%{thisver}
196 package %{name}-devel
204 # Mozilla does no versioning :(
212 package %{name}-softokn
213 summary = Network Security Services Softoken Module.
215 Network Security Services Softoken Cryptographic Module.
218 requires = nss=%{thisver}
221 %{libdir}/libnssdbm3.so
222 %{libdir}/libsoftokn3.so
223 %{libdir}/nss/unsupported-tools/shlibsign
227 package %{name}-softokn-freebl
228 summary = Freebl library for the Network Security Services.
230 NSS Softoken Cryptographic Module Freelb Library.
235 nss-softokn=%{thisver}
238 files = %{libdir}/libfreebl3.so
242 summary = Network Security Services Utilities Library.
244 Utilities for Network Security Services and the Softoken module.
247 requires = nss=%{thisver}
249 files = %{libdir}/libnssutil3.so
252 package %{name}-debuginfo