aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-04-16 20:30:44 +0200
committerJakub Jirutka <jakub@jirutka.cz>2018-04-16 20:36:11 +0200
commitb106a06b4e1fbaf82a3def3cf620e81e9fe63292 (patch)
tree342efb063a3ea2cd0a7bccb4af9d4de3012c0cd3
parent65c462a1b63e2b67aba6da7681a5b6aaf9bfb7b7 (diff)
downloadaports-b106a06b4e1f.tar.gz
aports-b106a06b4e1f.tar.bz2
aports-b106a06b4e1f.tar.xz
main/lua-penlight: modernize abuild, remove subpkgs, add rock_manifest
/usr/share/lua/common is now on default LUA_PATH in all Lua interpreters we package.
-rw-r--r--main/lua-penlight/APKBUILD66
1 files changed, 21 insertions, 45 deletions
diff --git a/main/lua-penlight/APKBUILD b/main/lua-penlight/APKBUILD
index e2498dba35..f1a020e872 100644
--- a/main/lua-penlight/APKBUILD
+++ b/main/lua-penlight/APKBUILD
@@ -1,61 +1,37 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-_luaversions="5.1 5.2 5.3"
pkgname=lua-penlight
+_rockname=penlight
pkgver=1.5.4
-pkgrel=0
+pkgrel=1
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"
+depends="lua"
+provides="$pkgname-shared=$pkgver-r$pkgrel" # for backward compatibility
+replaces="$pkgname-shared" # for backward compatibility
+subpackages="$pkgname-doc"
+source="$_rockname-$pkgver.tar.gz::https://github.com/stevedonovan/Penlight/archive/$pkgver.tar.gz"
+builddir="$srcdir/Penlight-$pkgver"
+
+_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
- makedepends="$makedepends lua$_v-dev lua$_v-filesystem"
- subpackages="$subpackages lua$_v-penlight:split_${_v/./_}"
+ provides="$provides lua$_v-${pkgname#lua-}=$pkgver-r$pkgrel" # for backward compatibility
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
-}
+ local lmod_dir="$pkgdir/usr/share/lua/common"
+ local rockdir="$pkgdir/usr/lib/luarocks/rocks-common/$_rockname/$pkgver-1"
+ local docdir="$pkgdir/usr/share/doc/$pkgname"
-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/
-}
+ cd "$builddir"
-_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/
-}
+ mkdir -p "$lmod_dir" "$docdir"
+ cp -r lua/pl "$lmod_dir"/
+ cp -r examples "$docdir"/
-for _v in $_luaversions; do
- eval "split_${_v/./_}() { _split $_v; }"
-done
+ mkdir -p "$rockdir"
+ echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
+}
sha512sums="c46e7875410a90390bfbf010a53f1d536475e2094668722618d03951caad0fcb0674c9bc7119a0753e4ed3df9e4d70fef828ba4c6c24e8ada4036948d2432519 penlight-1.5.4.tar.gz"