--- sympy-0.5.10.ebuild 2008-01-05 19:50:52.000000000 +0100 +++ sympy-0.5.10.ebuild.new 2008-01-05 19:49:52.000000000 +0100 @@ -4,9 +4,9 @@ NEED_PYTHON=2.4 -inherit distutils python multilib +inherit eutils distutils python multilib -DESCRIPTION="Python library for symbolic mathematics" +DESCRIPTION="Python library for symbolic mathematics." HOMEPAGE="http://code.google.com/p/sympy/" SRC_URI="http://sympy.googlecode.com/files/${P}.tar.gz" @@ -14,21 +14,15 @@ LICENSE="BSD" KEYWORDS="~amd64 ~x86" -IUSE="examples mathml gtk latex plot test" +IUSE="examples math gtk latex plot test" -RDEPEND="mathml? ( +RDEPEND="math? ( dev-libs/libxml2 dev-libs/libxslt - ) - gtk? ( - !mathml? ( - dev-libs/libxml2 - dev-libs/libxslt - ) - x11-libs/gtkmathview + gtk? ( x11-libs/gtkmathview ) ) latex? ( - virtual/tetex + virtual/latex-base app-text/dvipng >=dev-python/pexpect-2.0 ) @@ -40,10 +34,8 @@ DEPEND="test? ( >=dev-python/py-0.9.0 ) ${RDEPEND}" -PYTHON_MODNAME="sympy" - pkg_setup() { - if use mathml || use gtk ; then + if use math ; then if ! built_with_use "dev-libs/libxml2" python ; then eerror "dev-libs/libxml2 has to be compiled with 'python' USE-flag." die "Needed USE-flag for dev-libs/libxml2 not found." @@ -53,16 +45,18 @@ eerror "dev-libs/libxslt has to be compiled with 'python' USE-flag." die "Needed USE-flag for dev-libs/libxslt not found." fi - fi - if use gtk ; then - if ! built_with_use "x11-libs/gtkmathview" gtk ; then + if use gtk && ! built_with_use "x11-libs/gtkmathview" gtk ; then eerror "x11-libs/gtkmathview has to be compiled with 'gtk' USE-flag." die "Needed USE-flag for x11-libs/gtkmathview not found." fi fi } +src_test() { + PYTHONPATH=build/lib/ "${python}" setup.py test || die "Unit tests failed!" +} + src_install() { distutils_src_install @@ -78,39 +72,20 @@ doins -r sympy/thirdparty/pyglet } -src_test() { - PYTHONPATH=build/lib/ "${python}" setup.py test || die "Unit tests failed!" -} - pkg_postinst() { - python_version - - python_mod_optimize ${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/sympy/ - if ! has_version ">=dev-python/ipython-0.7.2" ; then elog elog "IPython 0.7.2 (or better) wasn't found on your system. It is" - elog "highly recommended that you install this package to optimize" - elog "your work with SymPy. To do so, you can run:" + elog "highly recommended to install this package to optimize your" + elog "work with SymPy. To do so, you can run:" elog elog " emerge '>=dev-python/ipython-0.7.2'" + elog fi - - elog - elog "SymPy comes with a console that is a simple wrapper around the" - elog "classic python console (or ipython when available) that loads" - elog "the sympy namespace and executes some common commands for you." - elog - elog "To start it, issue:" - elog - elog " isympy" - elog - elog "For a brief introduction to SymPy visit:" - elog - elog " http://code.google.com/p/sympy/wiki/Tutorial" - elog } pkg_postrm() { - python_mod_cleanup + if use examples ; then + python_mod_cleanup /usr/share/doc/${PF} + fi }