Sat Nov 22 15:20:51 2008 UTC ()
Import hal version 0.5.11. Uses the 'dummy' backend on NetBSD for now,
more to come soon.

What is the point of HAL?

To merge information from various sources such that desktop applications can
locate and use hardware devices. The point is that the exact set of
information to merge varies by device and bus type. In order to do this, we
need to define a format for the information, hence the HAL specification.

We may read some stuff from the hardware itself, then add some info provided
by the kernel, then add some metadata from some systemwide files, then add
some data that has been obtained by the desktop and stored per-user, then
look at some blacklist, and finally we have a complete picture of everything
known about that particular device.

An extra value is that we can do this in an operating system independent way.
Stuff like this is important to the major desktop environments.

Status:

Vendor Tag:	TNF
Release Tags:	pkgsrc-base


(jmcneill)
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/buildlink3.mk
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/Makefile
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/DESCR
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/distinfo
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/PLIST
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/patches/patch-aa
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/patches/patch-ab
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/patches/patch-ac
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/patches/patch-ad
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/patches/patch-ae
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/patches/patch-af
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/patches/patch-ag
diff -r0 -r1.1.1.1 pkgsrc/sysutils/hal/files/hal.sh

File Added: pkgsrc/sysutils/hal/buildlink3.mk
# $NetBSD: buildlink3.mk,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $

BUILDLINK_DEPTH:=	${BUILDLINK_DEPTH}+
HAL_BUILDLINK3_MK:=	${HAL_BUILDLINK3_MK}+

.if ${BUILDLINK_DEPTH} == "+"
BUILDLINK_DEPENDS+=	hal
.endif

BUILDLINK_PACKAGES:=	${BUILDLINK_PACKAGES:Nhal}
BUILDLINK_PACKAGES+=	hal
BUILDLINK_ORDER:=	${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}hal

.if ${HAL_BUILDLINK3_MK} == "+"
BUILDLINK_API_DEPENDS.hal+=	hal>=0.5.11
BUILDLINK_PKGSRCDIR.hal?=	../../sysutils/hal
.endif	# HAL_BUILDLINK3_MK

.include "../../sysutils/dbus/buildlink3.mk"
.include "../../sysutils/dbus-glib/buildlink3.mk"

