# Maintainer: Natanael Copa pkgname=lua-penlight pkgver=1.3.1 pkgrel=3 pkgdesc="Lua libraries for extended operations on tables, lists and strings" url="http://stevedonovan.github.io/Penlight" arch="noarch" license="MIT" depends="lua5.1-penlight lua5.2-penlight" makedepends="" install= subpackages="$pkgname-doc $pkgname-shared lua5.1-penlight:_51 lua5.2-penlight:_52" source="penlight-$pkgver.tar.gz::https://github.com/stevedonovan/Penlight/archive/$pkgver.tar.gz" _builddir="$srcdir"/Penlight-$pkgver build() { cd "$_builddir" # fix permissions of scripts chmod -x lua/pl/*.lua } package() { cd "$_builddir" mkdir -p "$pkgdir"/usr/share/lua/common/ \ "$pkgdir"/usr/share/lua/5.1/ \ "$pkgdir"/usr/share/lua/5.2/ \ "$pkgdir"/usr/share/doc/$pkgname cp -r lua/pl "$pkgdir"/usr/share/lua/common/ || return 1 cp -r examples "$pkgdir"/usr/share/doc/$pkgname/ ln -s ../common/pl "$pkgdir"/usr/share/lua/5.1/pl ln -s ../common/pl "$pkgdir"/usr/share/lua/5.2/pl } shared() { pkgdesc="penlight files that are shared for all supported Lua versions" depends= mkdir -p "$subpkgdir"/usr/share/lua/ mv "$pkgdir"/usr/share/lua/common "$subpkgdir"/usr/share/lua/ } _52() { pkgdesc="Lua 5.2 libraries for extended operations on tables, lists and strings" depends="lua-penlight-shared lua5.2-filesystem" mkdir -p "$subpkgdir"/usr/share/lua/ mv "$pkgdir"/usr/share/lua/5.2 "$subpkgdir"/usr/share/lua/ } _51() { pkgdesc="Lua 5.1 libraries for extended operations on tables, lists and strings" replaces="lua-penlight" depends="lua-penlight-shared lua5.1-filesystem" mkdir -p "$subpkgdir"/usr/share/lua/ mv "$pkgdir"/usr/share/lua/5.1 "$subpkgdir"/usr/share/lua/ } md5sums="831f8ce7d3d5c872d129ad5db54a8424 penlight-1.3.1.tar.gz" sha256sums="0f96ef033d9623ffd561a77088ac5adfd87b35a711fbf34815284d671cf4677c penlight-1.3.1.tar.gz" sha512sums="f37972beb6237b3a04ee3be80f43dd33b1f70cd821b05b88d0e3a8271927b32ab73fd4b51332b196e0f22fad4d929ae3024d64cc342f2c2c1032d982dbc2eecb penlight-1.3.1.tar.gz"