# Maintainer: Natanael Copa pkgname=lua-posix _name=luaposix pkgver=5.1.21 pkgrel=0 pkgdesc="POSIX library for Lua" url="https://github.com/luaposix/luaposix" arch="all" license="MIT" depends="lua" makedepends="lua-dev perl ncurses-dev" source="https://github.com/downloads/luaposix/luaposix/luaposix-$pkgver.tar.gz" replaces="luaposix" subpackages="curses" _builddir="$srcdir"/$_name-$pkgver _lualib=/usr/lib/lua/5.1 _luashare=/usr/share/lua/5.1 build() { cd "$_builddir" ./configure --prefix=/usr \ --libdir=$_lualib \ --datadir=$_luashare \ || return 1 make || return 1 } package() { cd "$_builddir" make DESTDIR="$pkgdir" install || return 1 rm "$pkgdir"/$_lualib/*.la || return 1 } curses() { pkgdesc="ncurses binding for Lua" mkdir -p "$subpkgdir"/$_lualib "$subpkgdir"/$_luashare mv "$pkgdir"/$_lualib/curses* "$subpkgdir"/$_lualib/ || return 1 mv "$pkgdir"/$_luashare/curses* "$subpkgdir"/$_luashare/ || return 1 } md5sums="7bc06747199f6bd2994ed5a7b2bdf089 luaposix-5.1.21.tar.gz"