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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Fri Nov 23 09:30:39 2007 UTC (6 years, 7 months ago) by compnerd
Branch: MAIN
Changes since 1.1: +1 -4 lines
dont mv hal-device-manager
(Portage version: 2.1.3.16)

1 compnerd 1.1 # Copyright 1999-2007 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 compnerd 1.2 # $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.10.ebuild,v 1.1 2007/11/23 06:29:51 compnerd Exp $
4 compnerd 1.1
5     inherit eutils linux-info autotools flag-o-matic
6    
7     DESCRIPTION="Hardware Abstraction Layer"
8     HOMEPAGE="http://www.freedesktop.org/Software/hal"
9     SRC_URI="http://hal.freedesktop.org/releases/${P}.tar.gz"
10    
11     LICENSE="|| ( GPL-2 AFL-2.0 )"
12     SLOT="0"
13     KEYWORDS="~amd64 -mips -ppc64 ~x86"
14    
15     KERNEL_IUSE="kernel_linux kernel_FreeBSD"
16     IUSE="acpi apm crypt debug dell disk-partition doc selinux ${KERNEL_IUSE}"
17    
18     RDEPEND=">=dev-libs/glib-2.6
19     >=dev-libs/dbus-glib-0.61
20     >=dev-libs/expat-1.95.8
21     >=sys-apps/pciutils-2.2.7-r1
22     >=dev-libs/libusb-0.1.10a
23     >=dev-util/gperf-3.0.3
24     >=sys-auth/consolekit-0.2
25     >=sys-auth/policykit-0.6
26     sys-apps/usbutils
27     virtual/eject
28     amd64? ( >=sys-apps/dmidecode-2.7 )
29     dell? ( >=sys-libs/libsmbios-0.13.4 )
30     disk-partition? (
31     || (
32     ~sys-apps/parted-1.7.1
33     ~sys-apps/parted-1.8.6
34     ~sys-apps/parted-1.8.7
35     )
36     )
37     ia64? ( >=sys-apps/dmidecode-2.7 )
38     kernel_linux? (
39     >=sys-fs/udev-111
40     >=sys-apps/util-linux-2.13
41     >=sys-kernel/linux-headers-2.6.19
42     crypt? (
43     || (
44     >=sys-fs/cryptsetup-1.0.5
45     >=sys-fs/cryptsetup-luks-1.0.1
46     )
47     )
48     )
49     kernel_FreeBSD? ( dev-libs/libvolume_id )
50     x86? ( >=sys-apps/dmidecode-2.7 )
51     selinux? ( sys-libs/libselinux sec-policy/selinux-hal )"
52     DEPEND="${RDEPEND}
53     dev-util/pkgconfig
54     >=dev-util/intltool-0.35
55     doc? (
56     app-doc/doxygen
57     app-text/docbook-sgml-utils
58     app-text/xmlto
59     dev-libs/libxml2
60     )"
61     PDEPEND=">=app-misc/hal-info-20071011
62     >=sys-power/pm-utils-0.99.3"
63    
64     ## HAL Daemon drops privledges so we need group access to read disks
65     HALDAEMON_GROUPS_LINUX="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
66     HALDAEMON_GROUPS_FREEBSD="haldaemon,plugdev,operator"
67    
68     function notify_uevent() {
69     ewarn
70     ewarn "You must enable Kernel Userspace Events in your kernel."
71     ewarn "For this you need to enable 'Hotplug' under 'General Setup' and"
72     ewarn "basic networking. They are marked CONFIG_HOTPLUG and CONFIG_NET"
73     ewarn "in the config file."
74     ewarn
75     ebeep 5
76     }
77    
78     function notify_inotify() {
79     ewarn
80     ewarn "You must enable the Inotify system in your kernel."
81     ewarn "For this you need to enable 'Inotify support for userspace'"
82     ewarn "in 'File systems'. It is marked CONFIG_INOTIFY_USER in the config file."
83     ewarn
84     ebeep 5
85     }
86    
87     function notify_acpi_procfs() {
88     ewarn
89     ewarn "You must enable support for the ACPI proc files in your kernel."
90     ewarn "For this you need to enable '/proc/acpi files' in"
91     ewarn "'ACPI Support (Advanced Configuration and Power Interface) Support'."
92     ewarn "It is marked ewarn CONFIG_ACPI_PROCFS in the config file."
93     ewarn
94     ebeep 5
95     }
96    
97     function notify_acpi_proc_event() {
98     ewarn
99     ewarn "You have not enabled support for the /proc/acpi/event interface."
100     ewarn "For this you need to enable '/proc/acpi/event support' in"
101     ewarn "ACPI Support (Advanced Configuration and Power Interface) Support"
102     ewarn
103     ebeep 5
104     }
105    
106     pkg_setup() {
107     if use kernel_linux; then
108     kernel_is ge 2 6 19 || ewarn "HAL requires a kernel version 2.6.19 or newer"
109    
110     if ! ( linux_chkconfig_present HOTPLUG && linux_chkconfig_present NET )
111     then
112     notify_uevent
113     fi
114    
115     linux_chkconfig_present INOTIFY_USER || notify_inotify
116    
117     if use acpi ; then
118     linux_chkconfig_present ACPI_PROCFS || notify_acpi_procfs
119     linux_chkconfig_present ACPI_PROC_EVENT || notify_acpi_proc_event
120     fi
121     fi
122    
123     # http://devmanual.gentoo.org/ebuild-writing/functions/
124     # http://bugs.gentoo.org/show_bug.cgi?id=191605
125    
126     # Create groups for hotplugging and HAL
127     enewgroup haldaemon || die "Problem adding haldaemon group"
128     enewgroup plugdev || die "Problem adding plugdev group"
129    
130     # HAL drops priviledges by default now ...
131     # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
132     if use kernel_linux; then
133     enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX} \
134     || die "Problem adding haldaemon user"
135     elif use kernel_FreeBSD; then
136     enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD} \
137     || die "Problem addding haldaemon user"
138     fi
139    
140     # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
141     # If users have a problem with this, let them file a bug
142     if [[ ${ROOT} == / ]] ; then
143     if use kernel_linux; then
144     usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
145     elif use kernel_FreeBSD; then
146     pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
147     fi
148     fi
149     }
150    
151     src_unpack() {
152     unpack ${A}
153     cd "${S}"
154    
155     # Hide recovery partitions
156     epatch "${FILESDIR}/hal-0.5.9-hide-recovery-partitions.patch"
157    
158     # Enable plugdev support
159     epatch "${FILESDIR}/0.5.9/96_plugdev_allow_send.patch"
160     }
161    
162     src_compile() {
163     local acpi="$(use_enable acpi)"
164     local backend=
165     local hardware=
166    
167     append-flags -rdynamic
168    
169     if use kernel_linux ; then
170     backend="linux"
171     elif use kernel_FreeBSD ; then
172     backend="freebsd"
173     else
174     eerror "Invalid backend"
175     fi
176    
177     if use kernel_linux ; then
178     if use acpi ; then
179     # Using IBM ACPI and Toshiba ACPI results in double notification as this
180     # was merged into the Linux Kernel 2.6.22
181     if kernel_is lt 2 6 22 ; then
182     acpi="$acpi --enable-acpi-ibm --enable-acpi-toshiba"
183     else
184     acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
185     fi
186    
187     acpi="$acpi --enable-acpi-proc --enable-acpi-acpid"
188     else
189     acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
190     acpi="$acpi --disable-acpi-proc --disable-acpi-acpid"
191     fi
192    
193     hardware="--with-cpufreq --with-usb-csr --with-keymaps"
194     use arm && hardware="$hardware --enable-omap"
195    
196     if use dell ; then
197     hardware="$hardware --with-dell-backlight"
198     else
199     hardware="$hardware --without-dell-backlight"
200     fi
201     else
202     hardware="--without-cpufreq --without-usb-csr --without-keymaps"
203     hardware="$hardware --disable-omap"
204     hardware="$hardware --without-dell-backlight"
205     hardware="$hardware --enable-acpi-ibm --enable-acpi-toshiba"
206     fi
207    
208     econf --with-backend=${backend} \
209     --with-os-type=gentoo \
210     --with-pid-file=/var/run/hald.pid \
211     --with-hwdata=/usr/share/misc \
212     --with-socket-dir=/var/run/hald \
213     --enable-umount-helper \
214     --enable-man-pages \
215     --enable-policy-kit \
216     --enable-console-kit \
217     --enable-acl-management \
218     --enable-pci \
219     --enable-sonypic \
220     $(use_enable apm) \
221     $(use_enable arm pmu) \
222     $(use_enable arm omap) \
223     $(use_enable debug verbose-mode) \
224     $(use_enable disk-partition parted) \
225     $(use_enable doc docbook-docs) \
226     $(use_enable doc doxygen-docs) \
227     --docdir=/usr/share/doc/${PF} \
228     --localstatedir=/var \
229     ${acpi} ${hardware} \
230     || die "configure failed"
231    
232     emake || die "make failed"
233     }
234    
235     src_install() {
236     make DESTDIR="${D}" install || die
237     dodoc AUTHORS ChangeLog NEWS README
238    
239     # hal umount for unclean unmounts
240     exeinto /lib/udev/
241     newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
242    
243     # initscript
244     newinitd "${FILESDIR}"/0.5.10-hald.rc hald
245    
246     # configuration
247     cp "${FILESDIR}"/0.5.10-hald.conf "${WORKDIR}"/
248    
249     if use debug; then
250     sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
251     -i "${WORKDIR}"/0.5.10-hald.conf
252     fi
253     newconfd "${WORKDIR}"/0.5.10-hald.conf hald
254    
255     # We now create and keep /media here as both gnome-mount and pmount
256     # use these directories, to avoid collision.
257     keepdir /media
258    
259     # We also need to create and keep /etc/fdi/{information,policy,preprobe}
260     # or else hal bombs.
261     keepdir /etc/hal/fdi/{information,policy,preprobe}
262    
263     # HAL stores it's fdi cache in /var/lib/cache/hald
264     keepdir /var/lib/cache/hald
265    
266     # HAL keeps its unix socket here
267     keepdir /var/run/hald
268     keepdir /var/lib/hal
269     }
270    
271     pkg_postinst() {
272     # Despite what people keep changing this location. Either one works.. it doesn't matter
273     # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
274    
275     elog "The HAL daemon needs to be running for certain applications to"
276     elog "work. Suggested is to add the init script to your start-up"
277     elog "scripts, this should be done like this :"
278     elog "\`rc-update add hald default\`"
279     echo
280     elog "Looking for automounting support? Add yourself to the plugdev group"
281    
282     elog "IF you have additional applications which consume ACPI events, you"
283     elog "should consider installing acpid to allow applications to share ACPI"
284     elog "events."
285     }

  ViewVC Help
Powered by ViewVC 1.1.20