[Midnightbsd-cvs] mports: sysutils/hal: Update of hal to latest version.

archite at midnightbsd.org archite at midnightbsd.org
Sun Jun 1 19:27:33 EDT 2008


Log Message:
-----------
Update of hal to latest version.

Modified Files:
--------------
    mports/sysutils/hal:
        Makefile (r1.6 -> r1.7)
        distinfo (r1.3 -> r1.4)
        pkg-plist (r1.2 -> r1.3)
    mports/sysutils/hal/files:
        extra-patch-tools_hal-storage-mount.c (r1.1 -> r1.2)
        hald.in (r1.1 -> r1.2)
        patch-Makefile.in (r1.1 -> r1.2)
        patch-doc_Makefile.in (r1.1 -> r1.2)
        pkg-install.in (r1.1 -> r1.2)

Added Files:
-----------
    mports/sysutils/hal/files:
        10-mouse-sysmouse.fdi (r1.1)
        patch-fdi_policy_10osvendor_10-x11-input.fdi (r1.1)
        patch-hald_freebsd_addons_Makefile.in (r1.1)
        patch-hald_freebsd_addons_addon-mouse.c (r1.1)
        patch-hald_freebsd_addons_addon-storage.c (r1.1)
        patch-hald_freebsd_clock (r1.1)
        patch-hald_freebsd_probing_probe-volume.c (r1.1)
        patch-hald_hf-storage.c (r1.1)
        patch-tools_hal-storage-mount.c (r1.1)

-------------- next part --------------
Index: pkg-plist
===================================================================
RCS file: /home/cvs/mports/sysutils/hal/pkg-plist,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sysutils/hal/pkg-plist -L sysutils/hal/pkg-plist -u -r1.2 -r1.3
--- sysutils/hal/pkg-plist
+++ sysutils/hal/pkg-plist
@@ -1,9 +1,13 @@
 @unexec %D/etc/rc.d/hald stop > /dev/null 2>&1 || true
 %%MEDIA%%@exec mkdir -p /media
 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-is-caller-privileged
+bin/hal-lock
 bin/hal-set-property
 bin/lshal
 @exec mkdir -p %D/etc/hal/fdi/preprobe
@@ -25,32 +29,41 @@
 lib/libhald_freebsd_probe.so.0
 libdata/pkgconfig/hal-storage.pc
 libdata/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-system-power-pmu
+libexec/hal-storage-unmount
+libexec/hal-system-power-pm-is-supported
+libexec/hal-system-setserial
+libexec/hal/scripts/freebsd/hal-system-lcd-get-brightness-freebsd
+libexec/hal/scripts/freebsd/hal-system-lcd-set-brightness-freebsd
+libexec/hal/scripts/freebsd/hal-system-power-reboot-freebsd
+libexec/hal/scripts/freebsd/hal-system-power-set-power-save-freebsd
+libexec/hal/scripts/freebsd/hal-system-power-shutdown-freebsd
+libexec/hal/scripts/freebsd/hal-system-power-suspend-freebsd
+libexec/hal/scripts/hal-dockstation-undock
+libexec/hal/scripts/hal-functions
 libexec/hal/scripts/hal-luks-remove
 libexec/hal/scripts/hal-luks-setup
 libexec/hal/scripts/hal-luks-teardown
+libexec/hal/scripts/hal-system-killswitch-get-power
+libexec/hal/scripts/hal-system-killswitch-set-power
 libexec/hal/scripts/hal-system-lcd-get-brightness
-libexec/hal/scripts/hal-system-lcd-get-brightness-freebsd
 libexec/hal/scripts/hal-system-lcd-set-brightness
-libexec/hal/scripts/hal-system-lcd-set-brightness-freebsd
 libexec/hal/scripts/hal-system-power-hibernate
 libexec/hal/scripts/hal-system-power-reboot
-libexec/hal/scripts/hal-system-power-reboot-freebsd
 libexec/hal/scripts/hal-system-power-set-power-save
-libexec/hal/scripts/hal-system-power-set-power-save-freebsd
 libexec/hal/scripts/hal-system-power-shutdown
-libexec/hal/scripts/hal-system-power-shutdown-freebsd
 libexec/hal/scripts/hal-system-power-suspend
-libexec/hal/scripts/hal-system-power-suspend-freebsd
-libexec/hal/scripts/hal-system-storage-cleanup-mountpoint
-libexec/hal/scripts/hal-system-storage-cleanup-mountpoints
-libexec/hal/scripts/hal-system-storage-cleanup-mountpoints-freebsd
-libexec/hal/scripts/hal-system-storage-eject
-libexec/hal/scripts/hal-system-storage-eject-freebsd
-libexec/hal/scripts/hal-system-storage-unmount
-libexec/hal/scripts/hal-system-storage-unmount-freebsd
+libexec/hal/scripts/hal-system-power-suspend-hybrid
+libexec/hal/scripts/hal-system-wol-enable
+libexec/hal/scripts/hal-system-wol-enabled
+libexec/hal/scripts/hal-system-wol-supported
+libexec/hald-addon-mouse-sysmouse
 libexec/hald-addon-storage
+libexec/hald-generate-fdi-cache
 libexec/hald-probe-hiddev
 libexec/hald-probe-scsi
 libexec/hald-probe-smbios
@@ -59,57 +72,30 @@
 libexec/hald-runner
 sbin/hald
 %%PORTDOCS%%%%DOCSDIR%%/README.freebsd
-%%DOCSDIR%%/conf/match-USB-camera.fdi
-%%DOCSDIR%%/conf/match-USB-mp3-player.fdi
-%%DOCSDIR%%/conf/match-cardreader.fdi
-%%DOCSDIR%%/conf/storage-non-fixed.fdi
-%%DOCSDIR%%/conf/storage-policy-examples.fdi
-%%DOCSDIR%%/conf/storage-skip-all.fdi
 %%DATADIR%%/dist/hal.conf
 %%DATADIR%%/fdi/fdi.dtd
-%%DATADIR%%/fdi/fdi.rng
-%%DATADIR%%/fdi/information/10freedesktop/10-camera-ptp.fdi
-%%DATADIR%%/fdi/information/10freedesktop/10-cd-dvd-burner.fdi
-%%DATADIR%%/fdi/information/10freedesktop/10-usb-card-readers.fdi
-%%DATADIR%%/fdi/information/10freedesktop/10-usb-music-players.fdi
-%%DATADIR%%/fdi/information/10freedesktop/10-usb-pda.fdi
-%%DATADIR%%/fdi/information/10freedesktop/10-usb-zip-drives.fdi
-%%DATADIR%%/fdi/information/10freedesktop/10-wireless-mice.fdi
+%%DATADIR%%/fdi/information/10freedesktop/01-deprecated-keys.fdi
 @exec mkdir -p %D/%%DATADIR%%/fdi/information/20thirdparty
-%%DATADIR%%/fdi/policy/10osvendor/10-keyboard-policy.fdi
+%%DATADIR%%/fdi/policy/10osvendor/10-dockstation.fdi
+%%DATADIR%%/fdi/policy/10osvendor/10-input-policy.fdi
 %%DATADIR%%/fdi/policy/10osvendor/10-laptop-panel-mgmt-policy.fdi
+%%DATADIR%%/fdi/policy/10osvendor/10-mouse-sysmouse.fdi
 %%DATADIR%%/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
-%%DATADIR%%/fdi/policy/10osvendor/10-toshiba-buttons.fdi
+%%DATADIR%%/fdi/policy/10osvendor/10-rfkill-switch.fdi
+%%DATADIR%%/fdi/policy/10osvendor/10-tabletPCs.fdi
+%%DATADIR%%/fdi/policy/10osvendor/10-x11-input.fdi
 %%DATADIR%%/fdi/policy/10osvendor/15-storage-luks.fdi
 %%DATADIR%%/fdi/policy/10osvendor/20-storage-methods.fdi
