-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI=6
PYTHON_COMPAT=( python2_7 )
DISTUTILS_SINGLE_IMPL=1
KEYWORDS="~amd64 ~x86"
IUSE="bazaar cvs mercurial monotone subversion"
-DEPEND="app-text/asciidoc[${PYTHON_USEDEP}]
+DEPEND="
+ app-text/asciidoc
app-text/xmlto
dev-python/PyQt4[${PYTHON_USEDEP}]
bazaar? ( dev-vcs/bzr[${PYTHON_USEDEP}] )
S="${WORKDIR}/${PN}"
-pkg_setup() {
- python-single-r1_pkg_setup
-}
-
-src_prepare() {
- distutils-r1_src_prepare
+python_prepare_all() {
+ # support for git requires cogito which isn't in portage
+ rm qctlib/vcs/{p4,git,cg}.py || die
- rm qctlib/vcs/p4.py
+ declare -A delfiles=([bazaar]=bzr [cvs]=cvs [mercurial]=hg [monotone]=mtn [subversion]=svn)
+ local i
+ for i in "${!delfiles[@]}"; do
+ if ! use $i; then
+ rm qctlib/vcs/${delfiles[$i]}.py || die
+ fi
+ done
- # support for git requires cogito which isn't in portage
- rm qctlib/vcs/git.py
- rm qctlib/vcs/cg.py
-
- use bazaar || rm qctlib/vcs/bzr.py
- use cvs || rm qctlib/vcs/cvs.py
- use mercurial || rm qctlib/vcs/hg.py
- use monotone || rm qctlib/vcs/mtn.py
- use subversion || rm qctlib/vcs/svn.py
+ distutils-r1_python_prepare_all
}
-src_install() {
- distutils-r1_src_install
-
+python_compile_all() {
# manpage and html docs are built using asciidoc
- make -C doc man html || die
- doman doc/qct.1 || die
- dohtml doc/qct.1.html || die
+ emake -C doc man html
+ HTML_DOCS=( doc/qct.1.html )
+}
+
+python_install_all() {
+ doman doc/qct.1
if use bazaar; then
- insinto "$(python_get_sitedir)/bzrlib/plugins"
- doins plugins/qctBzrPlugin.py
+ python_moduleinto bzrlib/plugins
+ python_domodule plugins/qctBzrPlugin.py
fi
if use mercurial; then
- insinto "$(python_get_sitedir)/hgext"
- doins hgext/qct.py
+ python_moduleinto hgext
+ python_domodule hgext/qct.py
+
insinto /etc/mercurial/hgrc.d
doins "${FILESDIR}/qct.rc"
fi
+
+ distutils-r1_python_install_all
}