diff options
author | Stuart Shelton <stuart@shelton.me> | 2013-11-19 14:59:46 +0000 |
---|---|---|
committer | Stuart Shelton <stuart@shelton.me> | 2013-11-19 14:59:46 +0000 |
commit | 2c86f5b62cb13fdcf3d8807101a553d3fa5dcdb6 (patch) | |
tree | a876f22593c2bd7f9ef2283c6ac1651523f54e91 /sys-apps | |
parent | Add sys-apps/kmod-15 with state files located within /var/run (diff) | |
download | srcshelton-2c86f5b62cb13fdcf3d8807101a553d3fa5dcdb6.tar.gz srcshelton-2c86f5b62cb13fdcf3d8807101a553d3fa5dcdb6.tar.bz2 srcshelton-2c86f5b62cb13fdcf3d8807101a553d3fa5dcdb6.zip |
Add sys-apps/lm_sensors with state files located within /var/run
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/lm_sensors/Manifest | 13 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/fancontrol-init.d-2 | 23 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/fancontrol.service | 9 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/lm_sensors-3-init.d | 105 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/lm_sensors-3.3.1-sensors-detect-gentoo.patch | 129 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/lm_sensors-3.3.4-sensors-detect-gentoo.patch | 118 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/sensord-3-init.d | 33 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/sensord-4-init.d | 22 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/sensord-conf.d | 3 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/sensord.service | 9 | ||||
-rw-r--r-- | sys-apps/lm_sensors/lm_sensors-3.3.3-r3.ebuild | 111 | ||||
-rw-r--r-- | sys-apps/lm_sensors/lm_sensors-3.3.4-r1.ebuild | 109 |
12 files changed, 684 insertions, 0 deletions
diff --git a/sys-apps/lm_sensors/Manifest b/sys-apps/lm_sensors/Manifest new file mode 100644 index 00000000..a5a8cb52 --- /dev/null +++ b/sys-apps/lm_sensors/Manifest @@ -0,0 +1,13 @@ +AUX fancontrol-init.d-2 560 SHA256 36d489296c31736f8015b0ce27052b3f1555b7fe6335120c0477b044b8e4fb8d SHA512 95f54da52993a9a39f3cc80caeac0e60ba11f158692df773564e981810e01371703fa50995388978edf08d122df64cffcbfd82a36e0cd61f76e8a9e7b11f23a8 WHIRLPOOL d6af2f05dec9418965695328f6ffd0a700126dcf885e92317bfc78743a5d885f27e2c65f7339a5e66c1cb77522bfc3c176285c4643af443b167fe45aeab8df43 +AUX fancontrol.service 150 SHA256 d07fb50714abfcac5d8aa818d6c40de08221401b554cb21f85dbf2a6cf2eef87 SHA512 e6a738c2458ecffa56d79ab0b187c20a7daebca737bac1a87c82fda5bae24ad4f2a61fd6daeab0a8e5582c404d57372f5eda1a66fe74ccbcb948c114d3e6a0cd WHIRLPOOL 7fb0f1170dbfca825ac245e257e275c58c76adb0bb550434b23d25cf317dffb0319bc9934da6393f279dea85aa6313941b7ff713bfcd9c8e70f36ebcb2c3e7b8 +AUX lm_sensors-3-init.d 2466 SHA256 9b018f9f7a0975988387858823fe59a5cd8af6413d8c3170db0e24aac6021ec3 SHA512 16b3c7f742c70abcd310928be32fc63b0d344447776bc380be20f8708fbb72bc9b07ddec5ad867cfdc44247474aea3ff5d4f8b405cab896c07791a7a1834db7f WHIRLPOOL 3a090000cc486389a8630f3d88df486cd63458710d1cfb05b8dc545a758fee646698854fd6a13d23b9ff78265ed04aa79c0119acd4a9355fcb51847f2f095b0d +AUX lm_sensors-3.3.1-sensors-detect-gentoo.patch 4906 SHA256 39f8674e526aa837493a5009b7465f7c8f04784c5990de8a6b8c885c5d8b44a7 SHA512 3d502f1271e06e74ef290efe7d634a55e5b1e017111c409fc26233416d9680e1a102ee1ba68986ca37f787a27d3e3325ba22ceb46e28d3a0d074dc92608f25f2 WHIRLPOOL 7df804767d16890b4420810b6e50797f0dbff4f525de6c41a5ec36e73319a44b5cff4f997a3dbe18e34835dfe3e07a7b8a296aa41f0c46a84c797fe8bcd0c909 +AUX lm_sensors-3.3.4-sensors-detect-gentoo.patch 4551 SHA256 cb170946b67fdc31fd42f174e1ef2ab40efb733c0db081fac4fa2b8ab7883e52 SHA512 15d4dfcebab8b89d6eca536256e92353e9abedda328fcb84629c0aff3e01fafaacb4df4caae9044bdcafb9b4a2fb660880e8e234ff8d797c26d616336f88d49a WHIRLPOOL 05d7eb12c54debaf2a6ee81f8fb954e0c02425f22930c271f111366a03832bd8db94e5163134e514bda634b6aa71afdeaeb94232b02e4e6cd825b1b8533ebb3e +AUX sensord-3-init.d 712 SHA256 8a3debf0b84af9944a467e377b0e4b0db67d428083675f0fcf33ec55a8b2a709 SHA512 d442053fce522f4133eb38220b7acd7bcf626fd00297eaa42ab191568bd9cd3b3592831269e5e73a6dd9885c64f7dd8745b542cee321a5daf21ecb189192d452 WHIRLPOOL dc48de372d732e9b883f5db1e06159b6d6df72c2f4ad92cae6290ee352b7f531bb2e3a94b3425bcd9400a58f8549f094948b2b3c930c80b7d4f9e181cc0be2df +AUX sensord-4-init.d 569 SHA256 9fc8de512a6e474e5c9cb4aabef4714d5039cc1b8880cefc7c50d4cf37216b7b SHA512 40fa69759138b411d00af761be0a112b67c5c8bb7ab0a7209c446da4c9a92075a3e3891fe721bb227bba2a7dcb0900c4a533287e3674215defbb84d440b6dfb4 WHIRLPOOL 59f964b1179a999e4cd8bdcb25e19347b38e63ebfd1d2b0aa977b90d2cfc59449632152cf79368c925ab25bb3b0f8273e4cd0f4c2de0281e830835bbb6e7d067 +AUX sensord-conf.d 104 SHA256 02230edf5efbb0a4de3840cd76f9ebf431c57a246fa7388e9dbeb0fe26fe7b8d SHA512 a77d81ab7ded085ba19e4c637e93268f889ccb8ce9e008a210ae135cb6e2140be07e5d455cf7fcc1084fd57cfbfb3f2bb37207123aebe9566f78b5183806fd7d WHIRLPOOL b52a37909dd45c3f7a6a3cab4695e460cf318f05b00faf25aa0717a5caaa1f185b32648711f4842d69e4aa4a062abbf39278fd903b3b07bd8389be73d4777907 +AUX sensord.service 159 SHA256 db38a15de6d311d91f336f708f63e732000731a1f07a5e7d7ac911faf58ddca3 SHA512 c554910a36e44d84f64d5c8924170c3eaccf9715aee2157a37ecf542a1d254c0d9a269555ec3e99165ef7e39874616bc07dddc01c8d708114232df58232c3906 WHIRLPOOL 1cffd3b9a62eba01af22237221980f1cbeb29738e65510532795a39ad9ea7fd72beafd2180a4342164abe9a1f6a1e11048fe3e75b342760add0548dc61e21c14 +DIST lm_sensors-3.3.3.tar.bz2 172467 SHA256 ecc91ba3d918e96fb7d5eb9acce978af803b130e0b33b08d5ea05b2bfca84955 SHA512 22996d4ded0df4302aa35b78dfbffe35ac27ceb72a23ca14d2ca83a41a5f7a1cf01a5e42dafa6cba91da81d27ddcdf14a7b4a41deebcd64f75c26bb6c35848c5 WHIRLPOOL b109ba91839c411f1a5d5e784b162b1c7da31768e366d55810e0574bae2e19fe106db46c994bc571fcab2900aa50a4ed5eba0dee40f7e2158a74c5dac69340cd +DIST lm_sensors-3.3.4.tar.bz2 172226 SHA256 b4608610cb5de4b24e3fe1ae357712e8633a8a929bbb42df5eecc4ccee6ba76d SHA512 a375f747a1687da0fe743d731893156f7983e001725c2d7cd284cefd3e8922deb3dfe542d3c901e3da8fff321633d64180a637d780b5e1bb3f1e9a254c16b7e6 WHIRLPOOL 4011264a56c36ffcfe28d357ceae1929fdf8a21c27bfaba928c9a7b48ef2b8422cd6650981a4c8f220900cc45526ca4bbfda9810b54db0efaf15cdaad4599838 +EBUILD lm_sensors-3.3.3-r3.ebuild 3463 SHA256 e4c5acec916d86f5544e913ab834c2fbfaab5a4f1caeb89034afc9e742e59983 SHA512 a299a6776398cdfb4b46c9e87aa51ebeedf570bb58608600981255064cb955cdf6ebf7c0fe678fe5964e2983193e271d220b110c33d4faebae86f729f78809c8 WHIRLPOOL 9d7f3b42c747f6bcda7ec8f73a7843604f74831cad6d353f0d8b3607d67698981931e03b7ef98f22447f6228a9914cfc3c8471c47a63db77d5d47f1a28131053 +EBUILD lm_sensors-3.3.4-r1.ebuild 3429 SHA256 4eca53a039663a3637e4d93207aef5db44f36188ec3d0005f064ee966c1a7d9e SHA512 51007566b1dd89eba403f314b2c10e639d9a21e1174494553015a14732cf26723c89a0925d7d5ec55bd140178e7b6d75f417737ff761e7c7856677ea3c4d106e WHIRLPOOL ce0bab078eb8e94b8c38cbfe93cca147310464bc970b5828745b43912de86923d4897c7689a27273364f3d978b27c4e34de3076ed460e281bd68adc3b578a94f diff --git a/sys-apps/lm_sensors/files/fancontrol-init.d-2 b/sys-apps/lm_sensors/files/fancontrol-init.d-2 new file mode 100644 index 00000000..51857a1f --- /dev/null +++ b/sys-apps/lm_sensors/files/fancontrol-init.d-2 @@ -0,0 +1,23 @@ +#!/sbin/runscript +# Copyright 1999-2012 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-2,v 1.1 2012/12/28 00:00:03 flameeyes Exp $ + +CONFIG=/etc/fancontrol + +depend() { + need localmount + use lm_sensors +} + +command=/usr/sbin/fancontrol +command_arguments="${CONFIG}" +start_stop_daemon_args="--background" +pidfile=/var/run/fancontrol.pid + +start_pre() { + if [ ! -f ${CONFIG} ]; then + eerror "Configuration file ${CONFIG} not found" + return 1 + fi +} diff --git a/sys-apps/lm_sensors/files/fancontrol.service b/sys-apps/lm_sensors/files/fancontrol.service new file mode 100644 index 00000000..c86b498f --- /dev/null +++ b/sys-apps/lm_sensors/files/fancontrol.service @@ -0,0 +1,9 @@ +[Unit] +Description=Fan control daemon + +[Service] +PIDFile=/var/run/fancontrol.pid +ExecStart=/usr/sbin/fancontrol + +[Install] +WantedBy=multi-user.target diff --git a/sys-apps/lm_sensors/files/lm_sensors-3-init.d b/sys-apps/lm_sensors/files/lm_sensors-3-init.d new file mode 100644 index 00000000..18fb3537 --- /dev/null +++ b/sys-apps/lm_sensors/files/lm_sensors-3-init.d @@ -0,0 +1,105 @@ +#!/sbin/runscript +# 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/lm_sensors-3-init.d,v 1.1 2008/03/17 07:59:28 dberkholz Exp $ + +checkconfig() { + if [ ! -f /etc/conf.d/lm_sensors ]; then + eerror "/etc/conf.d/lm_sensors does not exist, try running sensors-detect" + return 1 + fi + + if [ "${LOADMODULES}" = "yes" -a -f /proc/modules ]; then + if [ -z "${MODULE_0}" ]; then + eerror "MODULE_0 is not set in /etc/conf.d/lm_sensors, try running sensors-detect" + return 1 + fi + fi +} + +start() { + checkconfig || return 1 + + if [ "${LOADMODULES}" = "yes" -a -f /proc/modules ]; then + einfo "Loading lm_sensors modules..." + + mount | grep sysfs >/dev/null 2>&1 + if [ ${?} = 0 ]; then + if ! ( [ -e /sys/i2c ] || [ -e /sys/bus/i2c ] ); then + ebegin " Loading i2c-core" + modprobe i2c-core >/dev/null 2>&1 + if [ ${?} != 0 ]; then + eerror " Could not load i2c-core!" + eend 1 + fi + ( [ -e /sys/i2c ] || [ -e /sys/bus/i2c ] ) || return 1 + eend 0 + fi + elif ! [ -e /proc/sys/dev/sensors ]; then + ebegin " Loading i2c-proc" + modprobe i2c-proc >/dev/null 2>&1 + if [ ${?} != 0 ]; then + eerror " Could not load i2c-proc!" + eend 1 + fi + [ -e /proc/sys/dev/sensors ] || return 1 + eend 0 + fi + + i=0 + while true; do + module=`eval echo '$'MODULE_${i}` + module_args=`eval echo '$'MODULE_${i}_ARGS` + if [ -z "${module}" ]; then + break + fi + ebegin " Loading ${module}" + modprobe ${module} ${module_args} >/dev/null 2>&1 + eend $? + i=$(($i+1)) + done + fi + + if [ "${INITSENSORS}" = "yes" ]; then + if ! [ -f /etc/sensors3.conf ]; then + eerror "/etc/sensors3.conf does not exist!" + return 1 + fi + + ebegin "Initializing sensors" + /usr/bin/sensors -s >/dev/null 2>&1 + eend ${?} + fi +} + +stop() { + checkconfig || return 1 + + if [ "${LOADMODULES}" = "yes" -a -f /proc/modules ]; then + einfo "Unloading lm_sensors modules..." + + # find the highest possible MODULE_ number + i=0 + while true; do + module=`eval echo '$'MODULE_${i}` + if [ -z "${module}" ] ; then + break + fi + i=$(($i+1)) + done + + while [ ${i} -gt 0 ]; do + i=$(($i-1)) + module=`eval echo '$'MODULE_${i}` + ebegin " Unloading ${module}" + rmmod ${module} >/dev/null 2>&1 + eend $? + done + + if [ -e /proc/sys/dev/sensors ] ; then + ebegin " Unloading i2c-proc" + rmmod i2c-proc >/dev/null 2>&1 + eend $? + fi + fi +} diff --git a/sys-apps/lm_sensors/files/lm_sensors-3.3.1-sensors-detect-gentoo.patch b/sys-apps/lm_sensors/files/lm_sensors-3.3.1-sensors-detect-gentoo.patch new file mode 100644 index 00000000..58772f21 --- /dev/null +++ b/sys-apps/lm_sensors/files/lm_sensors-3.3.1-sensors-detect-gentoo.patch @@ -0,0 +1,129 @@ +--- lm_sensors-3.3.1/prog/detect/sensors-detect ++++ lm_sensors-3.3.1/prog/detect/sensors-detect +@@ -20,6 +20,9 @@ + # MA 02110-1301 USA. + # + ++# Gentoo specific modifications based on a patch from Rudo Thomas ++# <thomr9am@ss1000.ms.mff.cuni.cz> ++ + require 5.004; + + use strict; +@@ -6471,26 +6474,33 @@ + print MODPROBE_D $configfile; + close(MODPROBE_D); + } else { ++ print "\nIf you want to load the modules at startup, generate a config file\n", ++ "below and make sure lm_sensors gets started at boot time; e.g\n", ++ "\$ rc-update add lm_sensors default\n"; + print "To make the sensors modules behave correctly, add these lines to\n". +- "/etc/modprobe.conf:\n\n"; ++ "/etc/modules.d/lm_sensors and run modules-update:\n\n"; + print "#----cut here----\n". + $configfile. + "#----cut here----\n\n"; + } + } + +- 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'); +- $_ = <STDIN>; +- 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 ($!)"; ++ my $have_config = -f '/etc/conf.d/lm_sensors'; ++ print "\nDo you want to ".($have_config?"overwrite":"generate"). ++ " /etc/conf.d/lm_sensors? Enter s to specify other file name?\n", ++ " (".($have_config?"yes/NO":"YES/no")."/s): "; ++ my $reply = <STDIN>; ++ ++ if (($have_config and $reply =~ /^\s*[Yy]/) or ++ (not $have_config and not $reply =~ /^\s*[Nn]/) or ++ $reply =~ /^\s*[Ss]/) { ++ my $filename = "/etc/conf.d/lm_sensors"; ++ if ($reply =~ /^\s*[Ss]/) { ++ print "Specify the file to store the configuration to: "; ++ $filename = <STDIN>; + } +- open(local *SYSCONFIG, ">/etc/sysconfig/lm_sensors") +- or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)"; ++ open(local *SYSCONFIG, ">".$filename) ++ or die "Sorry, can't create $filename ($!)."; + 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 +@@ -6501,6 +6511,11 @@ + # BUS_MODULES for any required bus driver module (for example for I2C or SPI). + + EOT ++ print SYSCONFIG ++ "# Load modules at startup\n". ++ "LOADMODULES=yes\n\n". ++ "# Initialize sensors at startup\n". ++ "INITSENSORS=yes\n\n"; + print SYSCONFIG "BUS_MODULES=\"", join(" ", @{$bus_modules}), "\"\n" + if @{$bus_modules}; + print SYSCONFIG "HWMON_MODULES=\"", join(" ", @{$hwmon_modules}), "\"\n"; +@@ -6509,6 +6524,10 @@ + + # For compatibility reasons, modules are also listed individually as variables + # MODULE_0, MODULE_1, MODULE_2, etc. ++# Please note that the numbers in MODULE_X must start at 0 and increase in ++# steps of 1. Any number that is missing will make the init script skip the ++# rest of the modules. Use MODULE_X_ARGS for arguments. ++# + # You should use BUS_MODULES and HWMON_MODULES instead if possible. + + EOT +@@ -6519,25 +6538,7 @@ + } + close(SYSCONFIG); + +- if (-x "/bin/systemctl" && -d "/lib/systemd/system" && +- ! -f "/lib/systemd/system/lm_sensors.service") { +- print "Copy prog/init/lm_sensors.service to /lib/systemd/system\n". +- "and run 'systemctl enable lm_sensors.service'\n". +- "for initialization at boot time.\n"; +- return; +- } +- +- if (-x "/bin/systemctl" && +- -f "/lib/systemd/system/lm_sensors.service") { +- system("/bin/systemctl", "enable", "lm_sensors.service"); +- system("/bin/systemctl", "start", "lm_sensors.service"); +- # All done, don't check for /etc/init.d/lm_sensors +- return; +- } +- +- print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n". +- "for initialization at boot time.\n" +- unless -f "/etc/init.d/lm_sensors"; ++ print "Done.\n"; + + if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") { + system("/sbin/insserv", "/etc/init.d/lm_sensors"); +@@ -6551,20 +6552,6 @@ + "kernel modules.\n\n"; + } + } else { +- print "To load everything that is needed, add this to one of the system\n". +- "initialization scripts (e.g. /etc/rc.d/rc.local):\n\n"; +- print "#----cut here----\n"; +- if (@{$bus_modules}) { +- print "# Adapter drivers\n"; +- print "modprobe $_\n" foreach (@{$bus_modules}); +- } +- print "# Chip drivers\n"; +- print "modprobe $_\n" foreach (@{$hwmon_modules}); +- print((-e '/usr/bin/sensors' ? +- "/usr/bin/sensors -s\n" : +- "/usr/local/bin/sensors -s\n"). +- "#----cut here----\n\n"); +- + print "If you have some drivers built into your kernel, the list above will\n". + "contain too many modules. Skip the appropriate ones! You really\n". + "should try these commands right now to make sure everything is\n". diff --git a/sys-apps/lm_sensors/files/lm_sensors-3.3.4-sensors-detect-gentoo.patch b/sys-apps/lm_sensors/files/lm_sensors-3.3.4-sensors-detect-gentoo.patch new file mode 100644 index 00000000..215969af --- /dev/null +++ b/sys-apps/lm_sensors/files/lm_sensors-3.3.4-sensors-detect-gentoo.patch @@ -0,0 +1,118 @@ +diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect +index fb17481..bb324c2 100755 +--- a/prog/detect/sensors-detect ++++ b/prog/detect/sensors-detect +@@ -20,6 +20,9 @@ + # MA 02110-1301 USA. + # + ++# Gentoo specific modifications based on a patch from Rudo Thomas ++# <thomr9am@ss1000.ms.mff.cuni.cz> ++ + require 5.004; + + use strict; +@@ -6671,26 +6674,33 @@ sub write_config + print MODPROBE_D $configfile; + close(MODPROBE_D); + } else { ++ print "\nIf you want to load the modules at startup, generate a config file\n", ++ "below and make sure lm_sensors gets started at boot time; e.g\n", ++ "\$ rc-update add lm_sensors default\n"; + print "To make the sensors modules behave correctly, add these lines to\n". +- "/etc/modprobe.conf:\n\n"; ++ "/etc/modules.d/lm_sensors and run modules-update:\n\n"; + print "#----cut here----\n". + $configfile. + "#----cut here----\n\n"; + } + } + +- 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'); +- $_ = <STDIN>; +- 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 ($!)"; ++ my $have_config = -f '/etc/conf.d/lm_sensors'; ++ print "\nDo you want to ".($have_config?"overwrite":"generate"). ++ " /etc/conf.d/lm_sensors? Enter s to specify other file name?\n", ++ " (".($have_config?"yes/NO":"YES/no")."/s): "; ++ my $reply = <STDIN>; ++ ++ if (($have_config and $reply =~ /^\s*[Yy]/) or ++ (not $have_config and not $reply =~ /^\s*[Nn]/) or ++ $reply =~ /^\s*[Ss]/) { ++ my $filename = "/etc/conf.d/lm_sensors"; ++ if ($reply =~ /^\s*[Ss]/) { ++ print "Specify the file to store the configuration to: "; ++ $filename = <STDIN>; + } +- open(local *SYSCONFIG, ">/etc/sysconfig/lm_sensors") +- or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)"; ++ open(local *SYSCONFIG, ">".$filename) ++ or die "Sorry, can't create $filename ($!)."; + 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 +@@ -6701,30 +6711,17 @@ sub write_config + # BUS_MODULES for any required bus driver module (for example for I2C or SPI). + + EOT ++ print SYSCONFIG ++ "# Load modules at startup\n". ++ "LOADMODULES=yes\n\n". ++ "# Initialize sensors at startup\n". ++ "INITSENSORS=yes\n\n"; + print SYSCONFIG "BUS_MODULES=\"", join(" ", @{$bus_modules}), "\"\n" + if @{$bus_modules}; + print SYSCONFIG "HWMON_MODULES=\"", join(" ", @{$hwmon_modules}), "\"\n"; + close(SYSCONFIG); + +- if (-x "/bin/systemctl" && -d "/lib/systemd/system" && +- ! -f "/lib/systemd/system/lm_sensors.service") { +- print "Copy prog/init/lm_sensors.service to /lib/systemd/system\n". +- "and run 'systemctl enable lm_sensors.service'\n". +- "for initialization at boot time.\n"; +- return; +- } +- +- if (-x "/bin/systemctl" && +- -f "/lib/systemd/system/lm_sensors.service") { +- system("/bin/systemctl", "enable", "lm_sensors.service"); +- system("/bin/systemctl", "start", "lm_sensors.service"); +- # All done, don't check for /etc/init.d/lm_sensors +- return; +- } +- +- print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n". +- "for initialization at boot time.\n" +- unless -f "/etc/init.d/lm_sensors"; ++ print "Done.\n"; + + if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") { + system("/sbin/insserv", "/etc/init.d/lm_sensors"); +@@ -6738,20 +6735,6 @@ EOT + "kernel modules.\n\n"; + } + } else { +- print "To load everything that is needed, add this to one of the system\n". +- "initialization scripts (e.g. /etc/rc.d/rc.local):\n\n"; +- print "#----cut here----\n"; +- if (@{$bus_modules}) { +- print "# Adapter drivers\n"; +- print "modprobe $_\n" foreach (@{$bus_modules}); +- } +- print "# Chip drivers\n"; +- print "modprobe $_\n" foreach (@{$hwmon_modules}); +- print((-e '/usr/bin/sensors' ? +- "/usr/bin/sensors -s\n" : +- "/usr/local/bin/sensors -s\n"). +- "#----cut here----\n\n"); +- + print "If you have some drivers built into your kernel, the list above will\n". + "contain too many modules. Skip the appropriate ones! You really\n". + "should try these commands right now to make sure everything is\n". diff --git a/sys-apps/lm_sensors/files/sensord-3-init.d b/sys-apps/lm_sensors/files/sensord-3-init.d new file mode 100644 index 00000000..74851259 --- /dev/null +++ b/sys-apps/lm_sensors/files/sensord-3-init.d @@ -0,0 +1,33 @@ +#!/sbin/runscript +# 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-3-init.d,v 1.1 2009/11/29 13:13:08 bangert 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/sys-apps/lm_sensors/files/sensord-4-init.d b/sys-apps/lm_sensors/files/sensord-4-init.d new file mode 100644 index 00000000..4f773c80 --- /dev/null +++ b/sys-apps/lm_sensors/files/sensord-4-init.d @@ -0,0 +1,22 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/lm_sensors/files/sensord-4-init.d,v 1.3 2013/09/17 20:05:50 pacho Exp $ + +CONFIG=/etc/sensors3.conf + +depend() { + need localmount + use logger lm_sensors +} + +pidfile=/var/run/sensord.pid +command=/usr/sbin/sensord +command_args="--config-file ${CONFIG} ${SENSORD_OPTIONS} --pid-file ${pidfile}" + +start_pre() { + if [ ! -f ${CONFIG} ]; then + eerror "Configuration file ${CONFIG} not found" + return 1 + fi +} diff --git a/sys-apps/lm_sensors/files/sensord-conf.d b/sys-apps/lm_sensors/files/sensord-conf.d new file mode 100644 index 00000000..d82841ae --- /dev/null +++ b/sys-apps/lm_sensors/files/sensord-conf.d @@ -0,0 +1,3 @@ +# Extra options to pass to the sensord daemon, +# see sensord(8) for more information +SENSORD_OPTIONS="" diff --git a/sys-apps/lm_sensors/files/sensord.service b/sys-apps/lm_sensors/files/sensord.service new file mode 100644 index 00000000..6d272f1e --- /dev/null +++ b/sys-apps/lm_sensors/files/sensord.service @@ -0,0 +1,9 @@ +[Unit] +Description=Sensor information logging daemon + +[Service] +PIDFile=/var/run/sensord.pid +ExecStart=/usr/sbin/sensord + +[Install] +WantedBy=multi-user.target diff --git a/sys-apps/lm_sensors/lm_sensors-3.3.3-r3.ebuild b/sys-apps/lm_sensors/lm_sensors-3.3.3-r3.ebuild new file mode 100644 index 00000000..ca8bd147 --- /dev/null +++ b/sys-apps/lm_sensors/lm_sensors-3.3.3-r3.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/lm_sensors/lm_sensors-3.3.3-r3.ebuild,v 1.5 2013/09/25 17:29:07 ago Exp $ + +EAPI=5 + +inherit eutils linux-info toolchain-funcs multilib systemd + +DESCRIPTION="Hardware Monitoring user-space utilities" +HOMEPAGE="http://www.lm-sensors.org/" +SRC_URI="http://dl.lm-sensors.org/lm-sensors/releases/${P}.tar.bz2" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="alpha amd64 ~arm ~mips ppc sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux" +IUSE="sensord static-libs systemd" + +RDEPEND="dev-lang/perl + sensord? ( + net-analyzer/rrdtool + virtual/logger + )" +DEPEND="${RDEPEND} + sys-devel/bison + sys-devel/flex" + +CONFIG_CHECK="~HWMON ~I2C_CHARDEV ~I2C" +WARNING_HWMON="${PN} requires CONFIG_HWMON to be enabled for use." +WARNING_I2C_CHARDEV="sensors-detect requires CONFIG_I2C_CHARDEV to be enabled." +WARNING_I2C="${PN} requires CONFIG_I2C to be enabled for most sensors." + +src_prepare() { + epatch "${FILESDIR}"/${PN}-3.3.1-sensors-detect-gentoo.patch + + use sensord && { sed -i -e 's:^#\(PROG_EXTRA.*\):\1:' Makefile || die; } + + # Respect LDFLAGS + sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' Makefile || die + + # Fix shipped unit file paths + sed -i -e 's:\(^EnvironmentFile=\).*:\1/etc/conf.d/lm_sensors:' \ + prog/init/lm_sensors.service || die + + use static-libs || { sed -i -e '/^BUILD_STATIC_LIB/d' Makefile || die; } +} + +src_compile() { + einfo + einfo "You may safely ignore any errors from compilation" + einfo "that contain \"No such file or directory\" references." + einfo + + emake CC="$(tc-getCC)" +} + +src_install() { + emake \ + DESTDIR="${D}" \ + PREFIX="${EPREFIX}/usr" \ + MANDIR="${EPREFIX}/usr/share/man" \ + ETCDIR="${EPREFIX}/etc" \ + LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ + install + + newinitd "${FILESDIR}"/${PN}-3-init.d ${PN} + use systemd && systemd_dounit prog/init/lm_sensors.service + + newinitd "${FILESDIR}"/fancontrol-init.d-2 fancontrol + use systemd && systemd_dounit "${FILESDIR}"/fancontrol.service + + if use sensord; then + newconfd "${FILESDIR}"/sensord-conf.d sensord + newinitd "${FILESDIR}"/sensord-4-init.d sensord + use systemd && systemd_dounit "${FILESDIR}"/sensord.service + fi + + dodoc CHANGES CONTRIBUTORS INSTALL README \ + doc/{donations,fancontrol.txt,fan-divisors,libsensors-API.txt,progs,temperature-sensors,vid} + + docinto chips + dodoc doc/chips/* + + docinto developers + dodoc doc/developers/applications +} + +pkg_postinst() { + elog + elog "Please run \`/usr/sbin/sensors-detect' in order to setup" + elog "/etc/conf.d/${PN}." + elog + elog "/etc/conf.d/${PN} is vital to the init-script." + elog "Please make sure you also add ${PN} to the desired" + elog "runlevel. Otherwise your I2C modules won't get loaded" + elog "on the next startup." + elog + elog "You will also need to run the above command if you're upgrading from" + elog "<=${PN}-2, as the needed entries in /etc/conf.d/${PN} has" + elog "changed." + elog + elog "Be warned, the probing of hardware in your system performed by" + elog "sensors-detect could freeze your system. Also make sure you read" + elog "the documentation before running ${PN} on IBM ThinkPads." + elog + elog "Also make sure you have read:" + elog "http://www.lm-sensors.org/wiki/FAQ/Chapter3#Mysensorshavestoppedworkinginkernel2.6.31" + elog + elog "Please refer to the ${PN} documentation for more information." + elog "(http://www.lm-sensors.org/wiki/Documentation)" + elog +} diff --git a/sys-apps/lm_sensors/lm_sensors-3.3.4-r1.ebuild b/sys-apps/lm_sensors/lm_sensors-3.3.4-r1.ebuild new file mode 100644 index 00000000..4a1ecc7b --- /dev/null +++ b/sys-apps/lm_sensors/lm_sensors-3.3.4-r1.ebuild @@ -0,0 +1,109 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/lm_sensors/lm_sensors-3.3.4-r1.ebuild,v 1.1 2013/09/17 20:05:51 pacho Exp $ + +EAPI=5 + +inherit eutils linux-info multilib systemd toolchain-funcs + +DESCRIPTION="Hardware Monitoring user-space utilities" +HOMEPAGE="http://www.lm-sensors.org/" +SRC_URI="http://dl.lm-sensors.org/lm-sensors/releases/${P}.tar.bz2" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~mips ~ppc ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux" +IUSE="sensord static-libs systemd" + +RDEPEND=" + dev-lang/perl + sensord? ( + net-analyzer/rrdtool + virtual/logger + )" +DEPEND="${RDEPEND} + sys-devel/bison + sys-devel/flex" + +CONFIG_CHECK="~HWMON ~I2C_CHARDEV ~I2C" +WARNING_HWMON="${PN} requires CONFIG_HWMON to be enabled for use." +WARNING_I2C_CHARDEV="sensors-detect requires CONFIG_I2C_CHARDEV to be enabled." +WARNING_I2C="${PN} requires CONFIG_I2C to be enabled for most sensors." + +src_prepare() { + epatch "${FILESDIR}"/${P}-sensors-detect-gentoo.patch + + use sensord && { sed -i -e 's:^#\(PROG_EXTRA.*\):\1:' Makefile || die; } + + # Respect LDFLAGS + sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' Makefile || die + + # Fix shipped unit file paths + sed -i -e 's:\(^EnvironmentFile=\).*:\1/etc/conf.d/lm_sensors:' \ + prog/init/lm_sensors.service || die + + use static-libs || { sed -i -e '/^BUILD_STATIC_LIB/d' Makefile || die; } +} + +src_compile() { + einfo + einfo "You may safely ignore any errors from compilation" + einfo "that contain \"No such file or directory\" references." + einfo + + emake CC="$(tc-getCC)" +} + +src_install() { + emake \ + DESTDIR="${D}" \ + PREFIX="${EPREFIX}/usr" \ + MANDIR="${EPREFIX}/usr/share/man" \ + ETCDIR="${EPREFIX}/etc" \ + LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ + install + + newinitd "${FILESDIR}"/${PN}-3-init.d ${PN} + use systemd && systemd_dounit prog/init/lm_sensors.service + + newinitd "${FILESDIR}"/fancontrol-init.d-2 fancontrol + use systemd && systemd_dounit "${FILESDIR}"/fancontrol.service + + if use sensord; then + newconfd "${FILESDIR}"/sensord-conf.d sensord + newinitd "${FILESDIR}"/sensord-4-init.d sensord + use systemd && systemd_dounit "${FILESDIR}"/sensord.service + fi + + dodoc CHANGES CONTRIBUTORS INSTALL README \ + doc/{donations,fancontrol.txt,fan-divisors,libsensors-API.txt,progs,temperature-sensors,vid} + + docinto developers + dodoc doc/developers/applications +} + +pkg_postinst() { + echo + elog "Please run \`/usr/sbin/sensors-detect' in order to setup" + elog "/etc/conf.d/${PN}." + echo + elog "/etc/conf.d/${PN} is vital to the init-script." + elog "Please make sure you also add ${PN} to the desired" + elog "runlevel. Otherwise your I2C modules won't get loaded" + elog "on the next startup." + echo + elog "You will also need to run the above command if you're upgrading from" + elog "<=${PN}-2, as the needed entries in /etc/conf.d/${PN} has" + elog "changed." + echo + elog "Be warned, the probing of hardware in your system performed by" + elog "sensors-detect could freeze your system. Also make sure you read" + elog "the documentation before running ${PN} on IBM ThinkPads." + echo + elog "Also make sure you have read:" + elog "http://www.lm-sensors.org/wiki/FAQ/Chapter3#Mysensorshavestoppedworkinginkernel2.6.31" + echo + elog "Please refer to the ${PN} documentation for more information." + elog "(http://www.lm-sensors.org/wiki/Documentation)" + echo +} |