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

Contents of /sys-apps/hal/hal-0.5.7-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (hide annotations) (download)
Fri Mar 30 14:37:01 2007 UTC (7 years, 6 months ago) by cardoe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +1 -1 lines
FILE REMOVED
remove old version. metadata fixes.
(Portage version: 2.1.2.2)

1 flameeyes 1.14 # Copyright 1999-2007 Gentoo Foundation
2 compnerd 1.1 # Distributed under the terms of the GNU General Public License v2
3 cardoe 1.15 # $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.7-r3.ebuild,v 1.14 2007/01/05 04:41:12 flameeyes Exp $
4 compnerd 1.1
5 flameeyes 1.14 inherit eutils linux-info
6 compnerd 1.1
7     DESCRIPTION="Hardware Abstraction Layer"
8     HOMEPAGE="http://www.freedesktop.org/Software/hal"
9     SRC_URI="http://freedesktop.org/~david/dist/${P}.tar.gz"
10    
11     LICENSE="|| ( GPL-2 AFL-2.0 )"
12     SLOT="0"
13 christel 1.12 KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86"
14 compnerd 1.1 IUSE="acpi crypt debug doc dmi pcmcia selinux"
15    
16     RDEPEND=">=dev-libs/glib-2.6
17     >=sys-fs/udev-078
18     >=sys-apps/util-linux-2.12r
19     || ( >=sys-kernel/linux-headers-2.6 >=sys-kernel/mips-headers-2.6 )
20     dev-libs/expat
21     sys-libs/libcap
22     sys-apps/pciutils
23     dev-libs/libusb
24     sys-apps/hotplug
25 compnerd 1.13 || (
26     >=dev-libs/dbus-glib-0.71
27     ( <sys-apps/dbus-0.90 >=sys-apps/dbus-0.60 )
28     )
29 compnerd 1.1 dmi? ( >=sys-apps/dmidecode-2.7 )
30     crypt? ( >=sys-fs/cryptsetup-luks-1.0.1 )
31     selinux? ( sys-libs/libselinux )"
32     DEPEND="${RDEPEND}
33     dev-util/pkgconfig
34     >=dev-util/intltool-0.29
35     doc? ( app-doc/doxygen app-text/docbook-sgml-utils )"
36    
37     ## HAL Daemon drops privledges so we need group access to read disks
38     HALDAEMON_GROUPS="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
39    
40     function notify_uevent() {
41     eerror
42     eerror "You must enable Kernel Userspace Events in your kernel."
43     eerror "This can be set under 'General Setup'. It is marked as"
44     eerror "CONFIG_KOBJECT_UEVENT in the config file."
45     eerror
46     ebeep 5
47     }
48    
49     function notify_uevent_2_6_16() {
50     eerror
51     eerror "You must enable Kernel Userspace Events in your kernel."
52     eerror "For this you need to enable 'Hotplug' under 'General Setup' and"
53     eerror "basic networking. They are marked CONFIG_HOTPLUG and CONFIG_NET"
54     eerror "in the config file."
55     eerror
56     ebeep 5
57     }
58    
59     function notify_procfs() {
60     eerror
61     eerror "You must enable the proc filesystem in your kernel."
62     eerror "For this you need to enable '/proc file system support' under"
63     eerror "'Pseudo filesystems' in 'File systems'. It is marked"
64     eerror "CONFIG_PROC_FS in the config file."
65     eerror
66     ebeep 5
67     }
68    
69     pkg_setup() {
70 genstef 1.11 get_version || eerror "Unable to calculate Linux Kernel version"
71 compnerd 1.1
72 genstef 1.11 kernel_is ge 2 6 15 || eerror "HAL requires a kernel version 2.6.15 or newer"
73 compnerd 1.1
74     if kernel_is lt 2 6 16 ; then
75     linux_chkconfig_present KOBJECT_UEVENT || notify_uevent
76     else
77     (linux_chkconfig_present HOTPLUG && linux_chkconfig_present NET) \
78     || notify_uevent_2_6_16
79     fi
80    
81     if use acpi ; then
82     linux_chkconfig_present PROC_FS || notify_procfs
83     fi
84    
85     if [ -d ${ROOT}/etc/hal/device.d ]; then
86     eerror "HAL 0.5.x will not run with the HAL 0.4.x series of"
87     eerror "/etc/hal/device.d/ so please remove this directory"
88     eerror "with rm -rf /etc/hal/device.d/ and then re-emerge."
89     eerror "This is due to configuration protection of /etc/"
90     die "remove /etc/hal/device.d/"
91     fi
92     }
93    
94     src_unpack() {
95     unpack ${A}
96     cd "${S}"
97    
98     # sony screen brightness patch
99     # epatch "${FILESDIR}"/${PN}-0.5.7-sony-brightness.patch
100    
101     # handle ignored volumes properly
102     epatch "${FILESDIR}"/${PN}-0.5.7-ignored-volumes.patch
103    
104     # Fix bash in hald scripts
105     epatch "${FILESDIR}"/${PN}-0.5.7-hald-scripts.patch
106    
107     # probe partition table
108     epatch "${FILESDIR}"/${PN}-0.5.7-part-table.patch
109    
110     # fix pmu support crash
111     epatch "${FILESDIR}"/${PN}-0.5.7-pmu-fix.patch
112    
113     # unclean unmount
114     epatch "${FILESDIR}"/${PN}-0.5.7-unclean-unmount-r1.patch
115    
116     # allow plugdev group people to mount
117     epatch "${FILESDIR}"/${PN}-0.5.7-plugdev-allow-send.patch
118    
119     # rescan devices on resume
120     epatch "${FILESDIR}"/${PN}-0.5.7-rescan-on-resume.patch
121    
122     # detect hibernate-ram script as well
123     epatch "${FILESDIR}"/${PN}-0.5.7-hibernate.patch
124     }
125    
126     src_compile() {
127     econf \
128     --with-doc-dir=/usr/share/doc/${PF} \
129     --with-os-type=gentoo \
130     --with-pid-file=/var/run/hald.pid \
131     --enable-hotplug-map \
132     $(use_enable debug verbose-mode) \
133     $(use_enable pcmcia pcmcia-support) \
134     $(use_enable acpi acpi-proc) \
135     $(use_enable doc docbook-docs) \
136     $(use_enable doc doxygen-docs) \
137     $(use_enable selinux) \
138     || die "configure failed"
139    
140     emake || die "make failed"
141     }
142    
143     src_install() {
144     make DESTDIR="${D}" install || die
145     dodoc AUTHORS ChangeLog NEWS README
146    
147     # remove dep on gnome-python
148     mv "${D}"/usr/bin/hal-device-manager "${D}"/usr/share/hal/device-manager/
149    
150     # hal umount for unclean unmounts
151     exeinto /lib/udev/
152     newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
153    
154     # initscript
155     newinitd "${FILESDIR}"/0.5-hald.rc hald
156    
157     # Script to unmount devices if they are yanked out (from upstream)
158     exeinto /etc/dev.d/default
159     doexe "${FILESDIR}"/hal-unmount.dev
160    
161     # We now create and keep /media here as both gnome-mount and pmount
162     # use these directories, to avoid collision.
163     dodir /media
164     keepdir /media
165     }
166    
167     pkg_postinst() {
168     # Despite what people keep changing this location. Either one works.. it doesn't matter
169     # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
170    
171     # Create groups for hotplugging and HAL
172     enewgroup haldaemon || die "Problem adding haldaemon group"
173     enewgroup plugdev || die "Problem adding plugdev group"
174    
175     # HAL drops priviledges by default now ...
176     # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
177     enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS} || die "Problem adding haldaemon user"
178    
179     # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
180     # If users have a problem with this, let them file a bug
181     usermod -G ${HALDAEMON_GROUPS} haldaemon
182    
183     einfo "The HAL daemon needs to be running for certain applications to"
184     einfo "work. Suggested is to add the init script to your start-up"
185     einfo "scripts, this should be done like this :"
186     einfo "\`rc-update add hald default\`"
187     echo
188     einfo "Looking for automounting support? Add yourself to the plugdev group"
189     }

  ViewVC Help
Powered by ViewVC 1.1.20