summaryrefslogtreecommitdiffstats
path: root/main/ircservices/APKBUILD
blob: 77dc832fb65b91fdae0855a759dc662cb33013f8 (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
83
84
85
86
87
88
89
90
91
92
93
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ircservices
pkgver=5.1.24
pkgrel=2
pkgdesc="Services for IRC (NickServ, ChanServ, MemoServ)"
url="http://www.ircservices.za.net/"
arch="all"
license="GPL"
depends=
makedepends="perl"
install=$pkgname.pre-install
pkgusers="ircservices"
pkggroups="ircservices"
subpackages="$pkgname-doc"
source="http://achurch.org/services/tarballs/ircservices-$pkgver.tar.gz
	$pkgname.initd"

prepare() {
	cd "$srcdir"/$pkgname-$pkgver
	sed -i \
		-e "s/-m 750/-m 755/" \
		-e "s/-m 640/-m 644/" \
		configure
}

build() {
	cd "$srcdir"/$pkgname-$pkgver

	# note: this is not autotools
	RUNGROUP=ircservices ./configure \
		-cc "$CC" \
		-cflags "$CFLAGS" \
		-bindest /usr/bin \
		-datdest /var/lib/ircservices \
		|| return 1

	# build targets one by one as paralell builds breaks
	make config-check && \
		make ircservices && \
		make languages && \
		make tools
}

package() {
	cd "$srcdir"/$pkgname-$pkgver
#	export INSTALL_PREFIX="$pkgdir"
	make -j1 \
		BINDEST="$pkgdir"/usr/bin \
		DATDEST="$pkgdir"/var/lib/ircservices \
		install || return 1

	install -d "$pkgdir"/usr/share/man/man8
	install docs/ircservices.8 "$pkgdir"/usr/share/man/man8/ircservices.8
	install docs/convert-db.8 \
		"$pkgdir"/usr/share/man/man8/ircservices-convert-db.8

	# try conform to FHS
	cd "$pkgdir"
	install -d etc/ircservices usr/share/ircservices var/log/ircservices

	mv var/lib/ircservices/convert-db usr/bin/ircservices-convert-db

	mv var/lib/ircservices/example-ircservices.conf \
		etc/ircservices/ircservices.conf
	ln -s /etc/ircservices/ircservices.conf \
		var/lib/ircservices/ircservices.conf

	mv var/lib/ircservices/example-modules.conf \
		etc/ircservices/modules.conf
	ln -s /etc/ircservices/modules.conf var/lib/ircservices/modules.conf

	mv var/lib/ircservices/languages \
		var/lib/ircservices/helpfiles \
		usr/share/ircservices/
	ln -s /usr/share/ircservices/languages var/lib/ircservices/
	ln -s /usr/share/ircservices/helpfiles var/lib/ircservices/

	install -Dm755 "$srcdir"/ircservices.initd \
		etc/init.d/ircservices

	chown ircservices:ircservices var/lib/ircservices \
		var/log/ircservices

	chown root:ircservices etc/ircservices/ircservices.conf \
		etc/ircservices/modules.conf
}

md5sums="d4f531537aeed230026cf5560f221ecb  ircservices-5.1.24.tar.gz
6168b69dbce72d5f09f2c7437f1a540d  ircservices.initd"
sha256sums="63c88b84ddcd12f3636ca9c69987a06e4055156ae3ebe2ff4f22205c66c2a365  ircservices-5.1.24.tar.gz
b5d8db5e414c28daca2d1f55b7f67fd61df36c3dd57a841d9f6fc582a3cfc9a9  ircservices.initd"
sha512sums="1c1a0ec6d0e0a11071532e07792a15b1910fe108f09e991ca27e0196cfeec72e057a067fa69396b8647aca4ed8097c857eb8e714d8bee2ca6a0c5e27593fb06d  ircservices-5.1.24.tar.gz
7829d6f0919e8fb1813f1d143511e571663c0b6813d669a50041ec2b88813c630b56183ed2c5d860e941e3be9897bce635872c0b4b39eb2c8d95e01d0ad8b280  ircservices.initd"