--- asciidoc-8.6.8.ebuild 2012-12-27 20:09:35.000000000 +0100 +++ asciidoc-8.6.8-r1.ebuild 2013-02-23 00:33:51.144453285 +0100 @@ -2,13 +2,12 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-text/asciidoc/asciidoc-8.6.8.ebuild,v 1.2 2012/12/27 19:09:35 ottxor Exp $ -EAPI="3" +EAPI=5 -PYTHON_DEPEND="2:2.5" -RESTRICT_PYTHON_ABIS="3.*" +PYTHON_COMPAT=( python{2_5,2_6,2_7} pypy{1_9,2_0} ) [ "$PV" == "9999" ] && inherit mercurial autotools -inherit python +inherit python-r1 DESCRIPTION="A text document format for writing short documents, articles, books and UNIX man pages" HOMEPAGE="http://www.methods.co.nz/asciidoc/" @@ -29,14 +28,16 @@ RDEPEND=">=app-text/docbook-xsl-styleshe dev-libs/libxslt graphviz? ( media-gfx/graphviz ) app-text/docbook-xml-dtd:4.5 - highlight? ( || ( dev-python/pygments dev-util/source-highlight ) ) + highlight? ( || ( dev-python/pygments[${PYTHON_USEDEP}] dev-util/source-highlight ) ) + ${PYTHON_DEPS} " DEPEND="test? ( dev-util/source-highlight media-sound/lilypond media-gfx/imagemagick dev-texlive/texlive-latex app-text/dvipng - media-gfx/graphviz ) + media-gfx/graphviz + ${PYTHON_DEPS} ) " if [ "$PV" == "9999" ]; then @@ -46,10 +47,6 @@ if [ "$PV" == "9999" ]; then dev-util/source-highlight" fi -pkg_setup() { - python_set_active_version 2 -} - src_prepare() { if ! use vim-syntax; then sed -i -e '/^install/s/install-vim//' Makefile.in || die @@ -68,6 +65,8 @@ src_prepare() { } src_configure() { + python_export_best + econf --sysconfdir="${EPREFIX}"/usr/share } @@ -75,32 +74,38 @@ src_compile() { default if [ "$PV" == "9999" ]; then - ( cd doc && aap -f main.aap ../{CHANGELOG,README,BUGS} ) + cd doc || die + aap -f main.aap ../{CHANGELOG,README,BUGS} || die fi } src_install() { use vim-syntax && dodir /usr/share/vim/vimfiles - emake DESTDIR="${D}" install || die "install failed" + emake DESTDIR="${D}" install - python_convert_shebangs -r 2 "${D}" + python_replicate_script "${ED}"/usr/bin/*.py if use examples; then # This is a symlink to a directory rm examples/website/images || die - insinto /usr/share/doc/${PF} - doins -r examples || die - dosym ../../../asciidoc/images /usr/share/doc/${PF}/examples || die + dodoc -r examples + docompress -x /usr/share/doc/${PF}/examples + dosym ../../../asciidoc/images /usr/share/doc/${PF}/examples fi dodoc BUGS CHANGELOG README docbook-xsl/asciidoc-docbook-xsl.txt \ - dblatex/dblatex-readme.txt filters/code/code-filter-readme.txt || die + dblatex/dblatex-readme.txt filters/code/code-filter-readme.txt +} + +python_test() { + local -x ASCIIDOC_PY=../asciidoc.py + "${PYTHON}" test${PN}.py update || die "Tests fail with ${EPYTHON}" + "${PYTHON}" test${PN}.py run || die "Tests fail with ${EPYTHON}" } src_test() { cd tests || die - ASCIIDOC_PY=../asciidoc.py "$(PYTHON)" test${PN}.py update || die - ASCIIDOC_PY=../asciidoc.py "$(PYTHON)" test${PN}.py run || die + python_foreach_impl python_test }