aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-ossl/APKBUILD
blob: 79e897b0756463a2dee5aa3a963e12f7c5bf8ced (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"
pkgname=lua-ossl
pkgver=20140718
_ver=${pkgver%_git*}
pkgrel=2
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
	depends="$depends lua$_v-ossl"
	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
	0001-parse-CRLs-from-PEM-and-DER-formats.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"
	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="38d7c4527580e03335299349be4d70bc  luaossl-20140718.tar.gz
7d03f360ebc62b60279ff0f2066ed6f6  musl-fixes.patch
0ec967f53f6abaac1c9143338811e160  0001-parse-CRLs-from-PEM-and-DER-formats.patch"
sha256sums="5711dc079ecb2c01b6a5eb753839efbb599ee92ce0bd971ea55fe696d0bb39e0  luaossl-20140718.tar.gz
49694f9ab7f7a90074471d8e55580f13ff8fc6f7a158a5793f8d55df11147c0e  musl-fixes.patch
227756f93b4db793dbbfbd05f576531a032c4c3e6356e91f774e7663101a16c9  0001-parse-CRLs-from-PEM-and-DER-formats.patch"
sha512sums="5944ff745e08472e2be6b95c1fabdaaed46aeae8221d4e59fdbe8b8a4ee70368eb1d9cd39f619274a20151a46f5882445c89f69fc83cc54d812c01908ba1123d  luaossl-20140718.tar.gz
370467081c87c0e4b0c96a72ff81918d3d492dfa90578b34f51004461d9a983ffd486accb44471a34d092b1a08743ad60462c6937096f80f72a39a335ccd81be  musl-fixes.patch
d01c2b5efc95d6ddd79456ce6bfcce366b2863a10dfaed48b7dbe6f881da318b2e69a93ca64bbdba6a1dadcabbbefd398569c37364e7f87331d307eed311d55c  0001-parse-CRLs-from-PEM-and-DER-formats.patch"