# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=2 inherit eutils linux-info DESCRIPTION="OSS Proxy Daemon is Linux userland OSS sound device implementation using CUSE." HOMEPAGE="http://sourceforge.net/projects/osspd/" SRC_URI="mirror://sourceforge/osspd/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64" IUSE="pulseaudio" DEPEND="sys-fs/fuse media-libs/alsa-lib pulseaudio? ( media-sound/pulseaudio )" RDEPEND="${DEPEND}" pkg_setup() { if use kernel_linux ; then CONFIG_CHECK="~CUSE" CUSE_WARNING="You need to have CUSE module built to use ${PN}" else eerror "This package currently only supports linux" die fi } src_prepare() { # currently much stuff is hardcoded in the Makefile like *FLAGS and # prefix. Fixing ths with sed for now. sed '/^prefix/s|/usr/local|/usr|' -i "${S}"/Makefile \ || die "failed to tweak install path" if ! use pulseaudio ; then sed '/^all:/s|ossp-padsp||;/install -m755/s|ossp-padsp||;s|^\(OSSP_PADSP_\)|#\1|g' \ -i "${S}"/Makefile \ || die "Disabling pulseaudio support failed" fi } src_install() { emake DESTDIR="${D}" install || die "emake install failed" newinitd "${FILESDIR}"/osspd.initd osspd newconfd "${FILESDIR}"/osspd.confd osspd } pkg_postinst() { elog "osspd can use different backends. Currently there are an alsa- and" elog "a pulseaudio-backend available. You can choose between them in the" elog "/etc/conf.d/osspd file." }