+%%DATADIR%%/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
 @exec mkdir -p %D/%%DATADIR%%/fdi/policy/20thirdparty
-%%DATADIR%%/fdi/preprobe/10osvendor/10-ide-drives.fdi
+ at exec mkdir -p %D/%%DATADIR%%/fdi/preprobe/10osvendor
 @exec mkdir -p %D/%%DATADIR%%/fdi/preprobe/20thirdparty
-share/locale/cs/LC_MESSAGES/hal.mo
-share/locale/da/LC_MESSAGES/hal.mo
-share/locale/de/LC_MESSAGES/hal.mo
-share/locale/el/LC_MESSAGES/hal.mo
-share/locale/es/LC_MESSAGES/hal.mo
-share/locale/eu/LC_MESSAGES/hal.mo
-share/locale/fi/LC_MESSAGES/hal.mo
-share/locale/fr/LC_MESSAGES/hal.mo
-share/locale/hu/LC_MESSAGES/hal.mo
-share/locale/it/LC_MESSAGES/hal.mo
-share/locale/ja/LC_MESSAGES/hal.mo
-share/locale/km/LC_MESSAGES/hal.mo
-share/locale/ko/LC_MESSAGES/hal.mo
-share/locale/lt/LC_MESSAGES/hal.mo
-share/locale/nb/LC_MESSAGES/hal.mo
-share/locale/nl/LC_MESSAGES/hal.mo
-share/locale/pa/LC_MESSAGES/hal.mo
-share/locale/pl/LC_MESSAGES/hal.mo
-share/locale/pt/LC_MESSAGES/hal.mo
-share/locale/pt_BR/LC_MESSAGES/hal.mo
-share/locale/ru/LC_MESSAGES/hal.mo
-share/locale/sl_SI/LC_MESSAGES/hal.mo
-share/locale/uk/LC_MESSAGES/hal.mo
-share/locale/zh_CN/LC_MESSAGES/hal.mo
-share/locale/zh_TW/LC_MESSAGES/hal.mo
 @dirrm %%DATADIR%%/fdi/preprobe/20thirdparty
 @dirrm %%DATADIR%%/fdi/preprobe/10osvendor
 @dirrm %%DATADIR%%/fdi/preprobe
@@ -122,8 +108,8 @@
 @dirrm %%DATADIR%%/fdi
 @dirrm %%DATADIR%%/dist
 @dirrm %%DATADIR%%
- at dirrm %%DOCSDIR%%/conf
 @dirrm %%DOCSDIR%%
+ at dirrm libexec/hal/scripts/freebsd
 @dirrm libexec/hal/scripts
 @dirrm libexec/hal
 @dirrm include/hal
@@ -136,8 +122,8 @@
 @unexec rm -rf /var/run/hald/hald-local 2>/dev/null || true
 @unexec rm -rf /var/run/hald/hald-runner 2>/dev/null || true
 @unexec rmdir /var/run/hald 2>/dev/null || true
- at dirrmtry share/locale/sl_SI/LC_MESSAGES
- at dirrmtry share/locale/sl_SI
- at dirrmtry share/locale/km/LC_MESSAGES
- at dirrmtry share/locale/km
+ at unexec rmdir /var/cache/hald 2>/dev/null || true
+ at unexec rmdir /var/cache 2>/dev/null || true
+ at unexec /var/lib/hal 2>/dev/null || true
+ at unexec /var/lib 2>/dev/null || true
 %%MEDIA%%@unexec rmdir /media 2>/dev/null || true
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/sysutils/hal/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -L sysutils/hal/Makefile -L sysutils/hal/Makefile -u -r1.6 -r1.7
--- sysutils/hal/Makefile
+++ sysutils/hal/Makefile
@@ -3,27 +3,23 @@
 # Whom:				Joe Marcus Clarke <marcus at FreeBSD.org>
 #
 # $MidnightBSD$
-# $FreeBSD: ports/sysutils/hal/Makefile,v 1.22 2007/04/07 11:53:22 jylefort Exp $
-#   $MCom: ports/sysutils/hal/Makefile,v 1.26 2006/10/13 10:00:57 ahze Exp $
+# $FreeBSD: ports/sysutils/hal/Makefile,v 1.38 2008/05/19 06:24:44 marcus Exp $
+#   $MCom: ports/sysutils/hal/Makefile,v 1.43 2008/03/22 19:31:15 marcus Exp $
 #
 
 PORTNAME=	hal
-PORTVERSION=	${HALVERSION}.${SNAPVERSION}
-PORTREVISION?=	0
-CATEGORIES?=	sysutils
-MASTER_SITES=	http://www.marcuscom.com/downloads/
+DISTVERSION=	0.5.11
+CATEGORIES=	sysutils
+MASTER_SITES=	http://hal.freedesktop.org/releases/
 
 MAINTAINER=	ports at MidnightBSD.org
-COMMENT?=	Hardware Abstraction Layer for simplifying device access
-LICENSE=	gpl2
+COMMENT=	Hardware Abstraction Layer for simplifying device access
 
-.if !defined(HAL_SLAVE)
 LIB_DEPENDS=	polkit.2:${PORTSDIR}/sysutils/policykit \
-		volume_id.0:${PORTSDIR}/devel/libvolume_id
+		volume_id.0:${PORTSDIR}/devel/libvolume_id \
+		ck-connector.0:${PORTSDIR}/sysutils/consolekit
 RUN_DEPENDS=	${LOCALBASE}/share/pciids/pci.ids:${PORTSDIR}/misc/pciids
-.endif
 
-USE_BZIP2=	yes
 USE_GETTEXT=	yes
 USE_GMAKE=	yes
 USE_GNOME=	gnomehack gnometarget intlhack ltverhack
@@ -31,100 +27,95 @@
 USE_LDCONFIG=	yes
 USE_PYTHON=	yes
 CONFIGURE_ARGS=	--disable-gtk-doc \
-		--with-hwdata=${LOCALBASE}/share/pciids \
 		--with-backend=freebsd \
 		--disable-docbook-docs \
+		--with-pci-ids=${LOCALBASE}/share/pciids \
+		--disable-usb-ids \
+		--without-libpci \
+		--disable-usb \
+		--disable-smbios \
+		--disable-apm \
+		--disable-pmu \
+		--enable-policy-kit \
+		--enable-console-kit \
 		--with-socket-dir=/var/run/hald \
-		--with-pid-file=/var/run/hald/hald.pid
+		--with-eject=/usr/sbin/cdcontrol \
+		--with-pid-file=/var/run/hald/hald.pid \
+		--with-deprecated-keys \
+		--localstatedir=/var
 CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
 		LDFLAGS="-L${LOCALBASE}/lib" \
 		GTKDOC="false"
 
-HALVERSION=	0.5.8
-SNAPVERSION=	20071224
+#HALVERSION=	0.5.10
+#SNAPVERSION=	20080218
 
-.if !defined(HAL_SLAVE)
 USE_RC_SUBR=	hald
 USE_GNOME_SUBR=	yes
-DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}-${HALVERSION}
-PLIST_SUB=	VERSION=${HALVERSION}
-
-PRIV_FILES=	hal-power-hibernate \
-		hal-power-poweroff \
-		hal-power-reboot \
-		hal-power-suspend \
-		hal-storage-fixed-mount-change-uid \
-		hal-storage-fixed-mount \
-		hal-storage-removable-mount-change-uid \
-		hal-storage-removable-mount
-PRIV_FILES:=	${PRIV_FILES:S|$|.privilege|}
+DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}-${DISTVERSION}
+PLIST_SUB=	VERSION=${DISTVERSION}
 
