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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Sun Jan 18 19:10:25 2009 UTC (5 years, 5 months ago) by eva
Branch: MAIN
Changes since 1.1: +7 -4 lines
Update PDEPEND on hal-info, follow up on bug #241912.
(Portage version: 2.2_rc20/cvs/Linux 2.6.24-gentoo-r8-mactel x86_64)

1 chainsaw 1.1 # Copyright 1999-2009 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 eva 1.2 # $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.11-r6.ebuild,v 1.1 2009/01/06 13:43:59 chainsaw Exp $
4 chainsaw 1.1
5     inherit eutils linux-info autotools flag-o-matic
6    
7     PATCH_VERSION="3"
8    
9     DESCRIPTION="Hardware Abstraction Layer"
10     HOMEPAGE="http://www.freedesktop.org/Software/hal"
11     SRC_URI="http://hal.freedesktop.org/releases/${P/_/}.tar.bz2
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 ~ppc ~ppc64 ~sparc ~x86"
17    
18     KERNEL_IUSE="kernel_linux kernel_FreeBSD"
19     IUSE="X 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-117
35     >=sys-apps/util-linux-2.13
36     >=sys-kernel/linux-headers-2.6.19
37     crypt? ( >=sys-fs/cryptsetup-1.0.5 )
38     )
39     kernel_FreeBSD? ( >=dev-libs/libvolume_id-0.77 )
40     x86? ( >=sys-apps/dmidecode-2.7 )
41     selinux? ( sys-libs/libselinux sec-policy/selinux-hal )"
42     DEPEND="${RDEPEND}
43     dev-util/pkgconfig
44     >=dev-util/intltool-0.35
45     X? ( >=dev-python/pyxf86config-0.3.34-r1 )
46     doc? (
47     app-text/xmlto
48     dev-libs/libxml2
49     dev-util/gtk-doc
50     app-text/docbook-sgml-utils
51     )"
52 eva 1.2 PDEPEND="|| (
53     =app-misc/hal-info-20080310
54     =app-misc/hal-info-20080508
55     =app-misc/hal-info-20081219 )
56     !gnome-extra/hal-device-manager
57     laptop? ( >=sys-power/pm-utils-0.99.3 )"
58 chainsaw 1.1
59     ## HAL Daemon drops privledges so we need group access to read disks
60     HALDAEMON_GROUPS_LINUX="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
61     HALDAEMON_GROUPS_FREEBSD="haldaemon,plugdev,operator"
62    
63     function check_hotplug_net() {
64     local CONFIG_CHECK="~HOTPLUG ~NET"
65     local WARNING_HOTPLUG="CONFIG_HOTPLUG:\tis not set (required for HAL)\n"
66     local WARNING_NET="CONFIG_NET:\tis not set (required for HAL)\n"
67     check_extra_config
68     }
69    
70     function check_inotify() {
71     local CONFIG_CHECK="~INOTIFY_USER"
72     local WARNING_INOTIFY_USER="CONFIG_INOTIFY_USER:\tis not set (required for HAL)\n"
73     check_extra_config
74     }
75    
76     function check_acpi_proc() {
77     local CONFIG_CHECK="~ACPI_PROCFS ~ACPI_PROC_EVENT"
78     local WARNING_ACPI_PROCFS="CONFIG_ACPI_PROCFS:\tis not set (required for HAL)\n"
79     local WARNING_ACPI_PROC_EVENT="CONFIG_ACPI_PROC_EVENT:\tis not set (required for HAL)\n"
80     check_extra_config
81     }
82    
83     pkg_setup() {
84     if use kernel_linux ; then
85     if [[ -e "${ROOT}/usr/src/linux/.config" ]] ; then
86     kernel_is ge 2 6 19 || ewarn "HAL requires a kernel version 2.6.19 or newer"
87    
88     if kernel_is lt 2 6 23 && use acpi ; then
89     check_acpi_proc
90     fi
91     fi
92    
93     check_hotplug_net
94     check_inotify
95     fi
96    
97     # http://devmanual.gentoo.org/ebuild-writing/functions/
98     # http://bugs.gentoo.org/show_bug.cgi?id=191605
99    
100     # Create groups for hotplugging and HAL
101     enewgroup haldaemon
102     enewgroup plugdev
103    
104     # HAL drops priviledges by default now ...
105     # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
106     if use kernel_linux; then
107     enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX}
108     elif use kernel_FreeBSD; then
109     enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD}
110     fi
111    
112     # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
113     # If users have a problem with this, let them file a bug
114     if [[ ${ROOT} == / ]] ; then
115     if use kernel_linux; then
116     usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
117     elif use kernel_FreeBSD; then
118     pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
119     fi
120     fi
121     }
122    
123     S="${WORKDIR}/${PF/-r*/}"
124    
125     src_unpack() {
126     unpack ${A}
127     cd "${S}"
128    
129     EPATCH_MULTI_MSG="Applying Gentoo Patchset ..." \
130     EPATCH_SUFFIX="patch" \
131     EPATCH_SOURCE="${WORKDIR}/${P}-patches/" \
132     EPATCH_FORCE="yes" \
133     epatch
134    
135     epatch "${FILESDIR}"/${P}-ppc64.patch
136    
137     eautoreconf
138     }
139    
140     src_compile() {
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    
175     if use dell ; then
176     hardware="$hardware --with-dell-backlight"
177     else
178     hardware="$hardware --without-dell-backlight"
179     fi
180    
181     hardware="$hardware --enable-sonypic"
182     else
183     hardware="--without-cpufreq --without-usb-csr --without-keymaps"
184     hardware="$hardware --without-omap"
185     hardware="$hardware --without-dell-backlight"
186     hardware="$hardware --enable-acpi-ibm --enable-acpi-toshiba"
187     hardware="$hardware --disable-sonypic"
188     fi
189    
190     econf --with-backend=${backend} \
191     --with-os-type=gentoo \
192     --with-pid-file=/var/run/hald.pid \
193     --with-hwdata=/usr/share/misc \
194     --with-socket-dir=/var/run/hald \
195     --enable-umount-helper \
196     --enable-man-pages \
197     --disable-policy-kit \
198     --disable-console-kit \
199     --disable-acl-management \
200     --enable-pci \
201     $(use_enable apm) \
202     $(use_enable debug verbose-mode) \
203     $(use_enable disk-partition parted) \
204     $(use_enable doc docbook-docs) \
205     $(use_enable doc gtk-doc) \
206     --docdir=/usr/share/doc/${PF} \
207     --localstatedir=/var \
208     ${acpi} ${hardware} \
209     || die "configure failed"
210    
211     emake || die "make failed"
212     }
213    
214     src_install() {
215     emake DESTDIR="${D}" install || die
216     dodoc AUTHORS ChangeLog NEWS README || die "docs failed"
217    
218     # hal umount for unclean unmounts
219     exeinto /lib/udev/
220     newexe "${FILESDIR}/hal-unmount.dev" hal_unmount || die "udev helper failed"
221    
222     # initscript
223     newinitd "${FILESDIR}/0.5.10-hald.rc" hald || die "init script failed"
224    
225     # configuration
226     cp "${FILESDIR}/0.5.10-hald.conf" "${WORKDIR}/" || \
227     die "failed to copy hald.conf"
228    
229     if use debug; then
230     sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
231     -i "${WORKDIR}/0.5.10-hald.conf" || die "failed to change verbose"
232     fi
233     newconfd "${WORKDIR}/0.5.10-hald.conf" hald || \
234     die "failed to install hald.conf"
235    
236     if use X ; then
237     # New Configuration Snippets
238     dodoc "${WORKDIR}/${PN}-config-examples/"*.fdi || \
239     die "dodoc X examples failed"
240     dobin "${WORKDIR}/${PN}-config-examples/migrate-xorg-to-fdi.py" || \
241     die "dodoc X migration script failed"
242    
243     # Automagic conversion!
244     elog "Migrating xorg.conf Core Keyboard configuration to HAL FDI file"
245     "${WORKDIR}/${PN}-config-examples/migrate-xorg-to-fdi.py" 2> /dev/null \
246     > "${D}/etc/hal/fdi/policy/10-x11-input.fdi" || \
247     ewarn "Failed to migrate your keyboard configuration."
248     fi
249    
250     # We now create and keep /media here as both gnome-mount and pmount
251     # use these directories, to avoid collision.
252     keepdir /media
253    
254     # We also need to create and keep /etc/fdi/{information,policy,preprobe}
255     # or else hal bombs.
256     keepdir /etc/hal/fdi/{information,policy,preprobe}
257    
258     # HAL stores it's fdi cache in /var/lib/cache/hald
259     keepdir /var/lib/cache/hald
260    
261     # HAL keeps its unix socket here
262     keepdir /var/run/hald
263     keepdir /var/lib/hal
264     }
265    
266     pkg_postinst() {
267     # Despite what people keep changing this location. Either one works.. it doesn't matter
268     # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
269    
270     elog "The HAL daemon needs to be running for certain applications to"
271     elog "work. Suggested is to add the init script to your start-up"
272     elog "scripts, this should be done like this :"
273     elog "\`rc-update add hald default\`"
274     echo
275     elog "Looking for automounting support? Add yourself to the plugdev group"
276     echo
277     elog "IF you have additional applications which consume ACPI events, you"
278     elog "should consider installing acpid to allow applications to share ACPI"
279     elog "events."
280     if use X ; then
281     echo
282     elog "If you wish to use a non US layout, you may do so by executing:"
283     elog "setxkbmap <layout> or by utilizing your Desktop Environment's"
284     elog "Keyboard Layout Settings mechanism."
285     elog "Under GNOME, this is gnome-keyboard-properties, and under KDE"
286     elog "it is kxkb."
287     fi
288     echo
289     elog "In order have suspend/hibernate function with HAL or apps that use HAL"
290     elog "(such as gnome-power-manager), you should build HAL with the laptop"
291     elog "useflag which will install pm-utils."
292     if use X ; then
293     echo
294     elog "X Input Hotplugging (if you build xorg-server with the HAL useflag)"
295     elog "reads user specific configuration from /etc/hal/fdi/policy/."
296     if [[ $(cat "${ROOT}etc/hal/fdi/policy/10-x11-input.fdi" | wc -c) -gt 0 ]]
297     then
298     elog "We have converted your existing xorg.conf rules and the FDI is stored"
299     elog "at /etc/hal/fdi/policy/10-x11-input.fdi"
300     fi
301     elog "You should remove the Input sections from your xorg.conf once you have"
302     elog "migrated the rules to a HAL fdi file."
303     fi
304    
305     ebeep 5
306     epause 5
307     }

  ViewVC Help
Powered by ViewVC 1.1.20