Commit e1e2b1f4 authored by Natanael Copa's avatar Natanael Copa

main/nss: clean up and add -static subpackage

parent c23a77f7
......@@ -2,40 +2,35 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=nss
pkgver=3.30
_ver=${pkgver//./_}
pkgrel=0
pkgrel=1
pkgdesc="Mozilla Network Security Services"
url="http://www.mozilla.org/projects/security/pki/nss/"
arch="all"
license="MPL GPL"
options="!check"
depends=
depends_dev="nspr-dev"
makedepends="nspr-dev sqlite-dev zlib-dev perl bsd-compat-headers"
subpackages="$pkgname-dev $pkgname-tools"
source="http://ftp.mozilla.org/pub/security/$pkgname/releases/NSS_${_ver}_RTM/src/$pkgname-$pkgver.tar.gz
subpackages="$pkgname-static $pkgname-dev $pkgname-tools"
source="http://ftp.mozilla.org/pub/security/$pkgname/releases/NSS_${pkgver//./_}_RTM/src/$pkgname-$pkgver.tar.gz
nss.pc.in
nss-util.pc.in
nss-softokn.pc.in
nss-config.in
add_spi+cacert_ca_certs.patch
"
depends_dev="nspr-dev"
builddir="$srcdir/$pkgname-$pkgver"
_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
cd "$_builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
default_prepare || return 1
# Respect LDFLAGS
sed -i -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' \
nss/coreconf/rules.mk
"$builddir"/nss/coreconf/rules.mk
}
build() {
cd "$_builddir"
cd "$builddir"
unset CFLAGS
unset CXXFLAGS
export BUILD_OPT=1
......@@ -57,7 +52,7 @@ build() {
package() {
replaces="nss-dev libnss"
cd "$_builddir"
cd "$builddir"
install -m755 -d "$pkgdir"/usr/lib/pkgconfig
install -m755 -d "$pkgdir"/usr/bin
......@@ -98,13 +93,12 @@ package() {
chmod 755 "$pkgdir"/usr/bin/nss-config || return 1
local minor=${pkgver#*.}
minor=${minor%.*}
for file in libsoftokn3.so libfreebl3.so libnss3.so libnssutil3.so \
libssl3.so libsmime3.so libnssckbi.so libnssdbm3.so; do
install -m755 dist/*.OBJ/lib/${file} \
"$pkgdir"/usr/lib/${file}.$minor || return 1
ln -s $file.$minor "$pkgdir"/usr/lib/$file
for file in $(find dist/*.OBJ/lib -name "*.so"); do
install -m755 $file \
"$pkgdir"/usr/lib/${file##*/}.$minor || return 1
ln -s ${file##*/}.$minor "$pkgdir"/usr/lib/${file##*/}
done
install -m644 dist/*.OBJ/lib/libcrmf.a dist/*.OBJ/lib/libfreebl.a "$pkgdir"/usr/lib/ \
install -m644 dist/*.OBJ/lib/*.a "$pkgdir"/usr/lib/ \
|| return 1
install -m644 dist/*.OBJ/lib/*.chk "$pkgdir"/usr/lib/ \
|| return 1
......@@ -120,22 +114,16 @@ package() {
|| return 1
}
dev() {
local i= j=
depends="$pkgname $depends_dev"
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/nss-config "$subpkgdir"/usr/bin
static() {
pkgdesc="Static libraries for nss"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
}
cd "$pkgdir" || return 0
for i in usr/include usr/lib/pkgconfig usr/lib/*.a; do
if [ -e "$pkgdir/$i" ] || [ -L "$pkgdir/$i" ]; then
d="$subpkgdir/${i%/*}" # dirname $i
mkdir -p "$d"
mv "$pkgdir/$i" "$d"
rmdir "$pkgdir/${i%/*}" 2>/dev/null || true
fi
done
dev() {
default_dev || return 1
mv "$pkgdir"/usr/lib/libgtest1.* "$pkgdir"/usr/lib/libnsssysinit.* \
"$subpkgdir"/usr/lib
}
tools() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment