mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-29 05:12:18 +01:00
64 lines
2.0 KiB
Plaintext
64 lines
2.0 KiB
Plaintext
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
|
_luaversions="5.1 5.2 5.3"
|
|
pkgname=lua-penlight
|
|
pkgver=1.4.1
|
|
pkgrel=0
|
|
pkgdesc="Lua libraries for extended operations on tables, lists and strings"
|
|
url="http://stevedonovan.github.io/Penlight"
|
|
arch="noarch"
|
|
license="MIT"
|
|
depends=""
|
|
makedepends=""
|
|
install=
|
|
subpackages="$pkgname-doc $pkgname-shared"
|
|
for _v in $_luaversions; do
|
|
makedepends="$makedepends lua$_v-dev lua$_v-filesystem"
|
|
subpackages="$subpackages lua$_v-penlight:split_${_v/./_}"
|
|
done
|
|
|
|
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/doc/$pkgname
|
|
cp -r lua/pl "$pkgdir"/usr/share/lua/common/ || return 1
|
|
cp -r examples "$pkgdir"/usr/share/doc/$pkgname/
|
|
for i in $_luaversions; do
|
|
mkdir -p "$pkgdir"/usr/share/lua/$i || return 1
|
|
ln -s ../common/pl "$pkgdir"/usr/share/lua/$i/pl || return 1
|
|
done
|
|
}
|
|
|
|
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/
|
|
}
|
|
|
|
_split() {
|
|
local _ver="$1"
|
|
pkgdesc="Lua $_ver libraries for extended operations on tables, lists and strings"
|
|
depends="lua-penlight-shared lua$_ver-filesystem"
|
|
install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
|
|
mkdir -p "$subpkgdir"/usr/share/lua/
|
|
mv "$pkgdir"/usr/share/lua/$_ver "$subpkgdir"/usr/share/lua/
|
|
}
|
|
|
|
for _v in $_luaversions; do
|
|
eval "split_${_v/./_}() { _split $_v; }"
|
|
done
|
|
|
|
md5sums="5426a746dc7a9ab3b3b2e576cc4e167b penlight-1.4.1.tar.gz"
|
|
sha256sums="e530b7917e91ce1e2d5210b305e5db32a84c301c455769456c866a84589903be penlight-1.4.1.tar.gz"
|
|
sha512sums="ed34c119a43bb9b8baf0cf570ace3d175bd0beeacb250a5d5ee3efe5782864b79a8f5b7e92bd1e676a369ec32def29a1c5b0a7d77b1c665a22c1e69a4904abd4 penlight-1.4.1.tar.gz"
|