From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- python/which/setup.py | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 python/which/setup.py (limited to 'python/which/setup.py') diff --git a/python/which/setup.py b/python/which/setup.py new file mode 100644 index 000000000..3f6d1072c --- /dev/null +++ b/python/which/setup.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +# Copyright (c) 2002-2005 ActiveState Corp. +# Author: Trent Mick (TrentM@ActiveState.com) + +"""Distutils setup script for 'which'.""" + +import sys +import os +import shutil +from distutils.core import setup + + +#---- support routines + +def _getVersion(): + import which + return which.__version__ + +def _getBinDir(): + """Return the current Python's bindir.""" + if sys.platform.startswith("win"): + bindir = sys.prefix + else: + bindir = os.path.join(sys.prefix, "bin") + return bindir + + +#---- setup mainline + +if sys.platform == "win32": + scripts = [] + binFiles = ["which.exe", "which.py"] +else: + #XXX Disable installing which as a script on non-Windows platforms. + # It can get in the way of the system which. + # + #if os.path.exists("which"): + # os.remove("which") + #shutil.copy2("which.py", "which") + #scripts = ["which"] + binFiles = [] + scripts = [] + +setup(name="which", + version=_getVersion(), + description="a portable GNU which replacement", + author="Trent Mick", + author_email="TrentM@ActiveState.com", + url="http://trentm.com/projects/which/", + license="MIT License", + platforms=["Windows", "Linux", "Mac OS X", "Unix"], + long_description="""\ +This is a GNU which replacement with the following features: + - it is portable (Windows, Linux); + - it understands PATHEXT on Windows; + - it can print all matches on the PATH; + - it can note "near misses" on the PATH (e.g. files that match but + may not, say, have execute permissions; and + - it can be used as a Python module. +""", + keywords=["which", "find", "path", "where"], + + py_modules=['which'], + scripts=scripts, + # Install the Windows script/executable bits as data files with + # distutils chosen scripts install dir on Windows, + # "/Scripts", is just wrong. + data_files=[ (_getBinDir(), binFiles) ], + ) + -- cgit v1.2.3