# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils KEYWORDS="~x86" MY_P=${P/pdc/PDC} DESCRIPTION="A public domain curses library for DOS, OS/2, Win32 and X11" HOMEPAGE="http://pdcurses.sourceforge.net/" SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz" LICENSE="public-domain GPL-2" SLOT="0" IUSE="debug doc examples latin1 neXtaw Xaw3d" DEPEND="virtual/x11 Xaw3d? ( x11-libs/Xaw3d ) neXtaw? ( x11-libs/neXtaw )" RDEPEND="${DEPEND}" S=${WORKDIR}/${MY_P} src_unpack() { unpack ${A} cd "${S}" if ! use examples ; then sed -i \ -e 's/\([a-z]\) demos \([a-z]\)/\1 \2/g' \ -e '/demos/d' \ Makefile.in || die "sed failed" fi if ! use doc ; then sed -i \ -e '/tools/d' \ Makefile.in || die "sed failed" fi # Fixing -jX problems: sed -i \ -e 's/\(PDCurses.man:\)/\1 manext/' \ tools/Makefile.in || die "sed failed" # Fixing soname problem: sed -i \ -e "s/\(\$(LD_RXLIB1)\)/\1 -Wl,-soname,libXcurses.so.${PV%.*}/" \ pdcurses/Makefile.in || die "sed failed" } src_compile() { econf \ $(use_enable debug) \ $(use_enable latin1) \ $(use_with Xaw3d xaw3d) \ $(use_with neXtaw nextaw) \ || die "econf failed" emake || die "emake failed" } src_install() { emake DESTDIR="${D}" install || die "emake install failed" dodoc HISTORY README TODO doman doc/* if use doc ; then doman tools/PDCurses.man fi if use examples ; then insinto /usr/share/${PN}/examples doins -x Makefile* -x *.o demos/* fi }