APKBUILD 2.49 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1 2 3
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=znc
4 5 6
pkgver=1.7.1
pkgrel=0
pkgdesc="Advanced IRC bouncer"
Natanael Copa's avatar
Natanael Copa committed
7
url="http://znc.in"
Ariadne Conill's avatar
Ariadne Conill committed
8
arch="all"
9
license="ASL-2.0"
10
makedepends="perl-dev libressl-dev cyrus-sasl-dev python2-dev c-ares-dev swig
11
	gettext-dev tcl-dev autoconf automake python3-dev icu-dev"
12
pkgusers="$pkgname"
13 14
pkggroups="$pkgusers"
install="$pkgname.pre-install"
Natanael Copa's avatar
Natanael Copa committed
15
subpackages="$pkgname-dev $pkgname-doc $pkgname-extra $pkgname-modtcl
16
	$pkgname-modperl $pkgname-modpython"
Timo Teräs's avatar
Timo Teräs committed
17
source="http://znc.in/releases/znc-$pkgver.tar.gz
18 19
	$pkgname.initd
	$pkgname.confd"
20
builddir="$srcdir/znc-$pkgver"
Natanael Copa's avatar
Natanael Copa committed
21

22 23 24 25 26
# secfixes:
#   1.7.1-r0:
#   - CVE-2018-14055
#   - CVE-2018-14056

Natanael Copa's avatar
Natanael Copa committed
27
build() {
28 29
	cd "$builddir"

Timo Teräs's avatar
Timo Teräs committed
30
	export CFLAGS="$CFLAGS -D_GNU_SOURCE"
31 32 33 34
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
Natanael Copa's avatar
Natanael Copa committed
35 36 37 38 39 40
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-perl \
		--enable-tcl \
41 42
		--enable-python
	make
Natanael Copa's avatar
Natanael Copa committed
43 44 45
}

package() {
46
	cd "$builddir"
Natanael Copa's avatar
Natanael Copa committed
47

48
	make DESTDIR="$pkgdir" install
Natanael Copa's avatar
Natanael Copa committed
49

50 51 52
	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
Natanael Copa's avatar
Natanael Copa committed
53 54 55 56 57 58 59 60 61
}

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

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

Natanael Copa's avatar
Natanael Copa committed
63
	_mv_mod \
Natanael Copa's avatar
Natanael Copa committed
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
		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"
80

Natanael Copa's avatar
Natanael Copa committed
81 82 83 84 85 86 87
	_mv_mod modtcl.so
	_mv_to_sub usr/share/znc/modtcl
}

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

Natanael Copa's avatar
Natanael Copa committed
89 90 91
	_mv_mod modperl modperl.so
}

92 93 94
modpython() {
	pkgdesc="Python modules for ZNC"
	depends="znc"
95

96 97 98
	_mv_mod modpython modpython.so
}

99 100 101 102 103 104 105 106 107 108 109 110 111
_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
}

112
sha512sums="907068fb0828091026d440145b70ca76109302f13c18d94f772660192434287f209a06a52da1dd39726b9a38735b3cea9afbd062eb6def4cd428bb73c562a902  znc-1.7.1.tar.gz
Jakub Jirutka's avatar
Jakub Jirutka committed
113 114
47f9bd00f07861e195333d2cda5b1c7386e2324a1842b890837a7936a94b65b7a269f7fee656a522ec86b58a94bd451a2a3629bd6465578681b8d0733c2c77dc  znc.initd
00360f9b487ed5a9d50c85ce597e65c89cf869cabb893c294d0bc7fcd88f9610ecb63ba6df7af1ba1dd977b6d5b05da625a3ee799a46d381f17ac04b976a1f29  znc.confd"