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

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

  ViewVC Help
Powered by ViewVC 1.1.20