# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

LICENSE="OWPL-1"
DESCRIPTION="The Open Watcom compiler"
HOMEPAGE="http://www.openwatcom.org"
SRC_URI="http://openwatcom.mirrors.skynet.be/pub/ftp.openwatcom.org/source/open_watcom_${PV}-src.tar.bz2"

KEYWORDS="x86 amd64"
SLOT="0"
IUSE="examples source"

DEPEND="sys-devel/gcc"

RESTRICT="strip"
S=${WORKDIR}

src_compile() {
	./build.sh || die "build.sh failed"
}

src_install() {
	mkdir -p "${D}"/opt
	cp -R rel2 "${D}"/opt/openwatcom
	ln -s binl "${D}"/opt/openwatcom/bin

	use examples || rm -rf "${D}"/opt/openwatcom/samples
	use source || rm -rf "${D}"/opt/openwatcom/src
}