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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20