aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/lua-cloud_storage/APKBUILD
blob: 4fb06ac3c4ce977b420a429119d93f1a086e3c1e (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=lua-cloud_storage
pkgver=0.1.0
_luaversions="5.1 5.2 5.3"
pkgrel=3
pkgdesc="A Lua library for communicating with Google Cloud Storage"
url="https://github.com/leafo/cloud_storage"
arch="noarch"
license="MIT"
depends=""
depends_dev=""
makedepends="$depends_dev lua-moonscript"
install=""
subpackages=""
source="$pkgname-$pkgver.tar.gz::https://github.com/leafo/cloud_storage/archive/v$pkgver.tar.gz"
for _v in $_luaversions; do
	subpackages="$subpackages lua$_v-cloud_storage:split_${_v/./_}"
done

_builddir="$srcdir"/cloud_storage-$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"
	make || return 1
}

package() {
	mkdir -p "$pkgdir"
}

_split() {
	cd "$_builddir"
	local _ver="$1"
	pkgdesc="A Lua $_ver library for communicating with Google Cloud Storage"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	depends="lua${_ver}-socket lua${_ver}-cjson lua${_ver}-mimetypes
		lua${_ver}-crypto lua${_ver}-expat lua${_ver}-date"
	mkdir -p "$subpkgdir"/usr/share/lua/$_ver/cloud_storage
	cp cloud_storage/*.lua \
		"$subpkgdir"/usr/share/lua/$_ver/cloud_storage/ || return 1
	mv "$subpkgdir"/usr/share/lua/$_ver/cloud_storage/google.lua \
		"$subpkgdir"/usr/share/lua/$_ver/ || return 1
}

for _v in $_luaversions; do
        eval "split_${_v/./_}() { _split $_v; }"
done

md5sums="dae6fcd15554368f3b9fcc8d9be40542  lua-cloud_storage-0.1.0.tar.gz"
sha256sums="58eb6c8767daa07c05accf0a0624fa4ef5574865cfac631dff9768ec2dfdea29  lua-cloud_storage-0.1.0.tar.gz"
sha512sums="d1fe7811469cc2dce11319692500c1d3d78b39a8e3c6ad9513a1ad694c080ee8fc1872c76c08cdc3d777098407ad46574c18de95eb453d3333394b24c727e0ad  lua-cloud_storage-0.1.0.tar.gz"