aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-ossl/APKBUILD
blob: 96ec7bbfff22fb36fe65ff9fac0a684069e16ecd (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
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>

_luaversions="5.1 5.2 5.3"
pkgname=lua-ossl
_pkgname=luaossl
pkgver=20161214
_ver=${pkgver%_git*}
pkgrel=1
pkgdesc="A comprehensive OpenSSL Lua module"
url="http://25thandclement.com/~william/projects/luaossl.html"
arch="all"
license="MIT"
depends=""
makedepends="libressl-dev"
subpackages=""
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_package"
done
source="luaossl-$_ver.tar.gz::https://github.com/wahern/$_pkgname/archive/rel-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-rel-$pkgver"

build() {
	cd "$builddir"

	make config prefix=/usr || return 1
	local lver; for lver in $_luaversions; do
		make openssl$lver || return 1
	done
}

package() {
	mkdir -p "$pkgdir"
}

_package() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc for Lua $lver"
	depends="lua$lver"
	install_if="lua$lver $pkgname=$pkgver-r$pkgrel"
	local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_pkgname/$pkgver-1"

	cd "$builddir"
	make DESTDIR="$subpkgdir" install$lver

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}

sha512sums="4fd0685ae80fc6f999d806adb9e67016ddca5175e8ee0fedeaae3dace709157bfd87cdbeb6d808a0539c53be60193e1ac805358a7ea2f21246c19a8b6a7d7264  luaossl-20161214.tar.gz"