setup.py revision 1401
0N/A# The contents of this file are subject to the terms of the 0N/A# Common Development and Distribution License (the "License"). 0N/A# You may not use this file except in compliance with the License. 0N/A# See the License for the specific language governing permissions 0N/A# and limitations under the License. 0N/A# When distributing Covered Code, include this CDDL HEADER in each 0N/A# If applicable, add the following below this CDDL HEADER, with the 0N/A# fields enclosed by brackets "[]" replaced with your own identifying 0N/A# information: Portions Copyright [yyyy] [name of copyright owner] 0N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 0N/A# Use is subject to license terms. 0N/A# 3rd party software required for the build 0N/ACPHASH =
'0a8aace00ea28adc05edd41e20dd910042e6d265' 0N/APOHASH =
'bd072fef8eb36241852d25a9161282a051f0a63e' 0N/A# No hash, since we always fetch the latest 0N/APLYHASH =
'38efe9e03bc39d40ee73fa566eb9c1975f1a8003' 0N/APCHASH =
'3fb59eca1461331bb9e9e8d6fe3b23eda961a416' 0N/A# Unbuffer stdout and stderr. This helps to ensure that subprocess output 0N/A# is properly interleaved with output from this program. 0N/A# indexed by 'osname' 0N/A 'pkg.client.transport',
869N/A# Runs the test suite with the code coverage suite (figleaf) turned on, and 0N/A# outputs a coverage report. 869N/A# TODO: Make the cov report format an option (html, ast, cov, etc) 0N/A # Run the test suite with coverage enabled 0N/A # Reconstruct the cmdline and send that to run.py 0N/A# Runs lint on the extension module source code 0N/A description =
"Runs various lint tools over IPS extension source code" 0N/A # Make string shell-friendly 0N/A # assumes lint is on the $PATH 0N/A # Insert tests directory onto sys.path so any custom checkers 0N/A # assumes pylint is accessible on the sys.path # specify the filenames of the scripts, in addition # to the package names themselves # For some reason, the load-plugins option, when used in the # rcfile, does not work, so we put it here instead, to load lint.
Run([
'--load-plugins=multiplatform',
'--rcfile',
# PRIVATE_BUILD set in the environment tells us to put the build # directory into the .pyc files, rather than the final # installation directory. # This is used when installing scripts, below, but it isn't a # standard distutils variable. At the end of the install function, we need to rename some files because distutils provides no way to rename files as they are placed in their install locations. Also, make sure that cherrypy and other external dependencies # make scripts executable # Take cacerts in cacert_dir and install them in # proto-area-relative cacert_install_dir # Include /usr/sfw/lib in the build environment # to ensure that this builds and runs on older # nevada builds, before openssl moved out of /usr/sfw. # Remove some bits that we're not going to package, but be sure # not to complain if we try to remove them twice. print "checksumming %s" %
swname print >>
sys.
stderr,
"bad checksum! %s != %s" % \
# Call openssl to create hash symlink cmd = [
"openssl",
"x509",
"-noout",
"-hash",
"-in",
print "downloading %s" %
swname print >>
sys.
stderr,
"Unable to retrieve %s.\n" \
"Please retrieve the file " \
# remove a partial download or error message from proxy # extractall doesn't exist until python 2.5 # If there are patches, apply them now. print "Applying %s to %s" % (p,
swname)
"patch failed and returned %d." %
ret print "installing %s" %
swname print "installing %s" %
swname "install failed and returned %d." %
ret print >>
sys.
stderr,
"ERROR: unable to obtain mercurial version" """ Run python's compiler over the file, and discard the results. Arrange to generate an exception if the file does not compile. This is needed because distutil's own use of pycompile (in the distutils.utils module) is broken, and doesn't stop on error. """ # override the build_module method to do VERSION substitution on pkg/__init__.py # Grab the previously-built version out of the build vstr =
'VERSION = "%s"' % v
# If the versions haven't changed, there's no need to print "doing version substitution: ", v
# Will raise a DistutilsError on failure. description =
"Deletes any and all files created by setup" # NOTE: these options need to be in sync with tests/run.py and the # list of options stored in initialize_options below. The first entry # in each tuple must be the exact name of a member variable. user_options = [(
"verbosemode",
'v',
"run tests in verbose mode"),
(
"genbaseline",
'g',
"generate test baseline"),
(
"parseable",
'p',
"parseable output"),
(
"timing",
"t",
"timing file <file>"),
(
"baselinefile=",
'b',
"baseline file <file>"),
(
"only=",
"o",
"only <regex>")]
# Reconstruct the cmdline and send that to run.py # These are set to real values based on the platform, down below # all builds of IPS should have manpages # Solaris-specific extensions are added here # Unix platforms which the elf extension has been ported to # are specified here, so they are built automatically # Solaris has built-in md library and Solaris-specific arch extension # All others use OpenSSL and cross-platform arch module