summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorOle Andre Rodlie <olear@slackforge.net>2010-05-11 15:18:38 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-11 15:18:38 +0200
commite470b8994be4040f8f8610b52f960374a02346d3 (patch)
tree062da06c904d5ef4fd5e142e61e6d6d2cfd2b663 /system
parentcaa6dddf21450de17b391bddcadeba61e852431c (diff)
downloadslackbuilds-e470b8994be4040f8f8610b52f960374a02346d3.tar.gz
system/hal: Initial import
Diffstat (limited to 'system')
-rw-r--r--system/hal/README55
-rw-r--r--system/hal/doinst.sh25
-rw-r--r--system/hal/hal.SlackBuild106
-rw-r--r--system/hal/hal.conf.diff32
-rw-r--r--system/hal/hal.conf.orig67
-rw-r--r--system/hal/hal.info8
-rw-r--r--system/hal/rc.hald47
-rw-r--r--system/hal/slack-desc19
8 files changed, 359 insertions, 0 deletions
diff --git a/system/hal/README b/system/hal/README
new file mode 100644
index 0000000000..7a5ceef64f
--- /dev/null
+++ b/system/hal/README
@@ -0,0 +1,55 @@
+HAL - Hardware Abstraction Layer
+
+You will need to create the 'haldaemon' user and group and the 'plugdev' and
+'power' groups before installing the hal package; sample lines to do so are:
+ /usr/sbin/groupadd -g 82 haldaemon
+ /usr/sbin/groupadd -g 83 plugdev
+ /usr/sbin/groupadd -g 84 power
+ /usr/sbin/useradd -c 'HAL daemon' -g haldaemon -u 82 -d '/' -s /bin/false haldaemon
+
+Note that the numerical uid and gid given in the above sample lines may need
+to change on your system; if you already have an existing user and/or group
+with those id's, then they obviously need to be modified for your system.
+Because the 'haldaemon' user and group and the 'plugdev' and 'power' groups
+are considered system accounts, the custom is to make their uid's and gid's
+less than 100, but that's entirely up to you.
+
+After creating the required users and groups and installing the package,
+you will need to make sure the /etc/rc.d/rc.hald script is run at boot.
+The easiest way to do this is adding something like the following line to
+/etc/rc.d/rc.local:
+
+ if [ -x /etc/rc.d/rc.hald ]; then
+ /etc/rc.d/rc.hald start
+ fi
+
+Note that hald must be started after the messagebus service (dbus), and be
+sure to move or merge both of the .new files installed by this package
+(if they already existed):
+ /etc/dbus-1/system.d/hal.conf.new and /etc/rc.d/rc.hald.new
+
+You will also want to stop the hald service at shutdown; that can be done
+by adding the following to /etc/rc.d/rc.local_shutdown (note that this
+should happen before the messagebus service is stopped):
+
+ if [ -x /etc/rc.d/rc.hald ]; then
+ /etc/rc.d/rc.hald stop
+ fi
+
+We patch the included /etc/dbus-1/system.d/hal.conf to use the following
+group memberships:
+ power -- shutdown/restart/suspend/hibernate
+ video -- graphics adapter and display power management
+ plugdev -- mounting filesystems
+You can change these settings by editing the file.
+
+Dependencies: dbus, dbus-glib, 2.6.x kernel-headers (Use headers in /extra),
+ and hal-info Optional dependency: dbus-qt3 (if you want to use with kde)
+
+Also note that kde (or xfce) will need to be recompiled it you want them to
+use HAL. We do not in any way support the recompiling of stock Slackware
+packages, so you're on your own with that.
+
+DO NOT REPORT BUGS TO PAT IF YOU'RE USING THIS! We hope that it's stable
+and secure enough for regular use, but if it breaks, you get to keep all of
+the pieces...
diff --git a/system/hal/doinst.sh b/system/hal/doinst.sh
new file mode 100644
index 0000000000..0c5fcfc71c
--- /dev/null
+++ b/system/hal/doinst.sh
@@ -0,0 +1,25 @@
+#!/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...
+}
+
+# Keep same perms on rc.hald.new:
+if [ -e etc/rc.d/rc.hald ]; then
+ cp -a etc/rc.d/rc.hald etc/rc.d/rc.hald.new.incoming
+ cat etc/rc.d/rc.hald.new > etc/rc.d/rc.hald.new.incoming
+ mv etc/rc.d/rc.hald.new.incoming etc/rc.d/rc.hald.new
+fi
+
+config etc/rc.d/rc.hald.new
+config etc/dbus-1/system.d/hal.conf.new
+
diff --git a/system/hal/hal.SlackBuild b/system/hal/hal.SlackBuild
new file mode 100644
index 0000000000..f1ee7f3db4
--- /dev/null
+++ b/system/hal/hal.SlackBuild
@@ -0,0 +1,106 @@
+#!/bin/sh
+
+# Slackware build script for hal
+
+# Copyright 2007 Ole Andre Rodlie <olear@slackforge.net>
+# 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.
+
+# Modified by the Robby Workman < http://rlworkman.net >
+# No additional license terms added
+
+PRGNAM=hal
+VERSION=0.5.9
+ARCH=${ARCH:-i486}
+BUILD=${BUILD:-5}
+TAG=${TAG:-_SBo}
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP || exit 1
+rm -rf $PRGNAM-$VERSION
+tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
+cd $PRGNAM-$VERSION || exit 1
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --disable-static \
+ --disable-policy-kit \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --with-pid-file=/var/run/hald.pid \
+ --build=$ARCH-slackware-linux \
+ --host=$ARCH-slackware-linux \
+ || exit 1
+
+make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Compress man pages
+( cd $PKG/usr/man
+ find . -type f -exec gzip -9 {} \;
+ for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
+)
+
+# Make the defaults for manipulating/mounting system devices a bit more sane
+( cd $PKG/etc/dbus-1/system.d
+ cat $CWD/hal.conf.diff | patch -p0 || exit 1
+) || exit 1
+# Don't clobber existing config file in case custom changes have been made
+mv $PKG/etc/dbus-1/system.d/hal.conf $PKG/etc/dbus-1/system.d/hal.conf.new
+
+# Install init script for hal
+install -D -m 0755 $CWD/rc.hald $PKG/etc/rc.d/rc.hald.new
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS COPYING ChangeLog HACKING INSTALL NEWS README \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+( cd $PKG/usr/doc/$PRGNAM-$VERSION
+ ln -s ../../share/gtk-doc/html/libhal libhal
+ ln -s ../../share/gtk-doc/html/libhal-storage libhal-storage
+)
+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.tgz
diff --git a/system/hal/hal.conf.diff b/system/hal/hal.conf.diff
new file mode 100644
index 0000000000..8614eedf9f
--- /dev/null
+++ b/system/hal/hal.conf.diff
@@ -0,0 +1,32 @@
+--- hal.conf.orig 2007-05-19 19:20:28.000000000 -0500
++++ hal.conf 2007-05-19 19:23:09.000000000 -0500
+@@ -47,6 +47,7 @@
+ </policy>
+
+ <!-- This will not work if pam_console support is not enabled -->
++ <!-- This build (from SlackBuilds.org) does not include pam_console support -->
+ <policy at_console="true">
+ <allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
+ <allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>
+@@ -54,11 +55,19 @@
+ <allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/>
+ </policy>
+
+- <!-- You can change this to a more suitable user, or make per-group -->
+- <policy user="0">
++ <!-- Allow members of 'power' group to shutdown/restart/suspend/hibernate -->
++ <policy group="power">
+ <allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
++ </policy>
++
++ <!-- Allow members of 'video' group to manipulate video settings -->
++ <policy group="video">
+ <allow send_interface="org.freedesktop.Hal.Device.VideoAdapterPM"/>
+ <allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>
++ </policy>
++
++ <!-- Allow members of the 'plugdev' group to mount volumes -->
++ <policy group="plugdev">
+ <allow send_interface="org.freedesktop.Hal.Device.Volume"/>
+ <allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/>
+ </policy>
diff --git a/system/hal/hal.conf.orig b/system/hal/hal.conf.orig
new file mode 100644
index 0000000000..a270ef3655
--- /dev/null
+++ b/system/hal/hal.conf.orig
@@ -0,0 +1,67 @@
+<!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- This configuration file specifies the required security policies
+ for the HAL to work. -->
+
+ <!-- Only root or user haldaemon can own the HAL service -->
+ <policy user="haldaemon">
+ <allow own="org.freedesktop.Hal"/>
+ </policy>
+ <policy user="root">
+ <allow own="org.freedesktop.Hal"/>
+ </policy>
+
+ <!-- Allow anyone to invoke methods on the Manager and Device interfaces -->
+ <policy context="default">
+ <allow send_interface="org.freedesktop.Hal.Manager"/>
+ <allow send_interface="org.freedesktop.Hal.Device"/>
+ <allow receive_interface="org.freedesktop.Hal.Manager"
+ receive_sender="org.freedesktop.Hal"/>
+ <allow receive_interface="org.freedesktop.Hal.Device"
+ receive_sender="org.freedesktop.Hal"/>
+
+ <allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
+ <allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>
+ <allow send_interface="org.freedesktop.Hal.Device.Volume"/>
+ <allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/>
+ <allow receive_interface="org.freedesktop.Hal.Device.SystemPowerManagement"
+ receive_sender="org.freedesktop.Hal"/>
+ <allow receive_interface="org.freedesktop.Hal.Device.LaptopPanel"
+ receive_sender="org.freedesktop.Hal"/>
+ <allow receive_interface="org.freedesktop.Hal.Device.Volume"
+ receive_sender="org.freedesktop.Hal"/>
+ <allow receive_interface="org.freedesktop.Hal.Device.Volume.Crypto"
+ receive_sender="org.freedesktop.Hal"/>
+ </policy>
+
+ <!-- Default policy for the exported interfaces -->
+ <policy context="default">
+ <deny send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
+ <deny send_interface="org.freedesktop.Hal.Device.VideoAdapterPM"/>
+ <deny send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>
+ <deny send_interface="org.freedesktop.Hal.Device.Volume"/>
+ <deny send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/>
+ </policy>
+
+ <!-- This will not work if pam_console support is not enabled -->
+ <policy at_console="true">
+ <allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
+ <allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>
+ <allow send_interface="org.freedesktop.Hal.Device.Volume"/>
+ <allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/>
+ </policy>
+
+ <!-- You can change this to a more suitable user, or make per-group -->
+ <policy user="0">
+ <allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
+ <allow send_interface="org.freedesktop.Hal.Device.VideoAdapterPM"/>
+ <allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>
+ <allow send_interface="org.freedesktop.Hal.Device.Volume"/>
+ <allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/>
+ </policy>
+
+</busconfig>
+
diff --git a/system/hal/hal.info b/system/hal/hal.info
new file mode 100644
index 0000000000..6a07f40c79
--- /dev/null
+++ b/system/hal/hal.info
@@ -0,0 +1,8 @@
+PRGNAM="hal"
+VERSION="0.5.9"
+HOMEPAGE="http://freedesktop.org/wiki/Software/hal"
+DOWNLOAD="http://people.freedesktop.org/~david/dist/hal-0.5.9.tar.gz"
+MD5SUM="a6f532770cf9286e1de38d6570cbc6bc"
+MAINTAINER="Ole Andre Rodlie"
+EMAIL="olear@slackforge.net"
+APPROVED="rworkman,elohim"
diff --git a/system/hal/rc.hald b/system/hal/rc.hald
new file mode 100644
index 0000000000..5a73edf1f9
--- /dev/null
+++ b/system/hal/rc.hald
@@ -0,0 +1,47 @@
+#!/bin/sh
+# Start/stop/restart the hal daemon:
+
+PIDFILE=/var/run/hald.pid
+
+hal_start()
+{
+ if [ -x /usr/sbin/hald ]; then
+ if [ $(uname -r | cut -d. -f1) -ge 2 ]; then
+ if [ $(uname -r | cut -d. -f2) -ge 6 ]; then
+ echo "Starting HAL daemon: /usr/sbin/hald"
+ /usr/sbin/hald --daemon=yes
+ else
+ echo "You must be running a 2.6 kernel for HAL to work. "
+ exit 1
+ fi
+ else
+ echo "You must be running a 2.6 kernel for HAL to work. "
+ exit 1
+ fi
+ fi
+}
+
+hal_stop()
+{
+ kill $(cat $PIDFILE) || killall hald
+ rm -f $PIDFILE
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ hal_start
+ ;;
+ stop)
+ hal_stop
+ ;;
+ restart)
+ hal_stop
+ sleep 1
+ hal_start
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart}"
+ ;;
+esac
+
diff --git a/system/hal/slack-desc b/system/hal/slack-desc
new file mode 100644
index 0000000000..9a3ab1b166
--- /dev/null
+++ b/system/hal/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------------------------------------------------------|
+hal: HAL - Hardware Abstraction Layer
+hal:
+hal: Hardware Abstraction Layer.
+hal:
+hal:
+hal:
+hal:
+hal:
+hal:
+hal:
+hal: