Commit 8b1e05fa authored by Francesco Colista's avatar Francesco Colista
Browse files

main/lua-xctrl: added support versioning and use install_if

parent 7cfe6d42
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-xctrl
pkgver=2013.06.20
pkgver=2015.04.10
_x=${pkgver%%.*}
_y=${pkgver%.*}
_y=${_y#*.}
_z=${pkgver##*.}
_ver=${_x}-${_y}-${_z}
pkgrel=1
pkgrel=2
_luaversions="5.1 5.2 5.3"
pkgdesc="Lua module that allows you to query and manipulate various aspects of an X11 window manager"
url="https://github.com/yetanothergeek/xctrl"
arch="all"
license="GPL-2"
depends=
makedepends="lua-dev libx11-dev libxmu-dev"
for _i in $_luaversions; do
makedepends="$makedepends lua$_i-dev"
subpackages="$subpackages lua$_i-xctrl:split_${_i/./_}"
done
install=
subpackages="$pkgname-doc"
source="http://xctrl.googlecode.com/files/xctrl-$_ver.tar.gz"
source="https://github.com/yetanothergeek/xctrl/archive/$pkgver.zip"
_builddir="$srcdir"/xctrl-$_ver
_builddir="$srcdir"/xctrl-$pkgver
_lua_libdir=/usr/lib/lua/5.1
prepare() {
cd "$_builddir"
}
build() {
cd "$_builddir"
export EXTRA_CFLAGS="-fPIC"
make || return 1
for _i in $_luaversions; do
msg "Build for Lua $_i"
cd "$_builddir"
export EXTRA_CFLAGS="-fPIC"
make LUAPKG="lua$_i" || return 1
done
}
package() {
cd "$_builddir"
install -d "$pkgdir"/$_lua_libdir "$pkgdir"/usr/share/doc/$pkgname
install src/xctrl.so "$pkgdir"/$_lua_libdir/xctrl.so
install doc/lxctrl.html "$pkgdir"/usr/share/doc/$pkgname/lxctrl.html
cd "$_builddir"
for _i in $_luaversions; do
install -d "$pkgdir"/usr/lib/lua/$_i "$pkgdir"/usr/share/doc/$pkgname
install src/xctrl.so "$pkgdir"/usr/lib/lua/$_i/xctrl.so
install doc/lxctrl.html "$pkgdir"/usr/share/doc/$pkgname/lxctrl.html
done
}
md5sums="789f39228436e4c806911c6cbaae444a xctrl-2013-06-20.tar.gz"
sha256sums="9089ff10f5396e0a74b3f80c03d8f54395219d72f6ea0084e2858d7195ececbf xctrl-2013-06-20.tar.gz"
sha512sums="ebfbd3b13c0d5432c71afa6bc70984c794242204c9ce9eaaf391092f7cf5c99dbe0c66335bb9c97413d304f1f77529bddf6a0f37fb10eeab5fbcb7d75dc92d48 xctrl-2013-06-20.tar.gz"
_split() {
local d=usr/lib/lua _ver=$1
pkgdesc="$pkgdesc for Lua $_ver"
install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
depends=
mkdir -p "$subpkgdir/$d" || return 1
mv "$pkgdir/$d/$1" "$subpkgdir/$d"
}
for _v in $_luaversions; do
eval "split_${_v/./_}() { _split $_v; }"
done
md5sums="7e438db4b40e8d067de78581e55fbeb2 2015.04.10.zip"
sha256sums="eaef1a1d9a20adb55c5eef81de3dea25120fde8a02e3307bd86a9ba1af0791aa 2015.04.10.zip"
sha512sums="b047173647d430cc80526d2a0c92cc1ae1006c068d57362ece2ae2e9dac550b7e55446748def1cb2c73930026f4048f9581721f2768ac79df9946483d94c09e3 2015.04.10.zip"
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