| 1 |
# Copyright 1999-2005 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.4.ebuild,v 1.8 2005/12/14 07:04:06 cardoe Exp $
|
| 4 |
|
| 5 |
inherit eutils linux-info
|
| 6 |
|
| 7 |
DESCRIPTION="Hardware Abstraction Layer"
|
| 8 |
HOMEPAGE="http://www.freedesktop.org/Software/hal"
|
| 9 |
SRC_URI="http://freedesktop.org/~david/dist/${P}.tar.gz"
|
| 10 |
|
| 11 |
LICENSE="|| ( GPL-2 AFL-2.0 )"
|
| 12 |
SLOT="0"
|
| 13 |
KEYWORDS="~x86 ~amd64 ~ia64 ~ppc ~ppc64 ~sparc"
|
| 14 |
IUSE="debug pcmcia doc pam_console"
|
| 15 |
|
| 16 |
RDEPEND=">=dev-libs/glib-2.6
|
| 17 |
>=sys-apps/dbus-0.33
|
| 18 |
dev-libs/expat
|
| 19 |
>=sys-fs/udev-063
|
| 20 |
sys-apps/hotplug
|
| 21 |
>=sys-apps/util-linux-2.12i
|
| 22 |
|| ( >=sys-kernel/linux-headers-2.6 >=sys-kernel/mips-headers-2.6 )
|
| 23 |
dev-libs/libusb
|
| 24 |
pam_console? ( sys-libs/pam )"
|
| 25 |
|
| 26 |
DEPEND="${RDEPEND}
|
| 27 |
dev-util/pkgconfig
|
| 28 |
>=dev-util/intltool-0.29
|
| 29 |
doc? ( app-doc/doxygen app-text/docbook-sgml-utils )"
|
| 30 |
|
| 31 |
## HAL Daemon drops privledges so we need group access to read disks
|
| 32 |
HALDAEMON_GROUPS="haldaemon,disk,cdrom,cdrw,floppy,usb"
|
| 33 |
|
| 34 |
function notify_uevent() {
|
| 35 |
eerror
|
| 36 |
eerror "You must enable Kernel Userspace Events in your kernel."
|
| 37 |
eerror "This can be set under 'General Setup'. It is marked as"
|
| 38 |
eerror "CONFIG_KOBJECT_UEVENT in the config file."
|
| 39 |
eerror
|
| 40 |
ebeep 5
|
| 41 |
|
| 42 |
die "KOBJECT_UEVENT is not set"
|
| 43 |
}
|
| 44 |
|
| 45 |
pkg_setup() {
|
| 46 |
|
| 47 |
linux-info_pkg_setup
|
| 48 |
kernel_is ge 2 6 10 \
|
| 49 |
|| die "You need a 2.6.10 or newer kernel to run this package"
|
| 50 |
|
| 51 |
linux_chkconfig_present KOBJECT_UEVENT \
|
| 52 |
|| notify_uevent
|
| 53 |
|
| 54 |
if use pam_console && ! built_with_use sys-libs/pam pam_console ; then
|
| 55 |
eerror "You need to build pam with pam_console support"
|
| 56 |
eerror "Please remerge sys-libs/pam with USE=pam_console"
|
| 57 |
die "pam without pam_console detected"
|
| 58 |
fi
|
| 59 |
|
| 60 |
if [ -d ${ROOT}/etc/hal/device.d ]; then
|
| 61 |
eerror "HAL 0.5.x will not run with the HAL 0.4.x series of"
|
| 62 |
eerror "/etc/hal/device.d/ so please remove this directory"
|
| 63 |
eerror "with rm -rf /etc/hal/device.d/ and then re-emerge."
|
| 64 |
eerror "This is due to configuration protection of /etc/"
|
| 65 |
die "remove /etc/hal/device.d/"
|
| 66 |
fi
|
| 67 |
}
|
| 68 |
|
| 69 |
|
| 70 |
src_unpack() {
|
| 71 |
unpack ${A}
|
| 72 |
cd ${S}
|
| 73 |
# remove pamconsole option
|
| 74 |
use pam_console || epatch ${FILESDIR}/${PN}-0.5.1-old_storage_policy.patch
|
| 75 |
}
|
| 76 |
|
| 77 |
src_compile() {
|
| 78 |
econf \
|
| 79 |
$(use_enable debug verbose-mode) \
|
| 80 |
$(use_enable pcmcia pcmcia-support) \
|
| 81 |
--enable-sysfs-carrier \
|
| 82 |
--enable-hotplug-map \
|
| 83 |
$(use_enable doc docbook-docs) \
|
| 84 |
$(use_enable doc doxygen-docs) \
|
| 85 |
--with-pid-file=/var/run/hald.pid \
|
| 86 |
|| die "configure failed"
|
| 87 |
|
| 88 |
emake || die "make failed"
|
| 89 |
}
|
| 90 |
|
| 91 |
src_install() {
|
| 92 |
make DESTDIR=${D} install || die
|
| 93 |
|
| 94 |
# We install this in a seperate package to avoid gnome-python dep
|
| 95 |
rm ${D}/usr/bin/hal-device-manager
|
| 96 |
|
| 97 |
# initscript
|
| 98 |
newinitd ${FILESDIR}/0.5-hald.rc hald
|
| 99 |
|
| 100 |
dodoc AUTHORS COPYING ChangeLog INSTALL NEWS README
|
| 101 |
|
| 102 |
# Script to unmount devices if they are yanked out (from upstream)
|
| 103 |
exeinto /etc/dev.d/default
|
| 104 |
doexe ${FILESDIR}/hal-unmount.dev
|
| 105 |
}
|
| 106 |
|
| 107 |
pkg_postinst() {
|
| 108 |
## We need to add the user/groups *after* package compilation/installation, so that we
|
| 109 |
## don't change the user without the package being installed.
|
| 110 |
##
|
| 111 |
enewgroup haldaemon || die "Problem adding haldaemon group"
|
| 112 |
# HAL drops priviledges by default now ...
|
| 113 |
# ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
|
| 114 |
enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS} || die "Problem adding haldaemon user"
|
| 115 |
|
| 116 |
# Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
|
| 117 |
# If users have a problem with this, let them file a bug
|
| 118 |
usermod -G ${HALDAEMON_GROUPS} haldaemon
|
| 119 |
|
| 120 |
einfo "The HAL daemon needs to be running for certain applications to"
|
| 121 |
einfo "work. Suggested is to add the init script to your start-up"
|
| 122 |
einfo "scripts, this should be done like this :"
|
| 123 |
einfo "\`rc-update add hald default\`"
|
| 124 |
|
| 125 |
ewarn
|
| 126 |
ewarn "If you are upgrading from a previous version of hal you should run"
|
| 127 |
ewarn "revdep-rebuild to find any programs which were built against the old"
|
| 128 |
ewarn "version and then rebuild them. Not doing so may result in a broken"
|
| 129 |
ewarn "system."
|
| 130 |
ewarn
|
| 131 |
}
|