# Template file for 'libircclient'
pkgname=libircclient
version=1.10
revision=6
build_style=gnu-configure
configure_args="--libdir=/usr/lib --enable-openssl --enable-ipv6 --enable-shared"
hostmakedepends="automake libtool pkg-config"
makedepends="openssl-devel"
short_desc="IRC client library"
maintainer="maciozo@maciozo.com <maciozo@maciozo.com>"
license="LGPL-3.0-or-later"
homepage="https://www.ulduzsoft.com/linux/libircclient/"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/${version}/${pkgname}-${version}.tar.gz"
checksum=bbb26f3af348b252c5204917a7f91cfdf172f1b6afbf4df1e561b03e20503c2d

pre_configure() {
	autoreconf -fi
}

post_install() {
	make -C src static install
	cp -a src/${pkgname}.a ${DESTDIR}/usr/lib
	vmkdir usr/share/doc/${pkgname}
	vcopy doc/*.rst usr/share/doc/${pkgname}
	vcopy doc/sources/*.rst usr/share/doc/${pkgname}
	vmkdir usr/lib/pkgconfig
	sed ${FILESDIR}/${sourcepkg}.pc -e "s;@version@;${version};" \
		> ${DESTDIR}/usr/lib/pkgconfig/${sourcepkg}.pc
	vman man/${pkgname}.1
}

libircclient-devel_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/share
		vmove usr/include
		vmove "usr/lib/*.so"
		vmove "usr/lib/*.a"
		vmove usr/lib/pkgconfig
	}
}
