aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ Pipkin <j@dawnrazor.net>2013-12-02 00:51:56 -0600
committerRobby Workman <rworkman@slackbuilds.org>2013-12-02 00:58:20 -0600
commit62f5da796b270b532347d743a626fad81e761fdb (patch)
tree616470d9905493fb56186bbe4f43d43f1d1daa06
parent765ab602ddfe22670a1bc99ed86b9f08fafd5243 (diff)
desktop/razercfg: Added (Razer device configuration tool)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
-rw-r--r--desktop/razercfg/README9
-rw-r--r--desktop/razercfg/doinst.sh31
-rw-r--r--desktop/razercfg/razercfg.SlackBuild108
-rw-r--r--desktop/razercfg/razercfg.info10
-rw-r--r--desktop/razercfg/rc.razerd.diff50
-rw-r--r--desktop/razercfg/slack-desc19
6 files changed, 227 insertions, 0 deletions
diff --git a/desktop/razercfg/README b/desktop/razercfg/README
new file mode 100644
index 000000000000..83aa3a4937d3
--- /dev/null
+++ b/desktop/razercfg/README
@@ -0,0 +1,9 @@
+This is the next generation Razer device configuration tool bringing the Razer
+gaming experience to the free OpenSource world.
+
+This utility is a replacement for the old deathaddercfg tool.
+
+The tool architecture is based on "razerd", which is a background daemon doing
+all of the lowlevel privileged hardware accesses. The user interface tools are
+"razercfg", a commandline tool; and "qrazercfg", a QT4 based graphical device
+configuration tool.
diff --git a/desktop/razercfg/doinst.sh b/desktop/razercfg/doinst.sh
new file mode 100644
index 000000000000..20f78d3d9fb2
--- /dev/null
+++ b/desktop/razercfg/doinst.sh
@@ -0,0 +1,31 @@
+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/razer.conf.new
+preserve_perms etc/rc.d/rc.razerd.new
+
+if [ -x /sbin/udevadm ]; then
+ /sbin/udevadm control --reload-rules 2>&1
+fi
+
diff --git a/desktop/razercfg/razercfg.SlackBuild b/desktop/razercfg/razercfg.SlackBuild
new file mode 100644
index 000000000000..3f72b3e6e8b8
--- /dev/null
+++ b/desktop/razercfg/razercfg.SlackBuild
@@ -0,0 +1,108 @@
+#!/bin/sh
+
+# Slackware build script for razercfg
+
+# Copyright 2013 J Pipkin
+# 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.
+
+PRGNAM=razercfg
+VERSION=${VERSION:-0.21}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# Fix some paths and such in the init script
+patch -p1 < $CWD/rc.razerd.diff
+
+cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_SKIP_BUILD_RPATH=1 \
+ .
+make
+make install DESTDIR=$PKG
+
+# This could be fixed in librazer/cmake_install.cmake, but meh. --rworkman
+[ ! -z $LIBDIRSUFFIX ] && mv $PKG/usr/lib $PKG/usr/lib${LIBDIRSUFFIX}
+
+# install the example configuration file.
+install -vDm 644 razer.conf $PKG/etc/razer.conf.new
+# and the init script.
+install -vD razerd.initscript $PKG/etc/rc.d/rc.razerd.new
+chmod 0755 $PKG/etc/rc.d/rc.razerd.new
+
+# Move the udev rules to /lib/udev instead of /etc/udev
+# See CHANGES_AND_HINTS.TXT
+mkdir -p $PKG/lib
+mv $PKG/etc/udev $PKG/lib
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
+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/desktop/razercfg/razercfg.info b/desktop/razercfg/razercfg.info
new file mode 100644
index 000000000000..1d876c140d06
--- /dev/null
+++ b/desktop/razercfg/razercfg.info
@@ -0,0 +1,10 @@
+PRGNAM="razercfg"
+VERSION="0.21"
+HOMEPAGE="http://dual.bues.ch/cms/hacking/razercfg.html"
+DOWNLOAD="http://dual.bues.ch/razercfg/razercfg-0.21.tar.bz2"
+MD5SUM="30f10ef6a1643fb5f964cbf19d72109b"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="J Pipkin"
+EMAIL="j@dawnrazor.net"
diff --git a/desktop/razercfg/rc.razerd.diff b/desktop/razercfg/rc.razerd.diff
new file mode 100644
index 000000000000..846f883881c0
--- /dev/null
+++ b/desktop/razercfg/rc.razerd.diff
@@ -0,0 +1,50 @@
+diff -Nur razercfg-0.21.orig/razerd.initscript razercfg-0.21/razerd.initscript
+--- razercfg-0.21.orig/razerd.initscript 2013-07-30 04:54:30.000000000 -0500
++++ razercfg-0.21/razerd.initscript 2013-12-02 00:32:40.664988672 -0600
+@@ -12,34 +12,33 @@
+ export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+ NAME=razerd
+ DAEMON="$(which $NAME)"
+-PIDFILE="/run/razerd/razerd.pid"
++PIDFILE="/var/run/razerd/razerd.pid"
+ DESC="Razer device state daemon"
+
+-. /lib/lsb/init-functions
++. /etc/rc.d/init.d/functions
+
+ case "$1" in
+ start)
+- log_begin_msg "Starting $DESC: $NAME"
+- start-stop-daemon --start --quiet --pidfile $PIDFILE \
+- --oknodo --exec "$DAEMON" -- \
+- -f -B -P $PIDFILE
+- log_end_msg $?
++ mkdir -p $(dirname ${PIDFILE})
++ action $"Starting $DESC: $NAME" \
++ daemon --pidfile $PIDFILE $DAEMON -f -B -P $PIDFILE
+ ;;
+ stop)
+- log_begin_msg "Stopping $DESC: $NAME"
+- start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+- --name "$NAME"
++ action $"Stopping $DESC: $NAME" \
++ killproc -p $PIDFILE
+ RES=$?
+ rm -f $PIDFILE
+- log_end_msg $RES
+ ;;
+- restart|reload|force-reload)
++ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
++ status)
++ status -p $PIDFILE $NAME
++ ;;
+ *)
+- echo "Usage $0 [start|stop|restart|reload|force-reload]"
++ echo "Usage $0 [start|stop|restart|status]"
+ exit 1
+ ;;
+ esac
diff --git a/desktop/razercfg/slack-desc b/desktop/razercfg/slack-desc
new file mode 100644
index 000000000000..5b3420545524
--- /dev/null
+++ b/desktop/razercfg/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 ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+razercfg: razercfg (Razer device configuration tool)
+razercfg:
+razercfg: This is the next generation Razer device configuration tool bringing
+razercfg: the Razer gaming experience to the free OpenSource world.
+razercfg: This utility is a replacement for the old deathaddercfg tool.
+razercfg: The tool architecture is based on "razerd", which is a background
+razercfg: daemon doing all of the lowlevel privileged hardware accesses. The
+razercfg: user interface tools are "razercfg", a commandline tool; and
+razercfg: "qrazercfg", a QT4 based graphical device configuration tool.
+razercfg:
+razercfg: http://dual.bues.ch/cms/hacking/razercfg.html