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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Mon Sep 4 15:50:36 2006 UTC (8 years, 3 months ago) by cardoe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +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.ebuild,v 1.5 2006/05/01 10:11:37 steev 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
116 src_compile() {
117 econf \
118 --with-doc-dir=/usr/share/doc/${PF} \
119 --with-os-type=gentoo \
120 --with-pid-file=/var/run/hald.pid \
121 --enable-hotplug-map \
122 $(use_enable debug verbose-mode) \
123 $(use_enable pcmcia pcmcia-support) \
124 $(use_enable acpi acpi-proc) \
125 $(use_enable doc docbook-docs) \
126 $(use_enable doc doxygen-docs) \
127 $(use_enable selinux) \
128 || die "configure failed"
129
130 emake || die "make failed"
131 }
132
133 src_install() {
134 make DESTDIR="${D}" install || die
135
136 # remove dep on gnome-python
137 mv "${D}"/usr/bin/hal-device-manager "${D}"/usr/share/hal/device-manager/
138
139 # hal umount for unclean unmounts
140 exeinto /usr/libexec
141 doexe "${FILESDIR}"/hal-unmount.dev hal-unmount.sh
142
143 # initscript
144 newinitd "${FILESDIR}"/0.5-hald.rc hald
145
146 dodoc AUTHORS ChangeLog NEWS README
147
148 # Script to unmount devices if they are yanked out (from upstream)
149 exeinto /etc/dev.d/default
150 doexe "${FILESDIR}"/hal-unmount.dev
151 }
152
153 pkg_postinst() {
154 # Despite what people keep changing this location. Either one works.. it doesn't matter
155 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
156 enewgroup haldaemon || die "Problem adding haldaemon group"
157 enewgroup plugdev || die "Problem adding plugdev group"
158 # HAL drops priviledges by default now ...
159 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
160 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS} || die "Problem adding haldaemon user"
161
162 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
163 # If users have a problem with this, let them file a bug
164 usermod -G ${HALDAEMON_GROUPS} haldaemon
165
166 einfo "The HAL daemon needs to be running for certain applications to"
167 einfo "work. Suggested is to add the init script to your start-up"
168 einfo "scripts, this should be done like this :"
169 einfo "\`rc-update add hald default\`"
170 }

  ViewVC Help
Powered by ViewVC 1.1.20