/[gentoo-x86]/sys-apps/hal/hal-0.5.5.1.ebuild
Gentoo

Contents of /sys-apps/hal/hal-0.5.5.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Nov 27 06:10:37 2005 UTC (12 years, 11 months ago) by compnerd
Branch: MAIN
Changes since 1.1: +15 -1 lines
Adding Kernel Config check to resolve bug #112186
(Portage version: 2.0.53_rc7)

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.5.1.ebuild,v 1.1 2005/11/22 01:26:43 compnerd 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="acpi debug doc pam_console pcmcia"
15
16 RDEPEND=">=dev-libs/glib-2.6
17 >=sys-apps/dbus-0.50
18 >=sys-fs/udev-071
19 >=sys-apps/util-linux-2.12i
20 ||( >=sys-kernel/linux-headers-2.6 >=sys-kernel/mips-headers-2.6 )
21 dev-libs/expat
22 dev-libs/libusb
23 sys-apps/hotplug
24 pam_console? ( sys-libs/pam )"
25 DEPEND="${RDEPEND}
26 dev-util/pkgconfig
27 >=dev-util/intltool-0.29
28 doc? ( app-doc/doxygen app-text/docbook-sgml-utils )"
29
30 ## HAL Daemon drops privledges so we need group access to read disks
31 HALDAEMON_GROUPS="haldaemon,disk,cdrom,cdrw,floppy,usb"
32
33 function notify_uevent() {
34 eerror
35 eerror "You must enable Kernel Userspace Events in your kernel."
36 eerror "This can be set under 'General Setup'. It is marked as"
37 eerror "CONFIG_KOBJECT_UEVENT in the config file."
38 eerror
39 ebeep 5
40
41 die "KOBJECT_UEVENT is not set"
42 }
43
44 pkg_setup() {
45 linux-info_pkg_setup
46
47 kernel_is ge 2 6 13 \
48 || die "You need a 2.6.13 or newer kernel to run this package"
49
50 linux_chkconfig_present KOBJECT_UEVENT \
51 || notify_uevent
52
53 if use acpi ; then
54 linux_chkconfig_present PROC_FS \
55 || die "ACPI support requires PROC_FS support in kernel"
56 fi
57
58 if use pam_console && ! built_with_use sys-libs/pam pam_console ; then
59 eerror "You need to build pam with pam_console support"
60 eerror "Please remerge sys-libs/pam with USE=pam_console"
61 die "pam without pam_console detected"
62 fi
63
64 if [ -d ${ROOT}/etc/hal/device.d ]; then
65 eerror "HAL 0.5.x will not run with the HAL 0.4.x series of"
66 eerror "/etc/hal/device.d/ so please remove this directory"
67 eerror "with rm -rf /etc/hal/device.d/ and then re-emerge."
68 eerror "This is due to configuration protection of /etc/"
69 die "remove /etc/hal/device.d/"
70 fi
71 }
72
73
74 src_unpack() {
75 unpack ${A}
76 cd ${S}
77 # remove pamconsole option
78 use pam_console || epatch ${FILESDIR}/${PN}-0.5.1-old_storage_policy.patch
79 }
80
81 src_compile() {
82 econf \
83 --with-os-type=gentoo \
84 --with-pid-file=/var/run/hald.pid \
85 $(use_enable debug verbose-mode) \
86 $(use_enable pcmcia pcmcia-support) \
87 $(use_enable acpi acpi-proc) \
88 $(use_enable doc docbook-docs) \
89 $(use_enable doc doxygen-docs) \
90 || die "configure failed"
91
92 emake || die "make failed"
93 }
94
95 src_install() {
96 make DESTDIR=${D} install || die
97
98 # We install this in a seperate package to avoid gnome-python dep
99 rm ${D}/usr/bin/hal-device-manager
100
101 # initscript
102 newinitd ${FILESDIR}/0.5-hald.rc hald
103
104 dodoc AUTHORS COPYING ChangeLog INSTALL NEWS README
105
106 # Script to unmount devices if they are yanked out (from upstream)
107 exeinto /etc/dev.d/default
108 doexe ${FILESDIR}/hal-unmount.dev
109 }
110
111 pkg_postinst() {
112 ## We need to add the user/groups *after* package compilation/installation, so that we
113 ## don't change the user without the package being installed.
114 ##
115 enewgroup haldaemon || die "Problem adding haldaemon group"
116 # HAL drops priviledges by default now ...
117 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
118 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS} || die "Problem adding haldaemon user"
119
120 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
121 # If users have a problem with this, let them file a bug
122 usermod -G ${HALDAEMON_GROUPS} haldaemon
123
124 einfo "The HAL daemon needs to be running for certain applications to"
125 einfo "work. Suggested is to add the init script to your start-up"
126 einfo "scripts, this should be done like this :"
127 einfo "\`rc-update add hald default\`"
128 }

  ViewVC Help
Powered by ViewVC 1.1.20