diff options
Diffstat (limited to 'source/ap/lm_sensors')
-rwxr-xr-x | source/ap/lm_sensors/lm_sensors.SlackBuild | 116 | ||||
-rw-r--r-- | source/ap/lm_sensors/lm_sensors.makefile.diff | 15 | ||||
-rw-r--r-- | source/ap/lm_sensors/slack-desc | 19 |
3 files changed, 150 insertions, 0 deletions
diff --git a/source/ap/lm_sensors/lm_sensors.SlackBuild b/source/ap/lm_sensors/lm_sensors.SlackBuild new file mode 100755 index 00000000..72ad373d --- /dev/null +++ b/source/ap/lm_sensors/lm_sensors.SlackBuild @@ -0,0 +1,116 @@ +#!/bin/sh + +# Copyright 2006, 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +PKGNAM=lm_sensors +VERSION=${VERSION:-3.1.1} +ARCH=${ARCH:-x86_64} +NUMJOBS=${NUMJOBS:-" -j7 "} +BUILD=${BUILD:-1} + + +if [ "$ARCH" = "x86_64" ]; then + LIBDIRSUFFIX="64" +else + LIBDIRSUFFIX="" +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-${PKGNAM} +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf ${PKGNAM}-${VERSION} +tar xvf $CWD/${PKGNAM}-$VERSION.tar.bz2 || exit 1 +cd ${PKGNAM}-$VERSION || exit 1 + +# Make sure ownerships and permissions are sane: +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Configure: +zcat $CWD/lm_sensors.makefile.diff.gz | patch -p1 --verbose || exit 1 + +make user LIBDIR=/usr/lib${LIBDIRSUFFIX} || exit 1 +make user_install LIBDIR=/usr/lib${LIBDIRSUFFIX} || exit 1 + +# Nope. +rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.a + +# Nope. +rm -rf $PKG/usr/include/linux + +# Do the .new thing with the config file: +mv $PKG/etc/sensors3.conf $PKG/etc/sensors3.conf.new + +# Strip binaries: +find $PKG | xargs file | grep -e "executable" -e "shared object" \ + | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +# Compress and link manpages, if any: +if [ -d $PKG/usr/man ]; then + ( cd $PKG/usr/man + for manpagedir in $(find . -type d -name "man*") ; do + ( cd $manpagedir + for eachpage in $( find . -type l -maxdepth 1) ; do + ln -s $( readlink $eachpage ).gz $eachpage.gz + rm $eachpage + done + gzip -9 *.? + ) + done + ) +fi + +# Add a documentation directory: +mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION +cp -a \ + CHANGES CONTRIBUTORS COPYING* INSTALL README* doc \ + $PKG/usr/doc/${PKGNAM}-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat << EOF > $PKG/install/doinst.sh +#!/bin/sh +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} +config etc/sensors3.conf.new +EOF + +cd $PKG +/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/ap/lm_sensors/lm_sensors.makefile.diff b/source/ap/lm_sensors/lm_sensors.makefile.diff new file mode 100644 index 00000000..8216a8d1 --- /dev/null +++ b/source/ap/lm_sensors/lm_sensors.makefile.diff @@ -0,0 +1,15 @@ +--- ./Makefile.orig 2008-03-26 08:37:12.000000000 -0500 ++++ ./Makefile 2008-10-25 20:05:44.000000000 -0500 +@@ -39,10 +39,10 @@ + + # If you want to install at some other place then at from which you will run + # everything, set DESTDIR to the extra prefix. +-DESTDIR := ++DESTDIR := /tmp/package-lm_sensors + + # This is the prefix that will be used for almost all directories below. +-PREFIX := /usr/local ++PREFIX := /usr + + # Your C compiler + CC := gcc diff --git a/source/ap/lm_sensors/slack-desc b/source/ap/lm_sensors/slack-desc new file mode 100644 index 00000000..2f32f80d --- /dev/null +++ b/source/ap/lm_sensors/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +lm_sensors: lm_sensors (hardware monitoring package) +lm_sensors: +lm_sensors: lm_sensors provides tools for monitoring the temperatures, voltages, +lm_sensors: and fans of Linux systems with hardware monitoring devices. Included +lm_sensors: are text-based tools for sensor reporting, and a library for sensors +lm_sensors: access called libsensors. It also contains tools for sensor hardware +lm_sensors: identification and I2C bus probing. +lm_sensors: +lm_sensors: IMPORTANT NOTE: If you have a Thinkpad, please read the warnings in +lm_sensors: the README.thinkpad file. lm_sensors has been known to cause damage +lm_sensors: to some Thinkpads. |