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

EAPI=4
inherit prefix

DESCRIPTION="Programmable Completion for bash"
HOMEPAGE="http://bash-completion.alioth.debian.org"
SRC_URI="http://bash-completion.alioth.debian.org/files/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris"
IUSE="test"

DEPEND="test? ( dev-util/dejagnu dev-tcltk/tcllib )"
RDEPEND=">=app-shells/bash-4.1"
PDEPEND="app-shells/gentoo-bashcomp"

src_install() {
	emake install DESTDIR="${D}"
	dodoc AUTHORS CHANGES README
}

pkg_postinst() {
	elog "Any user can enable a command completion without editing their"
	elog ".bashrc by running:"
	elog
	elog "    eselect bashcomp enable "
	elog
	elog "The system administrator can also enable this globally with"
	elog
	elog "    eselect bashcomp enable --global "
	elog
	elog "Make sure you at least enable the base module! Additional completion"
	elog "modules can be found by running"
	elog
	elog "    eselect bashcomp list"
	elog
	elog "If you use non-login shells you still need to source"
	elog "/etc/profile.d/bash-completion.sh in your ~/.bashrc."
}