summaryrefslogtreecommitdiffstats
path: root/main/nspr/APKBUILD
blob: 30a390dbb7afa172a5e1d96be863bd13c5fa6de1 (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
75
76
77
78
79
80
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=nspr
pkgver=4.9.5
pkgrel=0
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 automake 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-config.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 && rm -f aclocal.m4 && aclocal && autoconf
}

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

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

	cd "$_builddir"/build
	make 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="b6ccfa8fcbbeb17ebeb19a3edff612bd  nspr-4.9.5.tar.gz
c48e1f47799c1cff7e3bf46dc0e653f1  nspr-4.7.0-prtime.patch
c790c638a7c9fd1d731272f464f065c6  nspr-4.8-config.patch
6574eabdfbfcd246e0dfaf1aa8b0e695  nspr-bb-shell.patch"
sha256sums="616ab65c849155c9ed0e5f502530a241cc9108e278275aa448b417ae632c7604  nspr-4.9.5.tar.gz
6eac39e0f7bac2eaf38ce918547345e02c61c1236b8db186f495072a6c014709  nspr-4.7.0-prtime.patch
18c730e1e02d23b64f10f72b18b6887ead49b7d032afd44a86902ce0680cbd60  nspr-4.8-config.patch
067642b22a49e2feb15a9bab7cf4634df1873218f378affb4f6798e3664f3a31  nspr-bb-shell.patch"
sha512sums="cbe60e4c5265863fa3250d7c16a2727d3a4a8762d17bc63d044ec88d11758fe9f54f54c08e198db6278ee68c55edd88f7c4bc5db9bdc46bdea4e4cf9eb277f27  nspr-4.9.5.tar.gz
f66eeadfef56a63214c069b71da11d425644ca1db13ac803cf07c76cb68f47ec0f919d342a5c5f8d1d6c29d0438390b29885f4d0936fbbef1904e3c60e45f6a1  nspr-4.7.0-prtime.patch
0e34d2729cb9cc2b4d977f59f4b2676be9f71a644eae429da85b416446c3665ffb6ca34fd6e9229ac9c923287a9147e3440f88e2998bc88a1f9d3f41b4e7e779  nspr-4.8-config.patch
cdf5f4eec6ed0a103d6cd328fcadb65dc37291e31bacccf30875259a0b22cfc04d7fbcab90a4602cc3b9b37a401016eb64f8b7a3e747430fe98843a5ec722e0a  nspr-bb-shell.patch"