commit:     55f34a44a67fd5b299bf909078e63b70deb3ebaf
Author:     Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 11 22:50:39 2016 +0000
Commit:     Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sun Dec 11 22:52:58 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55f34a44

dev-util/aap: install like a normal python module

 dev-util/aap/aap-1.091-r3.ebuild                  | 51 +++++++++++++++++++++++
 dev-util/aap/files/aap-1.091-module-install.patch | 26 ++++++++++++
 2 files changed, 77 insertions(+)

diff --git a/dev-util/aap/aap-1.091-r3.ebuild b/dev-util/aap/aap-1.091-r3.ebuild
new file mode 100644
index 00000000..be196aa
--- /dev/null
+++ b/dev-util/aap/aap-1.091-r3.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-single-r1
+
+DESCRIPTION="Bram Moolenaar's super-make program"
+HOMEPAGE="http://www.a-a-p.org/";
+SRC_URI="mirror://sourceforge/a-a-p/${P}.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ia64 ~mips ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux 
~ppc-macos"
+IUSE="doc"
+
+DEPEND="app-arch/unzip"
+RDEPEND="${PYTHON_DEPS}"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+S=${WORKDIR}
+
+PATCHES=( "${FILESDIR}"/${P}-module-install.patch )
+
+src_test() {
+       "${PYTHON}" aap || die "tests failed"
+       rm -r AAPDIR || die
+}
+
+src_install() {
+       rm -r rectest unittest test.aap || die
+       rm doc/*.sgml doc/*.pdf COPYING README.txt || die
+       if use doc; then
+               docinto html
+               dodoc -r doc/*.html doc/images
+       fi
+       rm -r doc/*.html doc/images || die
+
+       docinto /
+       dodoc doc/*
+       doman aap.1
+       rm -r doc aap.1 || die
+
+       python_doscript aap
+       rm aap aap.py aap.bat || die
+
+       python_moduleinto aap
+       python_domodule .
+}

diff --git a/dev-util/aap/files/aap-1.091-module-install.patch 
b/dev-util/aap/files/aap-1.091-module-install.patch
new file mode 100644
index 00000000..73cf353
--- /dev/null
+++ b/dev-util/aap/files/aap-1.091-module-install.patch
@@ -0,0 +1,26 @@
+Allow aap to be installed like a normal python module.
+
+--- aap-1.091/aap
++++ aap-1.091/aap
+@@ -7,8 +7,8 @@
+ 
+ # This simply calls the main() function in the Main.py module.
+ 
+-import Main
++from aap import Main
+ 
+-Main.main()
++Main.main(1)
+ 
+ # vim: set sw=4 sts=4 tw=79 fo+=l:
+--- aap-1.091/Main.py
++++ aap-1.091/Main.py
+@@ -168,7 +168,7 @@
+     if setroot:
+         # We need to know the location of our modules (find ccskim there).
+         try:
+-            progname = os.path.realpath(sys.argv[0])
++            progname = os.path.realpath(__file__)
+         except:
+             # Doesn't have os.path.realpath(), it's new in Python 2.2
+             # Use our copy of it.

Reply via email to