diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2008-01-08 14:46:46 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2008-01-08 14:46:46 +0800 |
commit | d05b8d90ffc1a17e691d97e62578deddd88929eb (patch) | |
tree | f3288ea76e20166e7cf7d7728fd634b32836b13c | |
parent | cf2086594a8ee7a5b1d54ec1ffbca691ce6b4908 (diff) | |
download | marcuscom-ports-d05b8d90ffc1a17e691d97e62578deddd88929eb.tar marcuscom-ports-d05b8d90ffc1a17e691d97e62578deddd88929eb.tar.gz marcuscom-ports-d05b8d90ffc1a17e691d97e62578deddd88929eb.tar.bz2 marcuscom-ports-d05b8d90ffc1a17e691d97e62578deddd88929eb.tar.lz marcuscom-ports-d05b8d90ffc1a17e691d97e62578deddd88929eb.tar.xz marcuscom-ports-d05b8d90ffc1a17e691d97e62578deddd88929eb.tar.zst marcuscom-ports-d05b8d90ffc1a17e691d97e62578deddd88929eb.zip |
This has been a LONG time coming, but update hal to 0.5.10, complete with
PolicyKit and ConsoleKit support. Thanks to mezz for testing hal without
PK or CK.
Configuring policies looks to be MUCH easier now. See PolicyKit.conf(5) and
/usr/local/etc/PolicyKit/PolicyKit.conf.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@10022 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r-- | sysutils/hal/Makefile | 140 | ||||
-rw-r--r-- | sysutils/hal/distinfo | 3 | ||||
-rw-r--r-- | sysutils/hal/files/extra-patch-tools_hal-storage-mount.c | 30 | ||||
-rw-r--r-- | sysutils/hal/files/hald.in | 63 | ||||
-rw-r--r-- | sysutils/hal/files/patch-Makefile.in | 25 | ||||
-rw-r--r-- | sysutils/hal/files/patch-doc_Makefile.in | 11 | ||||
-rw-r--r-- | sysutils/hal/files/pkg-deinstall.in | 12 | ||||
-rw-r--r-- | sysutils/hal/files/pkg-install.in | 47 | ||||
-rw-r--r-- | sysutils/hal/pkg-descr | 6 | ||||
-rw-r--r-- | sysutils/hal/pkg-plist | 115 |
10 files changed, 452 insertions, 0 deletions
diff --git a/sysutils/hal/Makefile b/sysutils/hal/Makefile new file mode 100644 index 000000000..45f522027 --- /dev/null +++ b/sysutils/hal/Makefile @@ -0,0 +1,140 @@ +# New ports collection makefile for: HAL +# Date Created: 02 May 2006 +# Whom: Joe Marcus Clarke <marcus@FreeBSD.org> +# +# $FreeBSD: ports/sysutils/hal/Makefile,v 1.30 2007/12/24 19:42:03 marcus Exp $ +# $MCom: ports/sysutils/hal/Makefile,v 1.26 2006/10/13 10:00:57 ahze Exp $ +# + +PORTNAME= hal +PORTVERSION= ${HALVERSION}.${SNAPVERSION} +PORTREVISION?= 0 +CATEGORIES?= sysutils +MASTER_SITES= http://www.marcuscom.com/downloads/ + +MAINTAINER= gnome@FreeBSD.org +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 \ + 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 +USE_AUTOTOOLS= libtool:15 +USE_LDCONFIG= yes +USE_PYTHON= yes +CONFIGURE_ARGS= --disable-gtk-doc \ + --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-eject=/usr/sbin/cdcontrol \ + --with-pid-file=/var/run/hald/hald.pid +CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ + LDFLAGS="-L${LOCALBASE}/lib" \ + GTKDOC="false" + +HALVERSION= 0.5.10 +SNAPVERSION= 20080106 + +.if !defined(HAL_SLAVE) +USE_RC_SUBR= hald +USE_GNOME_SUBR= yes +DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}-${HALVERSION} +PLIST_SUB= VERSION=${HALVERSION} + +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-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 ${OSVERSION} < 505000 +IGNORE= not supported on FreeBSD prior to 5.5-RELEASE +.endif + +.if !defined(HAL_SLAVE) +.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 's|user="0"|group="operator"|g' \ + ${WRKSRC}/hal.conf.in + +post-install: +.if !defined(HAL_SLAVE) + ${MKDIR} ${DATADIR}/dist + ${INSTALL_DATA} ${WRKSRC}/hal.conf ${DATADIR}/dist + @${SETENV} PKG_PREFIX=${PREFIX} PACKAGE_BUILDING=${PACKAGE_BUILDING} \ + ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +.if !defined(PACKAGE_BUILDING) && defined(NEEDS_MEDIA) + ${MKDIR} /media +.endif +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/hald/freebsd/README \ + ${DOCSDIR}/README.freebsd +.endif +.endif + +.include <bsd.port.post.mk> diff --git a/sysutils/hal/distinfo b/sysutils/hal/distinfo new file mode 100644 index 000000000..05e65a2df --- /dev/null +++ b/sysutils/hal/distinfo @@ -0,0 +1,3 @@ +MD5 (hal-0.5.10.20080106.tar.bz2) = bab8c3f0f87c3929d143625721361029 +SHA256 (hal-0.5.10.20080106.tar.bz2) = 0dea10c60f41d916251a23ed56c9b4c13b1f10b1cd1ef8366d9a4f1d3360c4bd +SIZE (hal-0.5.10.20080106.tar.bz2) = 965092 diff --git a/sysutils/hal/files/extra-patch-tools_hal-storage-mount.c b/sysutils/hal/files/extra-patch-tools_hal-storage-mount.c new file mode 100644 index 000000000..82a7fb607 --- /dev/null +++ b/sysutils/hal/files/extra-patch-tools_hal-storage-mount.c @@ -0,0 +1,30 @@ +--- tools/hal-storage-mount.c.orig 2008-01-03 21:10:54.000000000 -0500 ++++ tools/hal-storage-mount.c 2008-01-04 09:29:10.000000000 -0500 +@@ -583,23 +583,11 @@ handle_mount (LibHalContext *hal_ctx, + 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), "%s", "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; diff --git a/sysutils/hal/files/hald.in b/sysutils/hal/files/hald.in new file mode 100644 index 000000000..d581f8583 --- /dev/null +++ b/sysutils/hal/files/hald.in @@ -0,0 +1,63 @@ +#!/bin/sh +# +# $FreeBSD: ports/sysutils/hal/files/hald.in,v 1.4 2007/04/22 23:55:29 marcus Exp $ +# +# PROVIDE: hald +# REQUIRE: DAEMON usbd devd dbus consolekit +# +# Add the following line to /etc/rc.conf to enable the HAL daemon: +# +# hald_enable="YES" +# + +. %%RC_SUBR%% +. %%GNOME_SUBR%% + +hald_enable=${hald_enable-${gnome_enable}} +hald_flags=${hald_flags-""} + +name=hald +rcvar=`set_rcvar` + +command="%%PREFIX%%/sbin/hald" +pidfile="/var/run/${name}/${name}.pid" + +stop_postcmd="hald_postcmd" +start_precmd="hald_precmd" + +local_force_depend() +{ + _depend="$1" + if [ -f %%LOCALBASE%%/etc/rc.d/${_depend}.sh ]; then + _depend="${_depend}.sh" + fi + + if ! %%LOCALBASE%%/etc/rc.d/${_depend} forcestatus 1>/dev/null 2>&1 && + ! %%LOCALBASE%%/etc/rc.d/${_depend} forcestart; then + return 1 + fi + return 0 +} + +hald_precmd() +{ + if ! checkyesno dbus_enable + then + local_force_depend dbus || return 1 + fi + + if ! checkyesno consolekit_enable + then + local_force_depend consolekit || return 1 + fi + + mkdir -p $(dirname $pidfile) +} + +hald_postcmd() +{ + rm -f $pidfile +} + +load_rc_config ${name} +run_rc_command "$1" diff --git a/sysutils/hal/files/patch-Makefile.in b/sysutils/hal/files/patch-Makefile.in new file mode 100644 index 000000000..17d23980f --- /dev/null +++ b/sysutils/hal/files/patch-Makefile.in @@ -0,0 +1,25 @@ +--- 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 + install-dist_dbusDATA: $(dist_dbus_DATA) +- @$(NORMAL_INSTALL) +- 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) \ +- echo " $(dist_dbusDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(dbusdir)/$$f'"; \ +- $(dist_dbusDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(dbusdir)/$$f"; \ +- done ++# @$(NORMAL_INSTALL) ++# 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) \ ++# echo " $(dist_dbusDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(dbusdir)/$$f'"; \ ++# $(dist_dbusDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(dbusdir)/$$f"; \ ++# done + + uninstall-dist_dbusDATA: + @$(NORMAL_UNINSTALL) diff --git a/sysutils/hal/files/patch-doc_Makefile.in b/sysutils/hal/files/patch-doc_Makefile.in new file mode 100644 index 000000000..9cd951720 --- /dev/null +++ b/sysutils/hal/files/patch-doc_Makefile.in @@ -0,0 +1,11 @@ +--- 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 man ++SUBDIRS = spec man + MAINTAINERCLEANFILES = \ + *~ \ + Makefile.in diff --git a/sysutils/hal/files/pkg-deinstall.in b/sysutils/hal/files/pkg-deinstall.in new file mode 100644 index 000000000..96f8e9f91 --- /dev/null +++ b/sysutils/hal/files/pkg-deinstall.in @@ -0,0 +1,12 @@ +#!/bin/sh + +[ "$2" != DEINSTALL ] && exit 0 + +for pair in %%RC_FILES%%; do + file=`echo $pair | cut -f 1 -d :` + destdir=`echo $pair | cut -f 2 -d :` + + if cmp -s %%DATADIR%%/dist/$file $destdir/$file; then + rm -f $destdir/$file + fi +done diff --git a/sysutils/hal/files/pkg-install.in b/sysutils/hal/files/pkg-install.in new file mode 100644 index 000000000..2cfda5753 --- /dev/null +++ b/sysutils/hal/files/pkg-install.in @@ -0,0 +1,47 @@ +#!/bin/sh + +[ "$2" != POST-INSTALL ] && exit 0 + +if [ -z "${PACKAGE_BUILDING}" ]; then + USER=haldaemon + GROUP=${USER} + UID=560 + GID=${UID} + PW=/usr/sbin/pw + + if ${PW} group show "${GROUP}" 2>/dev/null; then + echo "You already have a group \"${GROUP}\", so I will use it." + else + if ${PW} groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi + fi + + if ${PW} user show "${USER}" 2>/dev/null; then + echo "You already have a user \"${USER}\", so I will use it." + else + if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -d "/nonexistent" -s /sbin/nologin -c "HAL Daemon User" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi + 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 :` + + if [ ! -f $destdir/$file ]; then + mkdir -p $destdir + cp -p %%DATADIR%%/dist/$file $destdir/$file + fi +done diff --git a/sysutils/hal/pkg-descr b/sysutils/hal/pkg-descr new file mode 100644 index 000000000..c94358513 --- /dev/null +++ b/sysutils/hal/pkg-descr @@ -0,0 +1,6 @@ +HAL is a hardware abstraction layer whose goal is 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. + +WWW: http://www.freedesktop.org/Software/hal diff --git a/sysutils/hal/pkg-plist b/sysutils/hal/pkg-plist new file mode 100644 index 000000000..75a3c60c9 --- /dev/null +++ b/sysutils/hal/pkg-plist @@ -0,0 +1,115 @@ +@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-lock +bin/hal-set-property +bin/lshal +@exec mkdir -p %D/etc/hal/fdi/preprobe +@exec mkdir -p %D/etc/hal/fdi/policy +@exec mkdir -p %D/etc/hal/fdi/information +include/hal/libhal-storage.h +include/hal/libhal.h +lib/libhal-storage.a +lib/libhal-storage.la +lib/libhal-storage.so +lib/libhal-storage.so.1 +lib/libhal.a +lib/libhal.la +lib/libhal.so +lib/libhal.so.1 +lib/libhald_freebsd_probe.a +lib/libhald_freebsd_probe.la +lib/libhald_freebsd_probe.so +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-storage-unmount +libexec/hal-system-power-pm-is-supported +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-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-set-brightness +libexec/hal/scripts/hal-system-power-hibernate +libexec/hal/scripts/hal-system-power-reboot +libexec/hal/scripts/hal-system-power-set-power-save +libexec/hal/scripts/hal-system-power-shutdown +libexec/hal/scripts/hal-system-power-suspend +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-storage +libexec/hald-generate-fdi-cache +libexec/hald-probe-hiddev +libexec/hald-probe-scsi +libexec/hald-probe-smbios +libexec/hald-probe-storage +libexec/hald-probe-volume +libexec/hald-runner +sbin/hald +%%PORTDOCS%%%%DOCSDIR%%/README.freebsd +%%DATADIR%%/dist/hal.conf +%%DATADIR%%/fdi/fdi.dtd +@exec mkdir -p %D/%%DATADIR%%/fdi/information/20thirdparty +%%DATADIR%%/fdi/policy/10osvendor/10-input-policy.fdi +%%DATADIR%%/fdi/policy/10osvendor/10-laptop-panel-mgmt-policy.fdi +%%DATADIR%%/fdi/policy/10osvendor/10-power-mgmt-policy.fdi +%%DATADIR%%/fdi/policy/10osvendor/10-rfkill-switch.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/hal-killswitch.policy +share/PolicyKit/policy/hal-lock.policy +share/PolicyKit/policy/hal-power.policy +share/PolicyKit/policy/hal-storage.policy +share/PolicyKit/policy/hal-wol.policy +@exec mkdir -p %D/%%DATADIR%%/fdi/policy/20thirdparty +@exec mkdir -p %D/%%DATADIR%%/fdi/preprobe/20thirdparty +@dirrm %%DATADIR%%/fdi/preprobe/20thirdparty +@dirrm %%DATADIR%%/fdi/preprobe/10osvendor +@dirrm %%DATADIR%%/fdi/preprobe +@dirrm %%DATADIR%%/fdi/policy/20thirdparty +@dirrm %%DATADIR%%/fdi/policy/10osvendor +@dirrm %%DATADIR%%/fdi/policy +@dirrm %%DATADIR%%/fdi/information/20thirdparty +@dirrm %%DATADIR%%/fdi/information/10freedesktop +@dirrm %%DATADIR%%/fdi/information +@dirrm %%DATADIR%%/fdi +@dirrm %%DATADIR%%/dist +@dirrm %%DATADIR%% +@dirrm %%DOCSDIR%% +@dirrm libexec/hal/scripts/freebsd +@dirrm libexec/hal/scripts +@dirrm libexec/hal +@dirrm include/hal +@dirrm etc/hal/fdi/preprobe +@dirrm etc/hal/fdi/policy +@dirrm etc/hal/fdi/information +@dirrm etc/hal/fdi +@dirrm etc/hal +@unexec rm -f /var/run/hald/hald.pid 2>/dev/null || true +@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 +%%MEDIA%%@unexec rmdir /media 2>/dev/null || true |