BUILDLINK_DEPTH:=	${BUILDLINK_DEPTH:S/+$//}

File Added: pkgsrc/sysutils/hal/Makefile
# $NetBSD: Makefile,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $
#

DISTNAME=		hal-0.5.11
CATEGORIES=		sysutils
MASTER_SITES=		http://hal.freedesktop.org/releases/
EXTRACT_SUFX=		.tar.bz2

MAINTAINER=		jmcneill@NetBSD.org
HOMEPAGE=		http://hal.freedesktop.org/
COMMENT=		FreeDesktop hardware abstraction layer

BUILD_DEFS+=		VARBASE

HAL_USER?=		haldaemon
HAL_GROUP?=		haldaemon

GNU_CONFIGURE=		YES
USE_DIRS+=		xdg-1.4
USE_PKGLOCALEDIR=	YES
USE_TOOLS+=		gmake intltool msgfmt perl pkg-config
USE_LIBTOOL=		YES

MAKE_DIRS=		${VARBASE}/cache/hald
SPECIAL_PERMS+=		${VARBASE}/cache/hald ${HAL_USER} ${HAL_GROUP} 0644

EGDIR=			${PREFIX}/share/examples/hal

CONF_FILES=		${EGDIR}/hal.conf ${PREFIX}/etc/dbus-1/system.d/hal.conf

CONFIGURE_ARGS+=	--localstatedir=${VARBASE}
CONFIGURE_ARGS+=	--with-pci-ids=${PREFIX}/share/pciids/pci.ids
CONFIGURE_ARGS+=	--with-usb-ids=${PREFIX}/share/usbids/usb.ids
CONFIGURE_ARGS+=	--with-hal-user=${HAL_USER}
CONFIGURE_ARGS+=	--with-hal-group=${HAL_GROUP}

REPLACE_INTERPRETER+=	bash
REPLACE.bash.old=	/bin/bash
REPLACE.bash.new=	${SH}
.for halscript in luks-remove luks-setup luks-teardown system-wol-enable system-wol-enabled system-wol-supported
REPLACE_FILES.bash+=	tools/hal-${halscript}
.endfor

RCD_SCRIPTS=		hal

PKG_GROUPS=		${HAL_GROUP}
PKG_USERS=		${HAL_USER}:${HAL_GROUP}
PKG_HOME.haldaemon=	${VARBASE}/run/hal

FILES_SUBST+=		HAL_USER=${HAL_USER}
FILES_SUBST+=		HAL_GROUP=${HAL_GROUP}

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "Linux"
.include "../../devel/libusb/buildlink3.mk"
.include "../../sysutils/pciutils/buildlink3.mk"
.endif

.include "../../devel/GConf/schemas.mk"
.include "../../devel/glib2/buildlink3.mk"
.include "../../devel/libvolume_id/buildlink3.mk"
.include "../../misc/pciids/buildlink3.mk"
.include "../../misc/usbids/buildlink3.mk"
.include "../../security/policykit/buildlink3.mk"
.include "../../sysutils/dbus/buildlink3.mk"
.include "../../sysutils/dbus-glib/buildlink3.mk"
.include "../../sysutils/hal-info/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/sysutils/hal/DESCR
What is the point of HAL?

To merge information from various sources such that desktop applications can
locate and use hardware devices. The point is that the exact set of
information to merge varies by device and bus type. In order to do this, we
need to define a format for the information, hence the HAL specification.

We may read some stuff from the hardware itself, then add some info provided
by the kernel, then add some metadata from some systemwide files, then add
some data that has been obtained by the desktop and stored per-user, then
look at some blacklist, and finally we have a complete picture of everything
known about that particular device.

An extra value is that we can do this in an operating system independent way.
Stuff like this is important to the major desktop environments.

File Added: pkgsrc/sysutils/hal/distinfo
$NetBSD: distinfo,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $

SHA1 (hal-0.5.11.tar.bz2) = 1ddb7895d2ddc2464b553ad11f7ba38860478ae9
RMD160 (hal-0.5.11.tar.bz2) = 741cfe82f0bc2d67106b24cfe526a754ab36e45f
Size (hal-0.5.11.tar.bz2) = 1281251 bytes
SHA1 (patch-aa) = 5b61b2eb10180e7e401088cb50b567bb3a596cd4
SHA1 (patch-ab) = b346c0bc21b428185a0fb3240791094506d33ff0
SHA1 (patch-ac) = 7643d4543bd3e07b03caeb74013da5d2d830c5f6
SHA1 (patch-ad) = d69b97031b2297b2f3a3963f9ab28870a8724934
SHA1 (patch-ae) = ebc98ede0b6e9535825434f2dc6185193d837f36
SHA1 (patch-af) = 161b59ee30d59dbc9e0c79f7f3162bcec5480d99
SHA1 (patch-ag) = 39b79fbcd99f9172afd492772c120161bb63a378

File Added: pkgsrc/sysutils/hal/PLIST
@comment $NetBSD: PLIST,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $
bin/hal-device
bin/hal-disable-polling
bin/hal-find-by-capability
bin/hal-find-by-property
bin/hal-get-property
bin/hal-is-caller-locked-out
bin/hal-lock
bin/hal-set-property
bin/lshal
include/hal/libhal-storage.h
include/hal/libhal.h
lib/hal/scripts/hal-dockstation-undock
lib/hal/scripts/hal-functions
lib/hal/scripts/hal-luks-remove
lib/hal/scripts/hal-luks-setup
lib/hal/scripts/hal-luks-teardown
lib/hal/scripts/hal-system-killswitch-get-power
lib/hal/scripts/hal-system-killswitch-set-power
lib/hal/scripts/hal-system-lcd-get-brightness
lib/hal/scripts/hal-system-lcd-set-brightness
lib/hal/scripts/hal-system-power-hibernate
lib/hal/scripts/hal-system-power-reboot
lib/hal/scripts/hal-system-power-set-power-save
lib/hal/scripts/hal-system-power-shutdown
lib/hal/scripts/hal-system-power-suspend
lib/hal/scripts/hal-system-power-suspend-hybrid
lib/hal/scripts/hal-system-wol-enable
lib/hal/scripts/hal-system-wol-enabled
lib/hal/scripts/hal-system-wol-supported
lib/libhal-storage.la
lib/libhal.la
lib/pkgconfig/hal-storage.pc
lib/pkgconfig/hal.pc
libexec/hal-storage-cleanup-all-mountpoints
libexec/hal-storage-cleanup-mountpoint
libexec/hal-storage-closetray
libexec/hal-storage-eject
libexec/hal-storage-mount
libexec/hal-storage-unmount
libexec/hal-system-power-pm-is-supported
libexec/hal-system-power-pmu
libexec/hal-system-setserial
libexec/hald-generate-fdi-cache
libexec/hald-runner
man/man1/hal-disable-polling.1
man/man1/hal-find-by-capability.1
man/man1/hal-find-by-property.1
man/man1/hal-get-property.1
man/man1/hal-is-caller-locked-out.1
man/man1/hal-lock.1
man/man1/hal-set-property.1
man/man1/lshal.1
man/man8/hald.8
sbin/hald
share/examples/hal/hal.conf
share/examples/rc.d/hal
share/gtk-doc/html/libhal-storage/home.png
share/gtk-doc/html/libhal-storage/index.html
share/gtk-doc/html/libhal-storage/index.sgml
share/gtk-doc/html/libhal-storage/ix01.html
share/gtk-doc/html/libhal-storage/left.png
share/gtk-doc/html/libhal-storage/libhal-storage-libhal-storage.html
share/gtk-doc/html/libhal-storage/libhal-storage.devhelp
share/gtk-doc/html/libhal-storage/libhal-storage.devhelp2
share/gtk-doc/html/libhal-storage/license.html
share/gtk-doc/html/libhal-storage/right.png
share/gtk-doc/html/libhal-storage/rn01.html
share/gtk-doc/html/libhal-storage/style.css
share/gtk-doc/html/libhal-storage/up.png
share/gtk-doc/html/libhal-storage/version.xml
share/gtk-doc/html/libhal/home.png
share/gtk-doc/html/libhal/index.html
share/gtk-doc/html/libhal/index.sgml
share/gtk-doc/html/libhal/ix01.html
share/gtk-doc/html/libhal/left.png
share/gtk-doc/html/libhal/libhal-libhal.html
share/gtk-doc/html/libhal/libhal.devhelp
share/gtk-doc/html/libhal/libhal.devhelp2
share/gtk-doc/html/libhal/license.html
share/gtk-doc/html/libhal/right.png
share/gtk-doc/html/libhal/rn01.html
share/gtk-doc/html/libhal/style.css
share/gtk-doc/html/libhal/up.png
share/hal/fdi/fdi.dtd
share/hal/fdi/policy/10osvendor/10-dockstation.fdi
share/hal/fdi/policy/10osvendor/10-input-policy.fdi
share/hal/fdi/policy/10osvendor/10-laptop-panel-mgmt-policy.fdi
share/hal/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
share/hal/fdi/policy/10osvendor/10-rfkill-switch.fdi
share/hal/fdi/policy/10osvendor/10-tabletPCs.fdi
share/hal/fdi/policy/10osvendor/10-x11-input.fdi
share/hal/fdi/policy/10osvendor/15-storage-luks.fdi
share/hal/fdi/policy/10osvendor/20-storage-methods.fdi
share/hal/fdi/policy/10osvendor/30-wol.fdi
@dirrm share/gtk-doc/html/libhal-storage
@dirrm share/gtk-doc/html/libhal
@dirrm lib/hal/scripts
@dirrm lib/hal
@dirrm include/hal
@exec ${MKDIR} %D/etc/hal/fdi/preprobe
@dirrm etc/hal/fdi/preprobe
@exec ${MKDIR} %D/etc/hal/fdi/policy
@dirrm etc/hal/fdi/policy
@exec ${MKDIR} %D/etc/hal/fdi/information
@dirrm etc/hal/fdi/information
@dirrm etc/hal/fdi
@dirrm etc/hal

File Added: pkgsrc/sysutils/hal/patches/patch-aa
$NetBSD: patch-aa,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $

--- tools/hal-storage-mount.c.orig	2008-05-07 19:24:23.000000000 -0400
+++ tools/hal-storage-mount.c
@@ -41,6 +41,10 @@
 #elif sun
 #include <sys/mnttab.h>
 #include <sys/vfstab.h>
+#elif __NetBSD__
+#include <fstab.h>
+#include <sys/param.h>
+#include <sys/mount.h>
 #else
 #include <mntent.h>
 #endif
@@ -58,6 +62,10 @@
 #define MOUNT		"/sbin/mount"
 #define MOUNT_OPTIONS	"noexec,nosuid"
 #define MOUNT_TYPE_OPT	"-t"
+#elif __NetBSD__
+#define MOUNT		"/sbin/mount"
+#define MOUNT_OPTIONS	"noexec,nosuid,nodev"
+#define	MOUNT_TYPE_OPT	"-t"
 #elif sun
 #define MOUNT		"/sbin/mount"
 #define MOUNT_OPTIONS	"noexec,nosuid"
@@ -430,6 +438,13 @@ map_fstype (const char *fstype)
 		return "ext2fs";
 	else if (! strcmp (fstype, "vfat"))
 		return "msdosfs";
+#elif __NetBSD__
+	if (! strcmp (fstype, "iso9660"))
+		return "cd9660";
+	else if (! strcmp (fstype, "ext2"))
+		return "ext2fs";
+	else if (! strcmp (fstype, "vfat"))
+		return "msdosfs";
 #elif sun
 	if (! strcmp (fstype, "iso9660"))
 		return "hsfs";

File Added: pkgsrc/sysutils/hal/patches/patch-ab
$NetBSD: patch-ab,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $

--- tools/hal-storage-shared.c.orig	2008-05-07 19:24:24.000000000 -0400
+++ tools/hal-storage-shared.c
@@ -42,6 +42,10 @@
 #include <fcntl.h>
 #include <sys/mnttab.h>
 #include <sys/vfstab.h>
+#elif __NetBSD__
+#include <fstab.h>
+#include <sys/param.h>
+#include <sys/mount.h>
 #else
 #include <mntent.h>
 #endif
@@ -60,13 +64,20 @@ struct mtab_handle
   int		n_mounts;
   int		iter;
 };
