www-apps/venus: python-single-r1, EAPI=6, use bsddb3 for berkdb
authorMichał Górny <mgorny@gentoo.org>
Tue, 21 Feb 2017 20:25:34 +0000 (21:25 +0100)
committerMichał Górny <mgorny@gentoo.org>
Tue, 21 Feb 2017 20:32:02 +0000 (21:32 +0100)
profiles/base/package.use.mask
www-apps/venus/files/venus-bsddb3.patch [new file with mode: 0644]
www-apps/venus/venus-20100911-r1.ebuild [moved from www-apps/venus/venus-20100911.ebuild with 51% similarity]

index 69d768385b680cd87927119d74bb874428474f5d..28a7918f756c315964cfac0f2fb6c29079f97cd2 100644 (file)
@@ -330,7 +330,6 @@ app-text/cmigemo emacs
 # dev-lang/python[berkdb] fails with recent multilib sys-libs/db (bug 519584).
 dev-lang/python berkdb
 net-nds/nsscache nssdb
-www-apps/venus test
 
 # Jason Zaman <perfinion@gentoo.org> (08 May 2015)
 # java wrappers fail to build (bug #548858)
diff --git a/www-apps/venus/files/venus-bsddb3.patch b/www-apps/venus/files/venus-bsddb3.patch
new file mode 100644 (file)
index 0000000..b57499c
--- /dev/null
@@ -0,0 +1,39 @@
+Use bsddb3 instead of deprecated python[berkdb]. Patch by Arfrever.
+
+--- a/planet/idindex.py
++++ b/planet/idindex.py
+@@ -13,8 +13,8 @@
+         cache = config.cache_directory()
+         index=os.path.join(cache,'index')
+         if not os.path.exists(index): return None
+-        import dbhash
+-        return dbhash.open(filename(index, 'id'),'w')
++        import bsddb3
++        return bsddb3.hashopen(filename(index, 'id'),'w')
+     except Exception, e:
+         if e.__class__.__name__ == 'DBError': e = e.args[-1]
+         from planet import logger as log
+@@ -35,8 +35,8 @@
+     cache = config.cache_directory()
+     index=os.path.join(cache,'index')
+     if not os.path.exists(index): os.makedirs(index)
+-    import dbhash
+-    index = dbhash.open(filename(index, 'id'),'c')
++    import bsddb3
++    index = bsddb3.hashopen(filename(index, 'id'),'c')
+     try:
+         import libxml2
+--- a/tests/test_idindex.py
++++ b/tests/test_idindex.py
+@@ -67,8 +67,8 @@
+         self.assertEqual(12,len(doc.getElementsByTagName('planet:name')))
+ try:
+-    module = 'dbhash'
++    import bsddb3
+ except ImportError:
+-    planet.logger.warn("dbhash is not available => can't test id index")
++    planet.logger.warn("bsddb3 is not available => can't test id index")
+     for method in dir(idIndexTest):
+         if method.startswith('test_'):  delattr(idIndexTest,method)
similarity index 51%
rename from www-apps/venus/venus-20100911.ebuild
rename to www-apps/venus/venus-20100911-r1.ebuild
index 6e173ba21a54396c36de049b269447aea7619cc3..a3841462f35eea0a208056a603d09067593081f1 100644 (file)
@@ -1,12 +1,11 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI="3"
-PYTHON_DEPEND="2:2.5"
-SUPPORT_PYTHON_ABIS="1"
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
 
-inherit webapp python
+inherit webapp python-single-r1
 
 WEBAPP_MANUAL_SLOT="yes"
 
@@ -19,42 +18,44 @@ KEYWORDS="amd64 x86"
 IUSE="django genshi redland test"
 SLOT="0"
 
-DEPEND="
-               test? ( =dev-lang/python-2*[berkdb] )
-               "
-RDEPEND="django? ( dev-python/django )
-               genshi? ( dev-python/genshi )
-               redland? ( dev-python/rdflib[redland] )
-               dev-python/chardet
-               dev-python/httplib2
-               dev-python/utidylib
-"
-RESTRICT_PYTHON_ABIS="3.*"
+RDEPEND="
+       dev-python/bsddb3[${PYTHON_USEDEP}]
+       dev-python/chardet[${PYTHON_USEDEP}]
+       dev-python/httplib2[${PYTHON_USEDEP}]
+       dev-python/utidylib[${PYTHON_USEDEP}]
+       django? ( dev-python/django[${PYTHON_USEDEP}] )
+       genshi? ( dev-python/genshi[${PYTHON_USEDEP}] )
+       redland? ( dev-python/rdflib[redland,${PYTHON_USEDEP}] )
+       ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 
 S="${WORKDIR}"/${PN}
 
+pkg_setup() {
+       python-single-r1_pkg_setup
+       webapp_pkg_setup
+}
+
 src_prepare() {
-       python_convert_shebangs -r 2 .
+       eapply "${FILESDIR}"/venus-bsddb3.patch
+       eapply_user
+       python_fix_shebang .
 }
 
 src_test() {
-       testing() {
-               PYTHONPATH="build-${PYTHON_ABI}/lib" "$(PYTHON)" runtests.py
-       }
-       python_execute_function testing
+       "${PYTHON}" runtests.py || die
 }
 
 src_install() {
        webapp_src_preinst
 
        dodoc AUTHORS README TODO
-       dohtml -r docs/*
+       dodoc -r docs
 
-       installation() {
-               insinto "$(python_get_sitedir)/${PN}"
-               doins -r *py {filters,planet}
-       }
-       python_execute_function installation
+       python_moduleinto venus
+       python_domodule *.py filters planet
 
        insinto "${MY_APPDIR}"
        doins -r themes
@@ -68,12 +69,7 @@ src_install() {
 }
 
 pkg_postinst() {
-       python_mod_optimize venus
        webapp_pkg_postinst
        elog "Installation instructions can be found at /usr/share/doc/${PF}/html/
                or http://intertwingly.net/code/venus/docs/index.html"
 }
-
-pkg_postrm() {
-       python_mod_cleanup venus
-}