diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-04-16 21:18:53 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2018-04-16 21:20:06 +0200 |
commit | 82e7b6d7c0e7ae95c8da189967fd975252b9c631 (patch) | |
tree | b88facccf779047d66816ede8d619f1ff365f339 | |
parent | 66573786035dbcffd144dcbc503943b7ee23c821 (diff) | |
download | aports-82e7b6d7c0e7ae95c8da189967fd975252b9c631.tar.bz2 aports-82e7b6d7c0e7ae95c8da189967fd975252b9c631.tar.xz |
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.
-rw-r--r-- | main/lua-lustache/APKBUILD | 54 |
1 files changed, 19 insertions, 35 deletions
diff --git a/main/lua-lustache/APKBUILD b/main/lua-lustache/APKBUILD index 8c4860294b..af0a3d6744 100644 --- a/main/lua-lustache/APKBUILD +++ b/main/lua-lustache/APKBUILD @@ -1,55 +1,39 @@ # 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" |