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

Contents of /sys-apps/hal/hal-0.5.7-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Mon Sep 4 15:50:36 2006 UTC (7 years, 10 months ago) by cardoe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Fixing HAL initscript. Removing oldness and some cleaning.
(Portage version: 2.1.1_rc1-r2)
 (Signed Manifest commit)

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.5.7-r1.ebuild,v 1.6 2006/08/16 14:21:34 corsair Exp $
4
5 inherit eutils linux-info debug
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="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ppc64 ~sparc x86"
14 IUSE="acpi crypt debug doc dmi pcmcia selinux"
15
16 RDEPEND=">=dev-libs/glib-2.6
17 >=sys-apps/dbus-0.60
18 >=sys-fs/udev-078
19 >=sys-apps/util-linux-2.12r
20 || ( >=sys-kernel/linux-headers-2.6 >=sys-kernel/mips-headers-2.6 )
21 dev-libs/expat
22 sys-libs/libcap
23 sys-apps/pciutils
24 dev-libs/libusb
25 sys-apps/hotplug
26 dmi? ( >=sys-apps/dmidecode-2.7 )
27 crypt? ( >=sys-fs/cryptsetup-luks-1.0.1 )
28 selinux? ( sys-libs/libselinux )"
29
30 DEPEND="${RDEPEND}
31 dev-util/pkgconfig
32 >=dev-util/intltool-0.29
33 doc? ( app-doc/doxygen app-text/docbook-sgml-utils )"
34
35 ## HAL Daemon drops privledges so we need group access to read disks
36 HALDAEMON_GROUPS="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
37
38 function notify_uevent() {
39 eerror
40 eerror "You must enable Kernel Userspace Events in your kernel."
41 eerror "This can be set under 'General Setup'. It is marked as"
42 eerror "CONFIG_KOBJECT_UEVENT in the config file."
43 eerror
44 ebeep 5
45
46 die "KOBJECT_UEVENT is not set"
47 }
48
49 function notify_uevent_2_6_16() {
50 eerror
51 eerror "You must enable Kernel Userspace Events in your kernel."
52 eerror "For this you need to enable 'Hotplug' under 'General Setup' and"
53 eerror "basic networking. They are marked CONFIG_HOTPLUG and CONFIG_NET"
54 eerror "in the config file."
55 eerror
56 ebeep 5
57
58 die "HOTPLUG is not set"
59 }
60
61 pkg_setup() {
62 linux-info_pkg_setup
63
64 kernel_is ge 2 6 15 \
65 || die "You need a 2.6.15 or newer kernel to run this package"
66
67 if kernel_is lt 2 6 16 ; then
68 linux_chkconfig_present KOBJECT_UEVENT \
69 || notify_uevent
70 else
71 (linux_chkconfig_present HOTPLUG && linux_chkconfig_present NET) \
72 || notify_uevent_2_6_16
73 fi
74
75 if use acpi ; then
76 linux_chkconfig_present PROC_FS \
77 || die "ACPI support requires PROC_FS support in kernel"
78 fi
79
80 if [ -d ${ROOT}/etc/hal/device.d ]; then
81 eerror "HAL 0.5.x will not run with the HAL 0.4.x series of"
82 eerror "/etc/hal/device.d/ so please remove this directory"
83 eerror "with rm -rf /etc/hal/device.d/ and then re-emerge."
84 eerror "This is due to configuration protection of /etc/"
85 die "remove /etc/hal/device.d/"
86 fi
87 }
88
89
90 src_unpack() {
91 unpack ${A}
92 cd "${S}"
93
94 # sony screen brightness patch
95 # epatch "${FILESDIR}"/${PN}-0.5.7-sony-brightness.patch
96
97 # handle ignored volumes properly
98 epatch "${FILESDIR}"/${PN}-0.5.7-ignored-volumes.patch
99
100 # Fix bash in hald scripts
101 epatch "${FILESDIR}"/${PN}-0.5.7-hald-scripts.patch
102
103 # probe partition table
104 epatch "${FILESDIR}"/${PN}-0.5.7-part-table.patch
105
106 # fix pmu support crash
107 epatch "${FILESDIR}"/${PN}-0.5.7-pmu-fix.patch
108
109 # unclean unmount
110 epatch "${FILESDIR}"/${PN}-0.5.7-unclean-unmount.patch
111
112 # allow plugdev group people to mount
113 epatch "${FILESDIR}"/${PN}-0.5.7-plugdev-allow-send.patch
114
115 # rescan devices on resume
116 epatch "${FILESDIR}"/${PN}-0.5.7-rescan-on-resume.patch
117 }
118
119 src_compile() {
120 econf \
121 --with-doc-dir=/usr/share/doc/${PF} \
122 --with-os-type=gentoo \
123 --with-pid-file=/var/run/hald.pid \
124 --enable-hotplug-map \
125 $(use_enable debug verbose-mode) \
126 $(use_enable pcmcia pcmcia-support) \
127 $(use_enable acpi acpi-proc) \
128 $(use_enable doc docbook-docs) \
129 $(use_enable doc doxygen-docs) \
130 $(use_enable selinux) \
131 || die "configure failed"
132
133 emake || die "make failed"
134 }
135
136 src_install() {
137 make DESTDIR="${D}" install || die
138
139 # remove dep on gnome-python
140 mv "${D}"/usr/bin/hal-device-manager "${D}"/usr/share/hal/device-manager/
141
142 # hal umount for unclean unmounts
143 exeinto /usr/libexec
144 doexe "${FILESDIR}"/hal-unmount.dev hal-unmount.sh
145
146 # initscript
147 newinitd "${FILESDIR}"/0.5-hald.rc hald
148
149 dodoc AUTHORS ChangeLog NEWS README
150
151 # Script to unmount devices if they are yanked out (from upstream)
152 exeinto /etc/dev.d/default
153 doexe "${FILESDIR}"/hal-unmount.dev
154
155 # We now create and keep /media here as both gnome-mount and pmount
156 # use these directories, to avoid collision.
157 dodir /media
158 keepdir /media
159 }
160
161 pkg_postinst() {
162 # Despite what people keep changing this location. Either one works.. it doesn't matter
163 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
164 enewgroup haldaemon || die "Problem adding haldaemon group"
165 enewgroup plugdev || die "Problem adding plugdev group"
166 # HAL drops priviledges by default now ...
167 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
168 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS} || die "Problem adding haldaemon user"
169
170 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
171 # If users have a problem with this, let them file a bug
172 usermod -G ${HALDAEMON_GROUPS} haldaemon
173
174 einfo "The HAL daemon needs to be running for certain applications to"
175 einfo "work. Suggested is to add the init script to your start-up"
176 einfo "scripts, this should be done like this :"
177 einfo "\`rc-update add hald default\`"
178 }

  ViewVC Help
Powered by ViewVC 1.1.20