# Template file for 'slurm-wlm'
pkgname=slurm-wlm
version=19.05.5.1
revision=5
_distver="${version//./-}"
build_style=gnu-configure
configure_args="--disable-static"
hostmakedepends="perl python cgit pkg-config"
# XXX: ofed, DataWarp, netloc, blcr
makedepends="munge-devel lua53-devel pam-devel openssl-devel gtk+-devel
 ncurses-devel readline-devel libmariadbclient-devel json-c-devel libhwloc-devel
 freeipmi-devel hdf5-devel libnuma-devel"
short_desc="Workload manager for Linux clusters of all sizes"
maintainer="Toyam Cox <Vaelatern@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="http://slurm.schedmd.com/slurm.html"
distfiles="https://github.com/SchedMD/slurm/archive/slurm-${_distver}.tar.gz"
checksum=e53e67bd0bb4c37a9c481998764a746467a96bc41d6527569080514f36452c07

CFLAGS="-fcommon"

# Fix plugin loading. Yes, this disables hardening, this is on purpose
# https://bugs.schedmd.com/show_bug.cgi?id=2443
LDFLAGS="-Wl,-z,lazy"

if [ "$XBPS_TARGET_WORDSIZE" = "32" ]; then
	# configure: error: 32-bit support is deprecated, and not tested
	# regularly. Use at your own risk.
	broken="32-bit support is deprecated by upstream"
fi

if [ -z "${CROSS_BUILD}" ]; then
	# The below at time of writing can not be cross compiled
	makedepends+=" rrdtool-devel"
fi

post_install() {
	# Rename slurm(1) manpage to avoid conflict with slurm
	mv ${DESTDIR}/usr/share/man/man1/slurm.1 ${DESTDIR}/usr/share/man/man1/slurm-wlm.1
}
