# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils S=${WORKDIR}/${PN} # Added cos to use-flags to pass it on the configure file IUSE="cos ecn Xaw3d neXtaw" DESCRIPTION="nist net - network emulation package" HOMEPAGE="http://www.cablespeed.com/~tmolina/index.html" SRC_URI="http://www.cablespeed.com/~tmolina/nistnet.2.4.1.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" DEPEND="virtual/x11 Xaw3d? ( x11-libs/Xaw3d ) neXtaw? ( x11-libs/neXtaw )" pkg_setup() { einfo "cos use flags enable Class Of Service and ecn enable Explicit Congestion Support" if ( use Xaw3d && use neXtaw ); then einfo "You need to select only one Widget, ie Xaw3d OR neXtaw" && die fi if ! ( use Xaw3d || use neXtaw ); then einfo "You need to select at least one Widget, ie Xaw3d OR neXtaw" && die fi } src_unpack() { unpack ${A} cd ${WORKDIR} # Patch makefile epatch ${FILESDIR}/${P}-gentoo.diff || die "epatch failed" # we need to setup for xaw3d or neXtaw. Assume xaw3d is default so no need to change it. if use neXtaw; then cd ${S} sed -i -e 's/lXaw3d/lneXtaw/g' configure || die "sed failed" cd monitor sed -i -e 's/lXaw3d/lneXtaw/g' Imakefile || die "sed failed" fi # Patch Config if use ecn; then cd ${S} sed -i -e 's/# -DCONFIG_ECN/-DCONFIG_ECN/g' Config || die "sed failed" fi if use cos; then cd ${S} sed -i -e 's/# -DCONFIG_COS/-DCONFIG_COS/g' Config || die "sed failed" fi } src_compile() { cd ${S} econf || die emake || die } src_install () { mkdir ${DESTDIR}dev/ make DESTDIR=${D} install || die dodoc ChangeLog doc/* doc/htmldocs/* doc/htmldocs/slides/* }