aboutsummaryrefslogtreecommitdiffstats
path: root/main/nspr/APKBUILD
blob: e492b23c23c79ebf4a1ba7526b1ad3150446ffb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=nspr
pkgver=4.8.6
pkgrel=5
pkgdesc="Netscape Portable Runtime"
url="http://www.mozilla.org/projects/nspr/"
arch="all"
license="MPL-1.1 GPL-2 LGPL-2.1"
depends=
makedepends="autoconf sed"
subpackages="$pkgname-dev"
source="ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v$pkgver/src/nspr-$pkgver.tar.gz
	nspr-4.7.0-prtime.patch
	nspr-4.8-sonames.patch
	nspr-4.8-config.patch
	nspr-4.8-pkgconfig-gentoo-3.patch
	nspr-bb-shell.patch
	"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	mkdir build inst
	for i in $source; do
		case $i in 
		*.patch)
			msg "Applying $i"
			patch -p1 -i "$srcdir"/$i || return 1
			;;
		esac
	done
	# respect LDFLAGS
	sed -i -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \
		mozilla/nsprpub/config/rules.mk
	cd mozilla/nsprpub && aclocal && autoconf
}

build() {
	local conf=
	if [ "$CARCH" = "x86_64" ];then
		conf="--enable-64bit"
	fi
	cd "$_builddir"/build
	../mozilla/nsprpub/configure --prefix=/usr \
		$conf \
		|| return 1
	make SO_VERSION=$pkgver CC="${CC:-gcc}" CXX="${CXX:-g++}" || return 1
}

package() {
	local file= 
	replaces="nspr-dev"

	cd "$_builddir"/build
	make SO_VERSION=$pkgver DESTDIR="$pkgdir" install || return 1

	cd "$pkgdir"/usr/lib
	rm -f *.a

	cd "$_builddir"/build/config
	install -Dm755 nspr-config "$pkgdir"/usr/bin/nspr-config || return 1
	install -Dm644 nspr.pc "$pkgdir"/usr/lib/pkgconfig/nspr.pc || return 1
	rm -rf "$pkgdir"/usr/bin/prerr.properties \
		"$pkgdir"/usr/bin/compile-et.pl \
		"$pkgdir"/usr/share/aclocal/nspr.m4 \
		"$pkgdir"/usr/include/nspr/md
}

md5sums="592c275728c29d193fdba8009165990b  nspr-4.8.6.tar.gz
c48e1f47799c1cff7e3bf46dc0e653f1  nspr-4.7.0-prtime.patch
5c9f15c65561af93ff5e148d8b64e212  nspr-4.8-sonames.patch
c790c638a7c9fd1d731272f464f065c6  nspr-4.8-config.patch
c31984cfcc167eb010aed949ace236ae  nspr-4.8-pkgconfig-gentoo-3.patch
6574eabdfbfcd246e0dfaf1aa8b0e695  nspr-bb-shell.patch"