aboutsummaryrefslogtreecommitdiffstats
path: root/main/znc/APKBUILD
blob: e7afe1f237d13d466bef9751101f203c3c639239 (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=znc
pkgver=1.6.5
pkgrel=3
pkgdesc="An advanced IRC bouncer"
url="http://znc.in"
arch="all"
license="Apache-2.0"
makedepends="perl-dev libressl-dev cyrus-sasl-dev python2-dev c-ares-dev swig
	gettext-dev tcl-dev autoconf automake python3-dev"
pkgusers="$pkgname"
pkggroups="$pkgusers"
install="$pkgname.pre-install"
subpackages="$pkgname-dev $pkgname-doc $pkgname-extra $pkgname-modtcl
	$pkgname-modperl $pkgname-modpython"
source="http://znc.in/releases/znc-$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd"
builddir="$srcdir/znc-$pkgver"

build() {
	cd "$builddir"

	export CFLAGS="$CFLAGS -D_GNU_SOURCE"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-perl \
		--enable-tcl \
		--enable-python
	make
}

package() {
	cd "$builddir"

	make DESTDIR="$pkgdir" install

	install -D -m755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -D -m644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
	install -d -m750 -o $pkgusers -g $pkggroups "$pkgdir"/var/lib/znc
}

dev() {
	default_dev
	_mv_to_sub usr/bin/znc-buildmod
}

extra() {
	pkgdesc="Extra modules for ZNC"

	_mv_mod \
		autovoice.so \
		block_motd.so \
		clearbufferonmsg.so \
		ctcpflood.so \
		flooddetach.so \
		imapauth.so \
		listsockets.so \
		log.so \
		notify_connect.so \
		send_raw.so \
		shell.so
}

modtcl() {
	pkgdesc="TCL module for ZNC"
	depends="znc"

	_mv_mod modtcl.so
	_mv_to_sub usr/share/znc/modtcl
}

modperl() {
	pkgdesc="Perl module for ZNC"
	depends="znc"

	_mv_mod modperl modperl.so
}

modpython() {
	pkgdesc="Python modules for ZNC"
	depends="znc"

	_mv_mod modpython modpython.so
}

_mv_mod() {
	local i; for i in "$@"; do
		_mv_to_sub usr/lib/znc/$i
	done
}

_mv_to_sub() {
	local i; for i in "$@"; do
		mkdir -p "$subpkgdir"/${i%/*}
		mv "$pkgdir"/$i "$subpkgdir"/$i
	done
}

sha512sums="d78603ac86d1fb92cdf591b1eb6d32fa19b0e39414bd69e1300c537051612ae590c43d3b8e4dd598cdff605bf3aa1d3d5d806edd428d15d50f733e1670f3e626  znc-1.6.5.tar.gz
47f9bd00f07861e195333d2cda5b1c7386e2324a1842b890837a7936a94b65b7a269f7fee656a522ec86b58a94bd451a2a3629bd6465578681b8d0733c2c77dc  znc.initd
00360f9b487ed5a9d50c85ce597e65c89cf869cabb893c294d0bc7fcd88f9610ecb63ba6df7af1ba1dd977b6d5b05da625a3ee799a46d381f17ac04b976a1f29  znc.confd"