From 98902d34f726fe64d69a344d5e8c77765937b1a3 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Thu, 9 May 2002 19:41:07 +0000 Subject: Add some help to setup.py if distutils isn't installed on the local system. --- README | 52 ++++++++++++++++++++++++++++++++++++++++++++-------- src/CHANGES.txt | 3 +++ src/README.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++------ src/setup.py | 14 ++++++++++++-- 4 files changed, 103 insertions(+), 16 deletions(-) diff --git a/README b/README index 3a3c265..6f2441a 100644 --- a/README +++ b/README @@ -28,11 +28,11 @@ latest version at the SCons download page: http://www.scons.org/download.html -REQUIREMENTS -============ +EXECUTION REQUIREMENTS +====================== -SCons requires Python version 1.5.2 or later. There should be no -other dependencies or requirements to run SCons. +Running SCons requires Python version 1.5.2 or later. There should be +no other dependencies or requirements to run SCons. The default SCons configuration assumes use of the Microsoft Visual C++ compiler suite on WIN32 systems, and assumes a C compiler named 'cc', @@ -42,13 +42,49 @@ You may, of course, override these default values by appropriate configuration of Environment construction variables. +INSTALLATION REQUIREMENTS +========================= + +Building and installing SCons from this package requires the Python +distutils package. The distutils package was not shipped as a standard +part of Python until Python version 1.6, so if your system is running +Python 1.5.2, you may not have distutils installed. If you are running +Python version 1.6 or later, you should be fine. + +NOTE TO RED HAT USERS: All Red Hat Linux versions as late as 7.3 +still ship Python 1.5.2 as the default, so you probably do *not* have +distutils installed, unless you have already done so manually. + +In this case, your options are: + + -- (Optional.) Install from a pre-packaged SCons package that + does not require distutils: + + Red Hat Linux scons-0.08-1.noarch.rpm + + Debian GNU/Linux scons_0.08-1_all.deb + (or use apt-get) + + Windows scons-0.08.win32.exe + + -- (Recommended.) Download the latest distutils package from the + following URL: + + http://www.python.org/sigs/distutils-sig/download.html + + Install the distutils according to the instructions on the page. + You can then proceed to the next section to install SCons from + this package. + + INSTALLATION ============ -To install SCons from this package, you must first populate the -build/scons/ directory. (For an easier way to install SCons, without -having to populate this directory, use the scons-{version}.tar.gz -or scons-{version}.zip package.) +Assuming your system satisfies the installation requirements in +the previous section, install SCons from this package by first +populating the build/scons/ directory. (For an easier way to +install SCons, without having to populate this directory, use the +scons-{version}.tar.gz or scons-{version}.zip package.) If you already have an appropriate version of SCons installed on your system, populate the build/scons/ directory by running: diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 965b7a6..ee716a5 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -16,6 +16,9 @@ RELEASE 0.08 - and a separate Platform() method, for more flexible specification of platform-specific environment changes. + - Updated README instructions and setup.py code to catch an + installation failure from not having distutils installed. + From Anthony Roach: - Add a "multi" keyword argument to Builder creation that specifies diff --git a/src/README.txt b/src/README.txt index b4bd42b..e12eead 100644 --- a/src/README.txt +++ b/src/README.txt @@ -27,11 +27,13 @@ the latest version by checking the SCons download page at: http://www.scons.org/download.html -REQUIREMENTS -============ +EXECUTION REQUIREMENTS +====================== -SCons requires Python version 1.5.2 or later. There should be no -other dependencies or requirements to run SCons. +Running SCons requires Python version 1.5.2 or later. There should be +no other dependencies or requirements to run SCons. (There is, however, +an additional requirement to *install* SCons from this particular +package; see the next section.) The default SCons configuration assumes use of the Microsoft Visual C++ compiler suite on WIN32 systems, and assumes a C compiler named 'cc', @@ -41,11 +43,47 @@ You may, of course, override these default values by appropriate configuration of Environment construction variables. +INSTALLATION REQUIREMENTS +========================= + +Installing SCons from this package requires the Python distutils +package. The distutils package was not shipped as a standard part of +Python until Python version 1.6, so if your system is running Python +1.5.2, you may not have distutils installed. If you are running +Python version 1.6 or later, you should be fine. + +NOTE TO RED HAT USERS: All Red Hat Linux versions as late as 7.3 +still ship Python 1.5.2 as the default, so you probably do *not* have +distutils installed, unless you have already done so manually. + +In this case, your options are: + + -- (Recommended.) Install from a pre-packaged SCons package that + does not require distutils: + + Red Hat Linux scons-__VERSION__-1.noarch.rpm + + Debian GNU/Linux scons___VERSION__-1_all.deb + (or use apt-get) + + Windows scons-__VERSION__.win32.exe + + -- (Optional.) Download the latest distutils package from the + following URL: + + http://www.python.org/sigs/distutils-sig/download.html + + Install the distutils according to the instructions on the page. + You can then proceed to the next section to install SCons from + this package. + + INSTALLATION ============ -To install this package, simply run the provided Python-standard setup -script as follows: +Assuming your system satisfies the installation requirements in the +previous section, install SCons from this package simply by running the +provided Python-standard setup script as follows: # python setup.py install diff --git a/src/setup.py b/src/setup.py index b84f41a..8104e6d 100644 --- a/src/setup.py +++ b/src/setup.py @@ -33,8 +33,18 @@ if head: os.chdir(head) sys.argv[0] = tail -from distutils.core import setup -from distutils.command.install_lib import install_lib +try: + from distutils.core import setup + from distutils.command.install_lib import install_lib +except ImportError: + sys.stderr.write("""Could not import distutils. + +Building or installing SCons from this package requires that the Python +distutils be installed. See the README or README.txt file from this +package for instructions on where to find distutils for installation on +your system, or on how to install SCons from a different package. +""") + sys.exit(1) class my_install_lib(install_lib): def finalize_options(self): -- cgit v0.12