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

Contents of /sys-apps/hal/hal-0.5.12_rc1-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat May 2 00:16:38 2009 UTC (5 years, 7 months ago) by dang
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Fix #267706 and #267621
(Portage version: 2.2_rc31/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20