aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-dbi/APKBUILD
blob: c465c9054e4216eeebc59fe6e65aa98b48a49ddf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Leonardo Arena <rnarld@alpinelinux.org>
# Maintainer:
pkgname=lua-dbi
_realname=luadbi
pkgver=0.5
pkgrel=4
pkgdesc="A database interface library for Lua"
url="http://code.google.com/p/luadbi"
arch="all"
license="GPL"
depends=""
makedepends="lua-dev mariadb-dev postgresql-dev sqlite-dev"
install=""
subpackages="$pkgname-mysql $pkgname-postgresql $pkgname-sqlite"
source="http://luadbi.googlecode.com/files/$_realname.$pkgver.tar.gz
	lua-dbi-postgresql.patch
	"

_builddir="$srcdir"

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	make || return 1
}

package() {
	cd "$_builddir"
	# install -d "$pkgdir"/usr/lib/lua/5.1
	install -D -m755 "$srcdir"/DBI.lua "$pkgdir"/usr/share/lua/5.1/DBI.lua  || return 1
	rm -f "$pkgdir"/usr/lib/*.la
}

_mv_backend() {
	install -d "$subpkgdir"/usr/lib/lua/5.1
	mv "$srcdir"/dbd${1}.so "$subpkgdir"/usr/lib/lua/5.1
}

sqlite() {
	pkgdesc="lua-dbi SQLite backend"
	depends="lua-dbi sqlite"
	_mv_backend sqlite3
}

mysql() {
	pkgdesc="lua-dbi MySQL backend"
	depends="lua-dbi mysql"
	_mv_backend mysql
}

postgresql() {
	pkgdesc="lua-dbi PostgreSQL backend"
	depends="lua-dbi postgresql"
	_mv_backend postgresql
}

md5sums="ede2b003aadddc151aac87050c3d926e  luadbi.0.5.tar.gz
2424dcd34af6b25016c6a875c61c266b  lua-dbi-postgresql.patch"
sha256sums="49116458dd80052536bf5d7e2b2a1f5a0fa42a671ce77f1cb7355ef7faeb331e  luadbi.0.5.tar.gz
f52a643b8e2b3680d2804683c08ddc451f41881d896e8600d9253de0d6903f48  lua-dbi-postgresql.patch"
sha512sums="4ed641e113e90acc8a4f6b3b2d0f5d5044c0fbbef3b2fdfb84d15e17115e45c553a33b19bfb165e5af11a2adce501d66859963e3363d3ab1c6a39b0b2ae92e62  luadbi.0.5.tar.gz
091b9a09999a89481ee09ad3f6f841417ed5edcf9324bae4a33ec0cd7290f612fe1d60fb56f76a2b8954d0d7d9f1495ffca8676cb7ed1dc8e93408658fd331db  lua-dbi-postgresql.patch"