diff options
Diffstat (limited to 'main/lua-zmq/APKBUILD')
-rw-r--r-- | main/lua-zmq/APKBUILD | 64 |
1 files changed, 48 insertions, 16 deletions
diff --git a/main/lua-zmq/APKBUILD b/main/lua-zmq/APKBUILD index bf80a51b8..4eb764808 100644 --- a/main/lua-zmq/APKBUILD +++ b/main/lua-zmq/APKBUILD @@ -1,48 +1,80 @@ # Contributor: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> + +_luaversions="5.1 5.2" + pkgname=lua-zmq -pkgver=1.1_git20121231 +pkgver=1.1_git20130709 _ver=${pkgver%_git*} pkgrel=0 pkgdesc="Lua zeromq2 binding" url="https://github.com/Neopallium/lua-zmq" arch="all" license="MIT" -depends="lua-llthreads" -makedepends="zeromq-dev cmake lua-dev" +depends="lua-llthreads lua5.1-zmq" +makedepends="zeromq-dev cmake" +for _i in $_luaversions; do + makedepends="$makedepends lua$_i-dev" + subpackages="$subpackages lua$_i-zmq:split_${_i/./_}" +done install="" -subpackages= source="$pkgname-$_ver.tar.gz::https://github.com/Neopallium/lua-zmq/archive/v$_ver.tar.gz git-${pkgver##*_git}.patch" -_builddir="$srcdir"/lua-zmq-$_ver +_sdir="$srcdir"/lua-zmq-$_ver prepare() { local i - cd "$_builddir" + cd "$_sdir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done + for _i in $_luaversions; do + mkdir -p "$srcdir"/build-$_i || return 1 + done } build() { - cd "$_builddir" - cmake \ - -DCMAKE_INSTALL_PREFIX=/usr \ - . || return 1 - make || return 1 + for _i in $_luaversions; do + cd "$srcdir"/build-$_i + msg "build for Lua $_i" + CFLAGS="$CFLAGS $(pkg-config --cflags lua$_i)" cmake \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DINSTALL_CMOD=/usr/lib/lua/$_i \ + -DINSTALL_LMOD=/usr/share/lua/$_i \ + "$_sdir" || return 1 + make || return 1 + done } package() { - cd "$_builddir" - make install DESTDIR="$pkgdir" || return 1 + for _i in $_luaversions; do + cd "$srcdir"/build-$_i + make install DESTDIR="$pkgdir" || return 1 + done } +_split() { + local d= _ver=$1 + pkgdesc="Filesystem functions for Lua $_ver" + replaces="$pkgname" + for d in usr/lib/lua usr/share/lua; do + if [ -d "$pkgdir"/$d/$_ver ]; then + mkdir -p "$subpkgdir"/$d + mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1 + fi + done +} + +for _i in $_luaversions; do + eval "split_${_i/./_}() { _split $_i; }" +done + md5sums="cb4df81b4c884bf97bf6add88fcfa58d lua-zmq-1.1.tar.gz -e568cb33eef6230454a70dddfd5d3978 git-20121231.patch" +e68a07c32d77fbea78165d6ae49027cb git-20130709.patch" sha256sums="f2bdf3142b744971da4eb8bdb12020a34b62f8ba384be44d8448b4ef05ec3dcc lua-zmq-1.1.tar.gz -9f3b2ddd87c0fd7064a317e5ed63c16c4d1999b020f3d98970f1c5962ed34354 git-20121231.patch" +f0266865ac2ebc10e74877686e8536caec88db286408170b22543243235fa608 git-20130709.patch" sha512sums="35d7da6215a96b80ea59b52591082473d2c54bcb9577ae95ead1235de894d5ef226b6c4e3030c327b2b146e07af6b3998d91c5b520dfb35e87c85e958069362d lua-zmq-1.1.tar.gz -12ff90d9b01ca03f8c9f8e02e1392de839c19242570acb77d5078e4358a89dabe3df6f6b701a30b95121b35ed09a72eedd0259c34b2663e5193a963c588be64c git-20121231.patch" +c9080a53b3f6f63a03bc105fc2d49bdf664fccfdcd35414f21972cee30db466744024727418491dbff6ac845186e1b77f684832ccbbf0c209759303ede8150bb git-20130709.patch" |