aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-alt-getopt/APKBUILD
blob: a1d05ffd1a16bf6ec0765f8ff42e84b948ccb4da (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
# Maintainer: Natanael Copa <ncopa@alpinlinux.org>
pkgname=lua-alt-getopt
pkgver=0.7.0
pkgrel=4
pkgdesc="Lua module for processing options similar to getopt_long(3)"
url="http://luaforge.net/projects/alt-getopt/"
arch="noarch"
license="MIT"
depends="lua5.1-alt-getopt lua5.2-alt-getopt"
makedepends=
install=
subpackages="lua5.1-alt-getopt:_51 lua5.2-alt-getopt:_52"
source="http://mova.org/~cheusov/pub/lua_alt_getopt/lua-alt-getopt-$pkgver.tar.gz"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
}

build() {
	cd "$_builddir"
}

package() {
	cd "$_builddir"
	mkdir -p "$pkgdir"/usr/share/lua/5.1 "$pkgdir"/usr/share/lua/5.2
	install -Dm644 alt_getopt.lua "$pkgdir"/usr/share/lua/5.2/alt_getopt.lua
	ln -s ../5.2/alt_getopt.lua "$pkgdir"/usr/share/lua/5.1/alt_getopt.lua
}

_52() {
        depends=""
        mkdir -p "$subpkgdir"/usr/share/lua/
        mv "$pkgdir"/usr/share/lua/5.2 "$subpkgdir"/usr/share/lua/
}

_51() {
        replaces="lua-alt-getopt"
        depends="lua5.2-alt-getopt"
        mkdir -p "$subpkgdir"/usr/share/lua/
        mv "$pkgdir"/usr/share/lua/5.1 "$subpkgdir"/usr/share/lua/
}

md5sums="f504578b1287ea02759add231b972812  lua-alt-getopt-0.7.0.tar.gz"