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

_luaversions="5.1 5.2 5.3"
pkgname=lua-ossl
pkgver=20141028
_ver=${pkgver%_git*}
pkgrel=1
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/deb-$_ver-0.tar.gz
	musl-fixes.patch
	fix-lua5.3.patch
	"

_builddir="$srcdir"/luaossl-deb-$_ver-0
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="0f90d964b9a058b1ee7d56be545d54ab  luaossl-20141028.tar.gz
7d03f360ebc62b60279ff0f2066ed6f6  musl-fixes.patch
b8633e15b72e4e3b7ded22b1d7ca25a0  fix-lua5.3.patch"
sha256sums="f4b64936a8ba1792fed14331cf7856646700833e5276a096ef5c6410cd9393c2  luaossl-20141028.tar.gz
49694f9ab7f7a90074471d8e55580f13ff8fc6f7a158a5793f8d55df11147c0e  musl-fixes.patch
f525bd6983418d68b2f9edf1b4653d0003c99f58240e601dfa5fd9bd086f43ed  fix-lua5.3.patch"
sha512sums="8edcb77becb4994c8d2ef0144a45eafcfccf7dca0d78940cf35a4bdbb2daec4be5c4a3a758e2a8ead2e6c395795a44f5b5061f05d1e2149600d48fec09bdf3fc  luaossl-20141028.tar.gz
370467081c87c0e4b0c96a72ff81918d3d492dfa90578b34f51004461d9a983ffd486accb44471a34d092b1a08743ad60462c6937096f80f72a39a335ccd81be  musl-fixes.patch
29424d2d1cd50f5a0d9dc087583a976cccec738aaaef1d96cc9555ea59193c3affad3fb331c3acb35577a7df453ca85f36b9537d15b778aade67a6f80d8b73af  fix-lua5.3.patch"