# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils toolchain-funcs multilib DESCRIPTION="A gtk port of DC++, using the unmodified DC++ core" HOMEPAGE="linuxdcpp.berlios.de" SRC_URI="http://dx.homelinux.org/gentoo/portage-overlay/local-overlay/distfiles/linuxdcpp-${PV}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="debug" RDEPEND="|| ( x11-libs/libX11 virtual/x11 ) >=x11-libs/gtk+-2.4.0 >=gnome-base/libglade-2.4.0 sys-libs/zlib app-arch/bzip2 gnome-base/librsvg virtual/libc" DEPEND="${RDEPEND} dev-util/scons >=sys-devel/gcc-3.4.0" S="${WORKDIR}/linuxdcpp" # Local vars INTO="/usr" src_unpack() { ok="false" if [ "$(gcc-major-version)" -eq "3" ]; then if [ "$(gcc-minor-version)" -ge "4" ]; then ok="true" fi else if [ "$(gcc-major-version)" -gt "3" ]; then ok="true" fi fi if [ ${ok} == "true" ]; then unpack linuxdcpp-${PV}.tar.gz else eerror "${PN} _needs_ gcc version 3.4 or later!" eerror "Use man gcc-config to see how you change" eerror "to the right gcc version" eerror "If you use distcc don't forget to change" eerror "compiler on all systems or temporarily" eerror "disable distcc before you try to reemerge ${PN}" die "Wrong gcc version" fi } # This is a hack to be able to dynamically determine which directories # scons will try to create .scons* files in. get_config() { for lib in `grep "ParseConfig('pkg-config" SConstruct | tr "'" ' ' | cut -d" " -f 5- | tr ')' ' '`; do echo `pkg-config --libs --cflags ${lib} | tr ' ' '\n' | grep -E -- '-L|-I' | cut -c 3-` done } addpredict_from_config() { for i in $(get_config); do addpredict "${i}" done; addpredict "/usr/lib/scons/SCons/" } src_compile() { addpredict_from_config if use debug; then scons ${MAKEOPTS} debug=1 FAKE_ROOT="${D}" PREFIX="${INTO}" || die "scons failed" else scons ${MAKEOPTS} release=1 FAKE_ROOT="${D}" PREFIX="${INTO}" || die "scons failed" fi } src_install() { addpredict_from_config if use debug; then scons install ${MAKEOPTS} debug=1 FAKE_ROOT="${D}" PREFIX="${INTO}" || die "scons install failed" else scons install ${MAKEOPTS} release=1 FAKE_ROOT="${D}" PREFIX="${INTO}" || die "scons install failed" fi doicon "pixmaps/linuxdcpp.svg" insinto /usr/share/applications echo "[Desktop Entry]" > ldcpp.desktop echo "Name=LinuxDC++" >> ldcpp.desktop echo "Comment=DC++ direct connect client ported for Linux" >> ldcpp.desktop echo "Exec=${INTO}/bin/ldcpp" >> ldcpp.desktop echo "Icon=linuxdcpp.svg" >> ldcpp.desktop echo "Terminal=0" >> ldcpp.desktop echo "Categories=Application;Network;" >> ldcpp.desktop echo "Type=Application" >> ldcpp.desktop doins "${FILESDIR}/ldcpp.desktop" }