-RC_FILES=	hal.conf:${PREFIX}/etc/dbus-1/system.d \
-		${PRIV_FILES:S|$|:${PREFIX}/etc/PolicyKit/privilege.d|}
+RC_FILES=	hal.conf:${PREFIX}/etc/dbus-1/system.d
 PLIST_FILES=	${PRIV_FILES:S|^|%%DATADIR%%/dist/|}
 
 SUB_FILES=	pkg-install pkg-deinstall
 SUB_LIST=	RC_FILES="${RC_FILES}"
 
+MAN1=		hal-disable-polling.1 hal-find-by-capability.1 \
+		hal-find-by-property.1 hal-get-property.1 \
+		hal-is-caller-locked-out.1 hal-is-caller-privileged.1 \
+		hal-lock.1 hal-set-property.1 lshal.1
+MAN8=		hald.8
+
 OPTIONS=	FIXED_MOUNTPOINTS "use fixed mountpoints" off
-.else # Slave port stuff
-LIB_DEPENDS+=	hal.1:${PORTSDIR}/sysutils/hal
-RUN_DEPENDS+=	${PYTHON_SITELIBDIR}/dbus/__init__.py:${PORTSDIR}/devel/py-dbus
-
-USE_GNOME+=	pygnome2
-DESKTOP_ENTRIES="Device Manager" \
-		"Examine your devices" \
-		"${DATADIR}/device-manager/hal-bus-pci.png" \
-		"hal-device-manager" \
-		"Application;System;" \
-		true
-BUILD_WRKSRC=	${WRKSRC}/tools/device-manager
-INSTALL_WRKSRC=	${BUILD_WRKSRC}
-.endif
 
 .include <bsd.port.pre.mk>
 
-.if !defined(HAL_SLAVE)
+.if ${OSVERSION} < 505000
+IGNORE=	not supported on FreeBSD prior to 5.5-RELEASE
+.endif
+
 .if (${ARCH}=="i386" || ${ARCH}=="amd64" || ${ARCH}=="ia64")
 RUN_DEPENDS+=	dmidecode:${PORTSDIR}/sysutils/dmidecode
 .endif
 
+.if ${OSVERSION} <= 601100
 NEEDS_MEDIA=	yes
 PLIST_SUB+=	MEDIA=""
+.else
+PLIST_SUB+=	MEDIA="@comment "
+.endif
 
 .if defined(WITH_FIXED_MOUNTPOINTS)
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-tools_hal-storage-mount.c
 .endif
-.endif
 
 post-patch:
-.if !defined(HAL_SLAVE)
-	@${REINPLACE_CMD} -e 's|device-manager||' \
-		${WRKSRC}/tools/Makefile.in
-.endif
 	@${REINPLACE_CMD} -e '/^scriptdir = /s|libdir|libexecdir|' \
 		${WRKSRC}/tools/Makefile.in \
 		${WRKSRC}/tools/freebsd/Makefile.in
 	@${REINPLACE_CMD} -e 's|[(]libdir[)]/hal/scripts|(libexecdir)/hal/scripts|' \
 		${WRKSRC}/hald/Makefile.in
-	@${REINPLACE_CMD} -e '/^SUBDIRS/ s|txt||' \
-		${WRKSRC}/policy/Makefile.in
 	@${REINPLACE_CMD} -e 's|user="0"|group="operator"|g' \
 		${WRKSRC}/hal.conf.in
-	@${TOUCH} ${WRKSRC}/doc/spec/hal-spec.html
 
 post-install:
-.if !defined(HAL_SLAVE)
 	${MKDIR} ${DATADIR}/dist
