src/setup.py
author Danek Duvall <danek.duvall@sun.com>
Fri, 05 Sep 2008 16:39:46 -0700
changeset 506 acc9011bd8d4
parent 498 e1c077b81de6
child 513 4ddcb572f5d9
permissions -rw-r--r--
2754 incorrect paths and source snippets in development stack traces
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
409
713e20963dc2 2314 shebang lines should use minimum python version
Shawn Walker <swalker@opensolaris.org>
parents: 395
diff changeset
     1
#!/usr/bin/python2.4
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     2
#
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     3
# CDDL HEADER START
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     4
#
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     8
#
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    11
# See the License for the specific language governing permissions
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    12
# and limitations under the License.
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    13
#
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    19
#
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    20
# CDDL HEADER END
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    21
#
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    22
# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    23
# Use is subject to license terms.
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    24
#
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    25
454
c27abbc11c8c 2811 clobber doesn't clobber all versions of dependencies
Shawn Walker <shawn.walker@sun.com>
parents: 452
diff changeset
    26
import fnmatch
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    27
import os
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
    28
import platform
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    29
import stat
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    30
import sys
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    31
import shutil
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
    32
import re
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    33
import subprocess
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    34
import tarfile
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    35
import tempfile
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    36
import urllib
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    37
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    38
from distutils.core import setup, Extension
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    39
from distutils.cmd import Command
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    40
from distutils.command.install import install as _install
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    41
from distutils.command.build import build as _build
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
    42
from distutils.command.build_py import build_py as _build_py
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    43
from distutils.command.bdist import bdist as _bdist
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    44
from distutils.command.clean import clean as _clean
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    45
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    46
from distutils.sysconfig import get_python_inc
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    47
import distutils.file_util as file_util
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    48
import distutils.dir_util as dir_util
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    49
import distutils.util as util
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    50
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    51
# 3rd party software required for the build
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    52
CP = 'CherryPy'
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    53
CPIDIR = 'cherrypy'
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    54
CPVER = '3.1.0'
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    55
CPARC = '%s-%s.tar.gz' % (CP, CPVER)
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    56
CPDIR = '%s-%s' % (CP, CPVER)
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    57
CPURL = 'http://download.cherrypy.org/cherrypy/%s/%s' % (CPVER, CPARC)
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    58
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    59
PO = 'pyOpenSSL'
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    60
POIDIR = 'OpenSSL'
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    61
POVER = '0.7'
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    62
POARC = '%s-%s.tar.gz' % (PO, POVER)
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    63
PODIR = '%s-%s' % (PO, POVER)
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    64
POURL = 'http://downloads.sourceforge.net/pyopenssl/%s' % (POARC)
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    65
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    66
osname = platform.uname()[0].lower()
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    67
ostype = arch = 'unknown'
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    68
if osname == 'sunos':
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    69
        arch = platform.processor()
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    70
        ostype = "posix"
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    71
elif osname == 'linux':
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    72
        arch = "linux_" + platform.machine()
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    73
        ostype = "posix"
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    74
elif osname == 'windows':
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    75
        arch = osname
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    76
        ostype = "windows"
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    77
elif osname == 'darwin':
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    78
        arch = osname
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    79
        ostype = "posix"
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    80
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
    81
