aboutsummaryrefslogtreecommitdiffstats
path: root/testing/erlang/APKBUILD
blob: 25ba6741ae4a1782e57744a32d47fa1f5cdc742c (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
# Contributor: Michael Mason <ms13sp@gmail.com>
# Maintainer: Michael Mason <ms13sp@gmail.com>

# TODO: create subpackages
# Check how fedora does it:
# http://pkgs.fedoraproject.org/gitweb/?p=erlang.git;a=blob;f=erlang.spec

pkgname=erlang
pkgver=16.2.01
# note: versioning scheme is weird. the .2. -> B
# needs to be updated manually
_ver=${pkgver%%.*}B01
#_ver=${pkgver%%.*}B${pkgver##*.}
pkgrel=0
pkgdesc="General-purpose programming language and runtime environment"
url="http://www.erlang.org/"
license="ERPL"
arch="all"
depends=""
makedepends="perl-dev zlib-dev ncurses-dev openssl-dev"
install=""
subpackages="$pkgname-dev"
# Patches found: http://pkgs.fedoraproject.org/gitweb/?p=erlang.git;a=tree
source="http://www.erlang.org/download/otp_src_R$_ver.tar.gz
		otp-0002-Remove-rpath.patch
		otp-0003-Do-not-install-C-sources.patch"

_builddir="$srcdir"/otp_src_R$_ver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	# remove shipped zlib sources
	rm -f erts/emulator/zlib/*.[ch]

	# Fix 664 file mode
	chmod 644 lib/kernel/examples/uds_dist/c_src/Makefile
	chmod 644 lib/kernel/examples/uds_dist/src/Makefile
	chmod 644 lib/ssl/examples/certs/Makefile
	chmod 644 lib/ssl/examples/src/Makefile

	# Remove old txt files
	rm -f lib/ssl/examples/certs/etc/otpCA/index.txt.old
	rm -f lib/ssl/examples/certs/etc/erlangCA/index.txt.old
}

build() {
	cd "$_builddir"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-threads \
		--enable-shared-zlib \
		--enable-ssl=dynamic-ssl-lib \
		|| return 1
	make -j1 || return 1
}

package() {
	cd "$_builddir"
	make -j1 DESTDIR="$pkgdir" install || return 1
}

md5sums="266b95db35560e505c9f69cc3e539e41  otp_src_R16B01.tar.gz
2978a60b60f62ad7e46834489e81d06a  otp-0002-Remove-rpath.patch
10d9990675b1be003ead2a8862fc4fe6  otp-0003-Do-not-install-C-sources.patch"
sha256sums="da388bc07b8ebdd008f5bb6c3d2c280e358bd188b5aac3ea01e3a7436315abc0  otp_src_R16B01.tar.gz
d7c494ba1f37e2f3d45d7455c8d771268bcbeba2143078b51d42ffa874a34761  otp-0002-Remove-rpath.patch
98de7e14f9d8e94c3a2d117125048f1f4c1bff242112e3149cd775a967fb6d6f  otp-0003-Do-not-install-C-sources.patch"
sha512sums="61b5f5370d5e88c7b5ad662ea71a16e910d16e5d5fe4ec9550947e0ca5824f23fdca268c64b3e70e815b4da08a08a27a5f83017d8fe306a4e62cae6c85a4812f  otp_src_R16B01.tar.gz
f1c5251d8f532322bd8cdd1fba3104ec2916dfaad42026112f1ea59bcf081725781b51f8c6c3bb3bf6af9d404e343bd0e22c3266ff2797ec01ffc91c92fdba4a  otp-0002-Remove-rpath.patch
e2ec4488ce5587e2a5af67a11aca2c619db7056cbc37520ff054123faee878fb9f726a34719013245d7cfc2ec23362207018efa5bf73f98387fbd1b53b02c014  otp-0003-Do-not-install-C-sources.patch"