summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c5c6ca1fae9ed6cb54f6230deff18ad84f31ecbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Maintainer: Stephen Smith <stephen304@gmail.com>

pkgname=('lua-inifile' 'lua51-inifile' 'lua52-inifile')
pkgbase=lua-inifile
_rockname=inifile
pkgver=1.0
pkgrel=1
pkgdesc="Inifile is a simple, complete ini parser for lua"
arch=('i686' 'x86_64')
url="http://docs.bartbes.com/inifile"
license=('BSD')
source=("${_rockname}-${pkgver}.tar.gz::https://github.com/bartbes/inifile/archive/v${pkgver}.tar.gz")
md5sums=('33e5b3e8eb9f4e2430cfb548e6f6d6fe')

_package_helper() {
  _lua_ver=$1

  mkdir -p "$_lua_ver"
  cd "$_rockname-$pkgver"
  luarocks-${_lua_ver} make --pack-binary-rock --deps-mode=none "$_rockname-$pkgver-2.rockspec"
  mv *.rock ../${_lua_ver}/
  luarocks-${_lua_ver} install --tree="$pkgdir/usr/" --deps-mode=none ../${_lua_ver}/*.rock
  find "$pkgdir/usr" -name manifest -delete
}

package_lua51-inifile() {
  depends=('lua51' 'luarocks5.1')

  _package_helper "5.1"
}

package_lua52-inifile() {
  depends=('lua52' 'luarocks5.2')

  _package_helper "5.2"
}

package_lua-inifile() {
  depends=('lua' 'luarocks')

  _package_helper "5.3"
}