# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo/portage/net-p2p/ldcpp-cvs/ldcpp-cvs-0.0.1.ebuild,v 1.3 2006/01/31 18:27:22 naga Exp $ # # Author nagatoro @ gmail.com inherit eutils cvs toolchain-funcs #MY_PATCH_DATE="20060117" #"20060106" DESCRIPTION="A gtk port of DC++, using the unmodified DC++ core" HOMEPAGE="linuxdcpp.berlios.de" #SRC_URI="http://dx.homelinux.org/gentoo/portage-overlay/distfiles/linuxdcpp-${MY_PATCH_DATE}.patch.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="" 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 sys-libs/glibc" DEPEND="${RDEPEND} dev-util/scons >=sys-devel/gcc-3.4.0" ECVS_SERVER="cvs.linuxdcpp.berlios.de:/cvsroot/linuxdcpp" ECVS_MODULE="linuxdcpp" S="${WORKDIR}/linuxdcpp" 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 cvs_src_unpack #cd "${S}" #epatch "${DISTDIR}/linuxdcpp-${MY_PATCH_DATE}.patch.bz2" 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; } src_compile() { # Waring message "borrowed" from the enlightenment.eclass # by vapier@gentoo.org eerror "This is a LIVE CVS ebuild." eerror "That means there are NO promises it will work." eerror "If it fails to build, FIX THE CODE YOURSELF" eerror "before reporting any issues." addpredict_from_config if use debug; then scons debug=1 FAKE_ROOT="${D}" PREFIX="${INTO}" || die "scons failed" else scons release=1 FAKE_ROOT="${D}" PREFIX="${INTO}" || die "scons failed" fi } src_install() { addpredict_from_config if use debug; then scons install debug=1 FAKE_ROOT="${D}" PREFIX="${INTO}" || die "scons install failed" else scons install release=1 FAKE_ROOT="${D}" PREFIX="${INTO}" || die "scons install failed" fi }