diff options
author | Milan P. Stanić <mps@arvanta.net> | 2019-09-15 20:02:27 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-09-26 14:51:58 +0000 |
commit | 5d99c7e0257f846cbdaa3b18fc8dfa0e6467f4ae (patch) | |
tree | 3e3af427332d38aa5ca41566e1f3826be9bb49f3 /main/lm-sensors | |
parent | 242a6a502d3a36c3e8f4fd681f59dcfe1e4e3c7d (diff) | |
download | aports-5d99c7e0257f846cbdaa3b18fc8dfa0e6467f4ae.tar.bz2 aports-5d99c7e0257f846cbdaa3b18fc8dfa0e6467f4ae.tar.xz |
main/lm-sensors: rename from lm_sensors and upgrade to 3.5.0
rename to lm-sensors to reflect upstream name
remove musl-fix-includes.patch. musl is supported upstream
change source url to github repository where development moved
add provides="lm_sensors" for packages which depends on old name
Diffstat (limited to 'main/lm-sensors')
-rw-r--r-- | main/lm-sensors/APKBUILD | 84 | ||||
-rw-r--r-- | main/lm-sensors/fancontrol.initd | 33 | ||||
-rw-r--r-- | main/lm-sensors/sensord.confd | 3 | ||||
-rw-r--r-- | main/lm-sensors/sensord.initd | 33 | ||||
-rw-r--r-- | main/lm-sensors/sensors-detect-alpine.patch | 47 | ||||
-rw-r--r-- | main/lm-sensors/sensors.install | 12 |
6 files changed, 212 insertions, 0 deletions
diff --git a/main/lm-sensors/APKBUILD b/main/lm-sensors/APKBUILD new file mode 100644 index 0000000000..80e235459c --- /dev/null +++ b/main/lm-sensors/APKBUILD @@ -0,0 +1,84 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=lm-sensors +pkgver=3.5.0 +pkgrel=0 +_ver=${pkgver//./-} +pkgdesc="Collection of user space tools for general SMBus access and hardware monitoring." +url="https://github.com/lm-sensors/lm-sensors" +arch="all" +provides="lm_sensors" +options="!check" # No test suite. +license="LGPL-2.1-or-later AND GPL-2.0-or-later" # libs are LGPL, binaries are GPL +depends="bash sysfsutils" +makedepends="perl rrdtool-dev bison flex" +subpackages="$pkgname-dev $pkgname-doc $pkgname-detect $pkgname-sensord + $pkgname-sensord-openrc:sensord_openrc" +#install=sensors.install + +source="$pkgname-$pkgver.tar.gz::https://github.com/lm-sensors/lm-sensors/archive/V$_ver.tar.gz + sensors-detect-alpine.patch + fancontrol.initd + sensord.confd + sensord.initd + " +builddir="$srcdir"/$pkgname-$_ver + +prepare() { + cd "$builddir" + sed -i -e 's:^# \(PROG_EXTRA\):\1:' Makefile + # Respect LDFLAGS + sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' Makefile + sed -i -e 's/\$(LIBSHSONAME) -o/$(LIBSHSONAME) \$(LDFLAGS) -o/g' \ + lib/Module.mk + + # do not check for libiconv in ldconfig cache + sed -i -e 's/^LIBICONV.*/LIBICONV ?=/' prog/sensors/Module.mk + + default_prepare +} + +build() { + cd "$builddir" + export CFLAGS="$CFLAGS -fno-stack-protector" + make PREFIX=/usr user +} + +package() { + cd "$builddir" + make PROG_EXTRA:=sensord user_install \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + DESTDIR="$pkgdir" + + cd "$srcdir" + install -Dm755 fancontrol.initd "$pkgdir"/etc/init.d/fancontrol +} + +detect() { + depends="perl" + pkgdesc="Detection/migration scripts for lm-sensors" + mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/sbin + cd "$pkgdir" + mv usr/bin/sensors-conf-convert "$subpkgdir"/usr/bin/ + mv usr/sbin/sensors-detect "$subpkgdir"/usr/bin/ +} + +sensord() { + pkgdesc="sensord daemon" + cd "$builddir" + mkdir -p "$subpkgdir"/usr/sbin + mv "$pkgdir"/usr/sbin/sensord "$subpkgdir"/usr/sbin/sensord +} + +sensord_openrc() { + pkgdesc="sensord daemon (OpenRC init scripts)" + install_if="$pkgname-sensord=$pkgver-r$pkgrel openrc" + install -Dm755 "$srcdir"/sensord.initd "$subpkgdir"/etc/init.d/sensord + install -Dm755 "$srcdir"/sensord.confd "$subpkgdir"/etc/conf.d/sensord +} + +sha512sums="bea9b2ac01bc43622cafdce0b00ac3bb8cb2d818449c8b332ab51e7ad0022b66bcbf6ca1e99c8500bdc6092c5c1ef985bfe7cff05dbcf015bd3ccf58c00a72e1 lm-sensors-3.5.0.tar.gz +794cf2aaa2a9e809c6b67f4c888a89064bba3e5b9333a9f0101a92372c25012e506fa48e86523f57cf30e5c2a808bc38058fd8640c870ea6b48faab44794cfbb sensors-detect-alpine.patch +04756c3844033dc7897e1348181140a43f8470c1bb863f1524b21bbe6be2f13fbf17ac3a68270c96a70d8c148124fea569d1ef75619bbe383e15ec705ea18b21 fancontrol.initd +a77d81ab7ded085ba19e4c637e93268f889ccb8ce9e008a210ae135cb6e2140be07e5d455cf7fcc1084fd57cfbfb3f2bb37207123aebe9566f78b5183806fd7d sensord.confd +9a19874c158e82ab076ed5fb96a40d4bfb4957bfd5a2ce66aa207c06e577bc1b048336c0046a9f856f6d00dc10e68a0dc9726f6e726a8f7bfd50c4043ee1e26a sensord.initd" diff --git a/main/lm-sensors/fancontrol.initd b/main/lm-sensors/fancontrol.initd new file mode 100644 index 0000000000..cb29a9ee93 --- /dev/null +++ b/main/lm-sensors/fancontrol.initd @@ -0,0 +1,33 @@ +#!/sbin/openrc-run +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/lm_sensors/files/fancontrol-init.d,v 1.1 2007/05/17 07:31:41 phreak Exp $ + +CONFIG=/etc/fancontrol +PID=/var/run/fancontrol.pid + +depend() { + after lm_sensors +} + +checkconfig() { + if [ ! -f ${CONFIG} ]; then + eerror "Configuration file ${CONFIG} not found" + return 1 + fi +} + +start() { + checkconfig || return 1 + + ebegin "Starting fancontrol" + start-stop-daemon --start --quiet --background --pidfile ${PID} \ + --exec /usr/sbin/fancontrol -- ${CONFIG} + eend ${?} +} + +stop() { + ebegin "Stopping fancontrol" + start-stop-daemon --stop --pidfile ${PID} + eend ${?} +} diff --git a/main/lm-sensors/sensord.confd b/main/lm-sensors/sensord.confd new file mode 100644 index 0000000000..d82841aebd --- /dev/null +++ b/main/lm-sensors/sensord.confd @@ -0,0 +1,3 @@ +# Extra options to pass to the sensord daemon, +# see sensord(8) for more information +SENSORD_OPTIONS="" diff --git a/main/lm-sensors/sensord.initd b/main/lm-sensors/sensord.initd new file mode 100644 index 0000000000..c100b1aa1e --- /dev/null +++ b/main/lm-sensors/sensord.initd @@ -0,0 +1,33 @@ +#!/sbin/openrc-run +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/lm_sensors/files/sensord-init.d,v 1.1 2007/05/17 07:31:41 phreak Exp $ + +CONFIG=/etc/sensors3.conf + +depend() { + need logger + use lm_sensors +} + +checkconfig() { + if [ ! -f ${CONFIG} ]; then + eerror "Configuration file ${CONFIG} not found" + return 1 + fi +} + +start() { + checkconfig || return 1 + + ebegin "Starting sensord" + start-stop-daemon --start --exec /usr/sbin/sensord \ + -- --config-file ${CONFIG} ${SENSORD_OPTIONS} + eend ${?} +} + +stop() { + ebegin "Stopping sensord" + start-stop-daemon --stop --pidfile /var/run/sensord.pid + eend ${?} +} diff --git a/main/lm-sensors/sensors-detect-alpine.patch b/main/lm-sensors/sensors-detect-alpine.patch new file mode 100644 index 0000000000..319fcec069 --- /dev/null +++ b/main/lm-sensors/sensors-detect-alpine.patch @@ -0,0 +1,47 @@ +diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect +index 08721f0..6e83e97 100755 +--- a/prog/detect/sensors-detect ++++ b/prog/detect/sensors-detect +@@ -7059,31 +7059,20 @@ sub write_config + } + } + +- my $have_sysconfig = -d '/etc/sysconfig'; +- printf "Do you want to \%s /etc/sysconfig/lm_sensors? (\%s): ", +- (-e '/etc/sysconfig/lm_sensors' ? 'overwrite' : 'generate'), +- ($have_sysconfig ? 'YES/no' : 'yes/NO'); ++ my $config = '/etc/modules-load.d/lm_sensors.conf'; ++ my $have_config = -f $config; ++ printf "Do you want to \%s \%s? (\%s): ", ++ (-e $config ? 'overwrite' : 'generate'), ++ $config, ++ ($have_config ? 'YES/no' : 'yes/NO'); + $_ = read_answer(); +- if (($have_sysconfig and not m/^\s*n/i) or m/^\s*y/i) { +- unless ($have_sysconfig) { +- mkdir('/etc/sysconfig', 0777) +- or die "Sorry, can't create /etc/sysconfig ($!)"; +- } +- open(local *SYSCONFIG, ">/etc/sysconfig/lm_sensors") +- or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)"; ++ if (($have_config and not m/^\s*n/i) or m/^\s*y/i) { ++ open(local *SYSCONFIG, ">$config") ++ or die "Sorry, can't create $config ($!)"; + print SYSCONFIG "# Generated by sensors-detect on " . scalar localtime() . "\n"; +- print SYSCONFIG <<'EOT'; +-# This file is sourced by /etc/init.d/lm_sensors and defines the modules to +-# be loaded/unloaded. +-# +-# The format of this file is a shell script that simply defines variables: +-# HWMON_MODULES for hardware monitoring driver modules, and optionally +-# BUS_MODULES for any required bus driver module (for example for I2C or SPI). +- +-EOT +- print SYSCONFIG "BUS_MODULES=\"", join(" ", @{$bus_modules}), "\"\n" ++ print SYSCONFIG join("\n", @{$bus_modules}), "\n" + if @{$bus_modules}; +- print SYSCONFIG "HWMON_MODULES=\"", join(" ", @{$hwmon_modules}), "\"\n"; ++ print SYSCONFIG join("\n", @{$hwmon_modules}), "\n"; + close(SYSCONFIG); + + if (-x "/bin/systemctl" && -d "/lib/systemd/system" && diff --git a/main/lm-sensors/sensors.install b/main/lm-sensors/sensors.install new file mode 100644 index 0000000000..d593f84144 --- /dev/null +++ b/main/lm-sensors/sensors.install @@ -0,0 +1,12 @@ +post_install() { + echo ">>> to control the lm_sensors daemon type" + echo ">>> \"/etc/rc.d/sensors start|stop|restart\" " + echo ">>> --------------------------------------" + echo ">>> before you can use the fancontrol daemon" + echo ">>> first create a fancontrol config file, use \"pwmconfig\"" + echo ">>> then type \"/etc/rc.d/fancontrol start|stop|restart\" " + echo ">>> --------------------------------------" + echo ">>> to decode memory SPD timings modprobe eeprom module" + echo ">>> and get this perl script from" + echo ">>> \"http://www.lm-sensors.org/browser/lm-sensors/trunk/prog/eeprom/decode-dimms.pl\"" +} |