Index: Makefile
===================================================================
RCS file: /NetBSD/pkgsrc/sysutils/hal/Makefile,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 Makefile
--- Makefile	22 Nov 2008 15:20:51 -0000	1.1.1.1
+++ Makefile	23 Nov 2008 17:15:17 -0000
@@ -34,6 +34,12 @@ CONFIGURE_ARGS+=	--with-usb-ids=${PREFIX
 CONFIGURE_ARGS+=	--with-hal-user=${HAL_USER}
 CONFIGURE_ARGS+=	--with-hal-group=${HAL_GROUP}
 
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
+CONFIGURE_ARGS+=	--with-eject=/usr/sbin/cdcontrol
+.endif
+
 REPLACE_INTERPRETER+=	bash
 REPLACE.bash.old=	/bin/bash
 REPLACE.bash.new=	${SH}
@@ -49,8 +55,6 @@ 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"
Index: PLIST
===================================================================
RCS file: /NetBSD/pkgsrc/sysutils/hal/PLIST,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 PLIST
--- PLIST	22 Nov 2008 15:20:51 -0000	1.1.1.1
+++ PLIST	23 Nov 2008 17:15:17 -0000
@@ -5,6 +5,7 @@ bin/hal-find-by-capability
 bin/hal-find-by-property
 bin/hal-get-property
 bin/hal-is-caller-locked-out
+bin/hal-is-caller-privileged
 bin/hal-lock
 bin/hal-set-property
 bin/lshal
@@ -48,6 +49,7 @@ 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-is-caller-privileged.1
 man/man1/hal-lock.1
 man/man1/hal-set-property.1
 man/man1/lshal.1
@@ -93,6 +95,12 @@ share/hal/fdi/policy/10osvendor/10-x11-i
 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
+share/PolicyKit/policy/org.freedesktop.hal.dockstation.policy
+share/PolicyKit/policy/org.freedesktop.hal.killswitch.policy
+share/PolicyKit/policy/org.freedesktop.hal.policy
+share/PolicyKit/policy/org.freedesktop.hal.power-management.policy
+share/PolicyKit/policy/org.freedesktop.hal.storage.policy
+share/PolicyKit/policy/org.freedesktop.hal.wol.policy
 @dirrm share/gtk-doc/html/libhal-storage
 @dirrm share/gtk-doc/html/libhal
 @dirrm lib/hal/scripts
Index: distinfo
===================================================================
RCS file: /NetBSD/pkgsrc/sysutils/hal/distinfo,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 distinfo
--- distinfo	22 Nov 2008 15:20:51 -0000	1.1.1.1
+++ distinfo	23 Nov 2008 17:15:17 -0000
@@ -3,10 +3,10 @@ $NetBSD: distinfo,v 1.1.1.1 2008/11/22 1
 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-aa) = 5194ec521824c49d3a7422002e383cfb31b75789
+SHA1 (patch-ab) = baf4068cf910cba8b7de47e5ba45e98f1a39cd94
+SHA1 (patch-ac) = c9ee51e6186e6899e161f673f55490d681469e4e
+SHA1 (patch-ad) = b5e2cac501997039d7d1227a4e9363f90658b5e6
 SHA1 (patch-ae) = ebc98ede0b6e9535825434f2dc6185193d837f36
 SHA1 (patch-af) = 161b59ee30d59dbc9e0c79f7f3162bcec5480d99
 SHA1 (patch-ag) = 39b79fbcd99f9172afd492772c120161bb63a378
Index: patches/patch-aa
===================================================================
RCS file: /NetBSD/pkgsrc/sysutils/hal/patches/patch-aa,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 patch-aa
--- patches/patch-aa	22 Nov 2008 15:20:51 -0000	1.1.1.1
+++ patches/patch-aa	23 Nov 2008 17:15:17 -0000
@@ -1,7 +1,14 @@
-$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
+--- tools/hal-storage-mount.c.orig	2008-05-08 02:24:23 +0300
++++ tools/hal-storage-mount.c	2008-11-23 13:25:17 +0200
+@@ -31,7 +31,7 @@
+ #include <string.h>
+ #include <glib.h>
+ #include <glib/gstdio.h>
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ #include <fstab.h>
+ #include <sys/param.h>
+ #include <sys/ucred.h>
 @@ -41,6 +41,10 @@
  #elif sun
  #include <sys/mnttab.h>
