2 # Copyright (c) 2002-2005 ActiveState Corp.
3 # Author: Trent Mick (TrentM@ActiveState.com)
5 """Distutils setup script for 'which'."""
10 from distutils
.core
import setup
13 #---- support routines
17 return which
.__version
__
20 """Return the current Python's bindir."""
21 if sys
.platform
.startswith("win"):
24 bindir
= os
.path
.join(sys
.prefix
, "bin")
30 if sys
.platform
== "win32":
32 binFiles
= ["which.exe", "which.py"]
34 #XXX Disable installing which as a script on non-Windows platforms.
35 # It can get in the way of the system which.
37 #if os.path.exists("which"):
39 #shutil.copy2("which.py", "which")
45 version
=_getVersion(),
46 description
="a portable GNU which replacement",
48 author_email
="TrentM@ActiveState.com",
49 url
="http://trentm.com/projects/which/",
50 license
="MIT License",
51 platforms
=["Windows", "Linux", "Mac OS X", "Unix"],
53 This is a GNU which replacement with the following features:
54 - it is portable (Windows, Linux);
55 - it understands PATHEXT on Windows;
56 - it can print <em>all</em> matches on the PATH;
57 - it can note "near misses" on the PATH (e.g. files that match but
58 may not, say, have execute permissions; and
59 - it can be used as a Python module.
61 keywords
=["which", "find", "path", "where"],
65 # Install the Windows script/executable bits as data files with
66 # distutils chosen scripts install dir on Windows,
67 # "<prefix>/Scripts", is just wrong.
68 data_files
=[ (_getBinDir(), binFiles
) ],