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

Diff of /sys-apps/hal/hal-0.5.9.ebuild

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.15 Revision 1.23
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/Attic/hal-0.5.9.ebuild,v 1.15 2007/04/11 15:19:58 cardoe Exp $ 3# $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/Attic/hal-0.5.9.ebuild,v 1.23 2007/04/17 16:26:30 cardoe Exp $
4 4
5inherit eutils linux-info autotools flag-o-matic 5inherit eutils linux-info autotools flag-o-matic
6 6
7DESCRIPTION="Hardware Abstraction Layer" 7DESCRIPTION="Hardware Abstraction Layer"
8HOMEPAGE="http://www.freedesktop.org/Software/hal" 8HOMEPAGE="http://www.freedesktop.org/Software/hal"
9SRC_URI="http://people.freedesktop.org/~david/dist/${P}.tar.gz" 9SRC_URI="http://people.freedesktop.org/~david/dist/${P}.tar.gz"
10 10
11LICENSE="|| ( GPL-2 AFL-2.0 )" 11LICENSE="|| ( GPL-2 AFL-2.0 )"
12SLOT="0" 12SLOT="0"
13KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 -mips ~ppc ~ppc64 ~sh ~sparc ~x86" 13KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 -mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
14 14
15KERNEL_IUSE="kernel_linux kernel_FreeBSD" 15KERNEL_IUSE="kernel_linux kernel_FreeBSD"
16IUSE="acpi crypt debug dell disk-partition doc pam pcmcia selinux ${KERNEL_IUSE}" 16IUSE="acpi crypt debug dell disk-partition doc pam pcmcia selinux ${KERNEL_IUSE}"
17 17
18RDEPEND=">=dev-libs/glib-2.6 18RDEPEND=">=dev-libs/glib-2.6
41 doc? ( app-doc/doxygen app-text/docbook-sgml-utils )" 41 doc? ( app-doc/doxygen app-text/docbook-sgml-utils )"
42 42
43PDEPEND="app-misc/hal-info" 43PDEPEND="app-misc/hal-info"
44 44
45## HAL Daemon drops privledges so we need group access to read disks 45## HAL Daemon drops privledges so we need group access to read disks
46HALDAEMON_GROUPS="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb" 46HALDAEMON_GROUPS_LINUX="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
47HALDAEMON_GROUPS_FREEBSD="haldaemon,plugdev,operator"
47 48
48function notify_uevent() { 49function notify_uevent() {
49 ewarn 50 ewarn
50 ewarn "You must enable Kernel Userspace Events in your kernel." 51 ewarn "You must enable Kernel Userspace Events in your kernel."
51 ewarn "For this you need to enable 'Hotplug' under 'General Setup' and" 52 ewarn "For this you need to enable 'Hotplug' under 'General Setup' and"
73 ewarn 74 ewarn
74 ebeep 5 75 ebeep 5
75} 76}
76 77
77pkg_setup() { 78pkg_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
78 kernel_is ge 2 6 17 || ewarn "HAL requires a kernel version 2.6.17 or newer" 85 kernel_is ge 2 6 17 || ewarn "HAL requires a kernel version 2.6.17 or newer"
79 86
80 if ! ( linux_chkconfig_present HOTPLUG && linux_chkconfig_present NET ) 87 if ! ( linux_chkconfig_present HOTPLUG && linux_chkconfig_present NET )
81 then 88 then
82 notify_uevent 89 notify_uevent
83 fi 90 fi
84 91
85 linux_chkconfig_present INOTIFY_USER || notify_inotify 92 linux_chkconfig_present INOTIFY_USER || notify_inotify
86 93
87 if use acpi ; then 94 if use acpi ; then
88 linux_chkconfig_present PROC_FS || notify_procfs 95 linux_chkconfig_present PROC_FS || notify_procfs
96 fi
89 fi 97 fi
90 98
91 if [[ -d ${ROOT}/etc/hal/device.d ]]; then 99 if [[ -d ${ROOT}/etc/hal/device.d ]]; then
92 eerror "HAL 0.5.x will not run with the HAL 0.4.x series of" 100 eerror "HAL 0.5.x will not run with the HAL 0.4.x series of"
93 eerror "/etc/hal/device.d/ so please remove this directory" 101 eerror "/etc/hal/device.d/ so please remove this directory"
101 unpack ${A} 109 unpack ${A}
102 cd ${S} 110 cd ${S}
103 111
104 # Gentoo Patch Set 112 # Gentoo Patch Set
105 EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch ${FILESDIR}/${PV} 113 EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch ${FILESDIR}/${PV}
114
115 eautoreconf
106} 116}
107 117
108src_compile() { 118src_compile() {
109 local backend="" 119 local backend=""
110 local acpi="" 120 local acpi=""
112 # TODO :: policykit should have a pam useflag 122 # TODO :: policykit should have a pam useflag
113 append-flags -rdynamic 123 append-flags -rdynamic
114 124
115 if use kernel_linux ; then 125 if use kernel_linux ; then
116 backend="linux" 126 backend="linux"
127 use acpi && acpi="--enable-acpi-toshiba --enable-acpi-ibm"
117 elif use kernel_FreeBSD ; then 128 elif use kernel_FreeBSD ; then
118 backend="freebsd" 129 backend="freebsd"
119 else 130 else
120 eerror "Invalid backend" 131 eerror "Invalid backend"
121 fi 132 fi
122 133
123 if use acpi ; then 134 if ! use acpi ; then
124 acpi="--enable-acpi-toshiba --enable-acpi-ibm"
125 else
126 acpi="--disable-acpi-proc --disable-acpi-acpid" 135 acpi="--disable-acpi-proc --disable-acpi-acpid"
127 fi 136 fi
128 137
129 econf --disable-policy-kit \ 138 econf --disable-policy-kit \
130 --with-doc-dir=/usr/share/doc/${PF} \ 139 --with-doc-dir=/usr/share/doc/${PF} \
131 --with-os-type=gentoo \ 140 --with-os-type=gentoo \
132 --with-pid-file=/var/run/hald.pid \ 141 --with-pid-file=/var/run/hald.pid \
142 --with-socket-dir=/var/run/hald \
133 --with-hwdata=/usr/share/misc \ 143 --with-hwdata=/usr/share/misc \
134 --enable-hotplug-map \ 144 --enable-hotplug-map \
135 --enable-man-pages \ 145 --enable-man-pages \
136 --with-backend=${backend} \ 146 --with-backend=${backend} \
137 $(use_enable debug verbose-mode) \ 147 $(use_enable debug verbose-mode) \
161 171
162 # initscript 172 # initscript
163 newinitd "${FILESDIR}"/0.5.9-hald.rc hald 173 newinitd "${FILESDIR}"/0.5.9-hald.rc hald
164 cp "${FILESDIR}"/0.5.9-hald.conf "${WORKDIR}"/ 174 cp "${FILESDIR}"/0.5.9-hald.conf "${WORKDIR}"/
165 if use pam; then 175 if use pam; then
166 sed -e 's:RC_NEED:RC_NEED="consolekit":' -i "${WORKDIR}"/0.5.9-hald.conf 176 sed -e 's:RC_NEED="":RC_NEED="consolekit":' -i "${WORKDIR}"/0.5.9-hald.conf
167 else 177 fi
168 sed -e 's:RC_NEED:RC_NEED="":' -i "${WORKDIR}"/0.5.9-hald.conf 178 if use debug; then
179 sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
180 -i "${WORKDIR}"/0.5.9-hald.conf
169 fi 181 fi
170 newconfd "${WORKDIR}"/0.5.9-hald.conf hald 182 newconfd "${WORKDIR}"/0.5.9-hald.conf hald
171 183
172 # We now create and keep /media here as both gnome-mount and pmount 184 # We now create and keep /media here as both gnome-mount and pmount
173 # use these directories, to avoid collision. 185 # use these directories, to avoid collision.
177 # or else hal bombs. 189 # or else hal bombs.
178 keepdir /etc/hal/fdi/{information,policy,preprobe} 190 keepdir /etc/hal/fdi/{information,policy,preprobe}
179 191
180 # HAL stores it's fdi cache in /var/lib/cache/hald 192 # HAL stores it's fdi cache in /var/lib/cache/hald
181 keepdir /var/lib/cache/hald 193 keepdir /var/lib/cache/hald
194
195 # HAL keeps its unix socket here
196 keepdir /var/run/hald
182} 197}
183 198
184pkg_postinst() { 199pkg_postinst() {
185 # Despite what people keep changing this location. Either one works.. it doesn't matter 200 # Despite what people keep changing this location. Either one works.. it doesn't matter
186 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/ 201 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
189 enewgroup haldaemon || die "Problem adding haldaemon group" 204 enewgroup haldaemon || die "Problem adding haldaemon group"
190 enewgroup plugdev || die "Problem adding plugdev group" 205 enewgroup plugdev || die "Problem adding plugdev group"
191 206
192 # HAL drops priviledges by default now ... 207 # HAL drops priviledges by default now ...
193 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups) 208 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
194 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS} || die "Problem adding haldaemon user" 209 if use kernel_linux; then
210 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX} \
211 || die "Problem adding haldaemon user"
212 elif use kernel_FreeBSD; then
213 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD} \
214 || die "Problem addding haldaemon user"
215 fi
195 216
196 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS} 217 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
197 # If users have a problem with this, let them file a bug 218 # If users have a problem with this, let them file a bug
219 if [[ ${ROOT} == / ]] ; then
220 if use kernel_linux; then
198 usermod -G ${HALDAEMON_GROUPS} haldaemon 221 usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
222 elif use kernel_FreeBSD; then
223 pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
224 fi
225 fi
199 226
200 elog "The HAL daemon needs to be running for certain applications to" 227 elog "The HAL daemon needs to be running for certain applications to"
201 elog "work. Suggested is to add the init script to your start-up" 228 elog "work. Suggested is to add the init script to your start-up"
202 elog "scripts, this should be done like this :" 229 elog "scripts, this should be done like this :"
203 elog "\`rc-update add hald default\`" 230 elog "\`rc-update add hald default\`"

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.20