-	${INSTALL_DATA} ${WRKSRC}/hal.conf ${WRKSRC}/policy/txt/*.privilege \
-		${DESTDIR}${DATADIR}/dist
-.if !defined(PACKAGE_BUILDING) && defined(NEEDS_MEDIA)
+	${INSTALL_DATA} ${WRKSRC}/hal.conf ${DATADIR}/dist
+	${MKDIR} ${PREFIX}/share/hal/fdi/policy/10osvendor
+	${INSTALL_DATA} ${FILESDIR}/10-mouse-sysmouse.fdi \
+	    	${PREFIX}/share/hal/fdi/policy/10osvendor
+.if !defined(PACKAGE_BUILDING)
+	@${SETENV} PKG_PREFIX=${PREFIX} \
+		${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+.if defined(NEEDS_MEDIA)
 	${MKDIR} /media
 .endif
+.endif
 .if !defined(NOPORTDOCS)
+	${MKDIR} ${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/hald/freebsd/README \
 		${DOCSDIR}/README.freebsd
 .endif
-.endif
 
 .include <bsd.port.post.mk>
Index: distinfo
===================================================================
RCS file: /home/cvs/mports/sysutils/hal/distinfo,v
retrieving revision 1.3
retrieving revision 1.4
diff -L sysutils/hal/distinfo -L sysutils/hal/distinfo -u -r1.3 -r1.4
--- sysutils/hal/distinfo
+++ sysutils/hal/distinfo
@@ -1,3 +1,3 @@
-MD5 (hal-0.5.8.20071224.tar.bz2) = e2f563bf6f313b98b4e00491f3cb571a
-SHA256 (hal-0.5.8.20071224.tar.bz2) = b1620e1a82124ef39d5b11eb1cf529f71bf3c92520836277a9f8dc2f35139920
-SIZE (hal-0.5.8.20071224.tar.bz2) = 1366761
+MD5 (hal-0.5.11.tar.gz) = 750cf074e88b6fb7012f26d99cd39b9b
+SHA256 (hal-0.5.11.tar.gz) = 730a9f2340f789677eb0c3b0984bbaca3ede6c12d1e4b16bc7ea91f51d10ba90
+SIZE (hal-0.5.11.tar.gz) = 1672992
--- /dev/null
+++ sysutils/hal/files/patch-hald_freebsd_probing_probe-volume.c
@@ -0,0 +1,12 @@
+--- hald/freebsd/probing/probe-volume.c.orig	2008-04-07 00:41:22.000000000 -0400
++++ hald/freebsd/probing/probe-volume.c	2008-04-07 00:43:32.000000000 -0400
+@@ -502,7 +502,8 @@ main (int argc, char **argv)
+ 	  hfp_cdrom_free(cdrom);
+ 	}
+ 
+-      if (has_data)
++      if (has_data && vid && (! strcmp(vid->type, "iso9660") ||
++          ! strcmp(vid->type, "udf")))
+         hf_probe_volume_advanced_disc_detect(fd);
+     }
+   else
--- /dev/null
+++ sysutils/hal/files/patch-hald_freebsd_clock
@@ -0,0 +1,111 @@
+--- hald/freebsd/libprobe/hfp.c.orig	2008-03-17 17:25:17.000000000 -0400
++++ hald/freebsd/libprobe/hfp.c	2008-03-26 12:07:32.000000000 -0400
+@@ -216,55 +216,59 @@ hfp_getenv_bool (const char *variable)
+ }
+ 
+ void
+-hfp_gettimeofday (struct timeval *t)
++hfp_clock_gettime (struct timespec *t)
+ {
+   int status;
+ 
+   assert(t != NULL);
+ 
+-  status = gettimeofday(t, NULL);
++#ifdef CLOCK_MONOTONIC_FAST
++  status = clock_gettime(CLOCK_MONOTONIC_FAST, t);
++#else
++  status = clock_gettime(CLOCK_MONOTONIC, t);
++#endif
+   assert(status == 0);
+ }
+ 
+-/* timeval functions from sys/kern/kern_time.c */
++/* timespec functions from sys/kern/kern_time.c */
+ 
+ static void
+-hfp_timevalfix (struct timeval *t)
++hfp_timespecfix (struct timespec *t)
+ {
+   assert(t != NULL);
+ 
+-  if (t->tv_usec < 0)
++  if (t->tv_nsec < 0)
+     {
+       t->tv_sec--;
+-      t->tv_usec += 1000000;
++      t->tv_nsec += 1000000000;
+     }
+-  if (t->tv_usec >= 1000000)
++  if (t->tv_nsec >= 1000000000)
+     {
+       t->tv_sec++;
+-      t->tv_usec -= 1000000;
++      t->tv_nsec -= 1000000000;
+     }
+ }
+ 
+ void
+-hfp_timevaladd (struct timeval *t1, const struct timeval *t2)
++hfp_timespecadd (struct timespec *t1, const struct timespec *t2)
+ {
+   assert(t1 != NULL);
+   assert(t2 != NULL);
+ 
+   t1->tv_sec += t2->tv_sec;
+-  t1->tv_usec += t2->tv_usec;
++  t1->tv_nsec += t2->tv_nsec;
+ 
+-  hfp_timevalfix(t1);
++  hfp_timespecfix(t1);
+ }
+ 
+ void
+-hfp_timevalsub (struct timeval *t1, const struct timeval *t2)
++hfp_timespecsub (struct timespec *t1, const struct timespec *t2)
+ {
+   assert(t1 != NULL);
+   assert(t2 != NULL);
+ 
+   t1->tv_sec -= t2->tv_sec;
+-  t1->tv_usec -= t2->tv_usec;
++  t1->tv_nsec -= t2->tv_nsec;
+ 
+-  hfp_timevalfix(t1);
++  hfp_timespecfix(t1);
+ }
+--- hald/freebsd/libprobe/hfp.h.orig	2008-03-17 17:25:17.000000000 -0400
++++ hald/freebsd/libprobe/hfp.h	2008-04-02 14:35:50.000000000 -0400
+@@ -29,8 +29,12 @@
+ #endif
+ 
+ #include <stdarg.h>
++#include <time.h>
+ #include <sys/types.h>
++#include <sys/param.h>
++#if __FreeBSD_version < 600000
+ #include <sys/time.h>
++#endif
+ 
+ #include "libhal/libhal.h"
+ 
+@@ -84,14 +88,14 @@ void volume_id_log (const char *format, 
+ 
+ boolean hfp_getenv_bool (const char *variable);
+ 
+-void hfp_gettimeofday (struct timeval *t);
+-void hfp_timevaladd (struct timeval *t1, const struct timeval *t2);
+-void hfp_timevalsub (struct timeval *t1, const struct timeval *t2);
++void hfp_clock_gettime (struct timespec *t);
++void hfp_timespecadd (struct timespec *t1, const struct timespec *t2);
++void hfp_timespecsub (struct timespec *t1, const struct timespec *t2);
+ 
+ /* from sys/time.h (_KERNEL) */
+-#define hfp_timevalcmp(t1, t2, cmp) \
++#define hfp_timespeccmp(t1, t2, cmp) \
+   (((t1)->tv_sec == (t2)->tv_sec	\
+-    ? ((t1)->tv_usec cmp (t2)->tv_usec)	\
++    ? ((t1)->tv_nsec cmp (t2)->tv_nsec)	\
+     : ((t1)->tv_sec cmp (t2)->tv_sec)))
+ 
+ #endif /* _HFP_H */
--- /dev/null
+++ sysutils/hal/files/patch-hald_freebsd_addons_Makefile.in
@@ -0,0 +1,92 @@
+--- hald/freebsd/addons/Makefile.in.orig	2008-03-27 00:45:50.000000000 -0400
++++ hald/freebsd/addons/Makefile.in	2008-03-27 00:48:15.000000000 -0400
+@@ -33,7 +33,8 @@ POST_UNINSTALL = :
+ build_triplet = @build@
+ host_triplet = @host@
+ @HALD_COMPILE_FREEBSD_TRUE at libexec_PROGRAMS =  \
+- at HALD_COMPILE_FREEBSD_TRUE@	hald-addon-storage$(EXEEXT)
++ at HALD_COMPILE_FREEBSD_TRUE@	hald-addon-storage$(EXEEXT) \
++ at HALD_COMPILE_FREEBSD_TRUE@	hald-addon-mouse-sysmouse$(EXEEXT)
+ subdir = hald/freebsd/addons
+ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+@@ -47,6 +48,15 @@ CONFIG_CLEAN_FILES =
+ am__installdirs = "$(DESTDIR)$(libexecdir)"
+ libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+ PROGRAMS = $(libexec_PROGRAMS)
++am_hald_addon_mouse_sysmouse_OBJECTS =  \
++	hald_addon_mouse_sysmouse-addon-mouse.$(OBJEXT)
++hald_addon_mouse_sysmouse_OBJECTS =  \
++	$(am_hald_addon_mouse_sysmouse_OBJECTS)
++hald_addon_mouse_sysmouse_DEPENDENCIES = $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
++hald_addon_mouse_sysmouse_LINK = $(LIBTOOL) --tag=CC \
++	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
++	$(hald_addon_mouse_sysmouse_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
++	$(LDFLAGS) -o $@
+ am_hald_addon_storage_OBJECTS = addon-storage.$(OBJEXT)
+ hald_addon_storage_OBJECTS = $(am_hald_addon_storage_OBJECTS)
+ hald_addon_storage_DEPENDENCIES = $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
+@@ -62,8 +72,10 @@ CCLD = $(CC)
+ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ 	$(LDFLAGS) -o $@
+-SOURCES = $(hald_addon_storage_SOURCES)
+-DIST_SOURCES = $(hald_addon_storage_SOURCES)
++SOURCES = $(hald_addon_mouse_sysmouse_SOURCES) \
++	$(hald_addon_storage_SOURCES)
++DIST_SOURCES = $(hald_addon_mouse_sysmouse_SOURCES) \
++	$(hald_addon_storage_SOURCES)
+ ETAGS = etags
+ CTAGS = ctags
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+@@ -227,6 +239,11 @@ hald_addon_storage_SOURCES = addon-stora
+ hald_addon_storage_LDADD = \
+ 	$(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
+ 
++hald_addon_mouse_sysmouse_SOURCES = addon-mouse.c
++hald_addon_mouse_sysmouse_CFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@
++hald_addon_mouse_sysmouse_LDADD = @GLIB_LIBS@ \
++	$(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
++
+ all: all-am
+ 
+ .SUFFIXES:
+@@ -288,6 +305,9 @@ clean-libexecPROGRAMS:
+ 	  echo " rm -f $$p $$f"; \
+ 	  rm -f $$p $$f ; \
+ 	done
++hald-addon-mouse-sysmouse$(EXEEXT): $(hald_addon_mouse_sysmouse_OBJECTS) $(hald_addon_mouse_sysmouse_DEPENDENCIES) 
++	@rm -f hald-addon-mouse-sysmouse$(EXEEXT)
++	$(hald_addon_mouse_sysmouse_LINK) $(hald_addon_mouse_sysmouse_OBJECTS) $(hald_addon_mouse_sysmouse_LDADD) $(LIBS)
+ hald-addon-storage$(EXEEXT): $(hald_addon_storage_OBJECTS) $(hald_addon_storage_DEPENDENCIES) 
+ 	@rm -f hald-addon-storage$(EXEEXT)
+ 	$(LINK) $(hald_addon_storage_OBJECTS) $(hald_addon_storage_LDADD) $(LIBS)
+@@ -299,6 +319,7 @@ distclean-compile:
+ 	-rm -f *.tab.c
+ 
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/addon-storage.Po at am__quote@
++ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hald_addon_mouse_sysmouse-addon-mouse.Po at am__quote@
+ 
+ .c.o:
+ @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@@ -321,6 +342,20 @@ distclean-compile:
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+ 
++hald_addon_mouse_sysmouse-addon-mouse.o: addon-mouse.c
++ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_mouse_sysmouse_CFLAGS) $(CFLAGS) -MT hald_addon_mouse_sysmouse-addon-mouse.o -MD -MP -MF $(DEPDIR)/hald_addon_mouse_sysmouse-addon-mouse.Tpo -c -o hald_addon_mouse_sysmouse-addon-mouse.o `test -f 'addon-mouse.c' || echo '$(srcdir)/'`addon-mouse.c
++ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/hald_addon_mouse_sysmouse-addon-mouse.Tpo $(DEPDIR)/hald_addon_mouse_sysmouse-addon-mouse.Po
++ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='addon-mouse.c' object='hald_addon_mouse_sysmouse-addon-mouse.o' libtool=no @AMDEPBACKSLASH@
++ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_mouse_sysmouse_CFLAGS) $(CFLAGS) -c -o hald_addon_mouse_sysmouse-addon-mouse.o `test -f 'addon-mouse.c' || echo '$(srcdir)/'`addon-mouse.c
++
++hald_addon_mouse_sysmouse-addon-mouse.obj: addon-mouse.c
++ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_mouse_sysmouse_CFLAGS) $(CFLAGS) -MT hald_addon_mouse_sysmouse-addon-mouse.obj -MD -MP -MF $(DEPDIR)/hald_addon_mouse_sysmouse-addon-mouse.Tpo -c -o hald_addon_mouse_sysmouse-addon-mouse.obj `if test -f 'addon-mouse.c'; then $(CYGPATH_W) 'addon-mouse.c'; else $(CYGPATH_W) '$(srcdir)/addon-mouse.c'; fi`
++ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/hald_addon_mouse_sysmouse-addon-mouse.Tpo $(DEPDIR)/hald_addon_mouse_sysmouse-addon-mouse.Po
++ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='addon-mouse.c' object='hald_addon_mouse_sysmouse-addon-mouse.obj' libtool=no @AMDEPBACKSLASH@
++ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hald_addon_mouse_sysmouse_CFLAGS) $(CFLAGS) -c -o hald_addon_mouse_sysmouse-addon-mouse.obj `if test -f 'addon-mouse.c'; then $(CYGPATH_W) 'addon-mouse.c'; else $(CYGPATH_W) '$(srcdir)/addon-mouse.c'; fi`
++
+ mostlyclean-libtool:
+ 	-rm -f *.lo
+ 
Index: patch-doc_Makefile.in
===================================================================
RCS file: /home/cvs/mports/sysutils/hal/files/patch-doc_Makefile.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -L sysutils/hal/files/patch-doc_Makefile.in -L sysutils/hal/files/patch-doc_Makefile.in -u -r1.1 -r1.2
--- sysutils/hal/files/patch-doc_Makefile.in
+++ sysutils/hal/files/patch-doc_Makefile.in
@@ -1,11 +1,11 @@
---- doc/Makefile.in.orig	Tue May  2 01:04:31 2006
-+++ doc/Makefile.in	Tue May  2 01:04:42 2006
-@@ -269,7 +269,7 @@ sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
+--- doc/Makefile.in.orig	2008-01-03 21:41:19.000000000 -0500
++++ doc/Makefile.in	2008-01-03 21:41:31.000000000 -0500
+@@ -203,7 +203,7 @@ target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
  EXTRA_DIST = TODO
--SUBDIRS = api spec conf
-+SUBDIRS = spec conf
- all: all-recursive
- 
- .SUFFIXES:
+-SUBDIRS = api spec man
++SUBDIRS = spec man
+ MAINTAINERCLEANFILES = \
+ 	*~			\
+ 	Makefile.in
--- /dev/null
+++ sysutils/hal/files/patch-hald_hf-storage.c
@@ -0,0 +1,18 @@
+--- hald/freebsd/hf-storage.c.orig	2008-04-07 00:40:06.000000000 -0400
++++ hald/freebsd/hf-storage.c	2008-04-07 00:40:37.000000000 -0400
+@@ -117,6 +117,7 @@ hf_storage_geom_has_partitions (const Ge
+   if (g_node_n_children(node) > 0)
+     return TRUE;
+ 
++  /*
+   if (hf_storage_class_is_partitionable(geom_obj->class) &&
+       g_node_next_sibling(node) != NULL)
+     {
+@@ -135,6 +136,7 @@ hf_storage_geom_has_partitions (const Ge
+             return TRUE;
+         }
+     }
++    */
+ 
+   return FALSE;
+ }
--- /dev/null
+++ sysutils/hal/files/patch-hald_freebsd_addons_addon-mouse.c
@@ -0,0 +1,219 @@
+--- hald/freebsd/addons/addon-mouse.c.orig	2008-03-31 04:53:42.000000000 -0400
++++ hald/freebsd/addons/addon-mouse.c	2008-03-31 05:07:19.000000000 -0400
+@@ -0,0 +1,216 @@
++/***************************************************************************
++ * CVSID: $Id$
++ *
++ * addon-mouse.c : poll mice to disable moused(8) owned devices
++ *
++ * Copyright (C) 2008 Joe Marcus Clarke
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
++ *
++ **************************************************************************/
++
++#ifdef HAVE_CONFIG_H
++#  include <config.h>
++#endif
++
++#include <string.h>
++#include <stdlib.h>
++#include <assert.h>
++#include <unistd.h>
++#include <glib.h>
++
++#include "libhal/libhal.h"
++
++#include "../libprobe/hfp.h"
++
++#define CMD "/usr/bin/fstat %s"
++
++#define MOUSE_DRIVER "mouse"
++#define MOUSED_DEVICE "/dev/sysmouse"
++#define MOUSED_PROC_NAME "moused"
++#define XORG_PROC_NAME "Xorg"
++
++static struct
++{
++  const struct timespec	update_interval;
++  char			*device_file;
++  struct timespec	next_update;
++} addon = { { 2, 0 } };
++
++static gboolean
++device_opened_by_proc (const char *device, const char *proc)
++{
++  char **lines;
++  char *output = NULL;
++  char *cmd;
++  int i;
++  gboolean found = FALSE;
++
++  cmd = g_strdup_printf(CMD, device);
++
++  if (! g_spawn_command_line_sync (cmd, &output, NULL, NULL, NULL))
++    {
++      g_free(cmd);
++      goto done;
++    }
++  g_free(cmd);
++
++  if (! output || strlen(output) == 0)
++    goto done;
++
++  lines = g_strsplit(output, "\n", 0);
++  if (g_strv_length(lines) < 2)
++    {
++      g_strfreev(lines);
++      goto done;
++    }
++
++  for (i = 1; lines[i]; i++)
++    {
++      char **fields;
++      guint len;
++      guint j;
++
++      fields = g_strsplit_set(lines[i], " ", 0);
++      len = g_strv_length(fields);
++      if (len < 2)
++        {
++          g_strfreev(fields);
++	  continue;
++	}
++      for (j = 1; j < len && fields[j] && *fields[j] == '\0'; j++)
++        ;
++      if (j < len && fields[j] && ! strcmp(fields[j], proc))
++        {
++          found = TRUE;
++          g_strfreev(fields);
++	  break;
++	}
++      g_strfreev(fields);
++    }
++
++  g_strfreev(lines);
++
++done:
++  g_free(output);
++
++  return found;
++}
++
++static const char *
++get_mouse_device (const char *device)
++{
++  if (device_opened_by_proc(device, MOUSED_PROC_NAME))
++    return MOUSED_DEVICE;
++
++  return device;
++}
++
++static void
++poll_for_moused (void)
++{
++  char *driver;
++  char *old_device;
++  const char *device;
++  gboolean found;
++
++  old_device = libhal_device_get_property_string(hfp_ctx, hfp_udi, "input.device", &hfp_error);
++  dbus_error_free(&hfp_error);
++
++  device = get_mouse_device(addon.device_file);
++  if (strcmp(old_device, device))
++    {
++      libhal_device_set_property_string(hfp_ctx, hfp_udi, "input.device", device, &hfp_error);
++      dbus_error_free(&hfp_error);
++    }
++  g_free(old_device);
++
++  driver = libhal_device_get_property_string(hfp_ctx, hfp_udi, "input.x11_driver", &hfp_error);
++  dbus_error_free(&hfp_error);
++
++  found = (strcmp(device, MOUSED_DEVICE) == 0);
++  if (! found)
++    found = device_opened_by_proc(device, XORG_PROC_NAME);
++
++  if (found && driver)
++    {
++      libhal_device_remove_property(hfp_ctx, hfp_udi, "input.x11_driver", &hfp_error);
++      dbus_error_free(&hfp_error);
++    }
++  else if (! (found || driver))
++    {
++      libhal_device_set_property_string(hfp_ctx, hfp_udi, "input.x11_driver", MOUSE_DRIVER, &hfp_error);
++      dbus_error_free(&hfp_error);
++    }
++
++  g_free(driver);
++}
++
++int
++main (int argc, char **argv)
++{
++  DBusConnection *connection;
++
++  if (! hfp_init(argc, argv))
++    goto end;
++
++  addon.device_file = getenv("HAL_PROP_FREEBSD_DEVICE_FILE");
++  if (! addon.device_file)
++    goto end;
++
++  setproctitle("%s", addon.device_file);
++
++  if (! libhal_device_addon_is_ready(hfp_ctx, hfp_udi, &hfp_error))
++    goto end;
++  dbus_error_free(&hfp_error);
++
++  connection = libhal_ctx_get_dbus_connection(hfp_ctx);
++  assert(connection != NULL);
++
++  while (TRUE)
++    {
++      /* process dbus traffic until update interval has elapsed */
++      while (TRUE)
++	{
++	  struct timespec now;
++
++	  hfp_clock_gettime(&now);
++	  if (hfp_timespeccmp(&now, &addon.next_update, <))
++	    {
++	      struct timespec timeout;
++
++	      timeout = addon.next_update;
++	      hfp_timespecsub(&timeout, &now);
++
++	      if (timeout.tv_sec < 0) /* current time went backwards */
++		timeout = addon.update_interval;
++
++	      dbus_connection_read_write_dispatch(connection, timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000);
++	      if (! dbus_connection_get_is_connected(connection))
++		goto end;
++	    }
++	  else
++	    break;
++	}
++
++      poll_for_moused();
++
++      hfp_clock_gettime(&addon.next_update);
++      hfp_timespecadd(&addon.next_update, &addon.update_interval);
++    }
++
++ end:
++  return 0;
++}
Index: patch-Makefile.in
===================================================================
RCS file: /home/cvs/mports/sysutils/hal/files/patch-Makefile.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -L sysutils/hal/files/patch-Makefile.in -L sysutils/hal/files/patch-Makefile.in -u -r1.1 -r1.2
--- sysutils/hal/files/patch-Makefile.in
+++ sysutils/hal/files/patch-Makefile.in
@@ -1,11 +1,11 @@
---- Makefile.in.orig	Thu May  4 15:35:41 2006
-+++ Makefile.in	Thu May  4 15:36:40 2006
-@@ -377,14 +377,14 @@ distclean-libtool:
+--- Makefile.in.orig	2008-01-03 21:28:32.000000000 -0500
++++ Makefile.in	2008-01-03 21:29:15.000000000 -0500
+@@ -311,14 +311,14 @@ clean-libtool:
+ distclean-libtool:
  	-rm -f libtool
- uninstall-info-am:
  install-dist_dbusDATA: $(dist_dbus_DATA)
 -	@$(NORMAL_INSTALL)
--	test -z "$(dbusdir)" || $(mkdir_p) "$(DESTDIR)$(dbusdir)"
+-	test -z "$(dbusdir)" || $(MKDIR_P) "$(DESTDIR)$(dbusdir)"
 -	@list='$(dist_dbus_DATA)'; for p in $$list; do \
 -	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 -	  f=$(am__strip_dir) \
@@ -13,7 +13,7 @@
 -	  $(dist_dbusDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(dbusdir)/$$f"; \
 -	done
 +#	@$(NORMAL_INSTALL)
-+#	test -z "$(dbusdir)" || $(mkdir_p) "$(DESTDIR)$(dbusdir)"
++#	test -z "$(dbusdir)" || $(MKDIR_P) "$(DESTDIR)$(dbusdir)"
 +#	@list='$(dist_dbus_DATA)'; for p in $$list; do \
 +#	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 +#	  f=$(am__strip_dir) \
Index: pkg-install.in
===================================================================
RCS file: /home/cvs/mports/sysutils/hal/files/pkg-install.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -L sysutils/hal/files/pkg-install.in -L sysutils/hal/files/pkg-install.in -u -r1.1 -r1.2
--- sysutils/hal/files/pkg-install.in
+++ sysutils/hal/files/pkg-install.in
@@ -1,8 +1,7 @@
 #!/bin/sh
 
-[ "$2" != POST-INSTALL ] && exit 0
-
-if [ -z "${PACKAGE_BUILDING}" ]; then
+case $2 in
+POST-INSTALL)
 	USER=haldaemon
 	GROUP=${USER}
 	UID=560
@@ -34,14 +33,18 @@
 	fi
 
 	/usr/bin/install -d -o ${USER} -g ${GROUP} /var/run/hald
-fi
-
-for pair in %%RC_FILES%%; do
-	file=`echo $pair | cut -f 1 -d :`
-	destdir=`echo $pair | cut -f 2 -d :`
+	/usr/bin/install -d -o ${USER} -g ${GROUP} /var/cache/hald
+	/usr/bin/install -d -o ${USER} -g ${GROUP} /var/lib/hal
 
-	if [ ! -f $destdir/$file ]; then
-	    	mkdir -p $destdir
-		cp -p %%DATADIR%%/dist/$file $destdir/$file
-	fi
-done
+	for pair in %%RC_FILES%%; do
+		file=`echo $pair | cut -f 1 -d :`
+		destdir=`echo $pair | cut -f 2 -d :`
+
+		if [ ! -f $destdir/$file ]; then
+	    		mkdir -p $destdir
+			cp -p %%DATADIR%%/dist/$file $destdir/$file
+		fi
+	done
+	exit 0
+	;;
+esac
--- /dev/null
+++ sysutils/hal/files/patch-tools_hal-storage-mount.c
@@ -0,0 +1,11 @@
+--- tools/hal-storage-mount.c.orig	2008-04-29 20:05:38.000000000 -0400
++++ tools/hal-storage-mount.c	2008-04-29 20:05:44.000000000 -0400
+@@ -56,7 +56,7 @@
+ 
+ #ifdef __FreeBSD__
+ #define MOUNT		"/sbin/mount"
+-#define MOUNT_OPTIONS	"noexec,nosuid"
++#define MOUNT_OPTIONS	"nosuid"
+ #define MOUNT_TYPE_OPT	"-t"
+ #elif sun
+ #define MOUNT		"/sbin/mount"
Index: hald.in
===================================================================
RCS file: /home/cvs/mports/sysutils/hal/files/hald.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -L sysutils/hal/files/hald.in -L sysutils/hal/files/hald.in -u -r1.1 -r1.2
--- sysutils/hal/files/hald.in
+++ sysutils/hal/files/hald.in
@@ -1,9 +1,9 @@
 #!/bin/sh
 #
-# $FreeBSD: ports/sysutils/hal/files/hald.in,v 1.3 2006/10/31 09:48:38 jylefort Exp $
+# $FreeBSD: ports/sysutils/hal/files/hald.in,v 1.5 2008/03/24 03:50:17 marcus Exp $
 #
 # PROVIDE: hald
-# REQUIRE: DAEMON usbd dbus polkitd
+# REQUIRE: DAEMON usbd devd dbus
 #
 # Add the following line to /etc/rc.conf to enable the HAL daemon:
 #
@@ -24,6 +24,7 @@
 
 stop_postcmd="hald_postcmd"
 start_precmd="hald_precmd"
+start_cmd="hald_start"
 
 local_force_depend()
 {
@@ -46,10 +47,7 @@
 	local_force_depend dbus || return 1
     fi
 
-    if ! checkyesno polkitd_enable
-    then
-	local_force_depend polkitd || return 1
-    fi
+    chmod 0755 /var/cache
 
     mkdir -p $(dirname $pidfile)
 }
@@ -59,5 +57,23 @@
     rm -f $pidfile
 }
 
+hald_start()
+{
+    if ! checkyesno hald_enable ; then
+	return 0
+    fi
+    echo "Starting ${name}."
+
+    ( iter=0
+    while ! ps -axoargs | grep "^/usr/libexec/getty " | grep -qv grep >/dev/null 2>&1; do
+	if [ ${iter} -eq 60 ]; then
+	    break
+	fi
+	sleep 1
+	iter=$(expr ${iter} + 1)
+    done
+    ${command} ${hald_flags} ) &
+}
+
 load_rc_config ${name}
 run_rc_command "$1"
