Commit 82e7b6d7 authored by Jakub Jirutka's avatar Jakub Jirutka

main/lua-lustache: modernize abuild, remove subpkgs, add rock_manifest

/usr/share/lua/common is now on default LUA_PATH in all Lua interpreters
we package.
parent 66573786
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
_pkgname=lustache
pkgname=lua-$_pkgname
pkgname=lua-lustache
_rockname=lustache
pkgver=1.3.1
_pkgver=$pkgver-0
pkgrel=1
pkgrel=2
pkgdesc="Logic-less {{mustache}} templates with Lua"
url="http://olivinelabs.com/lustache/"
arch="noarch"
license="MIT"
depends=""
makedepends=""
subpackages="$pkgname-common"
depends="lua"
provides="$pkgname-common=$pkgver-r$pkgrel" # for backward compatibility
replaces="$pkgname-common" # for backward compatibility
source="$pkgname-$pkgver.tar.gz::https://github.com/Olivine-Labs/$_rockname/archive/v$_pkgver.tar.gz"
builddir="$srcdir/$_rockname-$_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"
provides="$provides lua$_v-${pkgname#lua-}=$pkgver-r$pkgrel" # for backward compatibility
done
source="$pkgname-$pkgver.tar.gz::https://github.com/Olivine-Labs/$_pkgname/archive/v$_pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$_pkgver"
package() {
mkdir -p "$pkgdir"
}
common() {
cd "$builddir"
prepare() {
default_prepare
mkdir -p "$subpkgdir"/usr/share/lua/common/$_pkgname
install -m644 src/lustache/*.lua \
"$subpkgdir"/usr/share/lua/common/$_pkgname/ || return 1
install -m644 src/lustache.lua \
"$subpkgdir"/usr/share/lua/common/
find "$builddir"/src -type f -exec chmod 644 {} +
}
_package() {
local lver="${subpkgname:3:3}"
pkgdesc="$pkgdesc $lver"
depends="$pkgname-common lua$lver"
install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_pkgname/$_pkgver"
package() {
local lmod_dir="$pkgdir/usr/share/lua/common"
local rockdir="$pkgdir/usr/lib/luarocks/rocks-common/$_rockname/$_pkgver"
mkdir -p "$subpkgdir"/usr/share/lua/$lver
local path; for path in lustache lustache.lua; do
ln -s ../common/$path "$subpkgdir"/usr/share/lua/$lver/$path \
|| return 1
done
mkdir -p "$lmod_dir"
cp -r "$builddir"/src/* "$lmod_dir"/
mkdir -p "$rockdir"
echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}
md5sums="e4416abe1a822c1b2d4b3a9e702d5795 lua-lustache-1.3.1.tar.gz"
sha256sums="540bd5e1f6d32aa44d5be946d1772910fb73b62fa909ca5a026c115ece4170f0 lua-lustache-1.3.1.tar.gz"
sha512sums="f1ba0bdd38e60957df1995f32a73a16d1b430072af4e14cce530345c74d542021223c0ef41b0f997f88d762bb194fff7119701cd289e16e3e38dfe3f10d0d9d8 lua-lustache-1.3.1.tar.gz"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment