File PKGBUILD of Package thinkfan
# Maintainer: Oleksandr Natalenko <oleksandr@natalenko.name>
# Contributor: Barry Smith <brrtsm at gmail.com>
# Contributor: nblock <nblock [/at\] archlinux DOT us>
# Contributor: Frederik Alkærsig (FALKER) <havnelisten AT gmail.com>
pkgname=thinkfan
pkgver=2.0.0
pkgrel=1
pkgdesc="A minimalist fan control program"
url=https://github.com/vmatare/thinkfan
arch=(x86_64)
makedepends=(cmake ninja)
depends=(lm_sensors systemd yaml-cpp)
license=(GPL-3.0-or-later)
source=(${url}/archive/${pkgver}.tar.gz
thinkfan.env
thinkfan.service
thinkpad_acpi.conf)
backup=(etc/thinkfan/conf
etc/thinkfan/env)
sha256sums=('0fc94eb378dcba8c889e91f41dab3a8d6eebc7324a59a0704cc39aa66551987e'
'ed5efb7d701db0a17e92b59dc0ae990dafca774e832a440e981648b8e95cf553'
'549732696e91846e719520b99ca38923814d0c1e7f075878467c48f64fa4d724'
'28874576641b3cc1aa486e1bc9ed40eadfe8b13d6d3014016e31fedc5dc5195f')
prepare() {
cd thinkfan-${pkgver}
sed -i 's|"/run/thinkfan.pid"|"/run/thinkfan/pid"|' CMakeLists.txt
}
build() {
cmake -B build -S thinkfan-${pkgver} -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr
cmake --build build
}
package() {
cd build
install -Dt "${pkgdir}"/usr/bin -m0755 ${pkgname}
install -Dt "${pkgdir}"/usr/share/man/man1 -m0644 thinkfan.1
install -Dt "${pkgdir}"/usr/share/man/man5 -m0644 thinkfan.conf.5
install -Dt "${pkgdir}"/usr/share/man/man5 -m0644 thinkfan.conf.legacy.5
cd ../thinkfan-${pkgver}
install -Dt "${pkgdir}"/usr/lib/systemd/system -m0644 ../${pkgname}.service rcscripts/systemd/${pkgname}-{sleep,wakeup}.service
install -Dm0644 ../${pkgname}.env "${pkgdir}"/etc/${pkgname}/env
install -Dm0644 examples/${pkgname}.yaml "${pkgdir}"/etc/${pkgname}/conf
install -Dt "${pkgdir}"/usr/lib/modprobe.d -m0644 ../thinkpad_acpi.conf
}