| 1 |
# Copyright 1999-2006 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.4.7-r2.ebuild,v 1.12 2006/05/01 10:11:37 steev Exp $ |
| 4 |
|
| 5 |
inherit eutils python linux-info versionator flag-o-matic |
| 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="amd64 ia64 ppc ppc64 x86" |
| 14 |
IUSE="debug pcmcia doc livecd" |
| 15 |
|
| 16 |
RDEPEND=">=dev-libs/glib-2.4 |
| 17 |
=sys-apps/dbus-0.23* |
| 18 |
dev-libs/expat |
| 19 |
sys-fs/udev |
| 20 |
sys-apps/hotplug |
| 21 |
sys-libs/libcap |
| 22 |
dev-libs/popt |
| 23 |
>=sys-apps/util-linux-2.12i |
| 24 |
>=sys-kernel/linux-headers-2.6" |
| 25 |
|
| 26 |
DEPEND="${RDEPEND} |
| 27 |
dev-util/pkgconfig |
| 28 |
>=dev-util/intltool-0.29 |
| 29 |
doc? ( app-doc/doxygen )" |
| 30 |
# dep on a specific util-linux version for |
| 31 |
# managed mount patches #70873 |
| 32 |
|
| 33 |
# We need to run at least a 2.6.10 kernel, this is a |
| 34 |
# way to ensure that to some extent |
| 35 |
pkg_setup() { |
| 36 |
|
| 37 |
use livecd && return |
| 38 |
|
| 39 |
if get_version; then |
| 40 |
kernel_is ge 2 6 10 && return |
| 41 |
elif get_running_version; then |
| 42 |
kernel_is ge 2 6 10 && return |
| 43 |
fi |
| 44 |
|
| 45 |
die "You need to run a 2.6.10 or newer kernel to build & use this pack" |
| 46 |
|
| 47 |
} |
| 48 |
|
| 49 |
src_unpack() { |
| 50 |
|
| 51 |
unpack ${A} |
| 52 |
|
| 53 |
cd ${S} |
| 54 |
# remove pamconsole option |
| 55 |
epatch ${FILESDIR}/${PN}-0.4.1-old_storage_policy.patch |
| 56 |
# pick up the gentoo usermap |
| 57 |
epatch ${FILESDIR}/${PN}-0.4.5-gentoo_gphoto2_usermap.patch |
| 58 |
# don't doubleadd devices |
| 59 |
epatch ${FILESDIR}/${P}-dont_add_device_twice-r1.patch |
| 60 |
# fix memleaks |
| 61 |
cd ${S}/hald |
| 62 |
epatch ${FILESDIR}/${P}-device_info_leak.patch |
| 63 |
# detect floppy drives on >=2.6.12 kernels as well |
| 64 |
epatch ${FILESDIR}/${P}-sys_floppy_detection.patch |
| 65 |
# set defaultpolicy for vfat from iocharset=utf8 to utf8 (#83025) |
| 66 |
cd ${S} |
| 67 |
epatch ${FILESDIR}/${P}-vfat_mount_utf8.patch |
| 68 |
|
| 69 |
} |
| 70 |
|
| 71 |
src_compile() { |
| 72 |
|
| 73 |
# FIXME : docs |
| 74 |
econf \ |
| 75 |
`use_enable debug verbose-mode` \ |
| 76 |
`use_enable pcmcia pcmcia-support` \ |
| 77 |
--enable-sysfs-carrier \ |
| 78 |
--enable-fstab-sync \ |
| 79 |
--enable-hotplug-map \ |
| 80 |
--disable-docbook-docs \ |
| 81 |
`use_enable doc doxygen-docs` \ |
| 82 |
--with-pid-file=/var/run/hald/hald.pid \ |
| 83 |
|| die |
| 84 |
|
| 85 |
emake || die |
| 86 |
|
| 87 |
} |
| 88 |
|
| 89 |
src_install() { |
| 90 |
|
| 91 |
make DESTDIR=${D} install || die |
| 92 |
|
| 93 |
# We install this in a seperate package to avoid gnome-python dep |
| 94 |
rm ${D}/usr/bin/hal-device-manager |
| 95 |
|
| 96 |
# initscript |
| 97 |
exeinto /etc/init.d/ |
| 98 |
doexe ${FILESDIR}/hald |
| 99 |
|
| 100 |
# place our pid file |
| 101 |
keepdir /var/run/hald |
| 102 |
|
| 103 |
# keep the policy setup intact |
| 104 |
keepdir /usr/share/hal/fdi/{95userpolicy,50user,40oem,30osvendor,10generic} |
| 105 |
|
| 106 |
dodoc AUTHORS ChangeLog NEWS README |
| 107 |
|
| 108 |
} |
| 109 |
|
| 110 |
pkg_preinst() { |
| 111 |
|
| 112 |
enewgroup haldaemon || die "Problem adding haldaemon group" |
| 113 |
enewuser haldaemon -1 -1 /dev/null haldaemon || die "Problem adding haldaemon user" |
| 114 |
|
| 115 |
} |
| 116 |
|
| 117 |
pkg_postinst() { |
| 118 |
|
| 119 |
# make sure the permissions on the pid dir are alright & after preinst |
| 120 |
chown haldaemon:haldaemon /var/run/hald |
| 121 |
|
| 122 |
ewarn "Enabled in this ebuild by default is the usage of fstab-sync" |
| 123 |
ewarn "that will create mount rules for non-existing devices in" |
| 124 |
ewarn "fstab if needed, mount points will be created in /media." |
| 125 |
ewarn "This functionality alters /etc/fstab runtime on the filesystem" |
| 126 |
ewarn "and should be considered a security risk." |
| 127 |
echo |
| 128 |
einfo "The HAL daemon needs to be running for certain applications to" |
| 129 |
einfo "work. Suggested is to add the init script to your start-up" |
| 130 |
einfo "scripts, this should be done like this :" |
| 131 |
einfo "\`rc-update add hald default\`" |
| 132 |
|
| 133 |
} |