# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka setvar pkgname = 'lua-argparse' setvar _pkgname = 'argparse' setvar pkgver = '0.5.0' setvar pkgrel = '1' setvar pkgdesc = ""Feature-rich command line parser for Lua"" setvar url = ""https://github.com/mpeterv/argparse"" setvar arch = ""noarch"" setvar license = ""MIT"" setvar depends = """" setvar checkdepends = ""lua-busted"" setvar subpackages = """" setvar source = ""$pkgname-$pkgver.tar.gz::https://github.com/mpeterv/$_pkgname/archive/$pkgver.tar.gz"" setvar builddir = ""$srcdir/$_pkgname-$pkgver"" # luajit is not available for selected arches case (CARCH) { s390x { setvar _luajit = """"} * { setvar checkdepends = ""$checkdepends luajit"," _luajit = ""jit""} } setvar _luaversions = ""5.1 5.2 5.3"" for _v in $_luaversions { setvar subpackages = ""$subpackages lua$_v-${pkgname#lua-}:_subpackage"" setvar checkdepends = ""$checkdepends lua$_v"" } proc check { cd $builddir mkdir .bin local lver; for lver in $_luaversions $_luajit { msg "Testing on lua$lver" ln -sf /usr/bin/lua$lver .bin/lua" LUA_PATH="$builddir/src/?.lua;;""" \ PATH="$builddir/.bin:$PATH"" \ lua /usr/bin/busted } } proc package { mkdir -p $pkgdir } proc _subpackage { local lver="${subpkgname:3:3}" setvar pkgdesc = ""$pkgdesc $lver"" setvar depends = ""lua$lver"" setvar install_if = ""$pkgname=$pkgver-r$pkgrel lua$lver"" local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_pkgname/$pkgver-1" cd $builddir install -D -m 644 src/argparse.lua \ "$subpkgdir"/usr/share/lua/$lver/argparse.lua mkdir -p $rockdir echo 'rock_manifest = {}' > "$rockdir"/rock_manifest } setvar sha512sums = ""29ab0d53a985fee135ff8f4237129df338b9fcea3da7c10450bab8de4f7fde64f96bf863c97dc403388c21551a66280049c6f49531c5ea483f3fa0801e685422 lua-argparse-0.5.0.tar.gz""