# Description: Standalone C++ BitTorrent tracker
# URL: https://github.com/abique/hefur
# Maintainer: Matt Housh, jaeger at crux dot ninja
# Depends on: protobuf cmake gnutls git

name=hefur
version=1.0
release=1
source=(https://crux.nu/~jaeger/files/$name-$version.tar.xz \
	hefurd)

build() {
	cd $name-$version
	sed -i -e '45,48d' CMakeLists.txt
	sed -i -e '124,126d' hefur/CMakeLists.txt
	cmake -Bbuild -DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS -DNDEBUG" \
		-Wno-dev
	cmake --build build
	DESTDIR=$PKG cmake --install build
	install -d -m 0755 -o root -g root $PKG/var/run/hefur $PKG/usr/share/hefur/torrents
	install -D -m 0644 -o root -g root /dev/null $PKG/var/log/hefurd.log
	install -D -m 0755 -o root -g root $SRC/hefurd $PKG/etc/rc.d/hefurd
	rm -r $PKG/usr/share/doc
}
