############################################################################### # IPFire.org - An Open Source Firewall Solution # # Copyright (C) - IPFire Development Team # ############################################################################### name = nss version = 3.12.8 release = 4 groups = System/Libraries url = http://www.mozilla.org/projects/security/pki/nss/ license = MPLv1.1 or GPLv2+ or LGPLv2+ summary = Network Security Services. description Network Security Services (NSS) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. Applications built with NSS can support SSL v2 and v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other security standards. end source_dl = sources %{thisapp}-stripped.tar.bz2 %{name}-pem-20100809.tar.bz2 end build requires chrpath nspr-devel nss-softokn-devel nss-util-devel perl pkg-config psmisc sqlite-devel zlib-devel end ## Define some global environment variables export FREEBL_NO_DEPEND=1 # Enable compiler optimizations and disable debugging code export BUILD_OPT=1 export XCFLAGS=%{CFLAGS} export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 export NSPR_INCLUDE_DIR=/usr/include/nspr4 export NSPR_LIB_DIR=%{libdir} export NSS_INCLUDE_DIR=/usr/include/nss3 export NSS_LIB_DIR=%{libdir} export NSS_USE_SYSTEM_SQLITE=1 if "%{DISTRO_ARCH}" == "x86_64" export USE_64=1 end prepare # Extract tarball cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{thisapp}-stripped.tar.bz2 # Extract tarball into nss directory. cd %{DIR_APP} && %{MACRO_EXTRACT} %{DIR_DL}/%{name}-pem-20100809.tar.bz2 # Apply all patches %{MACRO_PATCHES} cp -vf %{DIR_SOURCE}/PayPalEE.cert \ %{DIR_APP}/mozilla/security/nss/tests/libpkix/certs end build make -C ./mozilla/security/coreconf make -C ./mozilla/security/dbm make -C ./mozilla/security/nss end install mkdir -pv %{BUILDROOT}/usr/include/nss3 mkdir -pv %{BUILDROOT}/usr/{bin,%{lib}} mkdir -pv %{BUILDROOT}%{libdir}/pkgconfig mkdir -pv %{BUILDROOT}%{libdir}/nss/unsupported-tools install -p -v -m 755 mozilla/dist/*.OBJ/lib/libnss3.so \ %{BUILDROOT}%{libdir} install -p -v -m 755 mozilla/dist/*.OBJ/lib/libnssckbi.so \ %{BUILDROOT}%{libdir} install -p -v -m 755 mozilla/dist/*.OBJ/lib/libnsspem.so \ %{BUILDROOT}%{libdir} install -p -v -m 755 mozilla/dist/*.OBJ/lib/libnsssysinit.so \ %{BUILDROOT}%{libdir} install -p -v -m 755 mozilla/dist/*.OBJ/lib/libsmime3.so \ %{BUILDROOT}%{libdir} install -p -v -m 755 mozilla/dist/*.OBJ/lib/libssl3.so \ %{BUILDROOT}%{libdir} # Install the empty NSS db files mkdir -pv %{BUILDROOT}/etc/pki/nssdb cp -vf %{DIR_SOURCE}/*.db %{BUILDROOT}/etc/pki/nssdb/ install -p -v -m 644 %{DIR_SOURCE}/system-pkcs11.txt \ %{BUILDROOT}/etc/pki/nssdb/pkcs11.txt # Copy the binaries we want install -p -v -m 755 mozilla/dist/*.OBJ/bin/certutil %{BUILDROOT}/usr/bin install -p -v -m 755 mozilla/dist/*.OBJ/bin/cmsutil %{BUILDROOT}/usr/bin install -p -v -m 755 mozilla/dist/*.OBJ/bin/crlutil %{BUILDROOT}/usr/bin install -p -v -m 755 mozilla/dist/*.OBJ/bin/modutil %{BUILDROOT}/usr/bin install -p -v -m 755 mozilla/dist/*.OBJ/bin/pk12util %{BUILDROOT}/usr/bin install -p -v -m 755 mozilla/dist/*.OBJ/bin/signtool %{BUILDROOT}/usr/bin install -p -v -m 755 mozilla/dist/*.OBJ/bin/signver %{BUILDROOT}/usr/bin install -p -v -m 755 mozilla/dist/*.OBJ/bin/ssltap %{BUILDROOT}/usr/bin chrpath --delete %{BUILDROOT}/usr/bin/* # Copy the binaries we ship as unsupported install -p -v -m 755 mozilla/dist/*.OBJ/bin/atob %{BUILDROOT}%{libdir}/nss/unsupported-tools install -p -v -m 755 mozilla/dist/*.OBJ/bin/btoa %{BUILDROOT}%{libdir}/nss/unsupported-tools install -p -v -m 755 mozilla/dist/*.OBJ/bin/derdump %{BUILDROOT}%{libdir}/nss/unsupported-tools install -p -v -m 755 mozilla/dist/*.OBJ/bin/ocspclnt %{BUILDROOT}%{libdir}/nss/unsupported-tools install -p -v -m 755 mozilla/dist/*.OBJ/bin/pp %{BUILDROOT}%{libdir}/nss/unsupported-tools install -p -v -m 755 mozilla/dist/*.OBJ/bin/selfserv %{BUILDROOT}%{libdir}/nss/unsupported-tools install -p -v -m 755 mozilla/dist/*.OBJ/bin/strsclnt %{BUILDROOT}%{libdir}/nss/unsupported-tools install -p -v -m 755 mozilla/dist/*.OBJ/bin/symkeyutil %{BUILDROOT}%{libdir}/nss/unsupported-tools install -p -v -m 755 mozilla/dist/*.OBJ/bin/tstclnt %{BUILDROOT}%{libdir}/nss/unsupported-tools install -p -v -m 755 mozilla/dist/*.OBJ/bin/vfyserv %{BUILDROOT}%{libdir}/nss/unsupported-tools install -p -v -m 755 mozilla/dist/*.OBJ/bin/vfychain %{BUILDROOT}%{libdir}/nss/unsupported-tools sed -e "s,@libdir@,%{libdir},g" \ -e "s,@prefix@,/usr,g" \ -e "s,@exec_prefix@,/usr,g" \ -e "s,@includedir@,/usr/include/nss3,g" \ -e "s,@MOD_MAJOR_VERSION@,$(grep "#define.*NSS_VMAJOR" mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'),g" \ -e "s,@MOD_MINOR_VERSION@,$(grep "#define.*NSS_VMINOR" mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'),g" \ -e "s,@MOD_PATCH_VERSION@,$(grep "#define.*NSS_VPATCH" mozilla/security/nss/lib/nss/nss.h | awk '{print $3}'),g" \ < %{DIR_SOURCE}/nss-config.in \ > %{BUILDROOT}/usr/bin/nss-config chmod -v 755 %{BUILDROOT}/usr/bin/nss-config install -p -v -m 755 %{DIR_SOURCE}/setup-nsssysinit.sh %{BUILDROOT}/usr/bin # Set up our package file # The nspr_version and nss_{util|softokn}_version globals used # here match the ones nss has for its Requires. # XXX need to fix this sed \ -e "s,%libdir%,%{libdir},g" \ -e "s,%prefix%,/usr,g" \ -e "s,%exec_prefix%,/usr,g" \ -e "s,%includedir%,/usr/include/nss3,g" \ -e "s,%NSS_VERSION%,%{version},g" \ -e "s,%NSPR_VERSION%,$(nspr-config --version),g" \ -e "s,%NSSUTIL_VERSION%,$(nss-util-config --version),g" \ -e "s,%SOFTOKEN_VERSION%,$(nss-softokn-config --version),g" \ < %{DIR_SOURCE}/nss.pc.in \ > %{BUILDROOT}%{libdir}/pkgconfig/nss.pc # Copy the include files we want cp -vf mozilla/dist/public/nss/*.h %{BUILDROOT}/usr/include/nss3 chmod -v 644 %{BUILDROOT}/usr/include/nss3/*.h # remove the nss-util-devel headers cd %{BUILDROOT}/usr/include/nss3 && rm -vf \ base64.h \ ciferfam.h \ nssb64.h \ nssb64t.h \ nsslocks.h \ nssilock.h \ nssilckt.h \ nssrwlk.h \ nssrwlkt.h \ nssutil.h \ pkcs11{,f,n,p,t,u}.h \ portreg.h \ secasn1.h \ secasn1t.h \ seccomon.h \ secder.h \ secdert.h \ secdig.h \ secdigt.h \ secerr.h \ secitem.h \ secoid.h \ secoidt.h \ secport.h \ utilrename.h # remove header shipped in nss-softokn-devel cd %{BUILDROOT}/usr/include/nss3 && rm -vf \ blapit.h \ ecl-exp.h \ hasht.h \ sechash.h \ secmodt.h \ shsign.h \ nsslowhash.h end end packages package %{name} package %{name}-libs template LIBS files %{libdir}/*.so end end package %{name}-devel template DEVEL requires nspr-devel %{name} nss-softokn-devel nss-util-devel end # Mozilla does no versioning :( files /usr/bin/*-config /usr/include %{libdir}/pkgconfig end end package %{name}-debuginfo template DEBUGINFO end end