# Template file for 'lm_sensors'
pkgname=lm_sensors
version=3.6.0
revision=2
build_style=gnu-makefile
make_build_args="MACHINE=${XBPS_TARGET_MACHINE#-musl}"
make_install_args="${make_build_args} SBINDIR=/usr/bin MANDIR=/usr/share/man"
hostmakedepends="flex perl which"
depends="perl"
short_desc="Utilities to read temperature/voltage/fan sensors"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.1-or-later"
homepage="https://hwmon.wiki.kernel.org/lm_sensors"
distfiles="https://github.com/lm-sensors/lm-sensors/archive/V${version//./-}.tar.gz"
checksum=0591f9fa0339f0d15e75326d0365871c2d4e2ed8aa1ff759b3a55d3734b7d197

conf_files="/etc/sensors3.conf"

post_patch() {
	vsed -e 's,CC :=,CC ?=,' -i Makefile
}

post_install() {
	vsv fancontrol
}

libsensors_package() {
	short_desc="Library to read temperature/voltage/fan sensors"
	pkg_install() {
		vmove "usr/lib/*.so.*"
	}
}

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