@@ -13,7 +20,12 @@ $NetBSD: patch-aa,v 1.1.1.1 2008/11/22 1
  #else
  #include <mntent.h>
  #endif
-@@ -58,6 +62,10 @@
+@@ -54,10 +58,14 @@
+ 
+ #include "hal-storage-shared.h"
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
  #define MOUNT		"/sbin/mount"
  #define MOUNT_OPTIONS	"noexec,nosuid"
  #define MOUNT_TYPE_OPT	"-t"
@@ -24,6 +36,15 @@ $NetBSD: patch-aa,v 1.1.1.1 2008/11/22 1
  #elif sun
  #define MOUNT		"/sbin/mount"
  #define MOUNT_OPTIONS	"noexec,nosuid"
+@@ -421,7 +429,7 @@ device_is_mounted (const char *device, c
+ static const char *
+ map_fstype (const char *fstype)
+ {
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ 	if (! strcmp (fstype, "iso9660"))
+ 		return "cd9660";
+ 	else if (! strcmp (fstype, "ext2"))
 @@ -430,6 +438,13 @@ map_fstype (const char *fstype)
  		return "ext2fs";
  	else if (! strcmp (fstype, "vfat"))
Index: patches/patch-ab
===================================================================
RCS file: /NetBSD/pkgsrc/sysutils/hal/patches/patch-ab,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 patch-ab
--- patches/patch-ab	22 Nov 2008 15:20:51 -0000	1.1.1.1
+++ patches/patch-ab	23 Nov 2008 17:15:17 -0000
@@ -1,7 +1,14 @@
-$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
+--- tools/hal-storage-shared.c.orig	2008-05-08 02:24:24 +0300
++++ tools/hal-storage-shared.c	2008-11-23 13:38:53 +0200
+@@ -31,7 +31,7 @@
+ #include <string.h>
+ #include <glib.h>
+ #include <glib/gstdio.h>
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ #include <fstab.h>
+ #include <sys/param.h>
+ #include <sys/ucred.h>
 @@ -42,6 +42,10 @@
  #include <fcntl.h>
  #include <sys/mnttab.h>
@@ -13,7 +20,15 @@ $NetBSD: patch-ab,v 1.1.1.1 2008/11/22 1
  #else
  #include <mntent.h>
  #endif
-@@ -60,13 +64,20 @@ struct mtab_handle
+@@ -53,20 +57,27 @@
+ 
+ #include "hal-storage-shared.h"
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ struct mtab_handle
+ {
+   struct statfs	*mounts;
    int		n_mounts;
    int		iter;
  };
@@ -31,7 +46,7 @@ $NetBSD: patch-ab,v 1.1.1.1 2008/11/22 1
  mtab_open (gpointer *handle)
  {
 -#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
  	struct mtab_handle *mtab;
  
  	mtab = g_new0 (struct mtab_handle, 1);
@@ -40,7 +55,7 @@ $NetBSD: patch-ab,v 1.1.1.1 2008/11/22 1
  mtab_next (gpointer handle, char **mount_point)
  {
 -#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
  	struct mtab_handle *mtab = handle;
  
  	if (mtab->iter < mtab->n_mounts) {
@@ -49,7 +64,7 @@ $NetBSD: patch-ab,v 1.1.1.1 2008/11/22 1
  mtab_close (gpointer handle)
  {
 -#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
  	g_free (handle);
  #else
  	fclose (handle);
@@ -58,7 +73,7 @@ $NetBSD: patch-ab,v 1.1.1.1 2008/11/22 1
  fstab_open (gpointer *handle)
  {
 -#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
  	return setfsent () == 1;
  #elif sun
  	*handle = fopen (VFSTAB, "r");
@@ -67,38 +82,47 @@ $NetBSD: patch-ab,v 1.1.1.1 2008/11/22 1
  fstab_next (gpointer handle, char **mount_point)
  {
 -#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
  	struct fstab *fstab;
  
  	fstab = getfsent ();
-@@ -188,7 +199,7 @@ fstab_next (gpointer handle, char **moun
+@@ -188,14 +199,16 @@ fstab_next (gpointer handle, char **moun
  void
  fstab_close (gpointer handle)
  {
 -#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
  	endfsent ();
  #else
  	fclose (handle);
-@@ -197,6 +208,8 @@ fstab_close (gpointer handle)
+ #endif
+ }
  
- #ifdef __FreeBSD__
- #define UMOUNT		"/sbin/umount"
-+#elif __NetBSD__
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
 +#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 !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__)
  	if (option_lazy)
  		args[na++] = "-l";
  #endif
-@@ -632,6 +645,11 @@ try_open_excl_again:
+@@ -625,13 +638,18 @@ try_open_excl_again:
+ 	/* construct arguments to EJECT_PROGRAM (e.g. /usr/bin/eject) */
+ 	na = 0;
+ 	args[na++] = EJECT_PROGRAM;
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ 	args[na++] = "-f";
+ 	args[na++] = (char *) device;
+ 	if (closetray)
  		args[na++] = "close";
  	else
  		args[na++] = "eject";
Index: patches/patch-ac
===================================================================
RCS file: /NetBSD/pkgsrc/sysutils/hal/patches/patch-ac,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 patch-ac
--- patches/patch-ac	22 Nov 2008 15:20:51 -0000	1.1.1.1
+++ patches/patch-ac	23 Nov 2008 17:15:17 -0000
@@ -1,8 +1,14 @@
-$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 @@
+--- tools/hal-storage-unmount.c.orig	2008-05-08 02:24:17 +0300
++++ tools/hal-storage-unmount.c	2008-11-23 13:40:23 +0200
+@@ -31,13 +31,17 @@
+ #include <string.h>
+ #include <glib.h>
+ #include <glib/gstdio.h>
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ #include <fstab.h>
+ #include <sys/param.h>
+ #include <sys/ucred.h>
  #include <sys/mount.h>
  #include <limits.h>
  #include <pwd.h>
Index: patches/patch-ad
===================================================================
RCS file: /NetBSD/pkgsrc/sysutils/hal/patches/patch-ad,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 patch-ad
--- patches/patch-ad	22 Nov 2008 15:20:51 -0000	1.1.1.1
+++ patches/patch-ad	23 Nov 2008 17:15:17 -0000
@@ -1,30 +1,34 @@
-$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)
+--- tools/hal-system-power-pmu.c.orig	2008-05-08 02:24:16 +0300
++++ tools/hal-system-power-pmu.c	2008-11-23 13:42:54 +0200
+@@ -55,6 +55,10 @@ pmac_sleep (void)
  {
  #ifdef __FreeBSD__
  	return FALSE;			/* FIXME implement */
 +#elif __NetBSD__
 +	return FALSE;			/* FIXME implement */
++#elif __DragonFly__
++	return FALSE;			/* FIXME implement */
  #elif sun
  	return FALSE;			/* FIXME implement */
  #elif __GNU__
-@@ -92,6 +94,8 @@ pmac_get_lcd_brightness (int *val)
+@@ -92,6 +96,10 @@ pmac_get_lcd_brightness (int *val)
  {
  #ifdef __FreeBSD__
  	return FALSE;			/* FIXME implement */
 +#elif __NetBSD__
 +	return FALSE;			/* FIXME implement */
++#elif __DragonFly__
++	return FALSE;			/* FIXME implement */
  #elif sun
  	return FALSE;			/* FIXME implement */
  #elif __GNU__
-@@ -129,6 +133,8 @@ pmac_set_lcd_brightness (int val)
+@@ -129,6 +137,10 @@ pmac_set_lcd_brightness (int val)
  {
  #ifdef __FreeBSD__
  	return FALSE;			/* FIXME implement */
 +#elif __NetBSD__
++	return FALSE;			/* FIXME implement */
++#elif __DragonFly__
 +	return FALSE;			/* FIXME implement */
  #elif sun
  	return FALSE;			/* FIXME implement */
