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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Aug 1 13:40:16 2007 UTC (6 years, 11 months ago) by cardoe
Branch: MAIN
Changes since 1.1: +2 -1 lines
ingore sun disklabel partition. remove old versions
(Portage version: 2.1.3_rc9)

1 # Copyright 1999-2007 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.9.1-r1.ebuild,v 1.1 2007/07/26 19:27:09 gustavoz Exp $
4
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://people.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 -mips ~ppc -ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
14
15 KERNEL_IUSE="kernel_linux kernel_FreeBSD"
16 IUSE="acpi crypt debug dell disk-partition doc pcmcia selinux ${KERNEL_IUSE}"
17
18 RDEPEND=">=dev-libs/glib-2.6
19 >=dev-libs/dbus-glib-0.61
20 kernel_linux? ( >=sys-fs/udev-104 )
21 kernel_linux? ( >=sys-apps/util-linux-2.12r-r1 )
22 kernel_linux? ( >=sys-kernel/linux-headers-2.6.17 )
23 kernel_FreeBSD? ( dev-libs/libvolume_id )
24 >=dev-libs/expat-1.95.8
25 >=sys-apps/pciutils-2.2.3
26 >=dev-libs/libusb-0.1.10a
27 sys-apps/usbutils
28 virtual/eject
29 amd64? ( >=sys-apps/dmidecode-2.7 )
30 x86? ( >=sys-apps/dmidecode-2.7 )
31 ia64? ( >=sys-apps/dmidecode-2.7 )
32 dell? ( >=sys-libs/libsmbios-0.13.4 )
33 disk-partition? ( >=sys-apps/parted-1.7.1 )
34 kernel_linux? ( crypt? ( >=sys-fs/cryptsetup-luks-1.0.1 ) )
35 selinux? ( sys-libs/libselinux
36 sec-policy/selinux-hal )"
37 # pam? ( sys-auth/consolekit )"
38
39 DEPEND="${RDEPEND}
40 dev-util/pkgconfig
41 >=dev-util/intltool-0.35
42 doc? ( app-doc/doxygen
43 app-text/docbook-sgml-utils
44 app-text/xmlto )"
45
46 PDEPEND="app-misc/hal-info"
47
48 ## HAL Daemon drops privledges so we need group access to read disks
49 HALDAEMON_GROUPS_LINUX="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
50 HALDAEMON_GROUPS_FREEBSD="haldaemon,plugdev,operator"
51
52 function notify_uevent() {
53 ewarn
54 ewarn "You must enable Kernel Userspace Events in your kernel."
55 ewarn "For this you need to enable 'Hotplug' under 'General Setup' and"
56 ewarn "basic networking. They are marked CONFIG_HOTPLUG and CONFIG_NET"
57 ewarn "in the config file."
58 ewarn
59 ebeep 5
60 }
61
62 function notify_procfs() {
63 ewarn
64 ewarn "You must enable the proc filesystem in your kernel."
65 ewarn "For this you need to enable '/proc file system support' under"
66 ewarn "'Pseudo filesystems' in 'File systems'. It is marked"
67 ewarn "CONFIG_PROC_FS in the config file."
68 ewarn
69 ebeep 5
70 }
71
72 function notify_inotify() {
73 ewarn
74 ewarn "You must enable the Inotify system in your kernel."
75 ewarn "For this you need to enable 'Inotify support for userspace'"
76 ewarn "in 'File systems'. It is marked CONFIG_INOTIFY_USER in the config file."
77 ewarn
78 ebeep 5
79 }
80
81 pkg_setup() {
82 if built_with_use --missing false sys-apps/pciutils zlib ; then
83 eerror "You MUST build sys-apps/pciutils without the zlib USE flag"
84 die "You MUST build sys-apps/pciutils without the zlib USE flag"
85 fi
86
87 if use kernel_linux; then
88 kernel_is ge 2 6 17 || ewarn "HAL requires a kernel version 2.6.17 or newer"
89
90 if ! ( linux_chkconfig_present HOTPLUG && linux_chkconfig_present NET )
91 then
92 notify_uevent
93 fi
94
95 linux_chkconfig_present INOTIFY_USER || notify_inotify
96
97 if use acpi ; then
98 linux_chkconfig_present PROC_FS || notify_procfs
99 fi
100 fi
101
102 if [[ -d ${ROOT}/etc/hal/device.d ]]; then
103 eerror "HAL 0.5.x will not run with the HAL 0.4.x series of"
104 eerror "/etc/hal/device.d/ so please remove this directory"
105 eerror "with rm -rf /etc/hal/device.d/ and then re-emerge."
106 eerror "This is due to configuration protection of /etc/"
107 die "remove /etc/hal/device.d/"
108 fi
109 }
110
111 src_unpack() {
112 unpack ${A}
113 cd ${S}
114
115 # Gentoo patchset
116 epatch ${FILESDIR}/0.5.9/07_malloc_h_for_stdlib_h.patch
117 epatch ${FILESDIR}/0.5.9/23_runner_64bit_values.patch
118 #epatch ${FILESDIR}/0.5.9/95_gentoo_man_page.patch
119 epatch ${FILESDIR}/0.5.9/96_plugdev_allow_send.patch
120 epatch ${FILESDIR}/0.5.9/97_ignore_fixed_drives.patch
121 epatch ${FILESDIR}/0.5.9/98_hald_cache_test_path.patch
122 epatch ${FILESDIR}/0.5.9/99_sun_disklabel_ignore.patch
123
124 eautoreconf
125 }
126
127 src_compile() {
128 local backend=""
129 local acpi=""
130
131 # TODO :: policykit should have a pam useflag
132 append-flags -rdynamic
133
134 if use kernel_linux ; then
135 backend="linux"
136 use acpi && acpi="--enable-acpi-toshiba --enable-acpi-ibm"
137 elif use kernel_FreeBSD ; then
138 backend="freebsd"
139 else
140 eerror "Invalid backend"
141 fi
142
143 if ! use acpi ; then
144 acpi="--disable-acpi-proc --disable-acpi-acpid"
145 fi
146
147 econf --disable-policy-kit \
148 --docdir=/usr/share/doc/${PF} \
149 --with-os-type=gentoo \
150 --with-pid-file=/var/run/hald.pid \
151 --with-socket-dir=/var/run/hald \
152 --with-hwdata=/usr/share/misc \
153 --enable-hotplug-map \
154 --enable-man-pages \
155 --with-backend=${backend} \
156 $(use_enable debug verbose-mode) \
157 $(use_with dell dell-backlight) \
158 $(use_enable disk-partition parted) \
159 $(use_enable pcmcia pcmcia-support) \
160 $(use_enable doc docbook-docs) \
161 $(use_enable doc doxygen-docs) \
162 $(use_enable selinux) \
163 --disable-console-kit \
164 ${acpi} \
165 || die "configure failed"
166 #$(use_enable pam console-kit)
167
168 emake || die "make failed"
169 }
170
171 src_install() {
172 make DESTDIR="${D}" install || die
173 dodoc AUTHORS ChangeLog NEWS README
174
175 # remove dep on gnome-python
176 mv "${D}"/usr/bin/hal-device-manager "${D}"/usr/share/hal/device-manager/
177
178 # hal umount for unclean unmounts
179 exeinto /lib/udev/
180 newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
181
182 # initscript
183 newinitd "${FILESDIR}"/0.5.9-hald.rc hald
184 cp "${FILESDIR}"/0.5.9-hald.conf "${WORKDIR}"/
185 # if use pam; then
186 # sed -e 's:RC_NEED="":RC_NEED="consolekit":' -i "${WORKDIR}"/0.5.9-hald.conf
187 # fi
188 if use debug; then
189 sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
190 -i "${WORKDIR}"/0.5.9-hald.conf
191 fi
192 newconfd "${WORKDIR}"/0.5.9-hald.conf hald
193
194 # We now create and keep /media here as both gnome-mount and pmount
195 # use these directories, to avoid collision.
196 keepdir /media
197
198 # We also need to create and keep /etc/fdi/{information,policy,preprobe}
199 # or else hal bombs.
200 keepdir /etc/hal/fdi/{information,policy,preprobe}
201
202 # HAL stores it's fdi cache in /var/lib/cache/hald
203 keepdir /var/lib/cache/hald
204
205 # HAL keeps its unix socket here
206 keepdir /var/run/hald
207 }
208
209 pkg_postinst() {
210 # Despite what people keep changing this location. Either one works.. it doesn't matter
211 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
212
213 # Create groups for hotplugging and HAL
214 enewgroup haldaemon || die "Problem adding haldaemon group"
215 enewgroup plugdev || die "Problem adding plugdev group"
216
217 # HAL drops priviledges by default now ...
218 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
219 if use kernel_linux; then
220 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX} \
221 || die "Problem adding haldaemon user"
222 elif use kernel_FreeBSD; then
223 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD} \
224 || die "Problem addding haldaemon user"
225 fi
226
227 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
228 # If users have a problem with this, let them file a bug
229 if [[ ${ROOT} == / ]] ; then
230 if use kernel_linux; then
231 usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
232 elif use kernel_FreeBSD; then
233 pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
234 fi
235 fi
236
237 elog "The HAL daemon needs to be running for certain applications to"
238 elog "work. Suggested is to add the init script to your start-up"
239 elog "scripts, this should be done like this :"
240 elog "\`rc-update add hald default\`"
241 echo
242 elog "Looking for automounting support? Add yourself to the plugdev group"
243 }

  ViewVC Help
Powered by ViewVC 1.1.20