# Contributor: Natanael Copa # Maintainer: Jakub Jirutka pkgname=lua-ossl _pkgname=luaossl pkgver=20180530 _ver=${pkgver%_git*} pkgrel=0 pkgdesc="A comprehensive OpenSSL Lua module" url="http://25thandclement.com/~william/projects/luaossl.html" arch="all" license="MIT" depends="" makedepends="libressl-dev" subpackages="" source="$_pkgname-$_ver.tar.gz::https://github.com/wahern/$_pkgname/archive/rel-$pkgver.tar.gz" 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" done build() { cd "$builddir" make config prefix=/usr local lver; for lver in $_luaversions; do make openssl$lver done } check() { 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="ebccd65d1887986dac5dc64a7fcd778a60b7cd9a4631ffc8e6337fc9ee1ee15207c84b31c13c363befd7aedb0200c2ff1441ee84a057373530c76b2799f1e04e luaossl-20180530.tar.gz"