From 3c4b305871a4e83fc0995dc8701acbe8b0955b5c Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sun, 7 Feb 2010 20:11:57 +0100 Subject: added mimeo package (easy file opening) --- x11-misc/mimeo/Manifest | 5 +++++ x11-misc/mimeo/files/__init__.py | 2 ++ x11-misc/mimeo/files/mimeo | 37 +++++++++++++++++++++++++++++++++++++ x11-misc/mimeo/files/mimeo-2.6 | 5 +++++ x11-misc/mimeo/mimeo-0.2.ebuild | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 82 insertions(+) create mode 100644 x11-misc/mimeo/Manifest create mode 100644 x11-misc/mimeo/files/__init__.py create mode 100644 x11-misc/mimeo/files/mimeo create mode 100644 x11-misc/mimeo/files/mimeo-2.6 create mode 100644 x11-misc/mimeo/mimeo-0.2.ebuild (limited to 'x11-misc/mimeo') diff --git a/x11-misc/mimeo/Manifest b/x11-misc/mimeo/Manifest new file mode 100644 index 0000000..9d87400 --- /dev/null +++ b/x11-misc/mimeo/Manifest @@ -0,0 +1,5 @@ +AUX __init__.py 45 RMD160 d38bc869fd2d0b34998652bd03118078b0bc09a6 SHA1 3f02bc2f13bf90298d44d03cc6d69758a2f13e9c SHA256 76fe1a367ae5be73f6236f6db887ec0ebf0af4e51da4d7a40c580697caf7add7 +AUX mimeo 1185 RMD160 ead58ddbd11eefaa2bf5c0cb96846fc59ad13aa4 SHA1 5549e58a0b1de7cab4787c118dd09ccbcb768430 SHA256 c1424b777b5c3e337ece5a4c3ca24963bba7c0da660d9c010d318c675f131395 +AUX mimeo-2.6 81 RMD160 1cbac8984c999443a4175c168336bffe3b2eb573 SHA1 562919f424f7650a2d98bcfc0b1c3704bca57f8d SHA256 453d912b08729d6d4979ac21707d0a093828600d3f2b25ee3aade285c2a4b326 +DIST mimeo-0.2.tar.gz 8905 RMD160 839020ae6e0c57e4f9fef8cb13f1c4574435aa30 SHA1 b12d067817f4df5c823a42558626b79926c1daa6 SHA256 083f2fced3203d804f54dc3a2e7e8113d40995f483fc5f2a18980d4a5c90d5c0 +EBUILD mimeo-0.2.ebuild 669 RMD160 2467963221658d384166e2d24d76b0e6979b185e SHA1 c472fb253d037090b6440bd6b107ada6e65a38cc SHA256 6f0f5803b9284e028c6da12b00f451682a2d7dd9773c3923de57fe623cf1f170 diff --git a/x11-misc/mimeo/files/__init__.py b/x11-misc/mimeo/files/__init__.py new file mode 100644 index 0000000..eae587c --- /dev/null +++ b/x11-misc/mimeo/files/__init__.py @@ -0,0 +1,2 @@ +#!/usr/bin/env python +from mimeo import main diff --git a/x11-misc/mimeo/files/mimeo b/x11-misc/mimeo/files/mimeo new file mode 100644 index 0000000..4c4fff4 --- /dev/null +++ b/x11-misc/mimeo/files/mimeo @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# Gentoo 'mimeo' wrapper script + +import os +import re +import subprocess +import sys + +EPYTHON_re = re.compile(r"^python(\d+\.\d+)$") + +try: + eselect_process = subprocess.Popen(["/usr/bin/eselect", "python", "show", "--python2"], stdout=subprocess.PIPE) + if eselect_process.wait() != 0: + raise ValueError +except (OSError, ValueError): + sys.stderr.write("Execution of 'eselect python show --python2' failed\n") + sys.exit(1) + +eselect_output = eselect_process.stdout.read() +if not isinstance(eselect_output, str): + # Python 3 + eselect_output = eselect_output.decode() + +EPYTHON_matched = EPYTHON_re.match(eselect_output) +if EPYTHON_matched: + PYTHON_ABI = EPYTHON_matched.group(1) +else: + sys.stderr.write("'eselect python show --python2' printed unrecognized value '%s" % eselect_output) + sys.exit(1) + +os.environ["PYTHON_PROCESS_NAME"] = sys.argv[0] +target_executable = "%s-%s" % (os.path.realpath(sys.argv[0]), PYTHON_ABI) +if not os.path.exists(target_executable): + sys.stderr.write("'%s' does not exist\n" % target_executable) + sys.exit(1) + +os.execv(target_executable, sys.argv) diff --git a/x11-misc/mimeo/files/mimeo-2.6 b/x11-misc/mimeo/files/mimeo-2.6 new file mode 100644 index 0000000..5e86b20 --- /dev/null +++ b/x11-misc/mimeo/files/mimeo-2.6 @@ -0,0 +1,5 @@ +#!/usr/bin/env python +# Gentoo 'mimeo' wrapper script +import mimeo + +mimeo.main() diff --git a/x11-misc/mimeo/mimeo-0.2.ebuild b/x11-misc/mimeo/mimeo-0.2.ebuild new file mode 100644 index 0000000..b04556f --- /dev/null +++ b/x11-misc/mimeo/mimeo-0.2.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit python + +DESCRIPTION="open files using mimetype associations" +HOMEPAGE="http://xyne.archlinux.ca/info/mimeo" +SRC_URI="http://xyne.archlinux.ca/src/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86" +IUSE="" + +src_install() { + insinto $(python_get_sitedir)/${PN} + newins mimeo/mimeo mimeo.py + doins ${FILESDIR}/__init__.py + + exeinto /usr/bin + doexe ${FILESDIR}/mimeo + doexe ${FILESDIR}/mimeo-2.6 +} + +pkg_postinst() { + python_mod_optimize $(python_get_sitedir)/${PN} +} + + +pkg_postrm() { + python_mod_cleanup $(python_get_sitedir)/${PN} +} -- cgit v1.2.3