From 8a2a2dc8c58dac4c86f177b737808ce392f31f73 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 28 May 2018 21:43:25 -0500
Subject: [PATCH] New package: i8kutils-1.43

Closes https://github.com/voidlinux/void-packages/issues/14765
---
 srcpkgs/i8kutils/files/i8kmon/run |  7 +++++++
 srcpkgs/i8kutils/template         | 31 +++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)
 create mode 100644 srcpkgs/i8kutils/files/i8kmon/run
 create mode 100644 srcpkgs/i8kutils/template

diff --git a/srcpkgs/i8kutils/files/i8kmon/run b/srcpkgs/i8kutils/files/i8kmon/run
new file mode 100644
index 0000000000..4e0179182e
--- /dev/null
+++ b/srcpkgs/i8kutils/files/i8kmon/run
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ -r ./conf ]; then
+	. ./conf
+fi
+
+exec /usr/bin/i8kmon ${OPTS:=--nouserconfig} 1>&2
diff --git a/srcpkgs/i8kutils/template b/srcpkgs/i8kutils/template
new file mode 100644
index 0000000000..7a239e21fa
--- /dev/null
+++ b/srcpkgs/i8kutils/template
@@ -0,0 +1,31 @@
+# Template file for 'i8kutils'
+pkgname=i8kutils
+version=1.43
+revision=1
+build_style=gnu-makefile
+wrksrc="${pkgname}"
+short_desc="Fan control for certain Dell laptops"
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://launchpad.net/i8kutils"
+distfiles="https://launchpad.net/i8kutils/trunk/${version}/+download/i8kutils_${version}.tar.xz"
+checksum=881a211c64f79be6a08c88864deda45280f0ce925ed9e2af180db2d93d364dcb
+conf_files="/etc/i8kmon.conf"
+
+case "${XBPS_TARGET_MACHINE}" in
+	i686*|x86_64*) ;;
+	*) broken="this hardware is not available on other architectures" ;;
+esac
+
+do_install() {
+	vbin i8kfan
+	vbin i8kmon
+	vbin i8kctl
+	vman i8kctl.1
+	vman i8kmon.1
+	mkdir -p "${DESTDIR}/etc/modprobe.d"
+	cp dell-smm-hwmon.conf "${DESTDIR}/etc/modprobe.d"
+	cp i8kmon.conf "${DESTDIR}/etc"
+	vdoc README.i8kutils
+	vsv i8kmon
+}