# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/media-sound/mumble/mumble-1.0.0.ebuild,v 1.0 2007/07/16 19:13:10 drizzt Exp $ inherit eutils toolchain-funcs qt4 DESCRIPTION="A client-server based voice chat software for gaming written in Qt4" HOMEPAGE="http://mumble.sourceforge.net/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="client server pulseaudio" DEPEND="$(qt4_min_version 4.3) media-libs/alsa-lib dev-libs/boost x11-libs/libXevie client? ( pulseaudio? ( media-sound/pulseaudio ) ) !client? ( !server? ( pulseaudio? ( media-sound/pulseaudio ) ) )" RDEPEND="${DEPEND}" build_client() { use client && return 1 ! use client && ! use server && return 1 return 0 } build_client() { use server && return 1 ! use server && ! use client && return 1 return 0 } pkg_setup() { if ! built_with_use -a =x11-libs/qt-4* sqlite3 dbus ; then echo if ! built_with_use =x11-libs/qt-4* sqlite3; then eerror "You need to build Qt4 with the sqlite3 use-flag" fi if ! built_with_use =x11-libs/qt-4* dbus; then eerror "You need to build Qt4 with the dbus use-flag" fi echo die "Your Qt4 installation lacks propper useflag configuration, see above" fi if ! use client && ! use server ; then echo ewarn "'client' and 'server' USE flags are disabled." ewarn "both client and server will be built." echo fi if ! build_client && use pulseaudio; then ewarn "Only the mumble client uses pulsaudio library."; fi if [[ $(gcc-major-version) -eq 3 && $(gcc-minor-version) -lt 4 ]]; then eerror "You need >=sys-devel/gcc-3.4 to compile ${PN}." die "System gcc is too old to compile ${PN}." fi } src_unpack() { unpack ${A} cd "${S}" if ! use pulseaudio; then epatch "${FILESDIR}"/mumble-1.1.1-disablePulsaudioBuild.patch fi if ! build_server ; then ewarn "building client only. murmur server building will be disabled" epatch "${FILESDIR}"/mumble-1.1.1-clientonly.patch fi if ! build_client ; then ewarn "building murmur server only. mumble client building will be disabled" epatch "${FILESDIR}"/mumble-1.1.1-serveronly.patch fi } src_compile() { qmake main.pro || die "qmake failed" emake || die "emake failed" } src_install() { newdoc README.Linux README dodoc CHANGES local dir if built_with_use =x11-libs/qt-4* debug; then dir=debug ewarn "Built debug-version because your Qt4 has the debug use-flag enabled." else dir=release fi if build_client ; then dobin ${dir}/mumble || die "installing failed" dolib.so ${dir}/lib*.so || die "installing failed" dolib.a ${dir}/lib*.a || die "installing failed" fi if build_server ; then dobin ${dir}/murmurd || die "installing failed" dolib.a ${dir}/lib*.a || die "installing failed" fi dobin scripts/mumble-overlay || die "installing failed" if build_client ; then newicon icons/mumble.64x64.png mumble.png || die "installing icon failed" make_desktop_entry ${PN} "Mumble" mumble.png "KDE;Qt;AudioVideo" \ || die "installing menu entry failed" fi } pkg_postinst() { if build_client ; then elog elog "Visit http://mumble.sourceforge.net/Audio_Tuning for futher configuration" elog "type mumble to run the client" elog "you might want to add this to your xorg.conf to get shortcut support" elog " Section \"Extensions\"" elog " Option \"XEVIE\" \"Enable\"" elog " EndSection" fi if build_server ; then elog elog "Mumble supports either sqlight db or PostgreSQL db" elog "You can set your initial 'SuperUser' password using:" elog " murmur -supw " elog "Read on here:" elog "http://mumble.sourceforge.net/Configuring_Murmur" elog "http://mumble.sourceforge.net/Running_Murmur" fi einfo "Both mumble/murmurd support dbus for configuration & misc" }