void-packages/srcpkgs/nss/template

103 lines
2.8 KiB
Plaintext

# Template file for 'nss'
pkgname=nss
version=3.15.2
_distver="3_15_2"
revision=1
hostmakedepends="perl"
makedepends="nspr-devel>=4.10 sqlite-devel"
short_desc="Mozilla Network Security Services"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://www.mozilla.org/projects/security/pki/nss/"
license="GPL-2, MPL-1.1"
distfiles="${MOZILLA_SITE}/security/nss/releases/NSS_${_distver}_RTM/src/nss-${version}.tar.gz"
checksum=7b2c80d18c49581edbdb509cbf7afd61d8c53658f2a38ff20e224c1909faeddc
do_build() {
# Respect LDFLAGS
sed -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' -i nss/coreconf/rules.mk
export LIBRUNPATH=
export BUILD_OPT=1
export NSS_USE_SYSTEM_SQLITE=1
export NSS_ENABLE_ECC=1
export NSPR_INCLUDE_DIR=/usr/include/nspr
export NSPR_LIB_DIR=/usr/lib
export XCFLAGS="${CFLAGS}"
if [ "$XBPS_MACHINE" = "x86_64" ]; then
export USE_64=1
fi
cd nss
make -C coreconf
make -C lib/dbm
make
}
do_install() {
vmkdir usr/lib/pkgconfig
vmkdir usr/bin
vmkdir usr/include/nss
NSS_VMAJOR=$(grep "#define.*NSS_VMAJOR" nss/lib/nss/nss.h | awk '{print $3}')
NSS_VMINOR=$(grep "#define.*NSS_VMINOR" nss/lib/nss/nss.h | awk '{print $3}')
NSS_VPATCH=$(grep "#define.*NSS_VPATCH" nss/lib/nss/nss.h | awk '{print $3}')
sed ${FILESDIR}/nss.pc.in \
-e "s,%libdir%,/usr/lib,g" \
-e "s,%prefix%,/usr,g" \
-e "s,%exec_prefix%,/usr/bin,g" \
-e "s,%includedir%,/usr/include/nss,g" \
-e "s,%NSPR_VERSION%,${version},g" \
-e "s,%NSS_VERSION%,${version},g" > \
${DESTDIR}/usr/lib/pkgconfig/nss.pc
ln -sf nss.pc ${DESTDIR}/usr/lib/pkgconfig/mozilla-nss.pc
chmod 644 ${DESTDIR}/usr/lib/pkgconfig/*.pc
sed ${FILESDIR}/nss-config.in \
-e "s,@libdir@,/usr/lib,g" \
-e "s,@prefix@,/usr/bin,g" \
-e "s,@exec_prefix@,/usr/bin,g" \
-e "s,@includedir@,/usr/include/nss,g" \
-e "s,@MOD_MAJOR_VERSION@,${NSS_VMAJOR},g" \
-e "s,@MOD_MINOR_VERSION@,${NSS_VMINOR},g" \
-e "s,@MOD_PATCH_VERSION@,${NSS_VPATCH},g" \
> ${DESTDIR}/usr/bin/nss-config
chmod 755 ${DESTDIR}/usr/bin/nss-config
for f in libsoftokn3.so libfreebl3.so libnss3.so libnssutil3.so \
libssl3.so libsmime3.so libnssckbi.so libnssdbm3.so; do
install -m755 dist/*.OBJ/lib/${f} ${DESTDIR}/usr/lib
done
install -m644 dist/*.OBJ/lib/libcrmf.a ${DESTDIR}/usr/lib
install -m644 dist/*.OBJ/lib/*.chk ${DESTDIR}/usr/lib
for f in certutil cmsutil crlutil modutil pk12util shlibsign \
signtool signver ssltap; do
install -m755 dist/*.OBJ/bin/${f} ${DESTDIR}/usr/bin
done
install -m644 dist/public/nss/*.h ${DESTDIR}/usr/include/nss
}
nss-devel_package() {
depends="nspr-devel>=4.10 nss-${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/bin/nss-config
vmove usr/lib/pkgconfig
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/*.chk"
}
}
nss_package() {
depends="nspr>=4.10"
pkg_install() {
vmove all
}
}