# HG changeset patch # User Christophe Lincoln # Date 1210877304 -7200 # Node ID 274ea51cd55334d084bdbe28ae5c938d33ac5606 # Parent a515fcc7a579854f791e435ac43f25db939986c1 Add hal - Hardware Abstraction Layer diff -r a515fcc7a579 -r 274ea51cd553 hal-dev/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hal-dev/receipt Thu May 15 20:48:24 2008 +0200 @@ -0,0 +1,18 @@ +# SliTaz package receipt. + +PACKAGE="hal-dev" +VERSION="0.5.11" +CATEGORY="development" +SHORT_DESC="Hal devel files." +WANTED="hal" +MAINTAINER="pankso@slitaz.org" +WEB_SITE="http://www.freedesktop.org/wiki/Software/hal" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/lib + cp -a $_pkg/usr/include $fs/usr + cp -a $_pkg/usr/lib/*.*a $fs/usr/lib + cp -a $_pkg/usr/lib/pkgconfig $fs/usr/lib +} diff -r a515fcc7a579 -r 274ea51cd553 hal-extra/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hal-extra/receipt Thu May 15 20:48:24 2008 +0200 @@ -0,0 +1,30 @@ +# SliTaz package receipt. + +PACKAGE="hal-extra" +VERSION="0.5.11" +CATEGORY="x-window" +SHORT_DESC="Hal devel files." +WANTED="hal" +MAINTAINER="pankso@slitaz.org" +WEB_SITE="http://www.freedesktop.org/wiki/Software/hal" + +EXTRA=" +hald-addon-cpufreq +hald-addon-hid-ups +hald-addon-imac-backlight +hald-probe-video4linux +hald-probe-net-bluetooth +hald-probe-ieee1394-unit +hald-probe-pc-floppy +hald-probe-printer +hal-ipw-killswitch-linux" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/lib/hal + for lib in $EXTRA + do + cp $_pkg/usr/lib/hal/$lib $fs/usr/lib/hal + done +} diff -r a515fcc7a579 -r 274ea51cd553 hal/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hal/receipt Thu May 15 20:48:24 2008 +0200 @@ -0,0 +1,95 @@ +# SliTaz package receipt. + +PACKAGE="hal" +VERSION="0.5.11" +CATEGORY="x-window" +SHORT_DESC="Hardware Abstraction Layer." +DEPENDS="dbus dbus-glib" +BUILD_DEPENDS="dbus-dev dbus-glib-dev" +MAINTAINER="pankso@slitaz.org" +TARBALL="$PACKAGE-$VERSION.tar.gz" +WEB_SITE="http://www.freedesktop.org/wiki/Software/hal" +WGET_URL="http://hal.freedesktop.org/releases/$TARBALL" + +EXTRA=" +hald-addon-cpufreq +hald-addon-hid-ups +hald-addon-imac-backlight +hald-probe-video4linux +hald-probe-net-bluetooth +hald-probe-ieee1394-unit +hald-probe-pc-floppy +hald-probe-printer +hal-ipw-killswitch-linux" + +# Rules to configure and make the package. +compile_rules() +{ + cd $src + ./configure \ + --prefix=/usr \ + --libexecdir=/usr/lib/hal \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --disable-usb-ids \ + --disable-policy-kit \ + $CONFIGURE_ARGS + make + make DESTDIR=$PWD/_pkg install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/lib $fs/usr/share + cp -a $_pkg/etc $fs + cp -a $_pkg/var $fs + cp -a $_pkg/usr/bin $fs/usr + cp -a $_pkg/usr/sbin $fs/usr + cp -a $_pkg/usr/lib/*.so* $fs/usr/lib + cp -a $_pkg/usr/lib/hal $fs/usr/lib + cp -a $_pkg/usr/share/hal $fs/usr/share + chmod -R +x $fs/usr/lib/hal/scripts/* + + # Remove a few run time lib. + for lib in $EXTRA + do + rm $fs/usr/lib/hal/$lib + done + + # Init script + cp -a stuff/etc $fs + chown -R root.root $fs +} + +pre_install() +{ + local root + root=$1 + # Go for echoing on configuration files if any haldeamon user + # was found. + if ! grep -q 'messagebus' $root/etc/passwd; then + echo -n "Adding user: messagebus..." + echo 'haldaemon:x:26:26:HAL Daemon User:/dev/null:/bin/false' >> $root/etc/passwd + echo 'haldaemon:!:14013:0:99999:7:::' >> $root/etc/shadow + echo 'haldaemon:x:26:' >> $root/etc/group + echo 'haldaemon:!::' >> $root/etc/gshadow + status + fi + if ! grep -q ^HALD_OPTIONS $root/etc/daemons.conf; then + echo -n "Configuring $root/etc/daemons.conf..." + cat >> $root/etc/daemons.conf << "EOT" +# HAL daemon options. +HALD_OPTIONS="--daemon=yes" + +EOT + status + fi +} + +pre_remove() +{ + /etc/init.d/hald stop + deluser haldaemon +} diff -r a515fcc7a579 -r 274ea51cd553 hal/stuff/etc/init.d/hald --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hal/stuff/etc/init.d/hald Thu May 15 20:48:24 2008 +0200 @@ -0,0 +1,55 @@ +#!/bin/sh +# /etc/init.d/hald: Start, stop and restart HAL daemon on SliTaz, +# at boot time or with the command line. Daemons options are configured +# with /etc/daemons.conf +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=HAL +DESC="Hardware Abstraction Layer" +DAEMON=/usr/sbin/hald +OPTIONS=$HALD_OPTIONS +PIDFILE=/var/run/hald/pid + +case "$1" in + start) + if [ -f $PIDFILE ] ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Starting $DESC: $NAME... " + $DAEMON $OPTIONS + status + ;; + stop) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + status + ;; + restart) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + sleep 2 + $DAEMON $OPTIONS + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0