summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-11-28 03:30:53 +0000
committerSteven Knight <knight@baldmt.com>2001-11-28 03:30:53 +0000
commitad78319ad3ede8f7065f9c945a3585cad04c3731 (patch)
treebf4e6fb4c27ddbb0d2d2ce54f79f0a8d80c723c1 /src
parentf5b84fd3af7d8e3b3d4570dcf40220c96f67d16e (diff)
downloadscons-ad78319ad3ede8f7065f9c945a3585cad04c3731.tar.gz
Change packaging to the new /usr/lib/scons/ scheme
Diffstat (limited to 'src')
-rw-r--r--src/README.txt55
-rw-r--r--src/engine/README.txt6
-rw-r--r--src/engine/SCons/Script.py5
-rw-r--r--src/script/README.txt6
-rw-r--r--src/script/scons.bat2
-rw-r--r--src/script/scons.py26
-rw-r--r--src/setup.cfg3
-rw-r--r--src/setup.py66
8 files changed, 87 insertions, 82 deletions
diff --git a/src/README.txt b/src/README.txt
index 1539f722..1659437a 100644
--- a/src/README.txt
+++ b/src/README.txt
@@ -23,54 +23,6 @@ the latest version by checking the SCons download page at:
http://www.scons.org/download.html
-ABOUT SCONS PACKAGES
-====================
-
-The complete SCons system is comprised of three separate packages:
-
- scons [THIS PACKAGE]
- The scons script itself, plus the SCons build engine
- installed into an SCons-specific library directory.
-
- python-scons
- The SCons build engine, installed into the standard
- Python library directory.
-
- scons-script
- Only the scons script itself.
-
-Depending on what you want to do with SCons, you may need to install
-additional (or other) packages:
-
- If you just want to use scons (the script) to build software:
-
- Install this package. You do not need to install any other
- packages.
-
- If you do NOT want to use the scons script, but you want to use the
- SCons build engine in other Python software:
-
- Do NOT install this package. Install the python-scons package
- instead.
-
- If you want to use the scons script AND you want to use the SCons
- build engine in other Python software:
-
- Install this package AND install the python-scons package.
-
- Note that this installs two separate copies of the build engine,
- one (in an SCons-specific library directory) used by the scons
- script itself and one (in the standard Python library) used by
- other software. This allows you the flexibility to upgrade
- one build engine without affecting the other.
-
- If you want the scons script and other Python software to use the
- same version of the build engine:
-
- Do NOT install this package. Install the python-scons AND the
- scons-script packages instead.
-
-
INSTALLATION
============
@@ -79,6 +31,11 @@ script as follows:
# python setup.py
+This will install the scons script in the default script directory
+(/usr/bin or C:\Python*\Scripts, for example) and the build engine in an
+appropriate SCons library directory (/usr/lib/scons or C:\Python*\SCons,
+for example).
+
You should have system installation privileges (that is, "root" or
"Administrator") when running the setup.py script.
@@ -153,7 +110,7 @@ Steven Knight
knight at baldmt dot com
http://www.baldmt.com/~knight/
-With more than a little help from:
+With more than a little help from the SCons Development team:
Chad Austin
Charles Crain
Steve Leblanc
diff --git a/src/engine/README.txt b/src/engine/README.txt
index b33fe729..10eb6d1d 100644
--- a/src/engine/README.txt
+++ b/src/engine/README.txt
@@ -1,3 +1,9 @@
+###
+### THIS FILE IS NO LONGER USED. THIS IS THE README FILE FOR THE
+### SEPARATE BUILD ENGINE PACKAGE FROM THE ORIGINAL (DRAFT) PACKAGING
+### SCHEME. WE'RE SAVING THIS IN CASE WE NEED OR WANT TO RESURRECT
+### A SEPARATE BUILD ENGINE PACKAGE IN THE FUTURE.
+###
# Copyright (c) 2001 Steven Knight
# __FILE__ __REVISION__ __DATE__ __DEVELOPER__
diff --git a/src/engine/SCons/Script.py b/src/engine/SCons/Script.py
index 3b81d504..3857df6d 100644
--- a/src/engine/SCons/Script.py
+++ b/src/engine/SCons/Script.py
@@ -497,7 +497,10 @@ def options_init():
help = "Search up directory tree for SConstruct.")
def option_v(opt, arg):
- print "SCons version __VERSION__, by Steven Knight et al."
+ import SCons
+ print "SCons by Steven Knight et al.:"
+ print "\tscript version __VERSION__"
+ print "\tbuild engine version %s" % SCons.__version__
print "Copyright 2001 Steven Knight"
sys.exit(0)
diff --git a/src/script/README.txt b/src/script/README.txt
index 6f1ef715..62a10bbf 100644
--- a/src/script/README.txt
+++ b/src/script/README.txt
@@ -1,3 +1,9 @@
+###
+### THIS FILE IS NO LONGER USED. THIS IS THE README FILE FOR THE
+### SEPARATE SCRIPT PACKAGE FROM THE ORIGINAL (DRAFT) PACKAGING
+### SCHEME. WE'RE SAVING THIS IN CASE WE NEED OR WANT TO RESURRECT
+### A SEPARATE SCRIPT PACKAGE IN THE FUTURE.
+###
# Copyright (c) 2001 Steven Knight
# __FILE__ __REVISION__ __DATE__ __DEVELOPER__
diff --git a/src/script/scons.bat b/src/script/scons.bat
new file mode 100644
index 00000000..ce4faad4
--- /dev/null
+++ b/src/script/scons.bat
@@ -0,0 +1,2 @@
+# __FILE__ __REVISION__ __DATE__ __DEVELOPER__
+@python -c "import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/src/script/scons.py b/src/script/scons.py
index f8ec6a8c..0f4eb0b1 100644
--- a/src/script/scons.py
+++ b/src/script/scons.py
@@ -30,20 +30,26 @@ import sys
import os.path
import os
-#XXX once we migrate to the new scheme of using /usr/lib/scons
-# instead of /usr/lib/scons-X.Y this hardcoding will go away:
-scons_lib_dir = "scons-0.01"
+# Strip the script directory from sys.path() so on case-insensitive
+# (WIN32) systems Python doesn't think that the "scons" script is the
+# "SCons" package. Replace it with our own library directories
+# (version-specific first, in case they installed by hand there,
+# followed by generic) so we pick up the right version of the build
+# engine modules if they're in either directory.
+
+libs = []
-script_dir = sys.path[0]
if os.environ.has_key("SCONS_LIB_DIR"):
- lib_dir = os.environ["SCONS_LIB_DIR"]
-elif script_dir and script_dir != os.curdir:
- (head, tail) = os.path.split(script_dir)
- lib_dir = os.path.join(head, "lib", scons_lib_dir)
+ libs.append = os.environ["SCONS_LIB_DIR"]
+
+if sys.platform == 'win32':
+ libs.extend([ os.path.join(sys.prefix, 'SCons-__VERSION__'),
+ os.path.join(sys.prefix, 'SCons') ])
else:
- lib_dir = os.path.join(os.pardir, "lib", scons_lib_dir)
+ libs.extend([ os.path.join(sys.prefix, 'lib', 'scons-__VERSION__'),
+ os.path.join(sys.prefix, 'lib', 'scons') ])
-sys.path = [lib_dir] + sys.path
+sys.path = libs + sys.path[1:]
import SCons.Script
SCons.Script.main()
diff --git a/src/setup.cfg b/src/setup.cfg
index 94ede1f3..f04ca1bb 100644
--- a/src/setup.cfg
+++ b/src/setup.cfg
@@ -1,2 +1,5 @@
[bdist_rpm]
group = Development/Tools
+
+[bdist_wininst]
+title = SCons - a software construction tool
diff --git a/src/setup.py b/src/setup.py
index f256e227..b132a9e8 100644
--- a/src/setup.py
+++ b/src/setup.py
@@ -38,7 +38,9 @@ from distutils.command.install_lib import install_lib
class my_install_lib(install_lib):
def finalize_options(self):
+ open("/dev/tty", "w").write("lib: self.install_dir = %s\n" % self.install_dir)
install_lib.finalize_options(self)
+ open("/dev/tty", "w").write("lib: self.install_dir = %s\n" % self.install_dir)
head = self.install_dir
while head:
if head == os.sep:
@@ -46,27 +48,47 @@ class my_install_lib(install_lib):
break
else:
head, tail = os.path.split(head)
- open("/dev/tty", 'w').write("head = " + head + "\n")
- if tail[:6] in ["python", "Python"]:
- break
- if head:
- self.install_dir = os.path.join(head, "scons-__VERSION__")
+ if tail[:6] == "python":
+ self.install_dir = os.path.join(head, "scons")
+ # Our original packaging scheme placed the build engine
+ # in a private library directory that contained the SCons
+ # version number in the directory name. Here's how this
+ # was supported here. See the Construct file for details
+ # on other files that would need to be changed to support
+ # this as well.
+ #self.install_dir = os.path.join(head, "scons-__VERSION__")
+ return
+ elif tail[:6] == "Python":
+ self.install_dir = os.path.join(head, tail)
+ return
-setup(name = "scons",
- version = "__VERSION__",
- description = "an Open Source software construction tool",
- long_description = """SCons is an Open Source software construction tool--that is, a build tool; an
+description = \
+"""SCons is an Open Source software construction tool--that is, a build tool; an
improved substitute for the classic Make utility; a better way to build
-software.""",
- author = "Steven Knight",
- author_email = "knight@baldmt.com",
- url = "http://www.scons.org/",
- license = "MIT, freely distributable",
- keywords = "scons, cons, make, build tool, make tool",
- packages = ["SCons",
- "SCons.Node",
- "SCons.Scanner",
- "SCons.Sig"],
- package_dir = {'': 'engine'},
- scripts = ["script/scons"],
- cmdclass = {'install_lib': my_install_lib})
+software."""
+
+keywords = "scons, cons, make, build tool, make tool, software build tool, software construction tool"
+
+arguments = {
+ 'name' : "scons",
+ 'version' : "__VERSION__",
+ 'description' : "an Open Source software construction tool",
+ 'long_description' : description,
+ 'author' : "Steven Knight",
+ 'author_email' : "knight@scons.org",
+ 'url' : "http://www.scons.org/",
+ 'license' : "MIT, freely distributable",
+ 'keywords' : keywords,
+ 'packages' : ["SCons",
+ "SCons.Node",
+ "SCons.Scanner",
+ "SCons.Sig"],
+ 'package_dir' : {'' : 'engine'},
+ 'scripts' : ["script/scons"],
+ 'cmdclass' : {'install_lib' : my_install_lib}
+}
+
+if sys.argv[1] == "bdist_wininst":
+ arguments['data_files'] = [('.', ["script/scons.bat"])]
+
+apply(setup, (), arguments)