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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20