aboutsummaryrefslogtreecommitdiffstats
path: root/main/sircbot/APKBUILD
blob: 9471bf99eafe64ffd7ae0a6f0e17d9dc6721a49d (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
73
74
75
76
77
78
79
80
81
82
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
pkgname=sircbot
pkgver=0.4
pkgrel=1
pkgdesc="Minimalistic IRC bot"
url="https://git.alpinelinux.org/cgit/sircbot/"
arch="all"
license="GPL2"
pkgusers="sircbot"
pkggroups="sircbot"
depends=
makedepends=""
subpackages="lua-sircbot:luamod"
for _i in $_luaversions; do
	makedepends="$makedepends lua$_i-dev"
	subpackages="$subpackages lua$_i-sircbot:split_${_i/./_}"
done
install="$pkgname.pre-install"
source="http://dev.alpinelinux.org/archive/sircbot/sircbot-$pkgver.tar.xz
	sircbot.initd
	sircbot.confd
	"

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

build() {
	cd "$_builddir"
	make || return 1
	for i in $_luaversions; do
		make LUA_VERSION=$i || return 1
	done
}

package() {
	cd "$_builddir"
	make install DESTDIR="$pkgdir" prefix=/usr
	for i in $_luaversions; do
		make install-lua DESTDIR="$pkgdir" prefix=/usr LUA_VERSION=$i \
			|| return 1
	done
	install -o sircbot -g sircbot -d "$pkgdir"/var/run/sircbot
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}

luamod() {
	pkgdesc="sirbot client for Lua"
	mkdir -p "$subpkgdir"
}

_split() {
	local d= _ver=$1
	pkgdesc="Sircbot client for Lua $_ver"
	install_if="lua$_ver lua-sircbot=$pkgver-r$pkgrel"
	depends=
	cd "$pkgdir"
	for d in usr/lib/lua usr/share/lua; do
		if [ -d "$pkgdir"/$d/$_ver ]; then
			mkdir -p "$subpkgdir"/$d
			mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1
		fi
	done
}


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

md5sums="e9b10d19ed30521e1950cab0b66c79a2  sircbot-0.4.tar.xz
c89aa17a632d2338daefa1fd99b82f5d  sircbot.initd
8443ac189030c7b8beb8e579dc16ebc7  sircbot.confd"
sha256sums="3f32fe97131402f827a6acba8507c372e53ce19690e732d226bb9a4d89313ce0  sircbot-0.4.tar.xz
f49ebfc6717fd34f946b8afbe7df50ddde59f0347b4300610cc6d6997710d1e7  sircbot.initd
b0bf9767150e486815aada1761b6fca7b7838df3045082ff8083167dbce613e6  sircbot.confd"
sha512sums="1f91581548dcc2d3f6d0da31591027792271994b86ffce73141de828eff27595a1df8a364988e0c5349996e36ae8879b166c84d6024a194626e61c9dc9e96816  sircbot-0.4.tar.xz
501bcf92aed2819dd902eab31470282b5951916f3d52bab6d8eb3a14e01690f10b5a9b52488bfdcf1aa5ada44840e918dbe93ba23d891389e5d8dbe4b9a40efb  sircbot.initd
315167ec664ce859908fcd230f6e0c604a0b02e56286156ba6ec76c32d6d514726acb493fe7a13b44d9255ec2e34fe4b2a6f02edf039b06e487cea6528d4d6a7  sircbot.confd"