| 1 |
compnerd |
1.5 |
# Copyright 1999-2008 Gentoo Foundation
|
| 2 |
compnerd |
1.1 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
armin76 |
1.13 |
# $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.10.ebuild,v 1.12 2008/04/03 20:29:39 klausman Exp $
|
| 4 |
compnerd |
1.1 |
|
| 5 |
|
|
inherit eutils linux-info autotools flag-o-matic
|
| 6 |
|
|
|
| 7 |
compnerd |
1.5 |
PATCH_VER="0"
|
| 8 |
compnerd |
1.3 |
|
| 9 |
compnerd |
1.1 |
DESCRIPTION="Hardware Abstraction Layer"
|
| 10 |
|
|
HOMEPAGE="http://www.freedesktop.org/Software/hal"
|
| 11 |
compnerd |
1.3 |
SRC_URI="http://hal.freedesktop.org/releases/${P}.tar.gz
|
| 12 |
compnerd |
1.5 |
http://dev.gentoo.org/~compnerd/files/${PN}/${P}-gentoo-patches-${PATCH_VER}.tar.bz2"
|
| 13 |
compnerd |
1.1 |
|
| 14 |
|
|
LICENSE="|| ( GPL-2 AFL-2.0 )"
|
| 15 |
|
|
SLOT="0"
|
| 16 |
armin76 |
1.13 |
KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~sparc ~x86"
|
| 17 |
compnerd |
1.1 |
|
| 18 |
|
|
KERNEL_IUSE="kernel_linux kernel_FreeBSD"
|
| 19 |
compnerd |
1.6 |
IUSE="acpi apm crypt debug dell disk-partition doc laptop selinux ${KERNEL_IUSE}"
|
| 20 |
compnerd |
1.1 |
|
| 21 |
|
|
RDEPEND=">=dev-libs/glib-2.6
|
| 22 |
|
|
>=dev-libs/dbus-glib-0.61
|
| 23 |
|
|
>=dev-libs/expat-1.95.8
|
| 24 |
|
|
>=sys-apps/pciutils-2.2.7-r1
|
| 25 |
|
|
>=dev-libs/libusb-0.1.10a
|
| 26 |
|
|
>=dev-util/gperf-3.0.3
|
| 27 |
|
|
sys-apps/usbutils
|
| 28 |
|
|
virtual/eject
|
| 29 |
|
|
amd64? ( >=sys-apps/dmidecode-2.7 )
|
| 30 |
|
|
dell? ( >=sys-libs/libsmbios-0.13.4 )
|
| 31 |
|
|
disk-partition? (
|
| 32 |
|
|
|| (
|
| 33 |
|
|
~sys-apps/parted-1.7.1
|
| 34 |
|
|
~sys-apps/parted-1.8.6
|
| 35 |
|
|
~sys-apps/parted-1.8.7
|
| 36 |
|
|
)
|
| 37 |
|
|
)
|
| 38 |
|
|
ia64? ( >=sys-apps/dmidecode-2.7 )
|
| 39 |
|
|
kernel_linux? (
|
| 40 |
|
|
>=sys-fs/udev-111
|
| 41 |
|
|
>=sys-apps/util-linux-2.13
|
| 42 |
|
|
>=sys-kernel/linux-headers-2.6.19
|
| 43 |
|
|
crypt? (
|
| 44 |
|
|
|| (
|
| 45 |
|
|
>=sys-fs/cryptsetup-1.0.5
|
| 46 |
|
|
>=sys-fs/cryptsetup-luks-1.0.1
|
| 47 |
|
|
)
|
| 48 |
|
|
)
|
| 49 |
|
|
)
|
| 50 |
|
|
kernel_FreeBSD? ( dev-libs/libvolume_id )
|
| 51 |
|
|
x86? ( >=sys-apps/dmidecode-2.7 )
|
| 52 |
|
|
selinux? ( sys-libs/libselinux sec-policy/selinux-hal )"
|
| 53 |
|
|
DEPEND="${RDEPEND}
|
| 54 |
|
|
dev-util/pkgconfig
|
| 55 |
|
|
>=dev-util/intltool-0.35
|
| 56 |
|
|
doc? (
|
| 57 |
|
|
app-doc/doxygen
|
| 58 |
|
|
app-text/docbook-sgml-utils
|
| 59 |
|
|
app-text/xmlto
|
| 60 |
|
|
dev-libs/libxml2
|
| 61 |
|
|
)"
|
| 62 |
|
|
PDEPEND=">=app-misc/hal-info-20071011
|
| 63 |
compnerd |
1.6 |
laptop? ( >=sys-power/pm-utils-0.99.3 )"
|
| 64 |
compnerd |
1.1 |
|
| 65 |
|
|
## HAL Daemon drops privledges so we need group access to read disks
|
| 66 |
|
|
HALDAEMON_GROUPS_LINUX="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
|
| 67 |
|
|
HALDAEMON_GROUPS_FREEBSD="haldaemon,plugdev,operator"
|
| 68 |
|
|
|
| 69 |
wolf31o2 |
1.9 |
function check_hotplug_net() {
|
| 70 |
|
|
local CONFIG_CHECK="~HOTPLUG ~NET"
|
| 71 |
wolf31o2 |
1.10 |
local WARNING_HOTPLUG="CONFIG_HOTPLUG:\tis not set (required for HAL)
|
| 72 |
|
|
"
|
| 73 |
|
|
local WARNING_NET="CONFIG_NET:\tis not set (required for HAL)\n"
|
| 74 |
wolf31o2 |
1.9 |
check_extra_config
|
| 75 |
compnerd |
1.1 |
}
|
| 76 |
|
|
|
| 77 |
wolf31o2 |
1.9 |
function check_inotify() {
|
| 78 |
|
|
local CONFIG_CHECK="~INOTIFY_USER"
|
| 79 |
wolf31o2 |
1.10 |
local WARNING_INOTIFY_USER="CONFIG_INOTIFY_USER:\tis not set (required for HAL)\n"
|
| 80 |
wolf31o2 |
1.9 |
check_extra_config
|
| 81 |
compnerd |
1.1 |
}
|
| 82 |
|
|
|
| 83 |
wolf31o2 |
1.9 |
function check_acpi_proc() {
|
| 84 |
|
|
local CONFIG_CHECK="~ACPI_PROCFS ~ACPI_PROC_EVENT"
|
| 85 |
wolf31o2 |
1.10 |
local WARNING_ACPI_PROCFS="CONFIG_ACPI_PROCFS:\tis not set (required for HAL)\n"
|
| 86 |
|
|
local WARNING_ACPI_PROC_EVENT="CONFIG_ACPI_PROC_EVENT:\tis not set (required for HAL)\n"
|
| 87 |
wolf31o2 |
1.9 |
check_extra_config
|
| 88 |
compnerd |
1.1 |
}
|
| 89 |
|
|
|
| 90 |
|
|
pkg_setup() {
|
| 91 |
wolf31o2 |
1.9 |
if use kernel_linux ; then
|
| 92 |
|
|
if [ -e ${ROOT}/usr/src/linux/.config ] ; then
|
| 93 |
|
|
kernel_is ge 2 6 19 || \
|
| 94 |
|
|
ewarn "HAL requires a kernel version 2.6.19 or newer"
|
| 95 |
|
|
if kernel_is lt 2 6 23 && use acpi ; then
|
| 96 |
|
|
check_acpi_proc
|
| 97 |
|
|
fi
|
| 98 |
compnerd |
1.1 |
fi
|
| 99 |
|
|
|
| 100 |
wolf31o2 |
1.9 |
check_hotplug_net
|
| 101 |
|
|
check_inotify
|
| 102 |
compnerd |
1.1 |
fi
|
| 103 |
|
|
|
| 104 |
|
|
# http://devmanual.gentoo.org/ebuild-writing/functions/
|
| 105 |
|
|
# http://bugs.gentoo.org/show_bug.cgi?id=191605
|
| 106 |
|
|
|
| 107 |
|
|
# Create groups for hotplugging and HAL
|
| 108 |
|
|
enewgroup haldaemon || die "Problem adding haldaemon group"
|
| 109 |
|
|
enewgroup plugdev || die "Problem adding plugdev group"
|
| 110 |
|
|
|
| 111 |
|
|
# HAL drops priviledges by default now ...
|
| 112 |
|
|
# ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
|
| 113 |
|
|
if use kernel_linux; then
|
| 114 |
|
|
enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX} \
|
| 115 |
|
|
|| die "Problem adding haldaemon user"
|
| 116 |
|
|
elif use kernel_FreeBSD; then
|
| 117 |
|
|
enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD} \
|
| 118 |
|
|
|| die "Problem addding haldaemon user"
|
| 119 |
|
|
fi
|
| 120 |
|
|
|
| 121 |
|
|
# Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
|
| 122 |
|
|
# If users have a problem with this, let them file a bug
|
| 123 |
|
|
if [[ ${ROOT} == / ]] ; then
|
| 124 |
|
|
if use kernel_linux; then
|
| 125 |
|
|
usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
|
| 126 |
|
|
elif use kernel_FreeBSD; then
|
| 127 |
|
|
pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
|
| 128 |
|
|
fi
|
| 129 |
|
|
fi
|
| 130 |
|
|
}
|
| 131 |
|
|
|
| 132 |
|
|
src_unpack() {
|
| 133 |
|
|
unpack ${A}
|
| 134 |
|
|
cd "${S}"
|
| 135 |
|
|
|
| 136 |
compnerd |
1.5 |
EPATCH_MULTI_MSG="Applying Gentoo Patchset ..." \
|
| 137 |
compnerd |
1.3 |
EPATCH_SUFFIX="patch" \
|
| 138 |
|
|
EPATCH_SOURCE="${WORKDIR}/hal-0.5.10-patches/" \
|
| 139 |
|
|
EPATCH_FORCE="yes" \
|
| 140 |
mr_bones_ |
1.4 |
epatch
|
| 141 |
compnerd |
1.3 |
|
| 142 |
compnerd |
1.1 |
# Hide recovery partitions
|
| 143 |
|
|
epatch "${FILESDIR}/hal-0.5.9-hide-recovery-partitions.patch"
|
| 144 |
|
|
|
| 145 |
|
|
# Enable plugdev support
|
| 146 |
compnerd |
1.3 |
epatch "${FILESDIR}/96_plugdev_allow_send.patch"
|
| 147 |
compnerd |
1.5 |
|
| 148 |
|
|
eautoreconf
|
| 149 |
compnerd |
1.1 |
}
|
| 150 |
|
|
|
| 151 |
|
|
src_compile() {
|
| 152 |
|
|
local acpi="$(use_enable acpi)"
|
| 153 |
|
|
local backend=
|
| 154 |
|
|
local hardware=
|
| 155 |
|
|
|
| 156 |
|
|
append-flags -rdynamic
|
| 157 |
|
|
|
| 158 |
|
|
if use kernel_linux ; then
|
| 159 |
|
|
backend="linux"
|
| 160 |
|
|
elif use kernel_FreeBSD ; then
|
| 161 |
|
|
backend="freebsd"
|
| 162 |
|
|
else
|
| 163 |
|
|
eerror "Invalid backend"
|
| 164 |
|
|
fi
|
| 165 |
|
|
|
| 166 |
|
|
if use kernel_linux ; then
|
| 167 |
|
|
if use acpi ; then
|
| 168 |
|
|
# Using IBM ACPI and Toshiba ACPI results in double notification as this
|
| 169 |
|
|
# was merged into the Linux Kernel 2.6.22
|
| 170 |
|
|
if kernel_is lt 2 6 22 ; then
|
| 171 |
|
|
acpi="$acpi --enable-acpi-ibm --enable-acpi-toshiba"
|
| 172 |
|
|
else
|
| 173 |
|
|
acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
|
| 174 |
|
|
fi
|
| 175 |
|
|
|
| 176 |
|
|
acpi="$acpi --enable-acpi-proc --enable-acpi-acpid"
|
| 177 |
|
|
else
|
| 178 |
|
|
acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
|
| 179 |
|
|
acpi="$acpi --disable-acpi-proc --disable-acpi-acpid"
|
| 180 |
|
|
fi
|
| 181 |
|
|
|
| 182 |
|
|
hardware="--with-cpufreq --with-usb-csr --with-keymaps"
|
| 183 |
|
|
use arm && hardware="$hardware --enable-omap"
|
| 184 |
|
|
|
| 185 |
|
|
if use dell ; then
|
| 186 |
|
|
hardware="$hardware --with-dell-backlight"
|
| 187 |
|
|
else
|
| 188 |
|
|
hardware="$hardware --without-dell-backlight"
|
| 189 |
|
|
fi
|
| 190 |
|
|
else
|
| 191 |
|
|
hardware="--without-cpufreq --without-usb-csr --without-keymaps"
|
| 192 |
|
|
hardware="$hardware --disable-omap"
|
| 193 |
|
|
hardware="$hardware --without-dell-backlight"
|
| 194 |
|
|
hardware="$hardware --enable-acpi-ibm --enable-acpi-toshiba"
|
| 195 |
|
|
fi
|
| 196 |
|
|
|
| 197 |
|
|
econf --with-backend=${backend} \
|
| 198 |
|
|
--with-os-type=gentoo \
|
| 199 |
|
|
--with-pid-file=/var/run/hald.pid \
|
| 200 |
|
|
--with-hwdata=/usr/share/misc \
|
| 201 |
|
|
--with-socket-dir=/var/run/hald \
|
| 202 |
|
|
--enable-umount-helper \
|
| 203 |
|
|
--enable-man-pages \
|
| 204 |
compnerd |
1.5 |
--disable-policy-kit \
|
| 205 |
|
|
--disable-console-kit \
|
| 206 |
|
|
--disable-acl-management \
|
| 207 |
compnerd |
1.1 |
--enable-pci \
|
| 208 |
|
|
--enable-sonypic \
|
| 209 |
|
|
$(use_enable apm) \
|
| 210 |
|
|
$(use_enable arm pmu) \
|
| 211 |
|
|
$(use_enable arm omap) \
|
| 212 |
|
|
$(use_enable debug verbose-mode) \
|
| 213 |
|
|
$(use_enable disk-partition parted) \
|
| 214 |
|
|
$(use_enable doc docbook-docs) \
|
| 215 |
|
|
$(use_enable doc doxygen-docs) \
|
| 216 |
|
|
--docdir=/usr/share/doc/${PF} \
|
| 217 |
|
|
--localstatedir=/var \
|
| 218 |
|
|
${acpi} ${hardware} \
|
| 219 |
|
|
|| die "configure failed"
|
| 220 |
|
|
|
| 221 |
|
|
emake || die "make failed"
|
| 222 |
|
|
}
|
| 223 |
|
|
|
| 224 |
|
|
src_install() {
|
| 225 |
|
|
make DESTDIR="${D}" install || die
|
| 226 |
|
|
dodoc AUTHORS ChangeLog NEWS README
|
| 227 |
|
|
|
| 228 |
|
|
# hal umount for unclean unmounts
|
| 229 |
|
|
exeinto /lib/udev/
|
| 230 |
|
|
newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
|
| 231 |
|
|
|
| 232 |
|
|
# initscript
|
| 233 |
|
|
newinitd "${FILESDIR}"/0.5.10-hald.rc hald
|
| 234 |
|
|
|
| 235 |
|
|
# configuration
|
| 236 |
|
|
cp "${FILESDIR}"/0.5.10-hald.conf "${WORKDIR}"/
|
| 237 |
|
|
|
| 238 |
|
|
if use debug; then
|
| 239 |
|
|
sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
|
| 240 |
|
|
-i "${WORKDIR}"/0.5.10-hald.conf
|
| 241 |
|
|
fi
|
| 242 |
|
|
newconfd "${WORKDIR}"/0.5.10-hald.conf hald
|
| 243 |
|
|
|
| 244 |
|
|
# We now create and keep /media here as both gnome-mount and pmount
|
| 245 |
|
|
# use these directories, to avoid collision.
|
| 246 |
|
|
keepdir /media
|
| 247 |
|
|
|
| 248 |
|
|
# We also need to create and keep /etc/fdi/{information,policy,preprobe}
|
| 249 |
|
|
# or else hal bombs.
|
| 250 |
|
|
keepdir /etc/hal/fdi/{information,policy,preprobe}
|
| 251 |
|
|
|
| 252 |
|
|
# HAL stores it's fdi cache in /var/lib/cache/hald
|
| 253 |
|
|
keepdir /var/lib/cache/hald
|
| 254 |
|
|
|
| 255 |
|
|
# HAL keeps its unix socket here
|
| 256 |
|
|
keepdir /var/run/hald
|
| 257 |
|
|
keepdir /var/lib/hal
|
| 258 |
|
|
}
|
| 259 |
|
|
|
| 260 |
|
|
pkg_postinst() {
|
| 261 |
|
|
# Despite what people keep changing this location. Either one works.. it doesn't matter
|
| 262 |
|
|
# http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
|
| 263 |
|
|
|
| 264 |
|
|
elog "The HAL daemon needs to be running for certain applications to"
|
| 265 |
|
|
elog "work. Suggested is to add the init script to your start-up"
|
| 266 |
|
|
elog "scripts, this should be done like this :"
|
| 267 |
|
|
elog "\`rc-update add hald default\`"
|
| 268 |
|
|
echo
|
| 269 |
|
|
elog "Looking for automounting support? Add yourself to the plugdev group"
|
| 270 |
|
|
|
| 271 |
|
|
elog "IF you have additional applications which consume ACPI events, you"
|
| 272 |
|
|
elog "should consider installing acpid to allow applications to share ACPI"
|
| 273 |
|
|
elog "events."
|
| 274 |
compnerd |
1.7 |
|
| 275 |
|
|
elog "If you wish to use a non US layout, you may do so by executing:"
|
| 276 |
|
|
elog "setxkbmap <layout> or by utilizing your Desktop Environment's"
|
| 277 |
|
|
elog "Keyboard Layout Settings mechanism."
|
| 278 |
|
|
elog "Under GNOME, this is gnome-keyboard-properties, and under KDE"
|
| 279 |
|
|
elog "it is kxkb."
|
| 280 |
compnerd |
1.1 |
}
|