APKBUILD 2.2 KB
Newer Older
1
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
Natanael Copa's avatar
Natanael Copa committed
2
_luaversions="5.1 5.2 5.3"
Natanael Copa's avatar
Natanael Copa committed
3
pkgname=sircbot
Natanael Copa's avatar
Natanael Copa committed
4
pkgver=0.4
5
pkgrel=2
Natanael Copa's avatar
Natanael Copa committed
6
pkgdesc="Minimalistic IRC bot"
7
url="https://git.alpinelinux.org/cgit/sircbot/"
8
arch="all"
9
license="GPL-2.0"
Natanael Copa's avatar
Natanael Copa committed
10 11 12
pkgusers="sircbot"
pkggroups="sircbot"
depends=
Natanael Copa's avatar
Natanael Copa committed
13
makedepends=""
14
subpackages="lua-sircbot:luamod"
Natanael Copa's avatar
Natanael Copa committed
15 16 17 18 19 20
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
21
	0001-add-simple-hack-to-allow-nickserv-identification.patch
Natanael Copa's avatar
Natanael Copa committed
22 23 24 25
	sircbot.initd
	sircbot.confd
	"

26
builddir="$srcdir"/$pkgname-$pkgver
Natanael Copa's avatar
Natanael Copa committed
27 28

build() {
29 30
	cd "$builddir"
	make
Natanael Copa's avatar
Natanael Copa committed
31
	for i in $_luaversions; do
32
		make LUA_VERSION=$i
Natanael Copa's avatar
Natanael Copa committed
33
	done
Natanael Copa's avatar
Natanael Copa committed
34 35 36
}

package() {
37
	cd "$builddir"
38
	make install DESTDIR="$pkgdir" prefix=/usr
Natanael Copa's avatar
Natanael Copa committed
39
	for i in $_luaversions; do
40
		make install-lua DESTDIR="$pkgdir" prefix=/usr LUA_VERSION=$i
Natanael Copa's avatar
Natanael Copa committed
41
	done
Natanael Copa's avatar
Natanael Copa committed
42 43 44 45 46
	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
}

47
luamod() {
Natanael Copa's avatar
Natanael Copa committed
48 49 50 51 52 53 54 55 56 57 58 59 60
	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
61
			mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/
Natanael Copa's avatar
Natanael Copa committed
62 63
		fi
	done
64 65
}

Natanael Copa's avatar
Natanael Copa committed
66 67 68 69 70 71

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

sha512sums="1f91581548dcc2d3f6d0da31591027792271994b86ffce73141de828eff27595a1df8a364988e0c5349996e36ae8879b166c84d6024a194626e61c9dc9e96816  sircbot-0.4.tar.xz
72 73
45cbf2b16374f0fb7746d80ce09a9f65c293e08fd641c174821caf78f27e0614882500e0ced08a611679f26e5b2f8acded9869af6be81bd0966820588612b1e6  0001-add-simple-hack-to-allow-nickserv-identification.patch
5a8ce80e8d43aa7737bd210812c8a99f1f5d5e7af78996b09ebef0c492d7df6303d63dbe3eb037fd5f750c955173e85fd87c75dfeb6dda7c731740d065ffa3d9  sircbot.initd
74
315167ec664ce859908fcd230f6e0c604a0b02e56286156ba6ec76c32d6d514726acb493fe7a13b44d9255ec2e34fe4b2a6f02edf039b06e487cea6528d4d6a7  sircbot.confd"