# See the README file for an overview of how SCons is built and tested.
#
-# When this gets changed, you also need to change test/option-v.py
-# so it looks for the right string.
-copyright_years = '2001, 2002, 2003, 2004, 2005, 2006, 2007'
+# When this gets changed, you must also change the copyright_years string
+# in QMTest/TestSCons.py so the test scripts look for the right string.
+copyright_years = '2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008'
# This gets inserted into the man pages to reflect the month of release.
-month_year = 'January 2007'
+month_year = 'September 2008'
#
# __COPYRIGHT__
import stat
import string
import sys
+import tempfile
project = 'scons'
-default_version = '0.97.0'
+default_version = '1.0.1'
copyright = "Copyright (c) %s The SCons Foundation" % copyright_years
SConsignFile()
checkpoint = time.strftime('d%Y%m%d', time.localtime(time.time()))
elif checkpoint == 'r':
checkpoint = 'r' + revision
- version = version + checkpoint
+ version = version + '.' + checkpoint
+
+svn_status = None
+svn_status_lines = []
if svn:
svn_status = os.popen("%s status --verbose 2> /dev/null" % svn, "r").read()
svn_status_lines = svn_status[:-1].split('\n')
-else:
- svn_status_lines = []
build_id = ARGUMENTS.get('BUILD_ID')
if build_id is None:
platform = distutils.util.get_platform()
+# Re-exporting LD_LIBRARY_PATH is necessary if the Python version was
+# built with the --enable-shared option.
+
ENV = { 'PATH' : os.environ['PATH'] }
-for key in ['LOGNAME', 'PYTHONPATH']:
+for key in ['LOGNAME', 'PYTHONPATH', 'LD_LIBRARY_PATH']:
if os.environ.has_key(key):
ENV[key] = os.environ[key]
"The default is whatever hostname is returned " +
"by socket.gethostname()."),
- ("CHECKPOINT=", "The specific checkpoint release being packaged. " +
- "This will be appended to the VERSION string. " +
+ ("CHECKPOINT=", "The specific checkpoint release being packaged, " +
+ "which will be appended to the VERSION string. " +
"A value of CHECKPOINT=d will generate a string " +
- "of 'd' plus today's date in the format YYYMMDD." +
+ "of 'd' plus today's date in the format YYYMMDD. " +
"A value of CHECKPOINT=r will generate a " +
- "string of 'r' plus the Subversion revision number. " +
- "Any other CHECKPOINT= string will be used as is." +
- "There is no default value."),
+ "string of 'r' plus the Subversion revision " +
+ "number. Any other CHECKPOINT= string will be " +
+ "used as is. There is no default value."),
("DATE=", "The date string representing when the packaging " +
"build occurred. The default is the day and time " +
indent_fmt = ' %-26s '
-Help("""
+Help("""\
The following aliases build packages of various types, and unpack the
contents into build/test-$PACKAGE subdirectories, which can be used by the
runtest.py -p option to run tests against what's been actually packaged:
},
}
-# The RPM spec file we generate will just execute "python", not
-# necessarily the one in sys.executable. If that version of python has
-# a distutils that knows about Python eggs, then setup.py will generate
-# a .egg-info file. Check for whether or not to add it to the expected
-# RPM files by executing "python" in a subshell.
+# Figure out the name of a .egg-info file that might be generated
+# as part of the RPM package. There are two complicating factors.
+#
+# First, the RPM spec file we generate will just execute "python", not
+# necessarily the one in sys.executable. If *that* version of python has
+# a distutils that knows about Python eggs, then setup.py will generate a
+# .egg-info file, so we have to execute any distutils logic in a subshell.
+#
+# Second, we can't just have the subshell check for the existence of the
+# distutils.command.install_egg_info module and generate the expected
+# file name by hand, the way we used to, because different systems can
+# have slightly different .egg-info naming conventions. (Specifically,
+# Ubuntu overrides the default behavior to remove the Python version
+# string from the .egg-info file name.) The right way to do this is to
+# actually call into the install_egg_info() class to have it generate
+# the expected name for us.
+#
+# This is all complicated enough that we do it by writing an in-line
+# script to a temporary file and then feeding it to a separate invocation
+# of "python" to tell us the actual name of the generated .egg-info file.
-cmd = "python -c 'import distutils.command.install_egg_info' > /dev/null 2>&1"
-import_egg_error = os.system(cmd)
+print_egg_info_name = """
+try:
+ from distutils.dist import Distribution
+ from distutils.command.install_egg_info import install_egg_info
+except ImportError:
+ pass
+else:
+ dist = Distribution({'name' : "scons", 'version' : '%s'})
+ i = install_egg_info(dist)
+ i.finalize_options()
+ import os.path
+ print os.path.split(i.outputs[0])[1]
+""" % version
-if not import_egg_error:
- egg_info_file = 'scons-' + version + '.egg-info'
- python_scons['extra_rpm_files'].append(egg_info_file)
+try:
+ fd, tfname = tempfile.mkstemp()
+ tfp = os.fdopen(fd, "w")
+ tfp.write(print_egg_info_name)
+ tfp.close()
+ egg_info_file = os.popen("python %s" % tfname).read()[:-1]
+ if egg_info_file:
+ python_scons['extra_rpm_files'].append(egg_info_file)
+finally:
+ try:
+ os.unlink(tfname)
+ except EnvironmentError:
+ pass
#
# The original packaging scheme would have have required us to push
distutils_targets = [ win32_exe ]
- Local(env.Install('$DISTDIR', distutils_targets))
+ dist_distutils_targets = env.Install('$DISTDIR', distutils_targets)
+ Local(dist_distutils_targets)
+ AddPostAction(dist_distutils_targets, Chmod(dist_distutils_targets, 0644))
- if gzip:
+ if not gzip:
+ print "gzip not found; skipping .tar.gz package for %s." % pkg
+ else:
distutils_formats.append('gztar')
dist_tar_gz = env.Install('$DISTDIR', tar_gz)
dist_platform_tar_gz = env.Install('$DISTDIR', platform_tar_gz)
Local(dist_tar_gz, dist_platform_tar_gz)
+ AddPostAction(dist_tar_gz, Chmod(dist_tar_gz, 0644))
+ AddPostAction(dist_platform_tar_gz, Chmod(dist_platform_tar_gz, 0644))
#
# Unpack the tar.gz archive created by the distutils into
bytes))
env.Command(digest, tar_gz, Digestify)
- if zipit:
+ if not zipit:
+ print "zip not found; skipping .zip package for %s." % pkg
+ else:
distutils_formats.append('zip')
dist_zip = env.Install('$DISTDIR', zip)
dist_platform_zip = env.Install('$DISTDIR', platform_zip)
Local(dist_zip, dist_platform_zip)
+ AddPostAction(dist_zip, Chmod(dist_zip, 0644))
+ AddPostAction(dist_platform_zip, Chmod(dist_platform_zip, 0644))
#
# Unpack the zip archive created by the distutils into
dist_noarch_rpm = env.Install('$DISTDIR', noarch_rpm)
dist_src_rpm = env.Install('$DISTDIR', src_rpm)
Local(dist_noarch_rpm, dist_src_rpm)
+ AddPostAction(dist_noarch_rpm, Chmod(dist_noarch_rpm, 0644))
+ AddPostAction(dist_src_rpm, Chmod(dist_src_rpm, 0644))
dfiles = map(lambda x, d=test_rpm_dir: os.path.join(d, 'usr', x),
dst_files)
dist_local_tar_gz = os.path.join("$DISTDIR/%s.tar.gz" % s_l_v)
dist_local_zip = os.path.join("$DISTDIR/%s.zip" % s_l_v)
+ AddPostAction(dist_local_tar_gz, Chmod(dist_local_tar_gz, 0644))
+ AddPostAction(dist_local_zip, Chmod(dist_local_zip, 0644))
commands = [
Delete(build_dir_local),
# source archive from the project files and files in the change.
#
-if svn_status:
+if not svn_status:
+ "Not building in a Subversion tree; skipping building src package."
+else:
slines = filter(lambda l: l[0] in ' MA', svn_status_lines)
sentries = map(lambda l: l.split()[-1], slines)
sfiles = filter(os.path.isfile, sentries)