summaryrefslogtreecommitdiff
path: root/community/luasql/PKGBUILD
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-12-12 02:49:40 -0800
committerroot <root@rshg054.dnsready.net>2012-12-12 02:49:40 -0800
commit6768c115af3c5f0772bcf7b02f34a88a880876c0 (patch)
treecf59712968581c230363f5604ad8f253cc0b5d87 /community/luasql/PKGBUILD
parentab94338181959432cf0046ce0a9643307dab9366 (diff)
Wed Dec 12 02:43:53 PST 2012
Diffstat (limited to 'community/luasql/PKGBUILD')
-rw-r--r--community/luasql/PKGBUILD62
1 files changed, 50 insertions, 12 deletions
diff --git a/community/luasql/PKGBUILD b/community/luasql/PKGBUILD
index 54aff4c20..399192c50 100644
--- a/community/luasql/PKGBUILD
+++ b/community/luasql/PKGBUILD
@@ -1,22 +1,60 @@
-# $Id: PKGBUILD 61380 2011-12-29 16:34:45Z spupykin $
+# $Id: PKGBUILD 81122 2012-12-12 00:49:33Z eric $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
-# Maintainer: Anders Bergh <anders1@gmail.com>
+# Contributor: Sébastien Luttringer <seblu@archlinux.org>
+# Contributor: Anders Bergh <anders1@gmail.com>
-pkgname=luasql-mysql
+pkgbase=luasql
+pkgname=('lua-sql-mysql' 'lua-sql-postgres' 'lua-sql-sqlite')
pkgver=2.2.0
pkgrel=1
-pkgdesc="MySQL module for Lua"
arch=('i686' 'x86_64')
-url="http://www.keplerproject.org/luasql/"
+url='http://www.keplerproject.org/luasql/'
license=('MIT')
-depends=('lua' 'libmysqlclient')
-source=(https://github.com/downloads/keplerproject/luasql/luasql-$pkgver.tar.gz)
-md5sums=('59d72db444c6369c936d4f03694db6b7')
+conflicts=('luasql-mysql')
+makedepends=('lua' 'libmysqlclient' 'postgresql-libs' 'sqlite')
+source=("https://github.com/downloads/keplerproject/luasql/luasql-$pkgver.tar.gz"
+ 'lua52.patch')
+md5sums=('59d72db444c6369c936d4f03694db6b7'
+ 'a1d6083215e7a83cfc08621b6998914c')
build() {
- cd "$srcdir/luasql-$pkgver"
+ cd $pkgbase-$pkgver
+ patch -p1 < "$srcdir/lua52.patch"
+ msg2 'Building sqlite support'
+ make T=sqlite3 PREFIX=/usr DRIVER_LIBS='-lsqlite3' DRIVER_INCS='-fPIC -std=c99'
+ msg2 'Building PostgreSQL support'
+ make T=postgres PREFIX=/usr DRIVER_LIBS='-lpq' DRIVER_INCS='-fPIC'
+ msg2 'Building MySQL support'
make T=mysql PREFIX=/usr DRIVER_LIBS="$(mysql_config --libs)" \
- DRIVER_INCS="$(mysql_config --include) -fPIC"
- install -Dm644 src/mysql.so $pkgdir/usr/lib/lua/5.1/luasql/mysql.so
- install -Dm644 doc/us/license.html $pkgdir/usr/share/licenses/$pkgname/license.html
+ DRIVER_INCS="$(mysql_config --include) -fPIC"
}
+
+package_lua-sql-mysql() {
+ pkgdesc='MySQL module for Lua'
+ depends=('lua' 'libmysqlclient')
+ replaces=('luasql-mysql')
+
+ cd $pkgbase-$pkgver
+ install -Dm644 src/mysql.so "$pkgdir/usr/lib/lua/5.2/luasql/mysql.so"
+ install -Dm644 doc/us/license.html "$pkgdir/usr/share/licenses/$pkgname/license.html"
+}
+
+package_lua-sql-postgres() {
+ pkgdesc='PostgreSQL module for Lua'
+ depends=('lua' 'postgresql-libs')
+
+ cd $pkgbase-$pkgver
+ install -Dm644 src/postgres.so "$pkgdir/usr/lib/lua/5.2/luasql/postgres.so"
+ install -Dm644 doc/us/license.html "$pkgdir/usr/share/licenses/$pkgname/license.html"
+}
+
+package_lua-sql-sqlite() {
+ pkgdesc='SQLite module for Lua'
+ depends=('lua' 'sqlite')
+
+ cd $pkgbase-$pkgver
+ install -Dm644 src/sqlite3.so "$pkgdir/usr/lib/lua/5.2/luasql/sqlite3.so"
+ install -Dm644 doc/us/license.html "$pkgdir/usr/share/licenses/$pkgname/license.html"
+}
+
+# vim:set ts=2 sw=2 et: