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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20