2 # Copyright (c) 2001, 2002 Steven Knight
4 # Permission is hereby granted, free of charge, to any person obtaining
5 # a copy of this software and associated documentation files (the
6 # "Software"), to deal in the Software without restriction, including
7 # without limitation the rights to use, copy, modify, merge, publish,
8 # distribute, sublicense, and/or sell copies of the Software, and to
9 # permit persons to whom the Software is furnished to do so, subject to
10 # the following conditions:
12 # The above copyright notice and this permission notice shall be included
13 # in all copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
16 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
17 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
30 (head, tail) = os.path.split(sys.argv[0])
36 from distutils.core import setup
37 from distutils.command.install_lib import install_lib
39 class my_install_lib(install_lib):
40 def finalize_options(self):
41 install_lib.finalize_options(self)
42 head = self.install_dir
48 head, tail = os.path.split(head)
49 if tail[:6] == "python":
50 self.install_dir = os.path.join(head, "scons")
51 # Our original packaging scheme placed the build engine
52 # in a private library directory that contained the SCons
53 # version number in the directory name. Here's how this
54 # was supported here. See the Construct file for details
55 # on other files that would need to be changed to support
57 #self.install_dir = os.path.join(head, "scons-__VERSION__")
59 elif tail[:6] == "Python":
60 self.install_dir = os.path.join(head, tail)
65 'version' : "__VERSION__",
66 'packages' : ["SCons",
71 'package_dir' : {'' : 'engine'},
72 'scripts' : ["script/scons"],
73 'cmdclass' : {'install_lib' : my_install_lib}
77 if sys.argv[1] == "bdist_wininst":
78 arguments['data_files'] = [('.', ["script/scons.bat"])]
82 apply(setup, (), arguments)