summaryrefslogtreecommitdiff
path: root/community/luasocket/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/luasocket/PKGBUILD')
-rw-r--r--community/luasocket/PKGBUILD55
1 files changed, 40 insertions, 15 deletions
diff --git a/community/luasocket/PKGBUILD b/community/luasocket/PKGBUILD
index 21e96f09d..88c9d5714 100644
--- a/community/luasocket/PKGBUILD
+++ b/community/luasocket/PKGBUILD
@@ -1,27 +1,52 @@
-# $Id: PKGBUILD 49637 2011-06-18 20:20:18Z foutrelis $
+# $Id: PKGBUILD 81121 2012-12-12 00:49:32Z eric $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Anders Bergh <anders1@gmail.com>
-pkgname=luasocket
+pkgbase=luasocket
+pkgname=(lua-socket lua51-socket)
pkgver=2.0.2
-pkgrel=5
-pkgdesc="Luasocket is the most comprehensive networking support library for the Lua language."
+pkgrel=1
+pkgdesc='Networking support library for the Lua language'
arch=('i686' 'x86_64')
-url="http://www.cs.princeton.edu/~diego/professional/luasocket/"
+url='http://www.cs.princeton.edu/~diego/professional/luasocket/'
license=('MIT')
-depends=(lua)
+replaces=('luasocket')
+conflicts=('luasocket')
+makedepends=('lua' 'lua51')
source=(http://luaforge.net/frs/download.php/2664/luasocket-$pkgver.tar.gz
- luasocket-arch.patch
- luasocket-unixsocket.patch)
+ luasocket-unixsocket.patch
+ lua52.patch)
md5sums=('41445b138deb7bcfe97bff957503da8e'
- '3270f42ff374f230c6450f49132f8625'
- '8d116bb70bd7a2fa15cbe949d4cfc35e')
+ '8d116bb70bd7a2fa15cbe949d4cfc35e'
+ '6f9c6416dd70a7bc1a867003f08c2752')
build() {
- cd "$srcdir/$pkgname-$pkgver"
- patch -p1 < $srcdir/luasocket-arch.patch
- patch -p1 < $srcdir/luasocket-unixsocket.patch
+ msg2 'Building with lua 5.2'
+ cp -a $pkgbase-$pkgver $pkgbase-$pkgver-52
+ cd $pkgbase-$pkgver-52
+ patch -Np1 -i "$srcdir/luasocket-unixsocket.patch"
+ patch -Np1 -i "$srcdir/lua52.patch"
make
- make DESTDIR="$pkgdir" install
- install -D -m0644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
+ msg2 'Building with lua 5.1'
+ cd ../$pkgbase-$pkgver
+ patch -Np1 -i "$srcdir/luasocket-unixsocket.patch"
+ make LUAINC=-I/usr/include/lua5.1
+}
+
+package_lua-socket() {
+ depends=('lua')
+ cd $pkgbase-$pkgver
+ make DESTDIR="$pkgdir/" \
+ INSTALL_TOP_SHARE='$(DESTDIR)/usr/share/lua/5.1' \
+ INSTALL_TOP_LIB='$(DESTDIR)/usr/lib/lua/5.1' install
+ install -D -m0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+package_lua51-socket() {
+ depends=('lua51')
+ cd $pkgbase-$pkgver
+ make DESTDIR="$pkgdir/" \
+ INSTALL_TOP_SHARE='$(DESTDIR)/usr/share/lua/5.2' \
+ INSTALL_TOP_LIB='$(DESTDIR)/usr/lib/lua/5.2' install
+ install -D -m0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}