1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
25 include $(PKGROOT)/Include
32 PKG_GROUPS = System/Libraries
33 PKG_URL = http://www.mozilla.org/projects/security/pki/nss/
34 PKG_LICENSE = MPLv1.1 or GPLv2+ or LGPLv2+
35 PKG_SUMMARY = Network Security Services.
37 PKG_BUILD_DEPS+= nspr-devel nss-softokn-devel nss-util-devel perl pkg-config \
38 psmisc sqlite-devel zlib-devel
40 define PKG_DESCRIPTION
41 Network Security Services (NSS) is a set of libraries designed to \
42 support cross-platform development of security-enabled client and \
43 server applications. Applications built with NSS can support SSL v2 \
44 and v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 \
45 v3 certificates, and other security standards.
48 PKG_TARBALL = $(THISAPP)-stripped.tar.bz2
49 PKG_OBJECTS += nss-pem-20100809.tar.bz2
51 PKG_PACKAGES += $(PKG_NAME_REAL)-devel $(PKG_NAME_REAL)-libs
53 PKG_DEPS-$(PKG_NAME_REAL)-devel += nspr-devel nss nss-softokn-devel nss-util-devel
55 # Mozilla does no versioning :(
56 define PKG_FILES-$(PKG_NAME_REAL)-devel
62 define PKG_FILES-$(PKG_NAME_REAL)-libs
66 # XXX -> need to be removed
67 define QUALITY_AGENT_WHITELIST_RPATH
71 ## Define some global environment variables
73 export FREEBL_NO_DEPEND=1
75 # Enable compiler optimizations and disable debugging code
77 export XCFLAGS=$(CFLAGS)
79 export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
80 export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
82 export NSPR_INCLUDE_DIR=/usr/include/nspr4
83 export NSPR_LIB_DIR=/usr/lib
85 export NSS_INCLUDE_DIR=/usr/include/nss3
86 export NSS_LIB_DIR=/usr/lib
88 export NSS_USE_SYSTEM_SQLITE=1
91 cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(PKG_TARBALL)
92 cd $(DIR_APP) && $(DO_EXTRACT) $(DIR_DL)/nss-pem-20100809.tar.bz2
96 cp -vf $(DIR_SOURCE)/PayPalEE.cert \
97 $(DIR_APP)/mozilla/security/nss/tests/libpkix/certs
101 cd $(DIR_APP) && make -C ./mozilla/security/coreconf
102 cd $(DIR_APP) && make -C ./mozilla/security/dbm
103 cd $(DIR_APP) && make -C ./mozilla/security/nss
107 -mkdir -pv $(BUILDROOT)/usr/include/nss3
108 -mkdir -pv $(BUILDROOT)/usr/{bin,lib}
109 -mkdir -pv $(BUILDROOT)/usr/lib/pkgconfig
110 -mkdir -pv $(BUILDROOT)/usr/lib/nss/unsupported-tools
112 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/lib/libnss3.so \
114 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/lib/libnssckbi.so \
116 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/lib/libnsspem.so \
118 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/lib/libnsssysinit.so \
120 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/lib/libsmime3.so \
122 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/lib/libssl3.so \
125 # Install the empty NSS db files
126 -mkdir -pv $(BUILDROOT)/etc/pki/nssdb
127 cp -vf $(DIR_SOURCE)/*.db $(BUILDROOT)/etc/pki/nssdb/
128 install -p -v -m 644 $(DIR_SOURCE)/system-pkcs11.txt \
129 $(BUILDROOT)/etc/pki/nssdb/pkcs11.txt
131 # Copy the binaries we want
132 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/certutil $(BUILDROOT)/usr/bin
133 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/cmsutil $(BUILDROOT)/usr/bin
134 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/crlutil $(BUILDROOT)/usr/bin
135 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/modutil $(BUILDROOT)/usr/bin
136 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/pk12util $(BUILDROOT)/usr/bin
137 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/signtool $(BUILDROOT)/usr/bin
138 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/signver $(BUILDROOT)/usr/bin
139 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/ssltap $(BUILDROOT)/usr/bin
141 # Copy the binaries we ship as unsupported
142 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/atob $(BUILDROOT)/usr/lib/nss/unsupported-tools
143 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/btoa $(BUILDROOT)/usr/lib/nss/unsupported-tools
144 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/derdump $(BUILDROOT)/usr/lib/nss/unsupported-tools
145 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/ocspclnt $(BUILDROOT)/usr/lib/nss/unsupported-tools
146 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/pp $(BUILDROOT)/usr/lib/nss/unsupported-tools
147 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/selfserv $(BUILDROOT)/usr/lib/nss/unsupported-tools
148 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/strsclnt $(BUILDROOT)/usr/lib/nss/unsupported-tools
149 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/symkeyutil $(BUILDROOT)/usr/lib/nss/unsupported-tools
150 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/tstclnt $(BUILDROOT)/usr/lib/nss/unsupported-tools
151 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/vfyserv $(BUILDROOT)/usr/lib/nss/unsupported-tools
152 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/vfychain $(BUILDROOT)/usr/lib/nss/unsupported-tools
154 sed -e "s,@libdir@,/usr/lib,g" \
155 -e "s,@prefix@,/usr,g" \
156 -e "s,@exec_prefix@,/usr,g" \
157 -e "s,@includedir@,/usr/include/nss3,g" \
158 -e "s,@MOD_MAJOR_VERSION@,$$(grep "#define.*NSS_VMAJOR" $(DIR_APP)/mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'),g" \
159 -e "s,@MOD_MINOR_VERSION@,$$(grep "#define.*NSS_VMINOR" $(DIR_APP)/mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'),g" \
160 -e "s,@MOD_PATCH_VERSION@,$$(grep "#define.*NSS_VPATCH" $(DIR_APP)/mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'),g" \
161 < $(DIR_SOURCE)/nss-config.in \
162 > $(BUILDROOT)/usr/bin/nss-config
163 chmod -v 755 $(BUILDROOT)/usr/bin/nss-config
165 install -p -v -m 755 $(DIR_SOURCE)/setup-nsssysinit.sh $(BUILDROOT)/usr/bin
167 # Set up our package file
168 # The nspr_version and nss_{util|softokn}_version globals used
169 # here match the ones nss has for its Requires.
171 # XXX need to fix this
173 -e "s,%libdir%,/usr/lib,g" \
174 -e "s,%prefix%,/usr,g" \
175 -e "s,%exec_prefix%,/usr,g" \
176 -e "s,%includedir%,/usr/include/nss3,g" \
177 -e "s,%NSS_VERSION%,$(PKG_VER),g" \
178 -e "s,%NSPR_VERSION%,$$(nspr-config --version),g" \
179 -e "s,%NSSUTIL_VERSION%,$$(nss-util-config --version),g" \
180 -e "s,%SOFTOKEN_VERSION%,$$(nss-softokn-config --version),g" \
181 < $(DIR_SOURCE)/nss.pc.in \
182 > $(BUILDROOT)/usr/lib/pkgconfig/nss.pc
184 # Copy the include files we want
185 cp -vf $(DIR_APP)/mozilla/dist/public/nss/*.h $(BUILDROOT)/usr/include/nss3
186 chmod -v 644 $(BUILDROOT)/usr/include/nss3/*.h
188 # remove the nss-util-devel headers
189 cd $(BUILDROOT)/usr/include/nss3 && rm -vf \
200 pkcs11{,f,n,p,t,u}.h \
216 # remove header shipped in nss-softokn-devel
217 cd $(BUILDROOT)/usr/include/nss3 && rm -vf \