# Template file for 'namecoin'
pkgname=namecoin
version=0.18.1
revision=8
build_style=gnu-configure
configure_args="--with-incompatible-bdb --disable-static
 --enable-hardening --with-boost=${XBPS_CROSS_BASE}/usr"
hostmakedepends="pkg-config yasm automake libtool which"
makedepends="libevent-devel db-devel protobuf-devel boost-devel
 miniupnpc-devel qrencode-devel"
short_desc="Distributed key/value database"
maintainer="ananteris <ananteris@protonmail.ch>"
license="MIT"
homepage="https://namecoin.org"
distfiles="https://github.com/namecoin/namecoin-core/archive/nc${version}.tar.gz"
checksum=7117a0a0b8f48d49e4abf3577660f8a4eb9a4dea753281d19d9470725fc75d8e

if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
	makedepends+=" libatomic-devel"
	LDFLAGS+=" -latomic"
fi

pre_configure() {
	./autogen.sh
	sed -i src/compat.h -e "s;<sys/fcntl.h>;<fcntl.h>;"
}

post_install() {
	vlicense COPYING
	# They don't bother to rename from bitcoin
	rm -rf $DESTDIR/usr/share/man/man1
}
