aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-ossl/APKBUILD
blob: c733a88aee79064ca386567431d788809cb88099 (plain) (blame)
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
83
84
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-ossl
_pkgname=luaossl
pkgver=20190731
_ver=${pkgver%_git*}
pkgrel=0
pkgdesc="A comprehensive OpenSSL Lua module"
url="http://25thandclement.com/~william/projects/luaossl.html"
arch="all"
license="MIT"
makedepends="openssl-dev"
subpackages=""
checkdepends=""
source="$_pkgname-$_ver.tar.gz::https://github.com/wahern/$_pkgname/archive/rel-$pkgver.tar.gz
	0001-pkey-getPrivateKey-method.patch
	0002-pkey.getPrivateKey-encryption.patch
	0003-pkey.new-decryption.patch
	0004-pkey.getPrivateKey-use-password-callback.patch
	0005-pkey-PEM-password-callback.patch
"
builddir="$srcdir/$_pkgname-rel-$pkgver"

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_package"
	checkdepends="$checkdepends lua$_v-cqueues"
done

build() {
	cd "$builddir"

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

check() {
	# requires ffi
	rm "$builddir"/regress/104-interposition-discarded.lua

	local lver; for lver in $_luaversions; do
		msg "Checking on lua$lver..."

		# Lua sources in src/ are in non-standard layout, so we can't
		# use them directly.
		make -C "$builddir" DESTDIR="$builddir/.test$lver" install$lver

		cd "$builddir"/regress
		local file; for file in $(find . -type f -perm +111); do
			echo "$file:" >&2
			LUA_CPATH="../.test$lver/usr/lib/lua/$lver/?.so;;" \
				LUA_PATH="../.test$lver/usr/share/lua/$lver/?.lua;;" \
				lua$lver $file
		done
	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="09315deb0c40b59230d80262906cb9f067660242315544179ec5df57a028b088c56a4bb0b944e5975bccf86d521901eae36006c5623ec1159cfca94d05fb6890  luaossl-20190731.tar.gz
385ca444d860deaf22b460cba0510daf40014c5da90bafb5e0299ee173625e4ab4083dab17fcd973f816a46b3cb1d2d3d535633128462ba33f5ab9c14c2baa77  0001-pkey-getPrivateKey-method.patch
0e33d10cb40f0b4d614591a3fda3e8ddc35438a9ddd8170239e8680b831ecbfea108ff111504686fbfc8a82bc59b96bbeb166ddef2ee6e299707fb5795b4b3ce  0002-pkey.getPrivateKey-encryption.patch
c5800c658773477c967a73eb1a86d9f746a6a0821ee462e8873ac5149c0b77ef3b54ee651ea7bf5d93c42e67b8e60b449e6697c1167aa92bf73e6d65aa645205  0003-pkey.new-decryption.patch
9eb6a87241bba69fc4508fb28a95e043fea9078aa7515314e9f181fd5e0789a31715de3912e4095c7b0028c24ee9ea4061e411ffb8ae7161ba7477ee85d6609c  0004-pkey.getPrivateKey-use-password-callback.patch
e0028d4623018de3f467b405e704a8cbb9e6a2a88d12358ff26ffad1aa0d28733f55fb2ed0ead4c358b350dd702c80a3d322a70c2d4463ee58ebf68ef1a9ab6a  0005-pkey-PEM-password-callback.patch"