APKBUILD 3.04 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
Natanael Copa's avatar
Natanael Copa committed
4
pkgver=1.6.3
5
pkgrel=2
Natanael Copa's avatar
Natanael Copa committed
6 7 8
pkgdesc="An advanced IRC bouncer"
url="http://znc.in"
arch="all"
Fabian Affolter's avatar
Fabian Affolter committed
9 10 11
license="ASL 2.0"
depends=""
depends_dev=""
Natanael Copa's avatar
Natanael Copa committed
12
makedepends="perl-dev openssl-dev cyrus-sasl-dev python-dev c-ares-dev swig
13
	gettext-dev tcl-dev autoconf automake python3-dev"
14 15
install="$pkgname.pre-install"
pkgusers="$pkgname"
Natanael Copa's avatar
Natanael Copa committed
16
subpackages="$pkgname-dev $pkgname-doc $pkgname-extra $pkgname-modtcl
17
			$pkgname-modperl  $pkgname-modpython"
Timo Teräs's avatar
Timo Teräs committed
18
source="http://znc.in/releases/znc-$pkgver.tar.gz
19 20
	$pkgname.initd
	$pkgname.confd"
Natanael Copa's avatar
Natanael Copa committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34

_builddir="$srcdir"/znc-$pkgver
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"
Timo Teräs's avatar
Timo Teräs committed
35
	export CFLAGS="$CFLAGS -D_GNU_SOURCE"
36 37 38 39
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
Natanael Copa's avatar
Natanael Copa committed
40 41 42 43 44 45
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-perl \
		--enable-tcl \
46
		--enable-python \
Natanael Copa's avatar
Natanael Copa committed
47 48 49 50 51 52 53
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
54 55 56 57 58
        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
Natanael Copa's avatar
Natanael Copa committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
}

_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"
Natanael Copa's avatar
Natanael Copa committed
83
	_mv_mod \
Natanael Copa's avatar
Natanael Copa committed
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
		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
}

110 111 112 113 114 115
modpython() {
	pkgdesc="Python modules for ZNC"
	depends="znc"
	_mv_mod modpython modpython.so
}

Natanael Copa's avatar
Natanael Copa committed
116
md5sums="0dad0307e2faea26b9e304e308f7ec63  znc-1.6.3.tar.gz
117
0170c261efe6da389bf637b00dfcb984  znc.initd
118
1817e134ec3fa6ec05d36d4995a5aaa5  znc.confd"
Natanael Copa's avatar
Natanael Copa committed
119
sha256sums="631c46de76fe601a41ef7676bc974958e9a302b72b25fc92b4a603a25d89b827  znc-1.6.3.tar.gz
120
fa67ed45506863f5c0d7a73a4ab2c7b199a8eb02a2b201dbb64bd8bace00bbf2  znc.initd
121
be3155e79e6ed13be88fbf9d99f6889b3ee8425837120c448c827b8302672063  znc.confd"
Natanael Copa's avatar
Natanael Copa committed
122
sha512sums="777279b6c973310b4e78a0472bd1e355c2adf3e4fbe9ebedde3dd4706e5c0b208d4330eb2318a8d9e0d7d7146bee0a4a428cbe5a3f230c8f6aa692a477e86e2b  znc-1.6.3.tar.gz
123
3287affd90f0048a7e790179d97ac9964498cc87f833afb97c6298abfbdbdf1131edd1211b3b64290a862ae4a768f63c346c274a18664a2e22e2815632a726c2  znc.initd
124
352f18d64cbfbd5970c859f2ae2290c0ddafcbd8f1bb5d74f33976bc8388f65a75f8a9a73a093fbac12f2d243d4bcf74380bbb3aaab8d68f7bf4eab7ce3bea46  znc.confd"