# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils distutils DESCRIPTION="Portato - a GUI for Portage written in Python." HOMEPAGE="http://portato.sourceforge.net" SRC_URI="mirror://sourceforge/portato/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="doc syntax etcproposals" official_syntax=">=dev-python/gnome-python-desktop-2.16.0" inoffical_syntax="||( >=dev-python/pygtksourceview-2.16.0 >=dev-python/gnome-python-desktop-2.16.0 )" used_syntax=$official_syntax DEPEND="doc? (>=dev-python/epydoc-2.0)" RDEPEND="=sys-apps/portage-2.1.2* >=dev-python/pygtk-2.8.6 >=x11-libs/vte-0.12.2 >=gnome-base/libglade-2.5.1 syntax? ( $used_syntax x11-libs/gtksourceview ) etcproposals? (>=app-portage/etcproposals-1.0)" S=${WORKDIR}/${PN} CONFIG_DIR="/etc/${PN}/" DATA_DIR="/usr/share/${PN}/" PLUGIN_DIR="${DATA_DIR}/plugins" apply_sed () { cd ${S}/${PN} sed -i -e "s;^\(VERSION\s*=\s*\).*;\1\"${PV}\";" \ -e "s;^\(CONFIG_DIR\s*=\s*\).*;\1\"${CONFIG_DIR}\";" \ -e "s;^\(DATA_DIR\s*=\s*\).*;\1\"${DATA_DIR}\";" \ -e "s;^\(PLUGIN_DIR\s*=\s*\).*;\1\"${PLUGIN_DIR}\";" \ constants.py } install_plugin() { flag=$1 plugin=$2 if use $flag; then einfo "Installing plugin $plugin.xml" cp plugins/${plugin}.xml ${D}${PLUGIN_DIR} fi } pkg_setup () { if ! built_with_use x11-libs/vte python; then echo eerror "x11-libs/vte has not been built with python support." eerror "Please re-emerge vte with the python use-flag enabled." die "missing python flag for x11-libs/vte" fi } src_install () { (apply_sed) || die "Applying sed-commands failed." dodir ${DATA_DIR} distutils_src_install cd ${S} newbin portato.py portato dodoc doc/* # config dodir ${CONFIG_DIR} cp etc/* ${D}${CONFIG_DIR} # plugins dodir ${PLUGIN_DIR} install_plugin syntax "ebuild_highlight" install_plugin etcproposals "etc_proposals" if use syntax; then insinto "/usr/share/gtksourceview-1.0/language-specs" doins ../gentoo.lang fi # doc if use doc; then epydoc -n Portato --url ${HOMEPAGE} ${PN} dohtml -r html/* fi } pkg_postinst() { if use syntax; then echo einfo "Sorry for having so much gnome dependencies." einfo "They are used by the \"syntax\" useflag, because we need" einfo "a small part of the gnome-python-desktop package." einfo "Blame upstream pygtk for bundling all those small projects" einfo "into a huge one." fi }