# Contributor: Natanael Copa # Maintainer: Jakub Jirutka pkgname=lua-ossl _pkgname=luaossl pkgver=20171028 _ver=${pkgver%_git*} pkgrel=2 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="8fd88650222c1cb853691a2b1b60e2a21bec112ffbf5dedb50bd2a3f87af8a5b48923d916c055f1524e7ef0bd5dd9e6bf8950d5bf564031c8cdf2c25381dc115 luaossl-20171028.tar.gz"