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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Sun Dec 28 15:02:55 2008 UTC (5 years, 8 months ago) by armin76
Branch: MAIN
Changes since 1.14: +4 -4 lines
Fix bug #252587
(Portage version: 2.1.4.5)

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

  ViewVC Help
Powered by ViewVC 1.1.20