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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (hide annotations) (download)
Sun Mar 8 22:03:59 2009 UTC (5 years, 7 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.16: +1 -1 lines
FILE REMOVED
Update HOMEPAGE, closes bug #261356 by Mr. Anderson <walch.martin@web.de>. Version bump to 0.5.12 release candidate 1 which incorporates some patches. Patchset trimmed and rebased accordingly.
(Portage version: 2.1.6.7/cvs/Linux x86_64)

1 chainsaw 1.16 # Copyright 1999-2009 Gentoo Foundation
2 compnerd 1.1 # Distributed under the terms of the GNU General Public License v2
3 chainsaw 1.17 # $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.11-r1.ebuild,v 1.16 2009/02/05 10:18:24 chainsaw Exp $
4 compnerd 1.1
5     inherit eutils linux-info autotools flag-o-matic
6    
7     PATCH_VERSION="1"
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 ranger 1.10 KEYWORDS="alpha amd64 hppa ia64 ppc sparc x86"
17 compnerd 1.1
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-111
35 cardoe 1.12 !>=sys-fs/udev-125
36 compnerd 1.1 >=sys-apps/util-linux-2.13
37     >=sys-kernel/linux-headers-2.6.19
38 mr_bones_ 1.8 crypt? ( >=sys-fs/cryptsetup-1.0.5 )
39 compnerd 1.1 )
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     X? ( >=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 tester 1.5 PDEPEND=">=app-misc/hal-info-20080310
54 compnerd 1.1 !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 pva 1.11 enewgroup haldaemon
100     enewgroup plugdev
101 compnerd 1.1
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 pva 1.11 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX}
106 compnerd 1.1 elif use kernel_FreeBSD; then
107 pva 1.11 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD}
108 compnerd 1.1 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/-r*/}"
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_with 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 cardoe 1.14 emake DESTDIR="${D}" install || die "emake failed"
211 cardoe 1.13 dodoc AUTHORS ChangeLog NEWS README || die "docs failed"
212 compnerd 1.1
213     # hal umount for unclean unmounts
214     exeinto /lib/udev/
215 cardoe 1.13 newexe "${FILESDIR}/hal-unmount.dev" hal_unmount || die "udev helper failed"
216 compnerd 1.1
217     # initscript
218 cardoe 1.13 newinitd "${FILESDIR}/0.5.10-hald.rc" hald || die "init script failed"
219 compnerd 1.1
220     # configuration
221 cardoe 1.13 cp "${FILESDIR}/0.5.10-hald.conf" "${WORKDIR}/" || \
222     die "failed to copy hald.conf"
223 compnerd 1.1
224     if use debug; then
225     sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
226 cardoe 1.13 -i "${WORKDIR}/0.5.10-hald.conf" || die "failed to change verbose"
227 compnerd 1.1 fi
228 cardoe 1.14 newconfd "${WORKDIR}/0.5.10-hald.conf" hald || \
229     die "failed to install hald.conf"
230 compnerd 1.1
231     if use X ; then
232     # New Configuration Snippets
233 armin76 1.15 dodoc "${WORKDIR}/${PN}-config-examples/"*.fdi || \
234 cardoe 1.14 die "dodoc X examples failed"
235 armin76 1.15 dobin "${WORKDIR}/${PN}-config-examples/migrate-xorg-to-fdi.py" || \
236 cardoe 1.14 die "dodoc X migration script failed"
237 compnerd 1.1
238     # Automagic conversion!
239 cardoe 1.14 elog "Migrating xorg.conf Core Keyboard configuration to HAL FDI file"
240 armin76 1.15 "${WORKDIR}/${PN}-config-examples/migrate-xorg-to-fdi.py" 2> /dev/null \
241 cardoe 1.14 > "${D}/etc/hal/fdi/policy/10-x11-input.fdi" || \
242     ewarn "Failed to migrate your keyboard configuration."
243 compnerd 1.1 fi
244    
245     # We now create and keep /media here as both gnome-mount and pmount
246     # use these directories, to avoid collision.
247     keepdir /media
248    
249     # We also need to create and keep /etc/fdi/{information,policy,preprobe}
250     # or else hal bombs.
251     keepdir /etc/hal/fdi/{information,policy,preprobe}
252    
253     # HAL stores it's fdi cache in /var/lib/cache/hald
254     keepdir /var/lib/cache/hald
255    
256     # HAL keeps its unix socket here
257     keepdir /var/run/hald
258     keepdir /var/lib/hal
259     }
260    
261     pkg_postinst() {
262     # Despite what people keep changing this location. Either one works.. it doesn't matter
263     # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
264    
265     elog "The HAL daemon needs to be running for certain applications to"
266     elog "work. Suggested is to add the init script to your start-up"
267     elog "scripts, this should be done like this :"
268     elog "\`rc-update add hald default\`"
269     echo
270     elog "Looking for automounting support? Add yourself to the plugdev group"
271     echo
272     elog "IF you have additional applications which consume ACPI events, you"
273     elog "should consider installing acpid to allow applications to share ACPI"
274     elog "events."
275     if use X ; then
276     echo
277     elog "If you wish to use a non US layout, you may do so by executing:"
278     elog "setxkbmap <layout> or by utilizing your Desktop Environment's"
279     elog "Keyboard Layout Settings mechanism."
280     elog "Under GNOME, this is gnome-keyboard-properties, and under KDE"
281     elog "it is kxkb."
282     fi
283     echo
284     elog "In order have suspend/hibernate function with HAL or apps that use HAL"
285     elog "(such as gnome-power-manager), you should build HAL with the laptop"
286     elog "useflag which will install pm-utils."
287     if use X ; then
288     echo
289     elog "X Input Hotplugging (if you build xorg-server with the HAL useflag)"
290     elog "reads user specific configuration from /etc/hal/fdi/policy/."
291     if [[ $(cat "${ROOT}etc/hal/fdi/policy/10-x11-input.fdi" | wc -c) -gt 0 ]]
292     then
293     elog "We have converted your existing xorg.conf rules and the FDI is stored"
294     elog "at /etc/hal/fdi/policy/10-x11-input.fdi"
295     fi
296     elog "You should remove the Input sections from your xorg.conf once you have"
297     elog "migrated the rules to a HAL fdi file."
298     fi
299    
300     ebeep 5
301     epause 5
302     }

  ViewVC Help
Powered by ViewVC 1.1.20