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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Dec 25 05:00:50 2007 UTC (6 years, 11 months ago) by compnerd
Branch: MAIN
Changes since 1.2: +14 -4 lines
add cardoe's patches
(Portage version: 2.1.4_rc11)

1 # Copyright 1999-2007 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.9.1-r2.ebuild,v 1.2 2007/08/31 14:19:51 cardoe Exp $
4
5 inherit eutils linux-info autotools flag-o-matic
6
7 PATCH_VER="p1"
8
9 DESCRIPTION="Hardware Abstraction Layer"
10 HOMEPAGE="http://www.freedesktop.org/Software/hal"
11 SRC_URI="http://hal.freedesktop.org/releases/${P}.tar.gz
12 http://dev.gentoo.org/~cardoe/files/${PN}/${P}-${PATCH_VER}.tar.bz2"
13
14 LICENSE="|| ( GPL-2 AFL-2.0 )"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17
18 KERNEL_IUSE="kernel_linux kernel_FreeBSD"
19 IUSE="acpi apm crypt debug dell disk-partition doc selinux ${KERNEL_IUSE}"
20
21 RDEPEND=">=dev-libs/glib-2.6
22 >=dev-libs/dbus-glib-0.61
23 >=dev-libs/expat-1.95.8
24 >=sys-apps/pciutils-2.2.7-r1
25 >=dev-libs/libusb-0.1.10a
26 >=dev-util/gperf-3.0.3
27 >=sys-auth/consolekit-0.2
28 >=sys-auth/policykit-0.6
29 sys-apps/usbutils
30 virtual/eject
31 amd64? ( >=sys-apps/dmidecode-2.7 )
32 dell? ( >=sys-libs/libsmbios-0.13.4 )
33 disk-partition? (
34 || (
35 ~sys-apps/parted-1.7.1
36 ~sys-apps/parted-1.8.6
37 ~sys-apps/parted-1.8.7
38 )
39 )
40 ia64? ( >=sys-apps/dmidecode-2.7 )
41 kernel_linux? (
42 >=sys-fs/udev-111
43 >=sys-apps/util-linux-2.13
44 >=sys-kernel/linux-headers-2.6.19
45 crypt? (
46 || (
47 >=sys-fs/cryptsetup-1.0.5
48 >=sys-fs/cryptsetup-luks-1.0.1
49 )
50 )
51 )
52 kernel_FreeBSD? ( dev-libs/libvolume_id )
53 x86? ( >=sys-apps/dmidecode-2.7 )
54 selinux? ( sys-libs/libselinux sec-policy/selinux-hal )"
55 DEPEND="${RDEPEND}
56 dev-util/pkgconfig
57 >=dev-util/intltool-0.35
58 doc? (
59 app-doc/doxygen
60 app-text/docbook-sgml-utils
61 app-text/xmlto
62 dev-libs/libxml2
63 )"
64 PDEPEND=">=app-misc/hal-info-20071011
65 >=sys-power/pm-utils-0.99.3"
66
67 ## HAL Daemon drops privledges so we need group access to read disks
68 HALDAEMON_GROUPS_LINUX="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
69 HALDAEMON_GROUPS_FREEBSD="haldaemon,plugdev,operator"
70
71 function notify_uevent() {
72 ewarn
73 ewarn "You must enable Kernel Userspace Events in your kernel."
74 ewarn "For this you need to enable 'Hotplug' under 'General Setup' and"
75 ewarn "basic networking. They are marked CONFIG_HOTPLUG and CONFIG_NET"
76 ewarn "in the config file."
77 ewarn
78 ebeep 5
79 }
80
81 function notify_inotify() {
82 ewarn
83 ewarn "You must enable the Inotify system in your kernel."
84 ewarn "For this you need to enable 'Inotify support for userspace'"
85 ewarn "in 'File systems'. It is marked CONFIG_INOTIFY_USER in the config file."
86 ewarn
87 ebeep 5
88 }
89
90 function notify_acpi_procfs() {
91 ewarn
92 ewarn "You must enable support for the ACPI proc files in your kernel."
93 ewarn "For this you need to enable '/proc/acpi files' in"
94 ewarn "'ACPI Support (Advanced Configuration and Power Interface) Support'."
95 ewarn "It is marked ewarn CONFIG_ACPI_PROCFS in the config file."
96 ewarn
97 ebeep 5
98 }
99
100 function notify_acpi_proc_event() {
101 ewarn
102 ewarn "You have not enabled support for the /proc/acpi/event interface."
103 ewarn "For this you need to enable '/proc/acpi/event support' in"
104 ewarn "ACPI Support (Advanced Configuration and Power Interface) Support"
105 ewarn
106 ebeep 5
107 }
108
109 pkg_setup() {
110 if use kernel_linux; then
111 kernel_is ge 2 6 19 || ewarn "HAL requires a kernel version 2.6.19 or newer"
112
113 if ! ( linux_chkconfig_present HOTPLUG && linux_chkconfig_present NET )
114 then
115 notify_uevent
116 fi
117
118 linux_chkconfig_present INOTIFY_USER || notify_inotify
119
120 if use acpi ; then
121 linux_chkconfig_present ACPI_PROCFS || notify_acpi_procfs
122 linux_chkconfig_present ACPI_PROC_EVENT || notify_acpi_proc_event
123 fi
124 fi
125
126 # http://devmanual.gentoo.org/ebuild-writing/functions/
127 # http://bugs.gentoo.org/show_bug.cgi?id=191605
128
129 # Create groups for hotplugging and HAL
130 enewgroup haldaemon || die "Problem adding haldaemon group"
131 enewgroup plugdev || die "Problem adding plugdev group"
132
133 # HAL drops priviledges by default now ...
134 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
135 if use kernel_linux; then
136 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX} \
137 || die "Problem adding haldaemon user"
138 elif use kernel_FreeBSD; then
139 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD} \
140 || die "Problem addding haldaemon user"
141 fi
142
143 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
144 # If users have a problem with this, let them file a bug
145 if [[ ${ROOT} == / ]] ; then
146 if use kernel_linux; then
147 usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
148 elif use kernel_FreeBSD; then
149 pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
150 fi
151 fi
152 }
153
154 src_unpack() {
155 unpack ${A}
156 cd "${S}"
157
158 # patchset from http://dev.gentoo.org/~cardoe/repos/hal.git
159 EPATCH_MULTI_MSG="Applying http://dev.gentoo.org/~cardoe/repos/hal.git patchset ..." \
160 EPATCH_SUFFIX="patch" \
161 EPATCH_SOURCE="${WORKDIR}/hal-0.5.10-patches/" \
162 EPATCH_FORCE="yes" \
163 epatch
164
165 # Hide recovery partitions
166 epatch "${FILESDIR}/hal-0.5.9-hide-recovery-partitions.patch"
167
168 # Enable plugdev support
169 epatch "${FILESDIR}/96_plugdev_allow_send.patch"
170 }
171
172 src_compile() {
173 local acpi="$(use_enable acpi)"
174 local backend=
175 local hardware=
176
177 append-flags -rdynamic
178
179 if use kernel_linux ; then
180 backend="linux"
181 elif use kernel_FreeBSD ; then
182 backend="freebsd"
183 else
184 eerror "Invalid backend"
185 fi
186
187 if use kernel_linux ; then
188 if use acpi ; then
189 # Using IBM ACPI and Toshiba ACPI results in double notification as this
190 # was merged into the Linux Kernel 2.6.22
191 if kernel_is lt 2 6 22 ; then
192 acpi="$acpi --enable-acpi-ibm --enable-acpi-toshiba"
193 else
194 acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
195 fi
196
197 acpi="$acpi --enable-acpi-proc --enable-acpi-acpid"
198 else
199 acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
200 acpi="$acpi --disable-acpi-proc --disable-acpi-acpid"
201 fi
202
203 hardware="--with-cpufreq --with-usb-csr --with-keymaps"
204 use arm && hardware="$hardware --enable-omap"
205
206 if use dell ; then
207 hardware="$hardware --with-dell-backlight"
208 else
209 hardware="$hardware --without-dell-backlight"
210 fi
211 else
212 hardware="--without-cpufreq --without-usb-csr --without-keymaps"
213 hardware="$hardware --disable-omap"
214 hardware="$hardware --without-dell-backlight"
215 hardware="$hardware --enable-acpi-ibm --enable-acpi-toshiba"
216 fi
217
218 econf --with-backend=${backend} \
219 --with-os-type=gentoo \
220 --with-pid-file=/var/run/hald.pid \
221 --with-hwdata=/usr/share/misc \
222 --with-socket-dir=/var/run/hald \
223 --enable-umount-helper \
224 --enable-man-pages \
225 --enable-policy-kit \
226 --enable-console-kit \
227 --enable-acl-management \
228 --enable-pci \
229 --enable-sonypic \
230 $(use_enable apm) \
231 $(use_enable arm pmu) \
232 $(use_enable arm omap) \
233 $(use_enable debug verbose-mode) \
234 $(use_enable disk-partition parted) \
235 $(use_enable doc docbook-docs) \
236 $(use_enable doc doxygen-docs) \
237 --docdir=/usr/share/doc/${PF} \
238 --localstatedir=/var \
239 ${acpi} ${hardware} \
240 || die "configure failed"
241
242 emake || die "make failed"
243 }
244
245 src_install() {
246 make DESTDIR="${D}" install || die
247 dodoc AUTHORS ChangeLog NEWS README
248
249 # hal umount for unclean unmounts
250 exeinto /lib/udev/
251 newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
252
253 # initscript
254 newinitd "${FILESDIR}"/0.5.10-hald.rc hald
255
256 # configuration
257 cp "${FILESDIR}"/0.5.10-hald.conf "${WORKDIR}"/
258
259 if use debug; then
260 sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
261 -i "${WORKDIR}"/0.5.10-hald.conf
262 fi
263 newconfd "${WORKDIR}"/0.5.10-hald.conf hald
264
265 # We now create and keep /media here as both gnome-mount and pmount
266 # use these directories, to avoid collision.
267 keepdir /media
268
269 # We also need to create and keep /etc/fdi/{information,policy,preprobe}
270 # or else hal bombs.
271 keepdir /etc/hal/fdi/{information,policy,preprobe}
272
273 # HAL stores it's fdi cache in /var/lib/cache/hald
274 keepdir /var/lib/cache/hald
275
276 # HAL keeps its unix socket here
277 keepdir /var/run/hald
278 keepdir /var/lib/hal
279 }
280
281 pkg_postinst() {
282 # Despite what people keep changing this location. Either one works.. it doesn't matter
283 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
284
285 elog "The HAL daemon needs to be running for certain applications to"
286 elog "work. Suggested is to add the init script to your start-up"
287 elog "scripts, this should be done like this :"
288 elog "\`rc-update add hald default\`"
289 echo
290 elog "Looking for automounting support? Add yourself to the plugdev group"
291
292 elog "IF you have additional applications which consume ACPI events, you"
293 elog "should consider installing acpid to allow applications to share ACPI"
294 elog "events."
295 }

  ViewVC Help
Powered by ViewVC 1.1.20