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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Oct 16 17:48:28 2006 UTC (7 years, 11 months ago) by genstef
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Handle no kernel sources with eerror instead of die, thanks to Chris Gianelloni <wolf31o2@gentoo.org> in bug 129811
(Portage version: 2.1.2_pre3-r2)
 (Unsigned Manifest commit)

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.7.1.ebuild,v 1.1 2006/08/16 03:36:55 steev Exp $
4
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 >=sys-apps/dbus-0.60
18 >=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 linux-info_pkg_setup
69
70 kernel_is ge 2 6 15 || die "HAL requires a kernel version 2.6.15 or newer"
71
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
127 src_compile() {
128 econf \
129 --with-doc-dir=/usr/share/doc/${PF} \
130 --with-os-type=gentoo \
131 --with-pid-file=/var/run/hald.pid \
132 --enable-hotplug-map \
133 $(use_enable debug verbose-mode) \
134 $(use_enable pcmcia pcmcia-support) \
135 $(use_enable acpi acpi-proc) \
136 $(use_enable doc docbook-docs) \
137 $(use_enable doc doxygen-docs) \
138 $(use_enable selinux) \
139 || die "configure failed"
140
141 emake || die "make failed"
142 }
143
144 src_install() {
145 make DESTDIR="${D}" install || die
146 dodoc AUTHORS ChangeLog NEWS README
147
148 # remove dep on gnome-python
149 mv "${D}"/usr/bin/hal-device-manager "${D}"/usr/share/hal/device-manager/
150
151 # hal umount for unclean unmounts
152 exeinto /lib/udev/
153 newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
154
155 # initscript
156 newinitd "${FILESDIR}"/0.5-hald.rc hald
157
158 # Script to unmount devices if they are yanked out (from upstream)
159 exeinto /etc/dev.d/default
160 doexe "${FILESDIR}"/hal-unmount.dev
161
162 # We now create and keep /media here as both gnome-mount and pmount
163 # use these directories, to avoid collision.
164 dodir /media
165 keepdir /media
166 }
167
168 pkg_postinst() {
169 # Despite what people keep changing this location. Either one works.. it doesn't matter
170 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
171
172 # Create groups for hotplugging and HAL
173 enewgroup haldaemon || die "Problem adding haldaemon group"
174 enewgroup plugdev || die "Problem adding plugdev group"
175
176 # HAL drops priviledges by default now ...
177 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
178 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS} || die "Problem adding haldaemon user"
179
180 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
181 # If users have a problem with this, let them file a bug
182 usermod -G ${HALDAEMON_GROUPS} haldaemon
183
184 elog "The HAL daemon needs to be running for certain applications to"
185 elog "work. Suggested is to add the init script to your start-up"
186 elog "scripts, this should be done like this :"
187 elog "\`rc-update add hald default\`"
188 echo
189 elog "Looking for automounting support? Add yourself to the plugdev group"
190 }

  ViewVC Help
Powered by ViewVC 1.1.20