pwd = os.path.normpath(sys.path[0])
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
    82
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    83
dist_dir = os.path.normpath(os.path.join(pwd, os.pardir, "proto", "dist_" + arch))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    84
build_dir = os.path.normpath(os.path.join(pwd, os.pardir, "proto", "build_" + arch))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    85
root_dir = os.path.normpath(os.path.join(pwd, os.pardir, "proto", "root_" + arch))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    86
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    87
py_install_dir = 'usr/lib/python2.4/vendor-packages'
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    88
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    89
scripts_dir = 'usr/bin'
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    90
lib_dir = 'usr/lib'
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    91
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    92
man1_dir = 'usr/share/man/cat1'
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    93
man1m_dir = 'usr/share/man/cat1m'
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    94
man5_dir = 'usr/share/man/cat5'
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    95
resource_dir = 'usr/share/lib/pkg'
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    96
smf_dir = 'var/svc/manifest/application'
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    97
zones_dir = 'etc/zones'
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    98
brand_dir = 'usr/lib/brand/ipkg'
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
    99
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   100
scripts_sunos = {
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   101
        scripts_dir: [
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   102
                ['client.py', 'pkg'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   103
                ['publish.py', 'pkgsend'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   104
                ['pull.py', 'pkgrecv'],
424
a767ef6bf887 2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents: 422
diff changeset
   105
                ['packagemanager.py', 'packagemanager'],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   106
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   107
        lib_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   108
                ['depot.py', 'pkg.depotd'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   109
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   110
        }
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   111
            
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   112
scripts_windows = {
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   113
        scripts_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   114
                ['client.py', 'client.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   115
                ['publish.py', 'publish.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   116
                ['pull.py', 'pull.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   117
                ['scripts/pkg.bat', 'pkg.bat'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   118
                ['scripts/pkgsend.bat', 'pkgsend.bat'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   119
                ['scripts/pkgrecv.bat', 'pkgrecv.bat'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   120
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   121
        lib_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   122
                ['depot.py', 'depot.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   123
                ['scripts/pkg.depotd.bat', 'pkg.depotd.bat'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   124
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   125
        }
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   126
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   127
scripts_other_unix = {
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   128
        scripts_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   129
                ['client.py', 'client.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   130
                ['pull.py', 'pull.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   131
                ['publish.py', 'publish.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   132
                ['scripts/pkg.sh', 'pkg'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   133
                ['scripts/pkgsend.sh', 'pkgsend'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   134
                ['scripts/pkgrecv.sh', 'pkgrecv'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   135
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   136
        lib_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   137
                ['depot.py', 'depot.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   138
                ['scripts/pkg.depotd.sh', 'pkg.depotd'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   139
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   140
        }
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   141
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   142
# indexed by 'osname'
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   143
scripts = {
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   144
        "sunos": scripts_sunos,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   145
        "linux": scripts_other_unix,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   146
        "windows": scripts_windows,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   147
        "darwin": scripts_other_unix,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   148
        "unknown": scripts_sunos,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   149
        }
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   150
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   151
man1_files = [
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   152
        'man/pkg.1',
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   153
        'man/pkgsend.1',
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   154
        'man/pkgrecv.1',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   155
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   156
man1m_files = [
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   157
        'man/pkg.depotd.1m'
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   158
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   159
man5_files = [
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   160
        'man/pkg.5'
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   161
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   162
packages = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   163
        'pkg',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   164
        'pkg.actions',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   165
        'pkg.bundle',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   166
        'pkg.client',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   167
        'pkg.portable',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   168
        'pkg.publish',
424
a767ef6bf887 2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents: 422
diff changeset
   169
        'pkg.server'
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   170
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   171
web_files = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   172
        'web/pkg-block-icon.png',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   173
        'web/pkg-block-logo.png',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   174
        'web/pkg.css',
451
74f1fe85fe2d 1324 RSS / Atom feeds of repository updates
Shawn Walker <shawn.walker@sun.com>
parents: 448
diff changeset
   175
        'web/feed-icon-32x32.png',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   176
        'web/robots.txt',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   177
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   178
zones_files = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   179
        'brand/SUNWipkg.xml',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   180
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   181
brand_files = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   182
        'brand/config.xml',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   183
        'brand/platform.xml',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   184
        'brand/pkgcreatezone',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   185
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   186
smf_files = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   187
        'pkg-server.xml',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   188
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   189
elf_srcs = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   190
        'modules/elf.c',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   191
        'modules/elfextract.c',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   192
        'modules/liblist.c',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   193
        ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   194
arch_srcs = [
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   195
        'modules/arch.c'
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   196
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   197
include_dirs = [ 'modules' ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   198
lint_flags = [ '-u', '-axms', '-erroff=E_NAME_DEF_NOT_USED2' ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   199
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   200
# Runs lint on the extension module source code
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   201
class lint_func(Command):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   202
        description = "Runs various lint tools over IPS extension source code"
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   203
        user_options = []
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   204
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   205
        def initialize_options(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   206
                pass
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   207
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   208
        def finalize_options(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   209
                pass
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   210
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   211
        # Make string shell-friendly
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   212
        @staticmethod
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   213
        def escape(astring):
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   214
                return astring.replace(' ', '\\ ')
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   215
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   216
        def run(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   217
                # assumes lint is on the $PATH
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   218
                if osname == 'sunos' or osname == "linux":
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   219
                        archcmd = ['lint'] + lint_flags + ['-D_FILE_OFFSET_BITS=64'] + \
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   220
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   221
                            ['-I' + self.escape(get_python_inc())] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   222
                            arch_srcs
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   223
                        elfcmd = ['lint'] + lint_flags + \
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   224
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   225
                            ['-I' + self.escape(get_python_inc())] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   226
                            ["%s%s" % ("-l", k) for k in elf_libraries] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   227
                            elf_srcs
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   228
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   229
                        print(" ".join(archcmd))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   230
                        os.system(" ".join(archcmd))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   231
                        print(" ".join(elfcmd))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   232
                        os.system(" ".join(elfcmd))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   233
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   234
                        proto = os.path.join(root_dir, py_install_dir)
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   235
                        sys.path.insert(0, proto)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   236
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   237
                        # Insert tests directory onto sys.path so any custom checkers
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   238
                        # can be found.
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   239
                        sys.path.insert(0, os.path.join(pwd, 'tests'))
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   240
                        print(sys.path)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   241
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   242
                # assumes pylint is accessible on the sys.path
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   243
                from pylint import lint
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   244
                scriptlist = [ 'setup.py' ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   245
                for d, m in scripts_sunos.items():
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   246
                        for a in m:
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   247
                                # specify the filenames of the scripts, in addition
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   248
                                # to the package names themselves
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   249
                                scriptlist.append(os.path.join(root_dir, d, a[1]))
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   250
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   251
                # For some reason, the load-plugins option, when used in the
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   252
                # rcfile, does not work, so we put it here instead, to load
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   253
                # our custom checkers.
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   254
                lint.Run(['--load-plugins=multiplatform', '--rcfile',
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   255
                          os.path.join(pwd, 'tests', 'pylintrc')] +
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   256
                          scriptlist + packages)
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   257
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   258
class install_func(_install):
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   259
        def initialize_options(self):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   260
                _install.initialize_options(self)
506
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   261
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   262
                # PRIVATE_BUILD set in the environment tells us to put the build
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   263
                # directory into the .pyc files, rather than the final
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   264
                # installation directory.
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   265
                private_build = os.getenv("PRIVATE_BUILD", None)
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   266
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   267
                # It's OK to have /'s here, python figures it out when writing files
506
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   268
                if private_build is None:
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   269
                        self.install_lib = py_install_dir
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   270
                        self.install_data = py_install_dir
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   271
                        self.root = root_dir
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   272
                else:
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   273
                        self.install_lib = os.path.join(root_dir, py_install_dir)
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   274
                        self.install_data = os.path.join(root_dir, py_install_dir)
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   275
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   276
                # This is used when installing scripts, below, but it isn't a
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   277
                # standard distutils variable.
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   278
                self.root_dir = root_dir
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   279
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   280
        def run(self):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   281
                """
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   282
                At the end of the install function, we need to rename some files
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   283
                because distutils provides no way to rename files as they are 
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   284
                placed in their install locations. 
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   285
                Also, make sure that cherrypy is installed.
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   286
                """
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   287
                for f in man1_files + man1m_files + man5_files:
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   288
                        file_util.copy_file(f + ".txt", f, update=1)
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   289
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   290
                _install.run(self)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   291
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   292
                for d, files in scripts[osname].iteritems():
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   293
                        for (srcname, dstname) in files:
506
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   294
                                dst_dir = util.change_root(self.root_dir, d)
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   295
                                dst_path = util.change_root(self.root_dir,
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   296
                                       os.path.join(d, dstname))
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   297
                                dir_util.mkpath(dst_dir, verbose = True)
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   298
                                file_util.copy_file(srcname, dst_path, update = True)
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   299
                                # make scripts executable
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   300
                                os.chmod(dst_path,
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   301
                                        os.stat(dst_path).st_mode | stat.S_IEXEC)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   302
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   303
                install_sw(CP, CPVER, CPARC, CPDIR, CPURL, CPIDIR)
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   304
                install_sw(PO, POVER, POARC, PODIR, POURL, POIDIR)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   305
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   306
def install_sw(swname, swver, swarc, swdir, swurl, swidir):
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   307
        if not os.path.exists(swarc):
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   308
                print "downloading %s" % swname
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   309
                try:
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   310
                        fname, hdr = urllib.urlretrieve(swurl, swarc)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   311
                except IOError:
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   312
                        pass
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   313
                if not os.path.exists(swarc) or \
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   314
                    (hdr.gettype() != "application/x-gzip" and
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   315
                     hdr.gettype() != "application/x-tar"):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   316
                        print "Unable to retrieve %s.\nPlease retrieve the file " \
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   317
                            "and place it at: %s\n" % (swurl, swarc)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   318
                        # remove a partial download or error message from proxy
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   319
                        remove_sw(swname)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   320
                        sys.exit(1)
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   321
        if not os.path.exists(swdir):
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   322
                print "unpacking %s" % swname
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   323
                tar = tarfile.open(swarc)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   324
                # extractall doesn't exist until python 2.5
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   325
                for m in tar.getmembers():
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   326
                        tar.extract(m)
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   327
                tar.close()
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   328
        swinst_dir = os.path.join(root_dir, py_install_dir, swidir)
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   329
        if not os.path.exists(swinst_dir):
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   330
                print "installing %s" % swname
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   331
                subprocess.Popen(['python', 'setup.py', 'install',
498
e1c077b81de6 3135 SUNWpython-cherrypy delivers pyc files with embedded gate path
Danek Duvall <danek.duvall@sun.com>
parents: 465
diff changeset
   332
                    '--root=%s' % root_dir,
e1c077b81de6 3135 SUNWpython-cherrypy delivers pyc files with embedded gate path
Danek Duvall <danek.duvall@sun.com>
parents: 465
diff changeset
   333
                    '--install-lib=%s' % py_install_dir,
e1c077b81de6 3135 SUNWpython-cherrypy delivers pyc files with embedded gate path
Danek Duvall <danek.duvall@sun.com>
parents: 465
diff changeset
   334
                    '--install-data=%s' % py_install_dir],
e1c077b81de6 3135 SUNWpython-cherrypy delivers pyc files with embedded gate path
Danek Duvall <danek.duvall@sun.com>
parents: 465
diff changeset
   335
                    cwd = swdir).wait()
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   336
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   337
        
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   338
def remove_sw(swname):
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   339
        print("deleting %s" % swname)
454
c27abbc11c8c 2811 clobber doesn't clobber all versions of dependencies
Shawn Walker <shawn.walker@sun.com>
parents: 452
diff changeset
   340
        for file in os.listdir("."):
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   341
                if fnmatch.fnmatch(file, "%s*" % swname):
454
c27abbc11c8c 2811 clobber doesn't clobber all versions of dependencies
Shawn Walker <shawn.walker@sun.com>
parents: 452
diff changeset
   342
                        if os.path.isfile(file):
c27abbc11c8c 2811 clobber doesn't clobber all versions of dependencies
Shawn Walker <shawn.walker@sun.com>
parents: 452
diff changeset
   343
                                os.unlink(file)
c27abbc11c8c 2811 clobber doesn't clobber all versions of dependencies
Shawn Walker <shawn.walker@sun.com>
parents: 452
diff changeset
   344
                        else:
c27abbc11c8c 2811 clobber doesn't clobber all versions of dependencies
Shawn Walker <shawn.walker@sun.com>
parents: 452
diff changeset
   345
                                shutil.rmtree(file, True)
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   346
        
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   347
class build_func(_build):
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   348
        def initialize_options(self):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   349
                _build.initialize_options(self)
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   350
                self.build_base = build_dir
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   351
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   352
def get_hg_version():
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   353
        try:
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   354
                p = subprocess.Popen(['hg', 'id', '-i'], stdout = subprocess.PIPE)
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   355
                return p.communicate()[0].strip()
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   356
        except OSError:
384
9d4746e5dd3e 115 pkg needs to not have a cow on a SIGPIPE
Shawn Walker <swalker@opensolaris.org>
parents: 383
diff changeset
   357
                print >> sys.stderr, "ERROR: unable to obtain mercurial version"
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   358
                return "unknown"
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   359
    
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   360
class build_py_func(_build_py):
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   361
        # override the build_module method to do VERSION substitution on pkg/__init__.py
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   362
        def build_module (self, module, module_file, package):
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   363
                if module == "__init__" and package == "pkg":
422
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   364
                        versionre = '(?m)^VERSION[^"]*"([^"]*)"'
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   365
                        # Grab the previously-built version out of the build
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   366
                        # tree.
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   367
                        try:
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   368
                                ocontent = \
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   369
                                    file(self.get_module_outfile(self.build_lib,
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   370
                                        [package], module)).read()
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   371
                                ov = re.search(versionre, ocontent).group(1)
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   372
                        except IOError:
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   373
                                ov = None
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   374
                        v = get_hg_version()
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   375
                        vstr = 'VERSION = "%s"' % v
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   376
                        # If the versions haven't changed, there's no need to
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   377
                        # recompile.
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   378
                        if v == ov:
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   379
                                return
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   380
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   381
                        mcontent = file(module_file).read()
422
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   382
                        mcontent = re.sub(versionre, vstr, mcontent)
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   383
                        tmpfd, tmp_file = tempfile.mkstemp()
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   384
                        os.write(tmpfd, mcontent)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   385
                        os.close(tmpfd)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   386
                        print "doing version substitution: ", v
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   387
                        rv = _build_py.build_module(self, module, tmp_file, package)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   388
                        os.unlink(tmp_file)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   389
                        return rv
422
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   390
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   391
                return _build_py.build_module(self, module, module_file, package)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   392
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   393
class clean_func(_clean):
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   394
        def initialize_options(self):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   395
                _clean.initialize_options(self)
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   396
                self.build_base = build_dir
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   397
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   398
class clobber_func(Command):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   399
        user_options = []
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   400
        description = "Deletes any and all files created by setup"
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   401
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   402
        def initialize_options(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   403
                pass
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   404
        def finalize_options(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   405
                pass
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   406
        def run(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   407
                # nuke everything
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   408
                print("deleting " + dist_dir)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   409
                shutil.rmtree(dist_dir, True)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   410
                print("deleting " + build_dir)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   411
                shutil.rmtree(build_dir, True)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   412
                print("deleting " + root_dir)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   413
                shutil.rmtree(root_dir, True)
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   414
                remove_sw(CP)
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   415
                remove_sw(PO)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   416
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   417
class test_func(Command):
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   418
        # NOTE: these options need to be in sync with tests/run.py
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   419
        user_options = [("verbosemode", 'v', "run tests in verbose mode"),
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   420
            ("genbaseline", 'g', "generate test baseline"),
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   421
            ("parseable", 'p', "parseable output"),
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   422
            ("baselinefile=", 'b', "baseline file <file>"),
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   423
            ("only=", "o", "only <regex>")]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   424
        description = "Runs unit and functional tests"
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   425
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   426
        def initialize_options(self):
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   427
                self.only = ""
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   428
                self.baselinefile = ""
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   429
                self.verbosemode = 0
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   430
                self.parseable = 0
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   431
                self.genbaseline = 0
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   432
        def finalize_options(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   433
                pass
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   434
        def run(self):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   435
                os.putenv('PYEXE', sys.executable)
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   436
                os.chdir(os.path.join(pwd, "tests"))
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   437
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   438
                # Reconstruct the cmdline and send that to run.py
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   439
                cmd = [sys.executable, "run.py"]
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   440
                args = ""
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   441
                if "test" in sys.argv:
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   442
                        args = sys.argv[sys.argv.index("test")+1:]
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   443
                        cmd.extend(args)
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   444
                subprocess.call(cmd)
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   445
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   446
class dist_func(_bdist):
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   447
        def initialize_options(self):
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   448
                _bdist.initialize_options(self)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   449
                self.dist_dir = dist_dir
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   450
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   451
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   452
# These are set to real values based on the platform, down below
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   453
ext_modules = None
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   454
compile_args = None
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   455
link_args = None
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   456
elf_libraries = None
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   457
data_files = [ (resource_dir, web_files) ]
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   458
cmdclasses = {
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   459
        'install': install_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   460
        'build': build_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   461
        'build_py': build_py_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   462
        'bdist': dist_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   463
        'lint': lint_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   464
        'clean': clean_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   465
        'clobber': clobber_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   466
        'test': test_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   467
        }
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   468
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   469
# all builds of IPS should have manpages
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   470
data_files += [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   471
        (man1_dir, man1_files),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   472
        (man1m_dir, man1m_files),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   473
        (man5_dir, man5_files),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   474
        ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   475
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   476
if osname == 'sunos':
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   477
        # Solaris-specific extensions are added here
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   478
        data_files += [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   479
                (zones_dir, zones_files),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   480
                (brand_dir, brand_files),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   481
                (smf_dir, smf_files),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   482
                ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   483
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   484
if osname == 'sunos' or osname == "linux":
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   485
        # Unix platforms which the elf extension has been ported to
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   486
        # are specified here, so they are built automatically
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   487
        elf_libraries = ['elf']
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   488
        ext_modules = [
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   489
                Extension(
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   490
                        'elf',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   491
                        elf_srcs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   492
                        include_dirs = include_dirs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   493
                        libraries = elf_libraries,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   494
                        extra_compile_args = compile_args,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   495
                        extra_link_args = link_args
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   496
                        ),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   497
                ]
290
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   498
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   499
        # Solaris has built-in md library and Solaris-specific arch extension
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   500
        # All others use OpenSSL and cross-platform arch module
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   501
        if osname == 'sunos':
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   502
            elf_libraries += [ 'md' ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   503
            ext_modules += [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   504
                    Extension(
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   505
                            'arch',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   506
                            arch_srcs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   507
                            include_dirs = include_dirs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   508
                            extra_compile_args = compile_args,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   509
                            extra_link_args = link_args,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   510
                            define_macros = [('_FILE_OFFSET_BITS', '64')]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   511
                            ),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   512
                    ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   513
        else:
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   514
            elf_libraries += [ 'ssl' ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   515
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   516
setup(cmdclass = cmdclasses,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   517
    name = 'ips',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   518
    version = '1.0',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   519
    package_dir = {'pkg':'modules'},
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   520
    packages = packages,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   521
    data_files = data_files,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   522
    ext_package = 'pkg',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   523
    ext_modules = ext_modules,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   524
    )