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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Aug 20 17:04:15 2010 UTC (4 years, 4 months ago) by jer
Branch: MAIN
Changes since 1.1: +2 -2 lines
Move from sys-apps/parted to sys-block/parted.
(Portage version: 2.2_rc67/cvs/Linux i686)

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

  ViewVC Help
Powered by ViewVC 1.1.20