+#elif __NetBSD__
+struct mtab_handle
+{
+  struct statvfs *mounts;
+  int		n_mounts;
+  int		iter;
+};
 #endif
 
 
 gboolean
 mtab_open (gpointer *handle)
 {
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 	struct mtab_handle *mtab;
 
 	mtab = g_new0 (struct mtab_handle, 1);
@@ -90,7 +101,7 @@ mtab_open (gpointer *handle)
 char *
 mtab_next (gpointer handle, char **mount_point)
 {
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 	struct mtab_handle *mtab = handle;
 
 	if (mtab->iter < mtab->n_mounts) {
@@ -131,7 +142,7 @@ mtab_next (gpointer handle, char **mount
 void
 mtab_close (gpointer handle)
 {
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 	g_free (handle);
 #else
 	fclose (handle);
@@ -143,7 +154,7 @@ mtab_close (gpointer handle)
 gboolean
 fstab_open (gpointer *handle)
 {
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 	return setfsent () == 1;
 #elif sun
 	*handle = fopen (VFSTAB, "r");
@@ -157,7 +168,7 @@ fstab_open (gpointer *handle)
 char *
 fstab_next (gpointer handle, char **mount_point)
 {
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 	struct fstab *fstab;
 
 	fstab = getfsent ();
@@ -188,7 +199,7 @@ fstab_next (gpointer handle, char **moun
 void
 fstab_close (gpointer handle)
 {
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 	endfsent ();
 #else
 	fclose (handle);
@@ -197,6 +208,8 @@ fstab_close (gpointer handle)
 
 #ifdef __FreeBSD__
 #define UMOUNT		"/sbin/umount"
+#elif __NetBSD__
+#define UMOUNT		"/sbin/umount"
 #elif sun
 #define UMOUNT		"/sbin/umount"
 #else
@@ -467,7 +480,7 @@ line_found:
 	/* construct arguments to /bin/umount */
 	na = 0;
 	args[na++] = UMOUNT;
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__NetBSD__)
 	if (option_lazy)
 		args[na++] = "-l";
 #endif
@@ -632,6 +645,11 @@ try_open_excl_again:
 		args[na++] = "close";
 	else
 		args[na++] = "eject";
+#elif __NetBSD__
+	args[na++] = "-f";
+	if (closetray)
+		args[na++] = "-l";
+	args[na++] = (char *) device;
 #else
 	if (closetray) {
 		args[na++] = "-t";

File Added: pkgsrc/sysutils/hal/patches/patch-ac
$NetBSD: patch-ac,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $

--- tools/hal-storage-unmount.c.orig	2008-05-07 19:24:17.000000000 -0400
+++ tools/hal-storage-unmount.c
@@ -38,6 +38,10 @@
 #include <sys/mount.h>
 #include <limits.h>
 #include <pwd.h>
+#elif __NetBSD__
+#include <fstab.h>
+#include <sys/param.h>
+#include <sys/mount.h>
 #elif sun
 #include <fcntl.h>
 #include <sys/mnttab.h>

File Added: pkgsrc/sysutils/hal/patches/patch-ad
$NetBSD: patch-ad,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $

--- tools/hal-system-power-pmu.c.orig	2008-05-07 19:24:16.000000000 -0400
+++ tools/hal-system-power-pmu.c
@@ -55,6 +55,8 @@ pmac_sleep (void)
 {
 #ifdef __FreeBSD__
 	return FALSE;			/* FIXME implement */
+#elif __NetBSD__
+	return FALSE;			/* FIXME implement */
 #elif sun
 	return FALSE;			/* FIXME implement */
 #elif __GNU__
@@ -92,6 +94,8 @@ pmac_get_lcd_brightness (int *val)
 {
 #ifdef __FreeBSD__
 	return FALSE;			/* FIXME implement */
+#elif __NetBSD__
+	return FALSE;			/* FIXME implement */
 #elif sun
 	return FALSE;			/* FIXME implement */
 #elif __GNU__
@@ -129,6 +133,8 @@ pmac_set_lcd_brightness (int val)
 {
 #ifdef __FreeBSD__
 	return FALSE;			/* FIXME implement */
+#elif __NetBSD__
+	return FALSE;			/* FIXME implement */
 #elif sun
 	return FALSE;			/* FIXME implement */
 #elif __GNU__

File Added: pkgsrc/sysutils/hal/patches/patch-ae
$NetBSD: patch-ae,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $

--- tools/hal-luks-teardown.orig	2008-05-07 19:24:30.000000000 -0400
+++ tools/hal-luks-teardown
@@ -47,9 +47,9 @@ fi
 # TODO: this is a little sketchy; we should check for hal-storage-crypto-teardown-others?
 #
 IS_HOTPLUGGABLE=`hal-get-property --udi $HAL_PROP_BLOCK_STORAGE_DEVICE --key storage.hotpluggable`
-if [ "$IS_HOTPLUGGABLE" == "true" ] ; then
+if [ "$IS_HOTPLUGGABLE" = "true" ] ; then
     ACTION="org.freedesktop.hal.storage.crypto-setup-removable"
-elif [ "$IS_HOTPLUGGABLE" == "false" ] ; then
+elif [ "$IS_HOTPLUGGABLE" = "false" ] ; then
     ACTION="org.freedesktop.hal.storage.crypto-setup-fixed"
 else
     unknown_error

File Added: pkgsrc/sysutils/hal/patches/patch-af
$NetBSD: patch-af,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $

--- tools/hal-luks-setup.orig	2008-05-07 19:24:29.000000000 -0400
+++ tools/hal-luks-setup
@@ -44,9 +44,9 @@ if [ -n "$HAL_METHOD_INVOKED_BY_SYSTEMBU
 fi
 
 IS_HOTPLUGGABLE=`hal-get-property --udi $HAL_PROP_BLOCK_STORAGE_DEVICE --key storage.hotpluggable`
-if [ "$IS_HOTPLUGGABLE" == "true" ] ; then
+if [ "$IS_HOTPLUGGABLE" = "true" ] ; then
     ACTION="org.freedesktop.hal.storage.crypto-setup-removable"
-elif [ "$IS_HOTPLUGGABLE" == "false" ] ; then
+elif [ "$IS_HOTPLUGGABLE" = "false" ] ; then
     ACTION="org.freedesktop.hal.storage.crypto-setup-fixed"
 else
     unknown_error

File Added: pkgsrc/sysutils/hal/patches/patch-ag
$NetBSD: patch-ag,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $

--- Makefile.in.orig	2008-11-22 09:25:09.000000000 -0500
+++ Makefile.in
@@ -239,7 +239,7 @@ SUBDIRS = libhal libhal-storage partutil
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = hal.pc hal-storage.pc
-dbusdir = $(DBUS_SYS_DIR)
+dbusdir = $(PREFIX)/share/examples/hal
 dist_dbus_DATA = hal.conf
 MAINTAINERCLEANFILES = ChangeLog
 DISTCLEANFILES = hal.pc hal-storage.pc

File Added: pkgsrc/sysutils/hal/files/hal.sh
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: hal.sh,v 1.1.1.1 2008/11/22 15:20:51 jmcneill Exp $
#
# PROVIDE: hal
# REQUIRE: DAEMON dbus
# KEYWORD: shutdown

. /etc/rc.subr

name="hal"
rcvar=$name
command="@PREFIX@/sbin/hald"
start_precmd=hal_prestart

hal_prestart() {
	dir="@VARBASE@/run/hal"
	if @TEST@ ! -d $dir; then
		@MKDIR@ $dir
		@CHMOD@ 0755 $dir
		@CHOWN@ @HAL_USER@:@HAL_GROUP@ $dir
	fi
	@CHMOD@ 0755 "@VARBASE@/cache"
}

load_rc_config $name
run_rc_command "$1"