aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-ossl/APKBUILD
blob: 359e214d87f51d6caabfc33830537eaf05f3dc01 (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
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer:

_luaversions="5.1 5.2 5.3"
pkgname=lua-ossl
pkgver=20150504
_ver=${pkgver%_git*}
pkgrel=0
pkgdesc="comprehensive OpenSSL Lua module"
url="http://25thandclement.com/~william/projects/luaossl.html"
arch="all"
license="MIT"
depends=""
depends_dev=""
makedepends="$depends_dev openssl-dev"
install=""
subpackages=""

for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-ossl:split_${_v/./_}"
done

source="luaossl-$_ver.tar.gz::https://github.com/wahern/luaossl/archive/rel-$_ver.tar.gz
	musl-fixes.patch
	"

_builddir="$srcdir"/luaossl-rel-$_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
}

build() {
	cd "$_builddir"
	make config prefix=/usr || return 1
	for _v in $_luaversions; do
		make openssl$_v || return 1
	done
}

package() {
	cd "$_builddir"
	for _v in $_luaversions; do
		make DESTDIR="$pkgdir" install$_v || return 1
	done
	rm -f "$pkgdir"/usr/lib/*.la
}

_split() {
	local d= _ver=$1
	pkgdesc="$pkgdesc for Lua $_ver"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	depends=
	for d in usr/lib/lua usr/share/lua; do
		if [ -d "$pkgdir"/$d/$_ver ]; then
			mkdir -p "$subpkgdir"/$d
			mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1
		fi
	done
}


for _v in $_luaversions; do
	eval "split_${_v/./_}() { _split $_v; }"
done

md5sums="b35a44550bc25569d7f35a49f19f320c  luaossl-20150504.tar.gz
7d03f360ebc62b60279ff0f2066ed6f6  musl-fixes.patch"
sha256sums="1c6b7c3dd81438431fa0a6c4be18683ccfcb23c1d6c26643863fc9fcaedd982f  luaossl-20150504.tar.gz
49694f9ab7f7a90074471d8e55580f13ff8fc6f7a158a5793f8d55df11147c0e  musl-fixes.patch"
sha512sums="97bd085059c0e4773dbf25c1f9c9c282034c900b65d59c6457c0da2b653315fd521e1f52913e580199d322d9ffb2d273badc9761c5104deed6ea5970c1cdda76  luaossl-20150504.tar.gz
370467081c87c0e4b0c96a72ff81918d3d492dfa90578b34f51004461d9a983ffd486accb44471a34d092b1a08743ad60462c6937096f80f72a39a335ccd81be  musl-fixes.patch"