diff options
author | xduguu | 2016-05-05 13:51:55 +0200 |
---|---|---|
committer | xduguu | 2016-05-05 13:51:55 +0200 |
commit | 9b349caf4c296ac90e457089120cd2a85fc82ab7 (patch) | |
tree | 07bab5fb2430d6c20ed33d6717254eea9eb90e59 | |
parent | 2c56961f89f61fbf93b57d1067ad0ab4caccbf17 (diff) | |
download | aur-9b349caf4c296ac90e457089120cd2a85fc82ab7.tar.gz |
Rewrite PKGBUILD
-rw-r--r-- | .SRCINFO | 27 | ||||
-rw-r--r-- | PKGBUILD | 89 | ||||
-rw-r--r-- | openrc.install | 34 | ||||
-rw-r--r-- | systemd.install | 34 |
4 files changed, 41 insertions, 143 deletions
@@ -1,30 +1,21 @@ # Generated by mksrcinfo v8 -# Tue Feb 2 23:42:13 UTC 2016 +# Thu May 5 11:51:54 UTC 2016 pkgbase = thinkfan-git - pkgdesc = rewrite of Thinkfan in C++11 - pkgver = 1.0.r150 + pkgdesc = The minimalist fan control program + pkgver = 1.0_beta1.r1.72bb1ff pkgrel = 1 - url = https://raw.githubusercontent.com/vmatare/thinkfan/master/README + url = https://github.com/vmatare/thinkfan/ arch = i686 arch = x86_64 license = GPL3 - makedepends = git makedepends = cmake - makedepends = make - makedepends = sed + makedepends = git depends = libatasmart - depends = lm_sensors - optdepends = libatasmart: read HDD temperatures optdepends = lm_sensors: hwmon support - source = thinkfan-git::git://github.com/vmatare/thinkfan#branch=master + provides = thinkfan=1.0_beta1.r1.72bb1ff + conflicts = thinkfan + source = git+https://github.com/vmatare/thinkfan.git md5sums = SKIP -pkgname = thinkfan-openrc - install = openrc.install - depends = libatasmart - depends = lm_sensors - depends = openrc - -pkgname = thinkfan-systemd - install = systemd.install +pkgname = thinkfan-git @@ -1,72 +1,47 @@ -# Maintainer: SSF <punx69 at gmx dot net> +# Contributor: SSF <punx69 at gmx dot net> -pkgbase=thinkfan-git -pkgname=('thinkfan-openrc' 'thinkfan-systemd') -pkgver=1.0.r150 +pkgname=thinkfan-git +pkgver=1.0_beta1.r1.72bb1ff pkgrel=1 -pkgdesc="rewrite of Thinkfan in C++11" +pkgdesc="The minimalist fan control program" arch=('i686' 'x86_64') -url="https://raw.githubusercontent.com/vmatare/thinkfan/master/README" +url="https://github.com/vmatare/thinkfan/" license=('GPL3') -makedepends=('git' 'cmake' 'make' 'sed') -optdepends=('libatasmart: read HDD temperatures' 'lm_sensors: hwmon support') -source=("${pkgbase}::git://github.com/vmatare/thinkfan#branch=master") +depends=('libatasmart') +makedepends=('cmake' 'git') +optdepends=('lm_sensors: hwmon support') +provides=("thinkfan=$pkgver") +conflicts=("thinkfan") +source=("git+https://github.com/vmatare/thinkfan.git") md5sums=('SKIP') -###if installed add to deps -if (pacman -Q libatasmart >/dev/null); then - depends+=('libatasmart') -fi -if (pacman -Q lm_sensors >/dev/null); then - depends+=('lm_sensors') -fi - pkgver() { - cd "${pkgbase}" - _rev=$(git rev-list --count HEAD) - printf "1.0.r$_rev" + cd "$srcdir/${pkgname%-git}" + printf "%s" "$(git describe --tags --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')" } build() { - cd "${pkgbase}" - if (pacman -Q libatasmart >/dev/null); then - msg "building against libatasmart" - cmake -DUSE_ATASMART:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DUSE_NVML=ON -DCMAKE_INSTALL_SBINDIR=/usr/bin . - else - msg "building without libatasmart" - cmake -DUSE_ATASMART:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DUSE_NVML=ON -DCMAKE_INSTALL_SBINDIR=/usr/bin . - fi - make -} + cd "$srcdir/${pkgname%-git}" -commonstuff() { - provides=("${pkgname}=$pkgver" "${pkgname}-git=$pkgver") - conflicts=("${pkgname}<=$pkgver" "${pkgname}-git<=$pkgver") - replaces=("${pkgname}<=$pkgver" "${pkgname}-git<=$pkgver") - cd "${pkgbase}" - make install DESTDIR="${pkgdir}" - install -d "${pkgdir}"/etc -###let this thing run at full speed(7) until configured - printf "#full speed see /usr/share/doc/thinkfan for proper configuration\n(7,0,32767)\n" > "${pkgdir}"/etc/thinkfan.conf - install -Dm644 COPYING "${pkgdir}"/usr/share/licenses/thinkfan/COPYING -###thinkpad modules load - install -d "${pkgdir}"/etc/modprobe.d - printf "options thinkpad_acpi fan_control=1" > "${pkgdir}"/etc/modprobe.d/thinkfan-thinkpad.conf -} + # fix cmake file + sed -i 's/^\(install(FILES \)NEWS /\1/' CMakeLists.txt -package_thinkfan-openrc() { - install="openrc.install" - depends+=('openrc') - commonstuff - sed -i 's|#!/sbin/runscript|#!/usr/bin/openrc-run|' rcscripts/thinkfan.gentoo - install -Dm755 rcscripts/thinkfan.gentoo "${pkgdir}"/etc/init.d/thinkfan + cmake -DUSE_ATASMART:BOOL=ON \ + -DCMAKE_BUILD_TYPE:STRING="Release" \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr \ + -DCMAKE_INSTALL_SBINDIR=/usr/bin \ + . + make } -package_thinkfan-systemd() { - install="systemd.install" - commonstuff - install -Dm644 rcscripts/thinkfan.service "${pkgdir}"/usr/lib/systemd/system/thinkfan.service -} +package() { + cd "$srcdir/${pkgname%-git}" + make install DESTDIR="$pkgdir" + + install -dm755 "$pkgdir/usr/lib/modprobe.d/" + echo "options thinkpad_acpi fan_control=1" > "$pkgdir/usr/lib/modprobe.d/thinkpad_acpi.conf" + # install systemd files + install -dm755 "$pkgdir/usr/lib/systemd/system/" + install -Dm644 rcscripts/systemd/*.service "$pkgdir/usr/lib/systemd/system/" +} diff --git a/openrc.install b/openrc.install deleted file mode 100644 index d49687881d61..000000000000 --- a/openrc.install +++ /dev/null @@ -1,34 +0,0 @@ -post_install() { - #rc-update add thinkfan default - cat <<\EOF - -############################ -# How to get this working? # -############################ - -#1 Edit the config file /etc/thinkfan.conf: - -For proper configuration see README and example configurations in /usr/share/doc/thinkfan - -#2 add/enable the service at boot: - -rc-update add thinkfan default - -#3 reboot! - -EOF -sleep 5 -} - -pre_remove() { - rc-service thinkfan stop - rc-update del thinkfan default -} - -pre_upgrade() { - rc-service thinkfan stop -} - -post_upgrade() { - rc-service thinkfan restart -} diff --git a/systemd.install b/systemd.install deleted file mode 100644 index bb1359aae704..000000000000 --- a/systemd.install +++ /dev/null @@ -1,34 +0,0 @@ -post_install() { - #systemctl enable thinkfan.service - cat <<\EOF - -############################ -# How to get this working? # -############################ - -#1 Edit the config file /etc/thinkfan.conf: - -For proper configuration see README and example configurations in /usr/share/doc/thinkfan - -#2 add/enable the service at boot: - -systemctl enable thinkfan.service - -#3 reboot! - -EOF -sleep 5 -} - -pre_remove() { - systemctl stop thinkfan.service - systemctl disable thinkfan.service -} - -pre_upgrade() { - systemctl stop thinkfan.service -} - -post_upgrade() { - systemctl restart thinkfan.service -} |