Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=kdetesting2.git;a=commitdiff;h=b84c4085e625fb9d790f0c6377803e5d77217a69

commit b84c4085e625fb9d790f0c6377803e5d77217a69
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Mon Jan 17 00:41:59 2011 +0100

hal-0.5.14-11-i686

- add systemd support (no upstream patch as hal is kind of dead already)
- enable bus activation so it won't be started till something connects
to it

diff --git a/source/apps/hal/FrugalBuild b/source/apps/hal/FrugalBuild
index e577b4c..5a6aa60 100644
--- a/source/apps/hal/FrugalBuild
+++ b/source/apps/hal/FrugalBuild
@@ -4,7 +4,7 @@

pkgname=hal
pkgver=0.5.14
-pkgrel=10
+pkgrel=11
pkgdesc="Hardware Abstraction Layer"
url="http://www.freedesktop.org/wiki/Software/hal";
depends=('dbus-glib>=0.74' 'udev>=132' 'util-linux-ng>=2.15' 'glib2' 
'libcap>=2.19' 'dbus>=1.2.12-4' \
@@ -24,14 +24,20 @@ 
source=(http://hal.freedesktop.org/releases/$pkgname-$pkgver.tar.gz \
suspend_hibernate.patch \
hal-performance_pci.ids_v5.diff \
fix_libusbdetection.diff \
-       hal.conf.patch)
+       hal.conf.patch \
+       do_not_check_hal_on_bus.patch \
+       org.freedesktop.Hal.service \
+       haldaemon.service)
sha1sums=('95bdc8141b0bce197d0d47f5bec491b08c6e3853' \
'4846dc72e10268768df9d301d0e92b2d4c7a3cc5' \
'2273e77c0c3c52aca31294b2b1a829937d0a3c18' \
'2fab4fd75f1359b0838748dfae4d749eb26b64b9' \
'654235977c83f76433f9737f37b8a18f04136b35' \
'f47dcd1b596605db17ae24942d40f6210cbe6b6d' \
-          'effad668dfcf46e20be068625fc3a027a26ae935')
+          'effad668dfcf46e20be068625fc3a027a26ae935' \
+          '15d78abf9f61a2d3b2fc76d1c44c11a57e7dc2a3' \
+          'baf7bb113d0bf766961d5b7af0863ff260e9f916' \
+          '25d1b5976690438134e4a53c4ac3aa71469d2050')
build()
{
Fcd
@@ -64,6 +70,9 @@ build()
Frm /etc/hotplug.d
Fmkdir /media
Frcd hald
+       Ffile /usr/share/dbus-1/system-services/org.freedesktop.Hal.service
+       Ffile /lib/systemd/system/haldaemon.service
+       Fln /dev/null /lib/systemd/system/hald.service
}

# optimization OK
diff --git a/source/apps/hal/do_not_check_hal_on_bus.patch 
b/source/apps/hal/do_not_check_hal_on_bus.patch
new file mode 100644
index 0000000..098ec75
--- /dev/null
+++ b/source/apps/hal/do_not_check_hal_on_bus.patch
@@ -0,0 +1,27 @@
+--- hal-0.5.14.orig/libhal/libhal.c
++++ hal-0.5.14/libhal/libhal.c
+@@ -3376,7 +3376,6 @@
+ libhal_ctx_init (LibHalContext *ctx, DBusError *error)
+ {
+       DBusError _error;
+-      dbus_bool_t hald_exists;
+
+       LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
+
+@@ -3384,16 +3383,6 @@
+               return FALSE;
+
+       dbus_error_init (&_error);
+-      hald_exists = dbus_bus_name_has_owner (ctx->connection, 
"org.freedesktop.Hal", &_error);
+-      dbus_move_error (&_error, error);
+-      if (error != NULL && dbus_error_is_set (error)) {
+-              return FALSE;
+-      }
+-
+-      if (!hald_exists) {
+-              return FALSE;
+-      }
+-
+
+       if (!dbus_connection_add_filter (ctx->connection, filter_func, ctx, 
NULL)) {
+               return FALSE;
diff --git a/source/apps/hal/hal.install b/source/apps/hal/hal.install
index 99c70e7..527a1db 100644
--- a/source/apps/hal/hal.install
+++ b/source/apps/hal/hal.install
@@ -14,6 +14,11 @@ post_install()
# only on install
if [ -n "$1" -a -x /usr/sbin/chkconfig ]; then
/usr/sbin/chkconfig --add rc.hald
+               # hald supports bus activation, no systemctl enable here
+               systemctl daemon-reload >/dev/null 2>&1
+       else
+               systemctl daemon-reload >/dev/null 2>&1
+               systemctl try-restart haldaemon.service >/dev/null 2>&1
fi
#for use the good layout
#we can't use backup we should patch /etc/hal/policy/10osvendor/10-keymap.fdi 
with the local
@@ -34,6 +39,8 @@ pre_remove()
{
if [ -x /usr/sbin/chkconfig ]; then
/usr/sbin/chkconfig --del rc.hald
+               systemctl stop haldaemon.service >/dev/null 2>&1
+               systemctl disable haldaemon.service >/dev/null 2>&1
fi
# remove hald user
if  grep -q '^hald:' /etc/passwd; then
@@ -42,6 +49,11 @@ pre_remove()
fi
}

+post_remove()
+{
+       systemctl daemon-reload >/dev/null 2>&1
+}
+
op=$1
shift

diff --git a/source/apps/hal/haldaemon.service 
b/source/apps/hal/haldaemon.service
new file mode 100644
index 0000000..c4b6714
--- /dev/null
+++ b/source/apps/hal/haldaemon.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=HAL Hardware Manager
+After=syslog.target
+
+[Service]
+ExecStart=/usr/sbin/hald --daemon=no --use-syslog
+Type=dbus
+BusName=org.freedesktop.Hal
diff --git a/source/apps/hal/org.freedesktop.Hal.service 
b/source/apps/hal/org.freedesktop.Hal.service
new file mode 100644
index 0000000..e79da60
--- /dev/null
+++ b/source/apps/hal/org.freedesktop.Hal.service
@@ -0,0 +1,5 @@
+[D-BUS Service]
+Name=org.freedesktop.Hal
+Exec=/usr/sbin/hald
+User=root
+SystemdService=haldaemon.service
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to