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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations) (download)
Wed Nov 15 21:02:48 2006 UTC (7 years, 7 months ago) by cardoe
Branch: MAIN
Changes since 1.4: +2 -2 lines
Fixing bug #155275, bug #147867, bug #140666 (the HAL parts not the KDE parts of it), bug #133743, and refactored patch from bug #146910 so I don't have to kill Ivan and Fabio.
(Portage version: 2.1.2_rc1-r3)

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

  ViewVC Help
Powered by ViewVC 1.1.20