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

Contents of /sys-apps/hal/hal-0.5.14-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Sun Mar 27 08:44:23 2011 UTC (3 years, 5 months ago) by ssuominen
Branch: MAIN
Changes since 1.5: +4 -2 lines
Block both sys-fs/udisks and sys-power/upower to prevent overlapping.

(Portage version: 2.2.0_alpha28/cvs/Linux x86_64)

1 # Copyright 1999-2011 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.14-r4.ebuild,v 1.5 2011/03/21 19:51:48 ssuominen Exp $
4
5 EAPI="2"
6
7 inherit eutils linux-info autotools flag-o-matic multilib
8
9 PATCH_VERSION="5"
10
11 MY_P=${P/_/}
12 S=${WORKDIR}/${MY_P}
13 PATCHNAME="${MY_P}-gentoo-patches-${PATCH_VERSION}"
14 DESCRIPTION="Hardware Abstraction Layer"
15 HOMEPAGE="http://www.freedesktop.org/wiki/Software/hal"
16 SRC_URI="http://hal.freedesktop.org/releases/${MY_P}.tar.bz2
17 http://dev.gentoo.org/~ssuominen/${PATCHNAME}.tar.bz2"
18
19 LICENSE="|| ( GPL-2 AFL-2.0 )"
20 SLOT="0"
21 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~x86-fbsd"
22
23 KERNEL_IUSE="kernel_linux kernel_FreeBSD"
24 IUSE="X acpi apm crypt debug dell disk-partition doc laptop selinux ${KERNEL_IUSE}"
25
26 RDEPEND=">=dev-libs/dbus-glib-0.61
27 >=dev-libs/glib-2.14
28 >=dev-libs/expat-1.95.8
29 =virtual/libusb-0*
30 >=sys-apps/pciutils-2.2.7-r1
31 sys-apps/usbutils
32 virtual/eject
33 amd64? ( >=sys-apps/dmidecode-2.7 )
34 dell? ( >=sys-libs/libsmbios-0.13.4 )
35 disk-partition? ( >=sys-block/parted-1.8.0 )
36 ia64? ( >=sys-apps/dmidecode-2.7 )
37 kernel_linux? (
38 >=sys-fs/udev-125
39 >=sys-apps/util-linux-2.16
40 >=sys-kernel/linux-headers-2.6.22
41 crypt? ( >=sys-fs/cryptsetup-1.0.5 )
42 )
43 kernel_FreeBSD? ( >=dev-libs/libvolume_id-0.77 )
44 x86? ( >=sys-apps/dmidecode-2.7 )
45 selinux? ( sys-libs/libselinux sec-policy/selinux-hal )
46 !sys-fs/udisks
47 !sys-power/upower"
48 DEPEND="${RDEPEND}
49 dev-util/pkgconfig
50 >=dev-util/gperf-3.0.3
51 >=dev-util/intltool-0.35
52 doc? (
53 app-text/xmlto
54 dev-libs/libxml2
55 dev-util/gtk-doc
56 app-text/docbook-sgml-utils
57 app-text/docbook-xml-dtd:4.1.2
58 )"
59 PDEPEND=">=app-misc/hal-info-20081219
60 !gnome-extra/hal-device-manager
61 laptop? ( >=sys-power/pm-utils-0.99.3 )"
62
63 ## HAL Daemon drops privledges so we need group access to read disks
64 HALDAEMON_GROUPS_LINUX="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
65 HALDAEMON_GROUPS_FREEBSD="haldaemon,plugdev,operator"
66
67 function check_hotplug_net() {
68 local CONFIG_CHECK="~HOTPLUG ~NET"
69 local WARNING_HOTPLUG="CONFIG_HOTPLUG:\tis not set (required for HAL)\n"
70 local WARNING_NET="CONFIG_NET:\tis not set (required for HAL)\n"
71 check_extra_config
72 }
73
74 function check_inotify() {
75 local CONFIG_CHECK="~INOTIFY_USER"
76 local WARNING_INOTIFY_USER="CONFIG_INOTIFY_USER:\tis not set (required for HAL)\n"
77 check_extra_config
78 }
79
80 function check_acpi_proc() {
81 local CONFIG_CHECK="~ACPI_PROCFS ~ACPI_PROC_EVENT"
82 local WARNING_ACPI_PROCFS="CONFIG_ACPI_PROCFS:\tis not set (required for HAL)\n"
83 local WARNING_ACPI_PROC_EVENT="CONFIG_ACPI_PROC_EVENT:\tis not set (required for HAL)\n"
84 check_extra_config
85 }
86
87 pkg_setup() {
88 if use kernel_linux ; then
89 if [[ -e "${ROOT}/usr/src/linux/.config" ]] ; then
90 kernel_is ge 2 6 19 || ewarn "HAL requires a kernel version 2.6.19 or newer"
91
92 if kernel_is lt 2 6 23 && use acpi ; then
93 check_acpi_proc
94 fi
95 fi
96
97 check_hotplug_net
98 check_inotify
99 fi
100
101 # http://devmanual.gentoo.org/ebuild-writing/functions/
102 # http://bugs.gentoo.org/show_bug.cgi?id=191605
103
104 # Create groups for hotplugging and HAL
105 enewgroup haldaemon
106 enewgroup plugdev
107
108 # HAL drops priviledges by default now ...
109 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
110 if use kernel_linux; then
111 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX}
112 elif use kernel_FreeBSD; then
113 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD}
114 fi
115
116 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
117 # If users have a problem with this, let them file a bug
118 if [[ ${ROOT} == / ]] ; then
119 if use kernel_linux; then
120 usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
121 elif use kernel_FreeBSD; then
122 pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
123 fi
124 fi
125 }
126
127 src_prepare() {
128 EPATCH_MULTI_MSG="Applying Gentoo Patchset ..." \
129 EPATCH_SUFFIX="patch" \
130 EPATCH_SOURCE="${WORKDIR}/${PATCHNAME}/patches/" \
131 EPATCH_FORCE="yes" \
132 epatch
133
134 eautoreconf
135 }
136
137 src_configure() {
138 local acpi="$(use_enable acpi)"
139 local backend=
140 local hardware=
141
142 append-flags -rdynamic
143
144 if use kernel_linux ; then
145 backend="linux"
146 elif use kernel_FreeBSD ; then
147 backend="freebsd"
148 else
149 eerror "Invalid backend"
150 fi
151
152 if use kernel_linux ; then
153 if use acpi ; then
154 # Using IBM ACPI and Toshiba ACPI results in double notification as this
155 # was merged into the Linux Kernel 2.6.22
156 if kernel_is lt 2 6 22 ; then
157 acpi="$acpi --enable-acpi-ibm --enable-acpi-toshiba"
158 else
159 acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
160 fi
161
162 acpi="$acpi --enable-acpi-proc --enable-acpi-acpid"
163 else
164 acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
165 acpi="$acpi --disable-acpi-proc --disable-acpi-acpid"
166 fi
167
168 hardware="--with-cpufreq --with-usb-csr --with-keymaps"
169 use arm && hardware="$hardware --with-omap --enable-pmu"
170 use ppc && hardware="$hardware --enable-pmu"
171 if use x86 || use amd64; then
172 hardware="$hardware --with-macbook --with-macbookpro"
173 fi
174
175 if use dell ; then
176 hardware="$hardware --with-dell-backlight"
177 else
178 hardware="$hardware --without-dell-backlight"
179 fi
180
181 hardware="$hardware --enable-sonypic"
182 else
183 hardware="--without-cpufreq --without-usb-csr --without-keymaps"
184 hardware="$hardware --without-omap"
185 hardware="$hardware --without-dell-backlight"
186 hardware="$hardware --enable-acpi-ibm --enable-acpi-toshiba"
187 hardware="$hardware --disable-sonypic"
188 fi
189
190 econf --with-backend=${backend} \
191 --with-os-type=gentoo \
192 --with-pid-file=/var/run/hald.pid \
193 --with-hwdata=/usr/share/misc \
194 --with-socket-dir=/var/run/hald \
195 --with-udev-prefix=/etc \
196 --enable-umount-helper \
197 --enable-man-pages \
198 --disable-acl-management \
199 --enable-pci \
200 --disable-policy-kit \
201 --disable-console-kit \
202 $(use_enable apm) \
203 $(use_enable debug verbose-mode) \
204 $(use_enable disk-partition parted) \
205 $(use_enable doc docbook-docs) \
206 $(use_enable doc gtk-doc) \
207 --docdir=/usr/share/doc/${PF} \
208 --localstatedir=/var \
209 ${acpi} ${hardware} \
210 || die "configure failed"
211 }
212
213 src_install() {
214 emake DESTDIR="${D}" install || die
215 dodoc AUTHORS ChangeLog NEWS README || die "docs failed"
216
217 # hal umount for unclean unmounts
218 exeinto /$(get_libdir)/udev/
219 newexe "${FILESDIR}/hal-unmount.dev" hal_unmount || die "udev helper failed"
220
221 # initscript
222 cp "${FILESDIR}/0.5.14-hald.rc.1" "${WORKDIR}/" || \
223 die "failed to copy hald.rc.1"
224 newinitd "${WORKDIR}/0.5.14-hald.rc.1" hald || die "init script failed"
225
226 # configuration
227 cp "${FILESDIR}/0.5.14-hald.conf" "${WORKDIR}/" || \
228 die "failed to copy hald.conf"
229
230 if use debug; then
231 sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
232 -i "${WORKDIR}/0.5.14-hald.conf" || die "failed to change verbose"
233 fi
234 newconfd "${WORKDIR}/0.5.14-hald.conf" hald || \
235 die "failed to install hald.conf"
236
237 if use X ; then
238 # New Configuration Snippets
239 dodoc "${WORKDIR}/${PATCHNAME}/config-examples/"*.fdi || \
240 die "dodoc X examples failed"
241 fi
242
243 # We now create and keep /media here as both gnome-mount and pmount
244 # use these directories, to avoid collision.
245 keepdir /media
246
247 # We also need to create and keep /etc/fdi/{information,policy,preprobe}
248 # or else hal bombs.
249 keepdir /etc/hal/fdi/{information,policy,preprobe}
250
251 # HAL stores it's fdi cache in /var/cache/hald
252 keepdir /var/cache/hald
253
254 # HAL keeps its unix socket here
255 keepdir /var/run/hald
256 keepdir /var/lib/hal
257 }
258
259 pkg_postinst() {
260 # Despite what people keep changing this location. Either one works.. it doesn't matter
261 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
262
263 elog "The HAL daemon needs to be running for certain applications to"
264 elog "work. Suggested is to add the init script to your start-up"
265 elog "scripts, this should be done like this :"
266 elog "\`rc-update add hald default\`"
267 echo
268 elog "Access to hal is now protected by either at_console or the plugdev group."
269 elog "If you have problems discovering/configuring hardware, try adding"
270 elog "yourself to plugdev, or ensuring consolekit is started"
271 echo
272 elog "IF you have additional applications which consume ACPI events, you"
273 elog "should consider installing acpid to allow applications to share ACPI"
274 elog "events."
275 if use X ; then
276 echo
277 elog "If you wish to use a non US layout, you may do so by executing:"
278 elog "setxkbmap <layout> or by utilizing your Desktop Environment's"
279 elog "Keyboard Layout Settings mechanism."
280 elog "Under GNOME, this is gnome-keyboard-properties, and under KDE"
281 elog "it is kxkb."
282 fi
283 echo
284 elog "In order have suspend/hibernate function with HAL or apps that use HAL"
285 elog "(such as gnome-power-manager), you should build HAL with the laptop"
286 elog "useflag which will install pm-utils."
287 if use X ; then
288 echo
289 elog "X Input Hotplugging (if you build xorg-server with the HAL useflag)"
290 elog "reads user specific configuration from /etc/hal/fdi/policy/."
291 echo
292 elog "You should remove the Input sections from your xorg.conf once you have"
293 elog "migrated the rules to a HAL fdi file."
294 fi
295
296 ebeep 5
297 epause 5
298 }

  ViewVC Help
Powered by ViewVC 1.1.20