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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (hide annotations) (download)
Wed Aug 1 13:40:16 2007 UTC (7 years ago) by cardoe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +1 -1 lines
FILE REMOVED
ingore sun disklabel partition. remove old versions
(Portage version: 2.1.3_rc9)

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

  ViewVC Help
Powered by ViewVC 1.1.20