# Template file for 'bitlbee'
pkgname=bitlbee
version=3.6
revision=4
build_style=gnu-configure
configure_args="--etcdir=/etc/bitlbee --pidfile=/run/${pkgname}/${pkgname}.pid
 --ipcsocket=/run/${pkgname}/${pkgname}.sock
 --strip=0 --otr=plugin
 $(vopt_if purple --purple=1 --purple=0)
 $(vopt_if pam --pam=1 --pam=0)
 $(vopt_if ldap --ldap=1 --ldap=0)"
make_install_args="install-etc"
hostmakedepends="pkg-config asciidoc"
makedepends="libgcrypt-devel libotr-devel libglib-devel gnutls-devel
 $(vopt_if purple libpurple-devel) $(vopt_if pam pam-devel)
 $(vopt_if ldap libldap-devel)"
short_desc="Brings instant messaging (XMPP, MSN, Yahoo!, AIM, ICQ, Twitter) to IRC"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://www.bitlbee.org/"
distfiles="https://get.bitlbee.org/src/${pkgname}-${version}.tar.gz"
checksum=9f15de46f29b46bf1e39fc50bdf4515e71b17f551f3955094c5da792d962107e

build_options="purple pam ldap"
build_options_default="pam"
desc_option_purple="Build with libpurple support"

system_accounts="bitlbee"
bitlbee_homedir="/var/lib/${pkgname}"

make_dirs="/var/lib/bitlbee 0755 bitlbee bitlbee"

conf_files="
 /etc/${pkgname}/*.txt
 /etc/${pkgname}/*.conf"

post_install() {
	vsv $pkgname
}

bitlbee-devel_package() {
	short_desc+=" - development files"
	depends="${sourcepkg}-${version}_${revision} ${makedepends}"
	pkg_install() {
		make DESTDIR=${PKGDESTDIR} install-dev
	}
}
