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

inherit flag-o-matic eutils

DESCRIPTION="LinM is a visaul file manager with many features."
HOMEPAGE="http://kldp.net/projects/mls"

MY_P="${PN}_${PV}-1"
SRC_URI="http://kldp.net/frs/download.php/4508/linm_0.8.1-1.tar.gz"

LICENSE="GPL"

SLOT="0"
KEYWORDS="~x86 ~amd64 ~ppc ~ppc-macos"
IUSE="samba ssl debug"

DEPEND=">=sys-libs/ncurses-5.3
		sys-devel/gettext
		samba? ( >=net-fs/samba-3.0.0 )
		ssl? ( >=dev-libs/openssl-0.9.6 )"

src_unpack() {
	unpack "${MY_P}.tar.gz"
}

src_compile() {
	if use samba ; then
		sambaconf=""
	else
		sambaconf="--disable-samba"
	fi
	if use ssl ; then
		sslconf=""
	else
		sslconf="--disable-sftp"
	fi
	if use debug ; then
		debugconf="--enable-debug"
	else
		debugconf=""
	fi
	econf \
		--prefix=/usr \
		${sambaconf} \
		${sslconf} \
		${debugconf} \
		|| die "could not configure"
	emake || die "emake failed"
}

src_install() {
	make DESTDIR="${D}" install || die "make install failed"
	dodoc AUTHORS INSTALL NEWS README* TODO
}
