aboutsummaryrefslogtreecommitdiffstats
path: root/main/znc/APKBUILD
blob: e91cd21d2de387f8132bc56369abb7082bfb85c2 (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=znc
pkgver=1.7.1
pkgrel=0
pkgdesc="Advanced IRC bouncer"
url="http://znc.in"
arch="all"
license="ASL 2.0"
depends=""
depends_dev=""
makedepends="perl-dev libressl-dev cyrus-sasl-dev python2-dev c-ares-dev swig
	gettext-dev tcl-dev autoconf automake python3-dev icu-dev"
install="$pkgname.pre-install"
pkgusers="$pkgname"
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

# secfixes:
#   1.7.1-r0:
#   - CVE-2018-14055
#   - CVE-2018-14056

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

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 \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
        install -D -m755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname || return 1
	install -D -m644 "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname || return 1
	install -d -o $pkgname $pkgdir/var/lib/znc || return 1
}

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

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

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
}

md5sums="1ca921308c5ba4f31c2d50b87d9fc71c  znc-1.7.1.tar.gz
0170c261efe6da389bf637b00dfcb984  znc.initd
1817e134ec3fa6ec05d36d4995a5aaa5  znc.confd"
sha256sums="44cfea7158ea05dc2547c7c6bc22371e66c869def90351de0ab90a9c200d39c4  znc-1.7.1.tar.gz
fa67ed45506863f5c0d7a73a4ab2c7b199a8eb02a2b201dbb64bd8bace00bbf2  znc.initd
be3155e79e6ed13be88fbf9d99f6889b3ee8425837120c448c827b8302672063  znc.confd"
sha512sums="907068fb0828091026d440145b70ca76109302f13c18d94f772660192434287f209a06a52da1dd39726b9a38735b3cea9afbd062eb6def4cd428bb73c562a902  znc-1.7.1.tar.gz
3287affd90f0048a7e790179d97ac9964498cc87f833afb97c6298abfbdbdf1131edd1211b3b64290a862ae4a768f63c346c274a18664a2e22e2815632a726c2  znc.initd
352f18d64cbfbd5970c859f2ae2290c0ddafcbd8f1bb5d74f33976bc8388f65a75f8a9a73a093fbac12f2d243d4bcf74380bbb3aaab8d68f7bf4eab7ce3bea46  znc.confd"