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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Tue Dec 23 21:04:59 2008 UTC (5 years, 3 months ago) by cardoe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
remove old versions that are no longer supported
(Portage version: 2.1.6.1/cvs/Linux 2.6.27-gentoo-r7 x86_64)

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.ebuild,v 1.8 2008/12/22 21:44:12 cardoe Exp $
4
5 inherit eutils linux-info autotools flag-o-matic
6
7 PATCH_VERSION="0"
8
9 DESCRIPTION="Hardware Abstraction Layer"
10 HOMEPAGE="http://www.freedesktop.org/Software/hal"
11 SRC_URI="http://hal.freedesktop.org/releases/${P/_/}.tar.gz
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 ~sparc ~x86"
17
18 KERNEL_IUSE="kernel_linux kernel_FreeBSD"
19 IUSE="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 >=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/_/}"
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_enable 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 make DESTDIR="${D}" install || die
211 dodoc AUTHORS ChangeLog NEWS README
212
213 # hal umount for unclean unmounts
214 exeinto /lib/udev/
215 newexe "${FILESDIR}/hal-unmount.dev" hal_unmount
216
217 # initscript
218 newinitd "${FILESDIR}/0.5.10-hald.rc" hald
219
220 # configuration
221 cp "${FILESDIR}/0.5.10-hald.conf" "${WORKDIR}/"
222
223 if use debug; then
224 sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
225 -i "${WORKDIR}/0.5.10-hald.conf"
226 fi
227 newconfd "${WORKDIR}/0.5.10-hald.conf" hald
228
229 # New Configuration Snippets
230 dodoc "${WORKDIR}/${P}-extras/"*.fdi
231 dobin "${WORKDIR}/${P}-extras/migrate-xorg-to-fdi.py"
232
233 # Authomagic conversion!
234 elog "Migrating xorg.conf Core Keyboard configuration to HAL FDI file..."
235 "${WORKDIR}/${P}-extras/migrate-xorg-to-fdi.py" 2> /dev/null > "${D}/etc/hal/fdi/policy/10-x11-input.fdi"
236
237 # We now create and keep /media here as both gnome-mount and pmount
238 # use these directories, to avoid collision.
239 keepdir /media
240
241 # We also need to create and keep /etc/fdi/{information,policy,preprobe}
242 # or else hal bombs.
243 keepdir /etc/hal/fdi/{information,policy,preprobe}
244
245 # HAL stores it's fdi cache in /var/lib/cache/hald
246 keepdir /var/lib/cache/hald
247
248 # HAL keeps its unix socket here
249 keepdir /var/run/hald
250 keepdir /var/lib/hal
251 }
252
253 pkg_postinst() {
254 # Despite what people keep changing this location. Either one works.. it doesn't matter
255 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
256
257 elog "The HAL daemon needs to be running for certain applications to"
258 elog "work. Suggested is to add the init script to your start-up"
259 elog "scripts, this should be done like this :"
260 elog "\`rc-update add hald default\`"
261 echo
262 elog "Looking for automounting support? Add yourself to the plugdev group"
263 echo
264 elog "IF you have additional applications which consume ACPI events, you"
265 elog "should consider installing acpid to allow applications to share ACPI"
266 elog "events."
267 echo
268 elog "If you wish to use a non US layout, you may do so by executing:"
269 elog "setxkbmap <layout> or by utilizing your Desktop Environment's"
270 elog "Keyboard Layout Settings mechanism."
271 elog "Under GNOME, this is gnome-keyboard-properties, and under KDE"
272 elog "it is kxkb."
273 echo
274 elog "In order have suspend/hibernate function with HAL or apps that use HAL"
275 elog "(such as gnome-power-manager), you should build HAL with the laptop"
276 elog "useflag which will install pm-utils."
277 echo
278 elog "X Input Hotplugging (if you build xorg-server with the HAL useflag)"
279 elog "reads user specific configuration from /etc/hal/fdi/policy/."
280 if [[ $(cat "${ROOT}etc/hal/fdi/policy/10-x11-input.fdi" | wc -c) -gt 0 ]]
281 then
282 elog "We have converted your existing xorg.conf rules and the FDI is stored"
283 elog "at /etc/hal/fdi/policy/10-x11-input.fdi"
284 fi
285 elog "You should remove the Input sections from your xorg.conf once you have"
286 elog "migrated the rules to a HAL fdi file."
287
288 ebeep 5
289 epause 5
290 }

  ViewVC Help
Powered by ViewVC 1.1.20