setup.py revision 2180
290N/A# The contents of this file are subject to the terms of the 290N/A# Common Development and Distribution License (the "License"). 290N/A# You may not use this file except in compliance with the License. 290N/A# See the License for the specific language governing permissions 290N/A# and limitations under the License. 290N/A# When distributing Covered Code, include this CDDL HEADER in each 290N/A# If applicable, add the following below this CDDL HEADER, with the 290N/A# fields enclosed by brackets "[]" replaced with your own identifying 290N/A# information: Portions Copyright [yyyy] [name of copyright owner] 395N/A# Copyright (c) 2008, 2010 Oracle and/or its affiliates. All rights reserved. 708N/A# 3rd party software required for the build 395N/A# Unbuffer stdout and stderr. This helps to ensure that subprocess output 395N/A# is properly interleaved with output from this program. 395N/A# A list of source, destination tuples of modules which should be hardlinked 395N/A# together if the os supports it and otherwise copied. 290N/A 'pkg.client.transport',
395N/A# Runs lint on the extension module source code 465N/A # Make string shell-friendly 395N/A # assumes lint is on the $PATH 430N/A # Insert tests directory onto sys.path so any custom checkers 383N/A # assumes pylint is accessible on the sys.path 383N/A # specify the filenames of the scripts, in addition 383N/A # to the package names themselves 383N/A # For some reason, the load-plugins option, when used in the 383N/A # rcfile, does not work, so we put it here instead, to load 422N/A # PRIVATE_BUILD set in the environment tells us to put the build 422N/A # directory into the .pyc files, rather than the final 422N/A # installation directory. 383N/A # This is used when installing scripts, below, but it isn't a 383N/A # standard distutils variable. 383N/A At the end of the install function, we need to rename some files 290N/A because distutils provides no way to rename files as they are 430N/A placed in their install locations. 395N/A Also, make sure that cherrypy and other external dependencies 290N/A for e
in [
".py",
".pyc"]:
448N/A # make scripts executable 430N/A # to ensure that this builds and runs on older 448N/A # nevada builds, before openssl moved out of /usr/sfw. 395N/A # Remove some bits that we're not going to package, but be sure 395N/A # not to complain if we try to remove them twice. 395N/A "Please retrieve the file " \
691N/A # remove a partial download or error message from proxy 395N/A # extractall doesn't exist until python 2.5 395N/A # 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. (
"archivedir=",
'a',
"archive failed tests <dir>"),
(
"baselinefile=",
'b',
"baseline file <file>"),
(
"coverage",
"c",
"collect code coverage data"),
(
"genbaseline",
'g',
"generate test baseline"),
(
"only=",
"o",
"only <regex>"),
(
"parseable",
'p',
"parseable output"),
(
"timing",
"t",
"timing file <file>"),
(
"verbosemode",
'v',
"run tests in verbose mode"),
(
"stoponerr",
'x',
"stop when a baseline mismatch occurs"),
(
"debugoutput",
'd',
"emit debugging output"),
(
"showonexpectedfail",
'f',
"show all failure info, even for expected fails"),
(
"startattest=",
's',
"start at indicated test"),
# Reconstruct the cmdline and send that to run.py (
"pkg=",
None,
"Component package name")
print "-D SOURCE_VER=%s -D PKG_VER=%s " \
# These are set to real values based on the platform, down below if osname in (
"sunos",
"linux",
"darwin"):
# 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