aboutsummaryrefslogtreecommitdiff
path: root/system/TLP
diff options
context:
space:
mode:
authorAaditya Bagga <aaditya_gnulinux@zoho.com>2014-04-25 08:00:09 +0700
committerErik Hanson <erik@slackbuilds.org>2014-04-27 12:18:16 -0500
commit1dd344df330172d72239982ae9c37f35188e3586 (patch)
tree622eaca6dbf33fedfbc5f23443857bdae0afca65 /system/TLP
parent439167b13392d202238e25c87cd0ea9e31ca4feb (diff)
system/TLP: Updated for version 0.5.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/TLP')
-rw-r--r--system/TLP/TLP.SlackBuild8
-rw-r--r--system/TLP/TLP.info8
-rw-r--r--system/TLP/doinst.sh26
3 files changed, 36 insertions, 6 deletions
diff --git a/system/TLP/TLP.SlackBuild b/system/TLP/TLP.SlackBuild
index a98b3782a454..9bdc91279698 100644
--- a/system/TLP/TLP.SlackBuild
+++ b/system/TLP/TLP.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for TLP
-# Copyright 2013 Aaditya Bagga <aaditya_gnulinux@zoho.com>
+# Copyright 2013-2014 Aaditya Bagga <aaditya_gnulinux@zoho.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=TLP
-VERSION=${VERSION:-0.4.1}
+VERSION=${VERSION:-0.5}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -84,6 +84,9 @@ make install-tlp DESTDIR=$PKG
# move to rc.tlp
mv $PKG/etc/rc.d/tlp $PKG/etc/rc.d/rc.tlp
+# Don't clobber configs
+mv $PKG/etc/default/tlp $PKG/etc/default/tlp.new
+
# install man files
mkdir -p $PKG/usr/man/man{1,8}
install -m 644 man/bluetooth.1 $PKG/usr/man/man1/
@@ -106,6 +109,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/system/TLP/TLP.info b/system/TLP/TLP.info
index f4a9ea5262a2..500b096a4ac6 100644
--- a/system/TLP/TLP.info
+++ b/system/TLP/TLP.info
@@ -1,10 +1,10 @@
PRGNAM="TLP"
-VERSION="0.4.1"
+VERSION="0.5"
HOMEPAGE="http://linrunner.de/en/tlp/tlp.html"
-DOWNLOAD="https://github.com/linrunner/TLP/archive/0.4.1.tar.gz"
-MD5SUM="43cb7a875e4237cbb1392294585ccc4f"
+DOWNLOAD="https://github.com/linrunner/TLP/archive/0.5.tar.gz"
+MD5SUM="93b2162cb278b3b5757d701edf2e1f7a"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
-MAINTAINER="aaditya"
+MAINTAINER="Aaditya Bagga"
EMAIL="aaditya_gnulinux@zoho.com"
diff --git a/system/TLP/doinst.sh b/system/TLP/doinst.sh
new file mode 100644
index 000000000000..d21b756e2afd
--- /dev/null
+++ b/system/TLP/doinst.sh
@@ -0,0 +1,26 @@
+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...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+config etc/default/tlp.new
+preserve_perms etc/rc.d/rc.tlp.new