Index: extra-patch-tools_hal-storage-mount.c
===================================================================
RCS file: /home/cvs/mports/sysutils/hal/files/extra-patch-tools_hal-storage-mount.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -L sysutils/hal/files/extra-patch-tools_hal-storage-mount.c -L sysutils/hal/files/extra-patch-tools_hal-storage-mount.c -u -r1.1 -r1.2
--- sysutils/hal/files/extra-patch-tools_hal-storage-mount.c
+++ sysutils/hal/files/extra-patch-tools_hal-storage-mount.c
@@ -1,30 +1,25 @@
---- tools/hal-storage-mount.c.orig	Sun May 14 20:57:59 2006
-+++ tools/hal-storage-mount.c	Sat Apr  7 12:50:53 2007
-@@ -513,23 +513,11 @@
- 	explicit_mount_point_given = FALSE;
- 	if (strlen (mount_point) == 0) {
- 		char *p;
--		const char *label;
-+		char *basename;
- 
--		if (volume != NULL)
--			label = libhal_volume_get_label (volume);
--		else
--			label = NULL;
--
--		if (label != NULL) {
--			/* best - use label */
--			g_strlcpy (mount_point, label, sizeof (mount_point));
--
--			/* TODO: use drive type */
--
--		} else {
--			/* fallback - use "disk" */
--			g_snprintf (mount_point, sizeof (mount_point), "disk");
--		}
-+		basename = g_path_get_basename (device);
-+		g_strlcpy (mount_point, basename, sizeof (mount_point));
-+		g_free (basename);
- 
- 		/* sanitize computed mount point name, e.g. replace invalid chars with '-' */
- 		p = mount_point;
+--- tools/hal-storage-mount.c.orig	2008-05-20 13:24:30.000000000 -0400
++++ tools/hal-storage-mount.c	2008-05-20 13:30:14.000000000 -0400
+@@ -585,17 +585,11 @@ handle_mount (LibHalContext *hal_ctx, 
+ 		explicit_mount_point_given = FALSE;
+ 		if (strlen (mount_point) == 0) {
+ 			char *p;
+-			
+-			if (label != NULL) {
+-				/* best - use label */
+-				g_strlcpy (mount_point, label, sizeof (mount_point));
+-				
+-				/* TODO: use drive type */
+-				
+-			} else {
+-				/* fallback - use "disk" */
+-				g_snprintf (mount_point, sizeof (mount_point), "%s", "disk");
+-			}
++			char *basename;
++
++			basename = g_path_get_basename (device);
++			g_strlcpy (mount_point, basename, sizeof (mount_point));
++			g_free (basename);
+ 			
+ 			/* sanitize computed mount point name, e.g. replace invalid chars with '-' */
+ 			p = mount_point;
--- /dev/null
+++ sysutils/hal/files/patch-fdi_policy_10osvendor_10-x11-input.fdi
@@ -0,0 +1,18 @@
+--- fdi/policy/10osvendor/10-x11-input.fdi.orig	2008-03-27 13:42:31.000000000 -0400
++++ fdi/policy/10osvendor/10-x11-input.fdi	2008-03-27 13:48:06.000000000 -0400
+@@ -1,15 +1,6 @@
+ <?xml version="1.0" encoding="ISO-8859-1"?>
+ <deviceinfo version="0.2">
+   <device>
+-    <!-- FIXME: Support tablets too. -->
+-    <match key="info.capabilities" contains="input.mouse">
+-      <merge key="input.x11_driver" type="string">mouse</merge>
+-      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+-             string="Linux">
+-        <merge key="input.x11_driver" type="string">evdev</merge>
+-      </match>
+-    </match>
+-
+     <match key="info.capabilities" contains="input.keys">
+       <!-- If we're using Linux, we use evdev by default (falling back to
+            keyboard otherwise). -->
--- /dev/null
+++ sysutils/hal/files/patch-hald_freebsd_addons_addon-storage.c
@@ -0,0 +1,238 @@
+--- hald/freebsd/addons/addon-storage.c.orig	2008-05-07 19:24:04.000000000 -0400
++++ hald/freebsd/addons/addon-storage.c	2008-05-19 02:18:59.000000000 -0400
+@@ -36,17 +36,23 @@
+ #include "../libprobe/hfp.h"
+ #include "../libprobe/hfp-cdrom.h"
+ 
++static boolean is_locked_by_hal = FALSE;
++static boolean check_lock_state = TRUE;
++static boolean polling_disabled = FALSE;
++
+ static struct
+ {
+-  const struct timeval	update_interval;
++  const struct timespec	update_interval;
+   char			*device_file;
+   char			*parent;
+   boolean		is_cdrom;
+   boolean		is_scsi_removable;
+   boolean		had_media;
+-  struct timeval	next_update;
++  struct timespec	next_update;
+ } addon = { { 2, 0 } };
+ 
++static void update_proc_title (const char *device);
++
+ /* see MMC-3 Working Draft Revision 10 */
+ static boolean
+ hf_addon_storage_cdrom_eject_pressed (HFPCDROM *cdrom)
+@@ -144,18 +150,49 @@ hf_addon_storage_update (void)
+ 	}
+     }
+ 
+-  hfp_gettimeofday(&addon.next_update);
+-  hfp_timevaladd(&addon.next_update, &addon.update_interval);
+-
+   return has_media;
+ }
+ 
+ static boolean
+-poll_for_media (void)
++poll_for_media (boolean check_only, boolean force)
+ {
+   boolean has_media;
+ 
++  if (check_lock_state)
++    {
++      boolean should_poll;
++
++      check_lock_state = FALSE;
++
++      hfp_info("Checking whether device %s is locked by HAL", addon.device_file);
++      if (libhal_device_is_locked_by_others(hfp_ctx, hfp_udi, "org.freedesktop.Hal.Device.Storage", &hfp_error))
++        {
++          hfp_info("... device %s is locked by HAL", addon.device_file);
++	  dbus_error_free(&hfp_error);
++	  is_locked_by_hal = TRUE;
++	  update_proc_title(addon.device_file);
++	  goto skip_check;
++	}
++      else
++        {
++          hfp_info("... device %s is not locked by HAL", addon.device_file);
++	  is_locked_by_hal = FALSE;
++	}
++      dbus_error_free(&hfp_error);
++
++      should_poll = libhal_device_get_property_bool(hfp_ctx, hfp_udi, "storage.media_check_enabled", &hfp_error);
++      dbus_error_free(&hfp_error);
++      polling_disabled = ! should_poll;
++      update_proc_title(addon.device_file);
++    }
++
++  if (! force && polling_disabled)
++    goto skip_check;
++
+   has_media = hf_addon_storage_update();
++  if (check_only)
++    return has_media;
++
+   if (has_media != addon.had_media)
+     {
+       /*
+@@ -175,20 +212,33 @@ poll_for_media (void)
+ 
+       return TRUE;
+     }
++
++skip_check:
++
+   return FALSE;
+ }
+ 
+ static void
+-update_proc_title (const char *device, boolean polling_enabled)
++update_proc_title (const char *device)
+ {
+-  if (polling_enabled)
+-    setproctitle("%s", device);
+-  else
++  if (polling_disabled)
+     setproctitle("no polling on %s because it is explicitly disabled", device);
++  else if (is_locked_by_hal)
++    setproctitle("no polling on %s because it is locked by HAL", device);
++  else
++    setproctitle("%s", device);
+ }
+ 
+ static DBusHandlerResult
+-filter_function (DBusConnection *connection, DBusMessage *message, void *user_data)
++dbus_filter_function (DBusConnection *connection, DBusMessage *message, void *user_data)
++{
++  check_lock_state = TRUE;
++
++  return DBUS_HANDLER_RESULT_HANDLED;
++}
++
++static DBusHandlerResult
++direct_filter_function (DBusConnection *connection, DBusMessage *message, void *user_data)
+ {
+   if (dbus_message_is_method_call(message,
+ 			  	  "org.freedesktop.Hal.Device.Storage.Removable",
+@@ -199,7 +249,7 @@ filter_function (DBusConnection *connect
+ 
+       hfp_info("Forcing poll for media becusse CheckForMedia() was called");
+ 
+-      had_effect = poll_for_media();
++      had_effect = poll_for_media(FALSE, TRUE);
+ 
+       reply = dbus_message_new_method_return (message);
+       dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &had_effect, DBUS_TYPE_INVALID);
+@@ -217,8 +267,9 @@ main (int argc, char **argv)
+   char *removable;
+   char *bus;
+   char *driver;
+-  boolean should_poll;
++  char *filter_str;
+   DBusConnection *connection;
++  DBusConnection *syscon;
+ 
+   if (! hfp_init(argc, argv))
+     goto end;
+@@ -251,16 +302,41 @@ main (int argc, char **argv)
+   addon.is_scsi_removable = (! strcmp(bus, "scsi") ||
+     (! strcmp(bus, "usb") && (! strcmp(driver, "da") || ! strcmp(driver, "sa") ||
+     ! strcmp(driver, "cd")))) && ! strcmp(removable, "true");
+-  addon.had_media = hf_addon_storage_update();
++  addon.had_media = poll_for_media(TRUE, FALSE);
+ 
+   if (! libhal_device_addon_is_ready(hfp_ctx, hfp_udi, &hfp_error))
+     goto end;
+   dbus_error_free(&hfp_error);
+ 
++  syscon = dbus_bus_get(DBUS_BUS_SYSTEM, &hfp_error);
++  dbus_error_free(&hfp_error);
++  assert(syscon != NULL);
++  dbus_connection_set_exit_on_disconnect(syscon, 0);
++
++  dbus_bus_add_match(syscon,
++		     "type='signal'"
++		     ",interface='org.freedesktop.Hal.Manager'"
++		     ",sender='org.freedesktop.Hal'",
++		     NULL);
++  dbus_bus_add_match(syscon,
++		     "type='signal'"
++		     ",interface='org.freedesktop.Hal.Manager'"
++		     ",sender='org.freedesktop.Hal'",
++		     NULL);
++  filter_str = hfp_strdup_printf("type='signal'"
++		  	       ",interface='org.freedesktop.Hal.Device'"
++			       ",sender='org.freedesktop.Hal'"
++			       ",path='%s'",
++			       hfp_udi);
++  dbus_bus_add_match(syscon, filter_str, NULL);
++  hfp_free(filter_str);
++
++  dbus_connection_add_filter(syscon, dbus_filter_function, NULL, NULL);
++
+   connection = libhal_ctx_get_dbus_connection(hfp_ctx);
+   assert(connection != NULL);
+   dbus_connection_set_exit_on_disconnect(connection, 0);
+-  dbus_connection_add_filter(connection, filter_function, NULL, NULL);
++  dbus_connection_add_filter(connection, direct_filter_function, NULL, NULL);
+ 
+   if (! libhal_device_claim_interface(hfp_ctx,
+ 			 	      hfp_udi,
+@@ -280,40 +356,32 @@ main (int argc, char **argv)
+       /* process dbus traffic until update interval has elapsed */
+       while (TRUE)
+ 	{
+-	  struct timeval now;
++	  struct timespec now;
+ 
+-	  hfp_gettimeofday(&now);
+-	  if (hfp_timevalcmp(&now, &addon.next_update, <))
++	  hfp_clock_gettime(&now);
++	  if (hfp_timespeccmp(&now, &addon.next_update, <))
+ 	    {
+-	      struct timeval timeout;
++	      struct timespec timeout;
+ 
+ 	      timeout = addon.next_update;
+-	      hfp_timevalsub(&timeout, &now);
++	      hfp_timespecsub(&timeout, &now);
+ 
+ 	      if (timeout.tv_sec < 0) /* current time went backwards */
+ 		timeout = addon.update_interval;
+ 
+-	      dbus_connection_read_write_dispatch(connection, timeout.tv_sec * 1000 + timeout.tv_usec / 1000);
+-	      if (! dbus_connection_get_is_connected(connection))
++	      dbus_connection_read_write_dispatch(connection, (int) ((timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000) / 2));
++	      dbus_connection_read_write_dispatch(syscon, (int) ((timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000) / 2));
++	      if (! dbus_connection_get_is_connected(connection) ||
++		  ! dbus_connection_get_is_connected(syscon))
+ 		goto end;
+ 	    }
+ 	  else
+ 	    break;
+ 	}
+ 
+-      should_poll = libhal_device_get_property_bool(hfp_ctx, hfp_udi, "storage.media_check_enabled", &hfp_error);
+-      dbus_error_free(&hfp_error);
+-      update_proc_title(addon.device_file, should_poll);
+-
+-      if (should_poll)
+-        {
+-          poll_for_media();
+-        }
+-      else
+-        {
+-          hfp_gettimeofday(&addon.next_update);
+-	  hfp_timevaladd(&addon.next_update, &addon.update_interval);
+-	}
++      poll_for_media(FALSE, FALSE);
++      hfp_clock_gettime(&addon.next_update);
++      hfp_timespecadd(&addon.next_update, &addon.update_interval);
+     }
+ 
+  end:
--- /dev/null
+++ sysutils/hal/files/10-mouse-sysmouse.fdi
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deviceinfo version="0.2">
+  <device>
+    <match key="info.capabilities" contains="input.mouse">
+      <append key="info.addons" type="strlist">hald-addon-mouse-sysmouse</append>
+    </match>
+  </device>
+</deviceinfo>


More information about the Midnightbsd-cvs mailing list