# Contributor: Noel Kuntze <noel.kuntze@thermi.consulting>
# Maintainer: Noel Kuntze <noel.kuntze@thermi.consulting>
pkgname=fehqlibs
pkgver=23
pkgrel=0
pkgdesc="State-of-the-art C routines for Internet services"
url="http://www.fehcom.de/ipnet/qlibs.html"
arch="all"
license="Public-Domain"
subpackages="$pkgname-doc"
source="https://www.fehcom.de/ipnet/fehQlibs/fehQlibs-$pkgver.tgz"

builddir="$srcdir/fehQlibs-$pkgver"

prepare() {
	sed -i '/^CC=/d' configure
	default_prepare
}


build() {
	make -j1 \
		CC="$CC" \
		LDFLAGS= \
		PREFIX=/usr \
		USRLIBDIR=/usr/lib \
		SHLIBDIR=/usr/lib \
		CONFIGURE="./configure --prefix=/usr --libdir=/usr/lib --includedir=/usr/include"
}

check() {
	make check
}

package() {
	install -dm0755 "$pkgdir"/usr/lib/fehQlibs/include
	install -Dm0644 lib* "$pkgdir"/usr/lib/fehQlibs/
	install -Dm0644 include/*.h "$pkgdir"/usr/lib/fehQlibs/include/

	ln -s fehQlibs "$pkgdir"/usr/lib/qlibs

	install -Dm644 man/*.3 -t "$pkgdir"/usr/share/man/man3

	install -Dm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha512sums="
676b8e57cac2f6700cdf4643d72c55df2beca42a893dd7428cebfbb2844f3643608ab25205f8b36cf35741847476df862773dd8a14a604d25dc69bec3a5b5999  fehQlibs-23.tgz
"
