/[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.1 - (show annotations) (download)
Fri Apr 27 18:37:09 2007 UTC (7 years, 2 months ago) by cardoe
Branch: MAIN
Add version that's locked to a certain patchset.
(Portage version: 2.1.2.4)

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

  ViewVC Help
Powered by ViewVC 1.1.20