summaryrefslogtreecommitdiffstats
path: root/main/lua-stringy/APKBUILD
blob: a38718f8c763f8ce0172a9e645d4145bdd34b797 (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
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-stringy
pkgver=0.2
pkgrel=0
pkgdesc="Lua string utility library"
url="http://hackmap.blogspot.com"
arch="all"
license="MIT"
depends=""
makedepends="lua lua-dev"
install=""
subpackages=""
source="http://bpbio.googlecode.com/files/stringy-$pkgver.tar.gz
	stringy-memcmp.patch"

_builddir="$srcdir"/stringy-$pkgver
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"
	${CC:-gcc} ${CFLAGS}  -fPIC -shared ${LDFLAGS} -llua -o stringy.so stringy.c || return 1
	lua stringy_test.lua
}

package() {
	local _lualibdir=/usr/lib/lua/5.1
	cd "$_builddir"
	mkdir -p "$pkgdir"/$_lualibdir
	cp stringy.so "$pkgdir"/$_lualibdir/
}

md5sums="c53f05a37410a234d4afa0aa3210d800  stringy-0.2.tar.gz
b3fbeca41227425894d6e0d74a684969  stringy-memcmp.patch"