aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-cmsgpack/APKBUILD
blob: e45d66a38eede2a200ab476b2844e93b0f26a8aa (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
# Contributor: Francesco Colista <francesco.colista@gmail.com>
# Maintainer: Francesco Colista <francesco.colista@gmail.com>
pkgname=lua-cmsgpack
pkgver=0.3.0
pkgrel=0
pkgdesc="MessagePack C implementation for Lua"
url="https://github.com/antirez/lua-cmsgpack"
arch="all"
license="Two-clause BSD"
depends=""
depends_dev=""
makedepends="lua-dev"
install=""
subpackages=""
source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.bz2"
_giturl="https://github.com/antirez/lua-cmsgpack.git"
_upload=dev.alpinelinux.org:/archive/$pkgname/
_builddir="$srcdir"/$pkgname-$pkgver

snapshot() {
        local _pkg=$pkgname-$pkgver.tar.bz2
        mkdir -p "$srcdir"
        cd "$srcdir"
        rm -rf "$pkgname"
        git clone --depth=1 --bare $_giturl || return 1
	local _tag=$(git --git-dir ${_giturl##*/} tag| head -1)
	git --git-dir ${_giturl##*/} archive \
		--prefix=$pkgname-$pkgver/ --format=tar \
		$_tag | bzip2 > $_pkg || return 1
	msg "New snapshot: $_pkg"
        if [ -n "$_upload" ]; then
                msg "Uploading to $_upload"
                scp $_pkg $_upload && abump $pkgname-$pkgver || return 1
        fi
}

build() {
	cd "$_builddir"
	${CC:-gcc} $CFLAGS -fPIC $(pkg-config --cflags lua) -o cmsgpack.so -shared $LFDLAGS  $(pkg-config --libs lua) lua_cmsgpack.c
}

package() {
	cd "$_builddir"
	local dir=$( pkg-config --variable INSTALL_CMOD lua)
	install -D cmsgpack.so "$pkgdir"/$dir/cmsgpack.so
}

md5sums="c7224cc06a6b03edce287bce797de851  lua-cmsgpack-0.3.0.tar.bz2"