# Contributor: Natanael Copa # Maintainer: Jakub Jirutka pkgname=lua-ossl _pkgname=luaossl pkgver=20180708 _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="b2a73a7e7ace9a01c8c5a26603107f7741de88de32c393ed9134b70d55278c81d48e357955e671654825de282449b9570ecdc6a4fbcf4890439c0200ba471338 luaossl-20180708.tar.gz"