/[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.25
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.25 2007/04/20 23:22:33 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="~amd64 ~hppa ~ia64 -mips ~ppc ~ppc64 ~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 )
30 ia64? ( >=sys-apps/dmidecode-2.7 ) 30 ia64? ( >=sys-apps/dmidecode-2.7 )
31 dell? ( >=sys-libs/libsmbios-0.13.4 ) 31 dell? ( >=sys-libs/libsmbios-0.13.4 )
32 disk-partition? ( >=sys-apps/parted-1.7.1 ) 32 disk-partition? ( >=sys-apps/parted-1.7.1 )
33 kernel_linux? ( crypt? ( >=sys-fs/cryptsetup-luks-1.0.1 ) ) 33 kernel_linux? ( crypt? ( >=sys-fs/cryptsetup-luks-1.0.1 ) )
34 selinux? ( sys-libs/libselinux 34 selinux? ( sys-libs/libselinux
35 sec-policy/selinux-hal ) 35 sec-policy/selinux-hal )"
36 pam? ( sys-auth/consolekit )" 36# pam? ( sys-auth/consolekit )"
37 37
38DEPEND="${RDEPEND} 38DEPEND="${RDEPEND}
39 dev-util/pkgconfig 39 dev-util/pkgconfig
40 >=dev-util/intltool-0.35 40 >=dev-util/intltool-0.35
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) \
139 $(use_enable disk-partition parted) \ 149 $(use_enable disk-partition parted) \
140 $(use_enable pcmcia pcmcia-support) \ 150 $(use_enable pcmcia pcmcia-support) \
141 $(use_enable doc docbook-docs) \ 151 $(use_enable doc docbook-docs) \
142 $(use_enable doc doxygen-docs) \ 152 $(use_enable doc doxygen-docs) \
143 $(use_enable selinux) \ 153 $(use_enable selinux) \
144 $(use_enable pam console-kit) \ 154 --disable-console-kit \
145 ${acpi} \ 155 ${acpi} \
146 || die "configure failed" 156 || die "configure failed"
157#$(use_enable pam console-kit)
147 158
148 emake || die "make failed" 159 emake || die "make failed"
149} 160}
150 161
151src_install() { 162src_install() {
160 newexe "${FILESDIR}"/hal-unmount.dev hal_unmount 171 newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
161 172
162 # initscript 173 # initscript
163 newinitd "${FILESDIR}"/0.5.9-hald.rc hald 174 newinitd "${FILESDIR}"/0.5.9-hald.rc hald
164 cp "${FILESDIR}"/0.5.9-hald.conf "${WORKDIR}"/ 175 cp "${FILESDIR}"/0.5.9-hald.conf "${WORKDIR}"/
165 if use pam; then 176# if use pam; then
166 sed -e 's:RC_NEED:RC_NEED="consolekit":' -i "${WORKDIR}"/0.5.9-hald.conf 177# sed -e 's:RC_NEED="":RC_NEED="consolekit":' -i "${WORKDIR}"/0.5.9-hald.conf
167 else 178# fi
168 sed -e 's:RC_NEED:RC_NEED="":' -i "${WORKDIR}"/0.5.9-hald.conf 179 if use debug; then
180 sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
181 -i "${WORKDIR}"/0.5.9-hald.conf
169 fi 182 fi
170 newconfd "${WORKDIR}"/0.5.9-hald.conf hald 183 newconfd "${WORKDIR}"/0.5.9-hald.conf hald
171 184
172 # We now create and keep /media here as both gnome-mount and pmount 185 # We now create and keep /media here as both gnome-mount and pmount
173 # use these directories, to avoid collision. 186 # use these directories, to avoid collision.
177 # or else hal bombs. 190 # or else hal bombs.
178 keepdir /etc/hal/fdi/{information,policy,preprobe} 191 keepdir /etc/hal/fdi/{information,policy,preprobe}
179 192
180 # HAL stores it's fdi cache in /var/lib/cache/hald 193 # HAL stores it's fdi cache in /var/lib/cache/hald
181 keepdir /var/lib/cache/hald 194 keepdir /var/lib/cache/hald
195
196 # HAL keeps its unix socket here
197 keepdir /var/run/hald
182} 198}
183 199
184pkg_postinst() { 200pkg_postinst() {
185 # Despite what people keep changing this location. Either one works.. it doesn't matter 201 # Despite what people keep changing this location. Either one works.. it doesn't matter
186 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/ 202 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
189 enewgroup haldaemon || die "Problem adding haldaemon group" 205 enewgroup haldaemon || die "Problem adding haldaemon group"
190 enewgroup plugdev || die "Problem adding plugdev group" 206 enewgroup plugdev || die "Problem adding plugdev group"
191 207
192 # HAL drops priviledges by default now ... 208 # HAL drops priviledges by default now ...
193 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups) 209 # ... 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" 210 if use kernel_linux; then
211 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX} \
212 || die "Problem adding haldaemon user"
213 elif use kernel_FreeBSD; then
214 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD} \
215 || die "Problem addding haldaemon user"
216 fi
195 217
196 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS} 218 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
197 # If users have a problem with this, let them file a bug 219 # If users have a problem with this, let them file a bug
220 if [[ ${ROOT} == / ]] ; then
221 if use kernel_linux; then
198 usermod -G ${HALDAEMON_GROUPS} haldaemon 222 usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
223 elif use kernel_FreeBSD; then
224 pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
225 fi
226 fi
199 227
200 elog "The HAL daemon needs to be running for certain applications to" 228 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" 229 elog "work. Suggested is to add the init script to your start-up"
202 elog "scripts, this should be done like this :" 230 elog "scripts, this should be done like this :"
203 elog "\`rc-update add hald default\`" 231 elog "\`rc-update add hald default\`"

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

  ViewVC Help
Powered by ViewVC 1.1.20