1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 SUPPORT_PYTHON_ABIS="1"
7 RESTRICT_PYTHON_ABIS="2.5 *-jython"
9 DB_COMMIT="bdf02cbf0a8d017c6c1bddeffd6f03d5d90695ed"
10 DB_DIR="rafaelmartins-${PN}-db-${DB_COMMIT:0:7}"
12 inherit distutils eutils
14 DESCRIPTION="A tool that generates and installs ebuilds for Octave-Forge"
15 HOMEPAGE="https://github.com/rafaelmartins/g-octave"
17 SRC_URI="mirror://github/rafaelmartins/${PN}/${P}.tar.gz
18 https://github.com/rafaelmartins/${PN}-db/tarball/${DB_COMMIT} ->
19 ${PN}-db-${DB_COMMIT:0:7}.tar.gz"
23 KEYWORDS="~amd64 ~x86"
26 DEPEND="doc? ( >=dev-python/sphinx-1.0 )"
27 RDEPEND="sys-apps/portage"
29 PYTHON_MODNAME="g_octave"
33 epatch "${FILESDIR}/${P}-add_cave_support.patch"
34 epatch "${FILESDIR}/${P}-fix-sourceforge-svn-root.patch"
35 epatch "${FILESDIR}/${P}-fix-Makefile.patch"
36 sed -i -e 's/^has_fetch.*$/has_fetch = False/' scripts/g-octave \
37 || die 'failed to patch the g-octave main script'
43 emake -C docs html || die 'failed to compile the documentation.'
49 dohtml ${PN}.html || die 'dohtml failed.'
50 doman ${PN}.1 || die 'doman failed.'
52 mv docs/_build/{html,sphinx} || die 'mv failed.'
53 dohtml -r docs/_build/sphinx || die 'dohtml failed.'
59 PYTHONPATH="build-${PYTHON_ABI}/lib" "$(PYTHON)" \
60 scripts/run_tests.py || die 'test failed.'
62 python_execute_function testing
66 distutils_pkg_postinst
68 elog 'To be able to use g-octave with the shipped package database, please'
69 elog 'edit your configuration file, clean your db directory and run:'
70 elog " emerge --config =${PF}"
72 elog "If you are upgrading from =${PN}-0.3, please read this:"
73 elog "http://g-octave.readthedocs.org/en/latest/upgrading/#from-0-3-to-0-4"
75 elog 'Please install the package manager that you want to use before run g-octave'
80 local db="$(g-octave --config db)"
82 einfo "Extracting g-octave database files to: ${db}"
83 tar -xzf "${DISTDIR}/${PN}-db-${DB_COMMIT:0:7}.tar.gz" -C "${db}" || die 'tar failed.'
84 rm -rf "${db}"/{patches,octave-forge,info.json,manifest.json,timestamp}
85 mv -f "${db}/${DB_DIR}"/* "${db}" || die 'mv failed.'
86 rm -rf "${db}/${DB_DIR}"