src/setup.py
author Edward Pilatowicz <edward.pilatowicz@oracle.com>
Wed, 18 May 2011 09:10:49 -0700
changeset 2364 7598ee41dcbc
parent 2345 9e403ec45791
child 2390 49043c6c5187
permissions -rw-r--r--
18340 unquoted matching patterns cause spurious test case failures 18341 test suite doesn't cleanup fakeroot 18342 pylint in the build is too noisy, it should only report errors 18358 pkg incorrectly claims child pub config must be subset of parents
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
     1
#!/usr/bin/python2.6
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
#
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
    22
# Copyright (c) 2008, 2011, Oracle and/or its affiliates.  All rights reserved.
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
    23
#
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
    24
883
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
    25
import errno
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
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
    37
import py_compile
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
    38
import hashlib
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
    39
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
    40
from distutils.errors import DistutilsError
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
    41
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
    42
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
    43
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
    44
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
    45
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
    46
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
    47
from distutils.command.clean import clean as _clean
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
    48
from distutils.dist import Distribution
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
    49
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
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
    51
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
    52
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
    53
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
    54
1660
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    55
osname = platform.uname()[0].lower()
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    56
ostype = arch = 'unknown'
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    57
if osname == 'sunos':
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    58
        arch = platform.processor()
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    59
        ostype = "posix"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    60
elif osname == 'linux':
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    61
        arch = "linux_" + platform.machine()
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    62
        ostype = "posix"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    63
elif osname == 'windows':
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    64
        arch = osname
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    65
        ostype = "windows"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    66
elif osname == 'darwin':
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    67
        arch = osname
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    68
        ostype = "posix"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    69
elif osname == 'aix':
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    70
        arch = "aix"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    71
        ostype = "posix"
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
    72
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    73
# 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
    74
CP = 'CherryPy'
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    75
CPIDIR = 'cherrypy'
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
    76
CPVER = '3.1.2'
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    77
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
    78
CPDIR = '%s-%s' % (CP, CPVER)
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    79
CPURL = 'http://download.cherrypy.org/cherrypy/%s/%s' % (CPVER, CPARC)
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
    80
CPHASH = 'a94aedfd0e675858dbcc32dd250c23d285ee9b88'
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    81
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    82
PO = 'pyOpenSSL'
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    83
POIDIR = 'OpenSSL'
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    84
POVER = '0.7'
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    85
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
    86
PODIR = '%s-%s' % (PO, POVER)
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    87
POURL = 'http://downloads.sourceforge.net/pyopenssl/%s' % (POARC)
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
    88
POHASH = 'bd072fef8eb36241852d25a9161282a051f0a63e'
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
    89
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
    90
COV = 'coveragepy'
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
    91
COVIDIR = 'coverage'
2075
f874d5e0efb5 16967 build of clean workspace fails due to coveragepy source location change
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2046
diff changeset
    92
COVVER = '3.2b2'
2180
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
    93
COVPVER = '3.2'
2075
f874d5e0efb5 16967 build of clean workspace fails due to coveragepy source location change
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2046
diff changeset
    94
COVARC = '%s-%s.tar.gz' % (COVIDIR, COVVER)
f874d5e0efb5 16967 build of clean workspace fails due to coveragepy source location change
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2046
diff changeset
    95
COVDIR = '%s-%s' % (COVIDIR, COVVER)
f874d5e0efb5 16967 build of clean workspace fails due to coveragepy source location change
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2046
diff changeset
    96
COVURL = 'http://pypi.python.org/packages/source/c/coverage/%s' % COVARC
f874d5e0efb5 16967 build of clean workspace fails due to coveragepy source location change
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2046
diff changeset
    97
COVHASH = '4710d033b8c6de1efaa562243e5b29e0a31fb8b9'
708
ef2162b85fab 4970 Add code coverage support
Brad Hall <bhall@eng.sun.com>
parents: 691
diff changeset
    98
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
    99
LDTP = 'ldtp'
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   100
LDTPIDIR = 'ldtp'
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   101
LDTPVER = '1.7.1'
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   102
LDTPMINORVER = '1.7.x'
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   103
LDTPMAJORVER = '1.x'
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   104
LDTPARC = '%s-%s.tar.gz' % (LDTP, LDTPVER)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   105
LDTPDIR = '%s-%s' % (LDTP, LDTPVER)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   106
LDTPURL = 'http://download.freedesktop.org/ldtp/%s/%s/%s' % \
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   107
    (LDTPMAJORVER, LDTPMINORVER, LDTPARC)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   108
LDTPHASH = 'd31213d2b1449a0dadcace723b9ff7041169f7ce'
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   109
742
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   110
MAKO = 'Mako'
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   111
MAKOIDIR = 'mako'
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   112
MAKOVER = '0.2.2'
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   113
MAKOARC = '%s-%s.tar.gz' % (MAKO, MAKOVER)
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   114
MAKODIR = '%s-%s' % (MAKO, MAKOVER)
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   115
MAKOURL = 'http://www.makotemplates.org/downloads/%s' % (MAKOARC)
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   116
MAKOHASH = '85c04ab3a6a26a1cab47067449712d15a8b29790'
742
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   117
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 883
diff changeset
   118
PLY = 'ply'
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 883
diff changeset
   119
PLYIDIR = 'ply'
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 883
diff changeset
   120
PLYVER = '3.1'
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 883
diff changeset
   121
PLYARC = '%s-%s.tar.gz' % (PLY, PLYVER)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 883
diff changeset
   122
PLYDIR = '%s-%s' % (PLY, PLYVER)
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 883
diff changeset
   123
PLYURL = 'http://www.dabeaz.com/ply/%s' % (PLYARC)
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   124
PLYHASH = '38efe9e03bc39d40ee73fa566eb9c1975f1a8003'
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 883
diff changeset
   125
2023
aee270220d37 16784 Integrate Pybonjour
johansen <johansen@opensolaris.org>
parents: 2021
diff changeset
   126
PBJ = 'pybonjour'
aee270220d37 16784 Integrate Pybonjour
johansen <johansen@opensolaris.org>
parents: 2021
diff changeset
   127
PBJIDIR = 'pybonjour'
aee270220d37 16784 Integrate Pybonjour
johansen <johansen@opensolaris.org>
parents: 2021
diff changeset
   128
PBJVER = '1.1.1'
aee270220d37 16784 Integrate Pybonjour
johansen <johansen@opensolaris.org>
parents: 2021
diff changeset
   129
PBJARC = '%s-%s.tar.gz' % (PBJ, PBJVER)
aee270220d37 16784 Integrate Pybonjour
johansen <johansen@opensolaris.org>
parents: 2021
diff changeset
   130
PBJDIR = '%s-%s' % (PBJ, PBJVER)
aee270220d37 16784 Integrate Pybonjour
johansen <johansen@opensolaris.org>
parents: 2021
diff changeset
   131
PBJURL = 'http://pybonjour.googlecode.com/files/%s' % (PBJARC)
aee270220d37 16784 Integrate Pybonjour
johansen <johansen@opensolaris.org>
parents: 2021
diff changeset
   132
PBJHASH = '92cabd14e04c5f62ce067c47c2057ee3d424d29b'
aee270220d37 16784 Integrate Pybonjour
johansen <johansen@opensolaris.org>
parents: 2021
diff changeset
   133
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   134
PC = 'pycurl'
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   135
PCIDIR = 'curl'
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   136
PCVER = '7.19.0'
2180
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   137
PCPVER= '7.19.0.1'
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   138
PCARC = '%s-%s.tar.gz' % (PC, PCVER)
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   139
PCDIR = '%s-%s' % (PC, PCVER)
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   140
PCURL = 'http://pycurl.sourceforge.net/download/%s' % PCARC
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   141
PCHASH = '3fb59eca1461331bb9e9e8d6fe3b23eda961a416'
1660
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   142
PCENVIRON = {}
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   143
if osname in ("sunos", "linux", "darwin"):
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   144
        PCENVIRON = {'CFLAGS': '-O3'}
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
   145
2026
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   146
M2C = 'M2Crypto'
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   147
M2CIDIR = 'm2crypto'
2263
42b8af0a12a1 17776 Need to update m2crypto to version 0.21.1
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2262
diff changeset
   148
M2CVER = '0.21.1'
2026
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   149
M2CARC = '%s-%s.tar.gz' % (M2C, M2CVER)
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   150
M2CDIR = '%s-%s' % (M2C, M2CVER)
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   151
M2CURL = 'http://pypi.python.org/packages/source/M/M2Crypto/%s' % (M2CARC)
2263
42b8af0a12a1 17776 Need to update m2crypto to version 0.21.1
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2262
diff changeset
   152
M2CHASH = '3c7135b952092e4f2eee7a94c5153319cccba94e'
2026
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   153
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   154
pwd = os.path.normpath(sys.path[0])
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   155
534
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
   156
#
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
   157
# Unbuffer stdout and stderr.  This helps to ensure that subprocess output
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
   158
# is properly interleaved with output from this program.
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
   159
#
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
   160
sys.stdout = os.fdopen(sys.stdout.fileno(), "w", 0)
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
   161
sys.stderr = os.fdopen(sys.stderr.fileno(), "w", 0)
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
   162
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
   163
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
   164
build_dir = os.path.normpath(os.path.join(pwd, os.pardir, "proto", "build_" + arch))
954
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
   165
if "ROOT" in os.environ and os.environ["ROOT"] != "":
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
   166
        root_dir = os.environ["ROOT"]
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
   167
else:
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
   168
        root_dir = os.path.normpath(os.path.join(pwd, os.pardir, "proto", "root_" + arch))
534
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
   169
pkgs_dir = os.path.normpath(os.path.join(pwd, os.pardir, "packages", arch))
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   170
extern_dir = os.path.normpath(os.path.join(pwd, "extern"))
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
   171
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
   172
py_install_dir = 'usr/lib/python2.6/vendor-packages'
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
   173
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   174
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
   175
lib_dir = 'usr/lib'
661
edf14bae4465 2717 pkg.depotd: need smf support for depot mode options
Brock Pytlik <bpytlik@sun.com>
parents: 613
diff changeset
   176
svc_method_dir = 'lib/svc/method'
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
   177
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   178
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
   179
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
   180
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
   181
resource_dir = 'usr/share/lib/pkg'
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   182
smf_app_dir = 'lib/svc/manifest/application'
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   183
smf_sys_dir = 'lib/svc/manifest/system'
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
   184
zones_dir = 'etc/zones'
1483
2276b6786711 6793 p2v support for ipkg-branded zones
<gerald.jelinek@sun.com>
parents: 1452
diff changeset
   185
etcbrand_dir = 'etc/brand/ipkg'
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
   186
brand_dir = 'usr/lib/brand/ipkg'
1498
1800f38ca303 6133 need to add pkg commands in /etc/security/exec_attr with "Software Installation" profile
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1483
diff changeset
   187
execattrd_dir = 'etc/security/exec_attr.d'
1800f38ca303 6133 need to add pkg commands in /etc/security/exec_attr with "Software Installation" profile
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1483
diff changeset
   188
authattrd_dir = 'etc/security/auth_attr.d'
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   189
sysrepo_dir = 'etc/pkg/sysrepo'
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   190
sysrepo_logs_dir = 'var/log/pkg/sysrepo'
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   191
sysrepo_cache_dir = 'var/cache/pkg/sysrepo'
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   192
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
   193
1674
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   194
# A list of source, destination tuples of modules which should be hardlinked
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   195
# together if the os supports it and otherwise copied.
2262
8d2364b8e9d5 17315 pkgdep test suite should remove python2.5 usage
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2242
diff changeset
   196
hardlink_modules = []
1674
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   197
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   198
scripts_sunos = {
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   199
        scripts_dir: [
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   200
                ['client.py', 'pkg'],
1544
e0ce5081236a 12697 pkgdep throws an exception for $PLATFORM or $ISALIST in runpath
Brock Pytlik <bpytlik@sun.com>
parents: 1516
diff changeset
   201
                ['pkgdep.py', 'pkgdepend'],
1968
c0540b1e4f7e 8722 advanced repository metadata store needed
Shawn Walker <shawn.walker@oracle.com>
parents: 1903
diff changeset
   202
                ['pkgrepo.py', 'pkgrepo'],
1557
d242d38c27d9 12899 Need a nice way of comparing manifests from the command line to aid publication
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1544
diff changeset
   203
                ['util/publish/pkgdiff.py', 'pkgdiff'],
1903
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
   204
                ['util/publish/pkgfmt.py', 'pkgfmt'],
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   205
                ['util/publish/pkglint.py', 'pkglint'],
2240
de59b73f1428 14965 merge should be productized
Shawn Walker <shawn.walker@oracle.com>
parents: 2223
diff changeset
   206
                ['util/publish/pkgmerge.py', 'pkgmerge'],
1506
9c8b3a3184be 12373 Need a programatic way of transforming manifests
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1505
diff changeset
   207
                ['util/publish/pkgmogrify.py', 'pkgmogrify'],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   208
                ['publish.py', 'pkgsend'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   209
                ['pull.py', 'pkgrecv'],
2026
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   210
                ['sign.py', 'pkgsign'],
424
a767ef6bf887 2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents: 422
diff changeset
   211
                ['packagemanager.py', 'packagemanager'],
1024
e83271f2e133 7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 954
diff changeset
   212
                ['updatemanager.py', 'pm-updatemanager'],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   213
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   214
        lib_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   215
                ['depot.py', 'pkg.depotd'],
2078
a13afe24c79a 17024 pm-updatemanager can't find display when running from cron
John Rice <john.rice@oracle.com>
parents: 2075
diff changeset
   216
                ['checkforupdates.py', 'pm-checkforupdates'],
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents: 534
diff changeset
   217
                ['updatemanagernotifier.py', 'updatemanagernotifier'],
1172
fc39dcc70f84 9574 Package Manager should use user's GNOME proxy settings
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1101
diff changeset
   218
                ['launch.py', 'pm-launch'],
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   219
                ['sysrepo.py', 'pkg.sysrepo'],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   220
                ],
661
edf14bae4465 2717 pkg.depotd: need smf support for depot mode options
Brock Pytlik <bpytlik@sun.com>
parents: 613
diff changeset
   221
        svc_method_dir: [
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   222
                ['svc/svc-pkg-depot', 'svc-pkg-depot'],
1902
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1815
diff changeset
   223
                ['svc/svc-pkg-mdns', 'svc-pkg-mdns'],
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   224
                ['svc/svc-pkg-sysrepo', 'svc-pkg-sysrepo'],
661
edf14bae4465 2717 pkg.depotd: need smf support for depot mode options
Brock Pytlik <bpytlik@sun.com>
parents: 613
diff changeset
   225
                ],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   226
        }
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   227
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
scripts_windows = {
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   229
        scripts_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   230
                ['client.py', 'client.py'],
1968
c0540b1e4f7e 8722 advanced repository metadata store needed
Shawn Walker <shawn.walker@oracle.com>
parents: 1903
diff changeset
   231
                ['pkgrepo.py', 'pkgrepo.py'],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   232
                ['publish.py', 'publish.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   233
                ['pull.py', 'pull.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   234
                ['scripts/pkg.bat', 'pkg.bat'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   235
                ['scripts/pkgsend.bat', 'pkgsend.bat'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   236
                ['scripts/pkgrecv.bat', 'pkgrecv.bat'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   237
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   238
        lib_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   239
                ['depot.py', 'depot.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   240
                ['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
   241
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   242
        }
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
   243
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   244
scripts_other_unix = {
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   245
        scripts_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   246
                ['client.py', 'client.py'],
1231
f7b99e8118d2 9290 need a way to find the file dependencies of a package
Brock Pytlik <bpytlik@sun.com>
parents: 1228
diff changeset
   247
                ['pkgdep.py', 'pkgdep'],
1557
d242d38c27d9 12899 Need a nice way of comparing manifests from the command line to aid publication
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1544
diff changeset
   248
                ['util/publish/pkgdiff.py', 'pkgdiff'],
1903
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
   249
                ['util/publish/pkgfmt.py', 'pkgfmt'],
1557
d242d38c27d9 12899 Need a nice way of comparing manifests from the command line to aid publication
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1544
diff changeset
   250
                ['util/publish/pkgmogrify.py', 'pkgmogrify'],
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   251
                ['pull.py', 'pull.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   252
                ['publish.py', 'publish.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   253
                ['scripts/pkg.sh', 'pkg'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   254
                ['scripts/pkgsend.sh', 'pkgsend'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   255
                ['scripts/pkgrecv.sh', 'pkgrecv'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   256
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   257
        lib_dir: [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   258
                ['depot.py', 'depot.py'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   259
                ['scripts/pkg.depotd.sh', 'pkg.depotd'],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   260
                ],
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   261
        }
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
   262
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   263
# indexed by 'osname'
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   264
scripts = {
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   265
        "sunos": scripts_sunos,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   266
        "linux": scripts_other_unix,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   267
        "windows": scripts_windows,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   268
        "darwin": scripts_other_unix,
1302
65995c02a467 10042 Port pkg(5) to AIX
Tom Mueller <Tom.Mueller@sun.com>
parents: 1265
diff changeset
   269
        "aix" : scripts_other_unix,
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   270
        "unknown": scripts_sunos,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   271
        }
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
   272
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   273
man1_files = [
1024
e83271f2e133 7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 954
diff changeset
   274
        'man/packagemanager.1',
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   275
        'man/pkg.1',
1544
e0ce5081236a 12697 pkgdep throws an exception for $PLATFORM or $ISALIST in runpath
Brock Pytlik <bpytlik@sun.com>
parents: 1516
diff changeset
   276
        'man/pkgdepend.1',
1557
d242d38c27d9 12899 Need a nice way of comparing manifests from the command line to aid publication
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1544
diff changeset
   277
        'man/pkgdiff.1',
1903
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
   278
        'man/pkgfmt.1',
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   279
        'man/pkglint.1',
2240
de59b73f1428 14965 merge should be productized
Shawn Walker <shawn.walker@oracle.com>
parents: 2223
diff changeset
   280
        'man/pkgmerge.1',
1506
9c8b3a3184be 12373 Need a programatic way of transforming manifests
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1505
diff changeset
   281
        'man/pkgmogrify.1',
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   282
        'man/pkgsend.1',
2026
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   283
        'man/pkgsign.1',
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   284
        'man/pkgrecv.1',
1978
69f2ff97bcd8 16567 pkgrepo help and manpage need to be consistent, and manpage needs publishing
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
   285
        'man/pkgrepo.1',
1024
e83271f2e133 7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 954
diff changeset
   286
        'man/pm-updatemanager.1',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   287
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   288
man1m_files = [
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   289
        'man/pkg.depotd.1m',
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   290
        'man/pkg.sysrepo.1m'
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   291
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   292
man5_files = [
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   293
        'man/pkg.5'
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   294
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   295
packages = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   296
        'pkg',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   297
        'pkg.actions',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   298
        'pkg.bundle',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   299
        'pkg.client',
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   300
        'pkg.client.linkedimage',
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   301
        'pkg.client.transport',
1452
bd6ffa78fed9 7960 client and depot need different organization of files
Brock Pytlik <bpytlik@sun.com>
parents: 1401
diff changeset
   302
        'pkg.file_layout',
1231
f7b99e8118d2 9290 need a way to find the file dependencies of a package
Brock Pytlik <bpytlik@sun.com>
parents: 1228
diff changeset
   303
        'pkg.flavor',
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   304
        'pkg.lint',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   305
        'pkg.portable',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   306
        'pkg.publish',
424
a767ef6bf887 2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents: 422
diff changeset
   307
        'pkg.server'
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   308
        ]
742
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   309
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   310
pylint_targets = [
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   311
        'pkg.altroot',
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   312
        'pkg.client.linkedimage',
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   313
        'pkg.client.pkgdefs',
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   314
        ]
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   315
742
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   316
web_files = []
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   317
for entry in os.walk("web"):
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   318
        web_dir, dirs, files = entry
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   319
        if not files:
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   320
                continue
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   321
        web_files.append((os.path.join(resource_dir, web_dir), [
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   322
            os.path.join(web_dir, f) for f in files
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   323
            if f != "Makefile"
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   324
            ]))
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   325
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   326
zones_files = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   327
        'brand/SUNWipkg.xml',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   328
        ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   329
brand_files = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   330
        'brand/pkgcreatezone',
954
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
   331
        'brand/attach',
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
   332
        'brand/clone',
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
   333
        'brand/detach',
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
   334
        'brand/prestate',
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
   335
        'brand/poststate',
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
   336
        'brand/uninstall',
8614b0c63fb3 4771 zone operations fail with package inventory errors when authority changes
Dan Price <dp@eng.sun.com>
parents: 941
diff changeset
   337
        'brand/common.ksh',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   338
        ]
1483
2276b6786711 6793 p2v support for ipkg-branded zones
<gerald.jelinek@sun.com>
parents: 1452
diff changeset
   339
etcbrand_files = [
2276b6786711 6793 p2v support for ipkg-branded zones
<gerald.jelinek@sun.com>
parents: 1452
diff changeset
   340
        'brand/pkgrm.conf',
2276b6786711 6793 p2v support for ipkg-branded zones
<gerald.jelinek@sun.com>
parents: 1452
diff changeset
   341
        'brand/smf_disable.conf',
2276b6786711 6793 p2v support for ipkg-branded zones
<gerald.jelinek@sun.com>
parents: 1452
diff changeset
   342
        ]
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   343
smf_app_files = [
1902
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1815
diff changeset
   344
        'svc/pkg-mdns.xml',
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   345
        'svc/pkg-server.xml',
2335
33734ca16f74 18254 system repository package should be renamed
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2310
diff changeset
   346
        'svc/pkg-system-repository.xml',
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   347
        'svc/pkg-update.xml',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   348
        ]
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   349
smf_sys_files = [
2338
63a4d56416c6 18240 zone proxy needed
johansen <johansen@opensolaris.org>
parents: 2337
diff changeset
   350
        'svc/zoneproxy-client.xml',
63a4d56416c6 18240 zone proxy needed
johansen <johansen@opensolaris.org>
parents: 2337
diff changeset
   351
        'svc/zoneproxyd.xml'
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   352
        ]
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   353
resource_files = [
2223
2da8c49e53dc 17735 build should use custom pkglintrc to locate proto version of opensolaris.org.sections
Tim Foster <tim.s.foster@oracle.com>
parents: 2180
diff changeset
   354
        'util/opensolaris.org.sections',
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   355
        'util/pkglintrc',
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   356
        ]
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   357
sysrepo_files = [
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   358
        'util/apache2/sysrepo/sysrepo_httpd.conf.mako',
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   359
        'util/apache2/sysrepo/sysrepo_publisher_response.mako',
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   360
        ]
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   361
sysrepo_log_stubs = [
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   362
        'util/apache2/sysrepo/logs/access_log',
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   363
        'util/apache2/sysrepo/logs/error_log',
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
   364
        ]
2345
9e403ec45791 18079 Package Manager GUI tools should have RBAC entries
Padraig O'Briain <padraig.obriain@oracle.com>
parents: 2340
diff changeset
   365
execattrd_files = ['util/misc/exec_attr.d/SUNWipkg',
9e403ec45791 18079 Package Manager GUI tools should have RBAC entries
Padraig O'Briain <padraig.obriain@oracle.com>
parents: 2340
diff changeset
   366
                   'util/misc/exec_attr.d/SUNWipkg-gui']
1498
1800f38ca303 6133 need to add pkg commands in /etc/security/exec_attr with "Software Installation" profile
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1483
diff changeset
   367
authattrd_files = ['util/misc/auth_attr.d/SUNWipkg']
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   368
syscallat_srcs = [
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   369
        'modules/syscallat.c'
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   370
        ]
691
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   371
pspawn_srcs = [
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   372
        'modules/pspawn.c'
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   373
        ]
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   374
elf_srcs = [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   375
        'modules/elf.c',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   376
        'modules/elfextract.c',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   377
        'modules/liblist.c',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   378
        ]
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
   379
arch_srcs = [
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   380
        'modules/arch.c'
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   381
        ]
591
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   382
_actions_srcs = [
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   383
        'modules/actions/_actions.c'
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   384
        ]
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1498
diff changeset
   385
solver_srcs = [
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1498
diff changeset
   386
        'modules/solver/solver.c', 
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1498
diff changeset
   387
        'modules/solver/py_solver.c'
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1498
diff changeset
   388
        ]
1632
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   389
solver_link_args = ["-lm", "-lc"]
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   390
if osname == 'sunos':
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   391
        solver_link_args = ["-ztext"] + solver_link_args
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   392
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   393
# Runs lint on the extension module source code
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   394
class pylint_func(Command):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   395
        description = "Runs pylint tools over IPS python source code"
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   396
        user_options = []
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   397
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   398
        def initialize_options(self):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   399
                pass
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   400
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   401
        def finalize_options(self):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   402
                pass
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   403
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   404
        # Make string shell-friendly
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   405
        @staticmethod
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   406
        def escape(astring):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   407
                return astring.replace(' ', '\\ ')
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   408
2364
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   409
        def run(self, quiet=False):
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   410
                proto = os.path.join(root_dir, py_install_dir)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   411
                sys.path.insert(0, proto)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   412
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   413
                # Insert tests directory onto sys.path so any custom checkers
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   414
                # can be found.
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   415
                sys.path.insert(0, os.path.join(pwd, 'tests'))
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   416
                # assumes pylint is accessible on the sys.path
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   417
                from pylint import lint
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   418
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   419
                #
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   420
                # For some reason, the load-plugins option, when used in the
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   421
                # rcfile, does not work, so we put it here instead, to load
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   422
                # our custom checkers.
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   423
                #
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   424
                # Unfortunately, pylint seems pretty fragile and will crash if
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   425
                # we try to run it over all the current pkg source.  Hence for
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   426
                # now we only run it over a subset of the source.  As source
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   427
                # files are made pylint clean they should be added to the
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   428
                # pylint_targets list.
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   429
                #
2364
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   430
                args = ['--load-plugins=multiplatform']
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   431
                if quiet:
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   432
                        args += ['--reports=no']
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   433
                args += ['--rcfile', os.path.join(pwd, 'tests', 'pylintrc')]
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   434
                args += pylint_targets
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   435
                lint.Run(args)
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   436
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   437
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   438
class pylint_func_quiet(pylint_func):
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   439
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   440
        def run(self, quiet=False):
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   441
                pylint_func.run(self, quiet=True)
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   442
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   443
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   444
include_dirs = [ 'modules' ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   445
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
   446
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
# Runs lint on the extension module source code
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   448
class clint_func(Command):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   449
        description = "Runs lint tools over IPS C extension source code"
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
        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
   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
        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
   453
                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
   454
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
        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
   456
                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
   457
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   458
        # 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
   459
        @staticmethod
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   460
        def escape(astring):
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   461
                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
   462
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   463
        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
   464
                # 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
   465
                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
   466
                        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
   467
                            ["%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
   468
                            ['-I' + self.escape(get_python_inc())] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   469
                            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
   470
                        elfcmd = ['lint'] + lint_flags + \
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   471
                            ["%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
   472
                            ['-I' + self.escape(get_python_inc())] + \
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   473
                            ["%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
   474
                            elf_srcs
591
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   475
                        _actionscmd = ['lint'] + lint_flags + \
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   476
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   477
                            ['-I' + self.escape(get_python_inc())] + \
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   478
                            _actions_srcs
691
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   479
                        pspawncmd = ['lint'] + lint_flags + ['-D_FILE_OFFSET_BITS=64'] + \
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   480
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   481
                            ['-I' + self.escape(get_python_inc())] + \
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   482
                            pspawn_srcs
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   483
                        syscallatcmd = ['lint'] + lint_flags + ['-D_FILE_OFFSET_BITS=64'] + \
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   484
                            ["%s%s" % ("-I", k) for k in include_dirs] + \
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   485
                            ['-I' + self.escape(get_python_inc())] + \
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   486
                            syscallat_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
   487
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   488
                        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
   489
                        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
   490
                        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
   491
                        os.system(" ".join(elfcmd))
591
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   492
                        print(" ".join(_actionscmd))
dbe9236b0884 2686 action key/value pairs separated by tabs cause parsing problems
Danek Duvall <danek.duvall@sun.com>
parents: 578
diff changeset
   493
                        os.system(" ".join(_actionscmd))
691
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   494
                        print(" ".join(pspawncmd))
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
   495
                        os.system(" ".join(pspawncmd))
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   496
                        print(" ".join(syscallatcmd))
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   497
                        os.system(" ".join(syscallatcmd))
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
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   499
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   500
# Runs both C and Python lint
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   501
class lint_func(Command):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   502
        description = "Runs C and Python lint checkers"
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   503
        user_options = []
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   504
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   505
        def initialize_options(self):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   506
                pass
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
   507
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   508
        def finalize_options(self):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   509
                pass
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
   510
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   511
        # Make string shell-friendly
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   512
        @staticmethod
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   513
        def escape(astring):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   514
                return astring.replace(' ', '\\ ')
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   515
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   516
        def run(self):
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   517
                clint_func(Distribution()).run()
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   518
                pylint_func(Distribution()).run()
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
   519
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   520
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
   521
        def initialize_options(self):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   522
                _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
   523
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   524
                # 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
   525
                # 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
   526
                # installation directory.
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   527
                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
   528
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   529
                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
   530
                        self.install_lib = py_install_dir
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 801
diff changeset
   531
                        self.install_data = os.path.sep
506
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   532
                        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
   533
                else:
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   534
                        self.install_lib = os.path.join(root_dir, py_install_dir)
513
4ddcb572f5d9 3330 smf manifest file in wrong location
Danek Duvall <danek.duvall@sun.com>
parents: 506
diff changeset
   535
                        self.install_data = root_dir
506
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   536
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   537
                # 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
   538
                # standard distutils variable.
acc9011bd8d4 2754 incorrect paths and source snippets in development stack traces
Danek Duvall <danek.duvall@sun.com>
parents: 498
diff changeset
   539
                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
   540
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   541
        def run(self):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   542
                """
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   543
                At the end of the install function, we need to rename some files
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   544
                because distutils provides no way to rename files as they are
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   545
                placed in their install locations.
883
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   546
                Also, make sure that cherrypy and other external dependencies
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   547
                are installed.
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   548
                """
413
3170bad6ceb7 2406 man pages are re-installed every time
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   549
                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
   550
                        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
   551
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   552
                _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
   553
1674
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   554
                for o_src, o_dest in hardlink_modules:
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   555
                        for e in [".py", ".pyc"]:
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   556
                                src = util.change_root(self.root_dir, o_src + e)
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   557
                                dest = util.change_root(
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   558
                                    self.root_dir, o_dest + e)
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   559
                                if ostype == "posix":
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   560
                                        if os.path.exists(dest) and \
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   561
                                            os.stat(src)[stat.ST_INO] != \
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   562
                                            os.stat(dest)[stat.ST_INO]:
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   563
                                                os.remove(dest)
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   564
                                        file_util.copy_file(src, dest,
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   565
                                            link="hard", update=1)
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   566
                                else:
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   567
                                        file_util.copy_file(src, dest, update=1)
faf484754465 13059 pkgdep generate should analyze python modules using the version of python they use
Brock Pytlik <bpytlik@sun.com>
parents: 1660
diff changeset
   568
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   569
                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
   570
                        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
   571
                                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
   572
                                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
   573
                                       os.path.join(d, dstname))
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   574
                                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
   575
                                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
   576
                                # make scripts executable
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   577
                                os.chmod(dst_path,
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   578
                                    os.stat(dst_path).st_mode
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 801
diff changeset
   579
                                    | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
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
   580
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   581
                prep_sw(CP, CPARC, CPDIR, CPURL, CPHASH)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   582
                install_sw(CP, CPDIR, CPIDIR)
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   583
                if osname == "sunos" and platform.uname()[2] == "5.11":
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   584
                        prep_sw(LDTP, LDTPARC, LDTPDIR, LDTPURL,
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   585
                            LDTPHASH)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   586
                        saveenv = os.environ.copy()
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   587
                        os.environ["LDFLAGS"] = os.environ.get("LDFLAGS", "") + \
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   588
                            " -lsocket -lnsl"
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   589
                        install_ldtp(LDTP, LDTPDIR, LDTPIDIR)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   590
                        os.environ = saveenv
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   591
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   592
                if "BUILD_PYOPENSSL" in os.environ and \
836
1800b2c96160 5599 Installing SUNWxvnc to a zone is not enough
David.Comay@Sun.COM
parents: 834
diff changeset
   593
                    os.environ["BUILD_PYOPENSSL"] != "":
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   594
                        #
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   595
                        # Include /usr/sfw/lib in the build environment
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   596
                        # to ensure that this builds and runs on older
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   597
                        # nevada builds, before openssl moved out of /usr/sfw.
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   598
                        #
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   599
                        saveenv = os.environ.copy()
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   600
                        if osname == "sunos":
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   601
                                os.environ["CFLAGS"] = "-I/usr/sfw/include " + \
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   602
                                    os.environ.get("CFLAGS", "")
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   603
                                os.environ["LDFLAGS"] = \
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   604
                                    "-L/usr/sfw/lib -R/usr/sfw/lib " + \
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   605
                                    os.environ.get("LDFLAGS", "")
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   606
                        prep_sw(PO, POARC, PODIR, POURL, POHASH)
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   607
                        install_sw(PO, PODIR, POIDIR)
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   608
                        os.environ = saveenv
2026
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   609
                prep_sw(M2C, M2CARC, M2CDIR, M2CURL, M2CHASH)
d1b30615bc99 9196 pkg(5) should have support for cryptographic manifest signatures
Brock Pytlik <bpytlik@sun.com>
parents: 2023
diff changeset
   610
                install_sw(M2C, M2CDIR, M2CIDIR)
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   611
                prep_sw(MAKO, MAKOARC, MAKODIR, MAKOURL, MAKOHASH)
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   612
                install_sw(MAKO, MAKODIR, MAKOIDIR)
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   613
                prep_sw(PLY, PLYARC, PLYDIR, PLYURL, PLYHASH)
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   614
                install_sw(PLY, PLYDIR, PLYIDIR)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   615
                prep_sw(PC, PCARC, PCDIR, PCURL, PCHASH)
1660
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   616
                install_sw(PC, PCDIR, PCIDIR, extra_env=PCENVIRON)
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   617
                prep_sw(COV, COVARC, COVDIR, COVURL, COVHASH)
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   618
                install_sw(COV, COVDIR, COVIDIR)
2023
aee270220d37 16784 Integrate Pybonjour
johansen <johansen@opensolaris.org>
parents: 2021
diff changeset
   619
                prep_sw(PBJ, PBJARC, PBJDIR, PBJURL, PBJHASH)
aee270220d37 16784 Integrate Pybonjour
johansen <johansen@opensolaris.org>
parents: 2021
diff changeset
   620
                install_sw(PBJ, PBJDIR, PBJIDIR)
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
   621
883
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   622
                # Remove some bits that we're not going to package, but be sure
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   623
                # not to complain if we try to remove them twice.
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   624
                def onerror(func, path, exc_info):
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   625
                        if exc_info[1].errno != errno.ENOENT:
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   626
                                raise
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   627
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   628
                for dir in ("cherrypy/scaffold", "cherrypy/test",
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   629
                    "cherrypy/tutorial"):
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   630
                        shutil.rmtree(os.path.join(root_dir, py_install_dir, dir),
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   631
                            onerror=onerror)
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   632
                try:
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   633
                        os.remove(os.path.join(root_dir, "usr/bin/mako-render"))
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   634
                except EnvironmentError, e:
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   635
                        if e.errno != errno.ENOENT:
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   636
                                raise
77885b2adc42 5539 SUNWpython-mako should deliver egg info
Danek Duvall <danek.duvall@sun.com>
parents: 849
diff changeset
   637
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   638
def hash_sw(swname, swarc, swhash):
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   639
        if swhash == None:
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   640
                return True
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   641
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   642
        print "checksumming %s" % swname
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
   643
        hash = hashlib.sha1()
1265
c700981b0af2 8656 build download hash check fails in Windows due to text mode open
Tom Mueller <Tom.Mueller@sun.com>
parents: 1231
diff changeset
   644
        f = open(swarc, "rb")
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   645
        while True:
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   646
                data = f.read(65536)
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   647
                if data == "":
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   648
                        break
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   649
                hash.update(data)
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   650
        f.close()
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   651
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   652
        if hash.hexdigest() == swhash:
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   653
                return True
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   654
        else:
1208
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   655
                print >> sys.stderr, "bad checksum! %s != %s" % \
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   656
                    (swhash, hash.hexdigest())
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   657
                return False
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   658
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   659
def prep_sw(swname, swarc, swdir, swurl, swhash):
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   660
        swarc = os.path.join(extern_dir, swarc)
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   661
        swdir = os.path.join(extern_dir, swdir)
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   662
        if not os.path.exists(extern_dir):
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   663
                os.mkdir(extern_dir)
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   664
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   665
        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
   666
                print "downloading %s" % swname
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   667
                try:
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   668
                        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
   669
                except IOError:
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   670
                        pass
2176
9056aef72613 17679 setup.py checks during extern source retrieval too strict
Shawn Walker <shawn.walker@oracle.com>
parents: 2125
diff changeset
   671
                if not os.path.exists(swarc):
1208
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   672
                        print >> sys.stderr, "Unable to retrieve %s.\n" \
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   673
                            "Please retrieve the file " \
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   674
                            "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
   675
                        # 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
   676
                        remove_sw(swname)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   677
                        sys.exit(1)
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   678
        if not os.path.exists(swdir):
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   679
                if not hash_sw(swname, swarc, swhash):
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   680
                        sys.exit(1)
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   681
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   682
                print "unpacking %s" % swname
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   683
                tar = tarfile.open(swarc)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   684
                # 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
   685
                for m in tar.getmembers():
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   686
                        tar.extract(m, extern_dir)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   687
                tar.close()
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   688
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   689
        # If there are patches, apply them now.
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   690
        patchdir = os.path.join("patch", swname)
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   691
        already_patched = os.path.join(swdir, ".patched")
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   692
        if os.path.exists(patchdir) and not os.path.exists(already_patched):
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   693
                patches = os.listdir(patchdir)
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   694
                for p in patches:
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   695
                        patchpath = os.path.join(os.path.pardir,
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   696
                            os.path.pardir, patchdir, p)
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   697
                        print "Applying %s to %s" % (p, swname)
1265
c700981b0af2 8656 build download hash check fails in Windows due to text mode open
Tom Mueller <Tom.Mueller@sun.com>
parents: 1231
diff changeset
   698
                        args = ["patch", "-d", swdir, "-i", patchpath, "-p0"]
c700981b0af2 8656 build download hash check fails in Windows due to text mode open
Tom Mueller <Tom.Mueller@sun.com>
parents: 1231
diff changeset
   699
                        if osname == "windows":
c700981b0af2 8656 build download hash check fails in Windows due to text mode open
Tom Mueller <Tom.Mueller@sun.com>
parents: 1231
diff changeset
   700
                                args.append("--binary")
1208
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   701
                        ret = subprocess.Popen(args).wait()
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   702
                        if ret != 0:
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   703
                                print >> sys.stderr, \
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   704
                                    "patch failed and returned %d." % ret
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   705
                                print >> sys.stderr, \
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   706
                                    "Command was: %s" % " ".join(args)
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   707
                                sys.exit(1)
1191
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   708
                file(already_patched, "w").close()
a48bee2a4b2e 305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents: 1172
diff changeset
   709
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   710
def install_ldtp(swname, swdir, swidir):
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   711
        swdir = os.path.join(extern_dir, swdir)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   712
        swinst_file = os.path.join(root_dir, py_install_dir, swidir + ".py")
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   713
        if not os.path.exists(swinst_file):
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   714
                print "installing %s" % swname
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   715
                args_config = ['./configure',
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   716
                    '--prefix=/usr',
1394
38c552cdcfbf 11763 make install noise / packages failure for ldtp if PYTHONPATH set
Shawn Walker <srw@sun.com>
parents: 1391
diff changeset
   717
                    '--bindir=/usr/bin',
38c552cdcfbf 11763 make install noise / packages failure for ldtp if PYTHONPATH set
Shawn Walker <srw@sun.com>
parents: 1391
diff changeset
   718
                    'PYTHONPATH=""',
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   719
                       ]
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   720
                args_make_install = ['make', 'install', 
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   721
                    'DESTDIR=%s' % root_dir
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   722
                       ]
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   723
                run_cmd(args_config, swdir)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   724
                run_cmd(args_make_install, swdir)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   725
1660
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   726
def install_sw(swname, swdir, swidir, extra_env=None):
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   727
        swdir = os.path.join(extern_dir, swdir)
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   728
        swinst_dir = os.path.join(root_dir, py_install_dir, swidir)
1660
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   729
        inst_env = os.environ.copy()
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   730
        if extra_env:
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   731
                inst_env.update(extra_env)
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   732
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   733
        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
   734
                print "installing %s" % swname
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
   735
                args = ['python2.6', '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
   736
                    '--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
   737
                    '--install-lib=%s' % py_install_dir,
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   738
                    '--install-data=%s' % py_install_dir]
1660
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   739
                run_cmd(args, swdir, env=inst_env)
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1337
diff changeset
   740
1660
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   741
def run_cmd(args, swdir, env=None):
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   742
                if env is None:
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   743
                        env = os.environ
f99db08aa9db 13799 pycurl could stand to be built with optimization
Tim Foster <tim.foster@sun.com>
parents: 1637
diff changeset
   744
                ret = subprocess.Popen(args, cwd=swdir, env=env).wait()
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   745
                if ret != 0:
1208
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   746
                        print >> sys.stderr, \
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   747
                            "install failed and returned %d." % ret
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   748
                        print >> sys.stderr, \
9d8a558cae2d 9901 Patch failure should stop build
johansen <johansen@sun.com>
parents: 1201
diff changeset
   749
                            "Command was: %s" % " ".join(args)
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   750
                        sys.exit(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
   751
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   752
def remove_sw(swname):
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   753
        print("deleting %s" % swname)
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   754
        for file in os.listdir(extern_dir):
465
44fddb622fe4 2818 We should include pyOpenSSL in the gate
Brad Hall <bhall@eng.sun.com>
parents: 454
diff changeset
   755
                if fnmatch.fnmatch(file, "%s*" % swname):
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   756
                        fpath = os.path.join(extern_dir, file)
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   757
                        if os.path.isfile(fpath):
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   758
                                os.unlink(fpath)
454
c27abbc11c8c 2811 clobber doesn't clobber all versions of dependencies
Shawn Walker <shawn.walker@sun.com>
parents: 452
diff changeset
   759
                        else:
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   760
                                shutil.rmtree(fpath, True)
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   761
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
   762
class build_func(_build):
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   763
        def initialize_options(self):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   764
                _build.initialize_options(self)
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   765
                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
   766
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   767
def get_hg_version():
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   768
        try:
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   769
                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
   770
                return p.communicate()[0].strip()
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   771
        except OSError:
384
9d4746e5dd3e 115 pkg needs to not have a cow on a SIGPIPE
Shawn Walker <swalker@opensolaris.org>
parents: 383
diff changeset
   772
                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
   773
                return "unknown"
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   774
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   775
def syntax_check(filename):
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   776
        """ Run python's compiler over the file, and discard the results.
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   777
            Arrange to generate an exception if the file does not compile.
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   778
            This is needed because distutil's own use of pycompile (in the
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   779
            distutils.utils module) is broken, and doesn't stop on error. """
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   780
        try:
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   781
                py_compile.compile(filename, os.devnull, doraise=True)
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   782
        except py_compile.PyCompileError, e:
2242
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   783
                res = ""
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   784
                for err in e.exc_value:
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   785
                        if isinstance(err, basestring):
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   786
                                res += err + "\n"
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   787
                                continue
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   788
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   789
                        # Assume it's a tuple of (filename, lineno, col, code)
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   790
                        fname, line, col, code = err
2337
acd36bf537d3 18271 setup.py can die if "col" is None
Danek Duvall <danek.duvall@oracle.com>
parents: 2335
diff changeset
   791
                        res += "line %d, column %s, in %s:\n%s" % (line,
acd36bf537d3 18271 setup.py can die if "col" is None
Danek Duvall <danek.duvall@oracle.com>
parents: 2335
diff changeset
   792
                            col or "unknown", fname, code)
2242
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   793
1bd3f64cf9de 16627 syntax check would be much more friendly if stringified
Shawn Walker <shawn.walker@oracle.com>
parents: 2240
diff changeset
   794
                raise DistutilsError(res)
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   795
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   796
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   797
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
   798
        # 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
   799
        def build_module (self, module, module_file, package):
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   800
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   801
                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
   802
                        versionre = '(?m)^VERSION[^"]*"([^"]*)"'
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   803
                        # 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
   804
                        # tree.
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   805
                        try:
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   806
                                ocontent = \
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   807
                                    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
   808
                                        [package], module)).read()
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   809
                                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
   810
                        except IOError:
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   811
                                ov = None
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   812
                        v = get_hg_version()
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   813
                        vstr = 'VERSION = "%s"' % v
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   814
                        # 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
   815
                        # recompile.
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   816
                        if v == ov:
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   817
                                return
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   818
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   819
                        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
   820
                        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
   821
                        tmpfd, tmp_file = tempfile.mkstemp()
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   822
                        os.write(tmpfd, mcontent)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   823
                        os.close(tmpfd)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   824
                        print "doing version substitution: ", v
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   825
                        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
   826
                        os.unlink(tmp_file)
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   827
                        return rv
422
c69607a5bdce 2554 make install could stand to be quieter
Danek Duvall <danek.duvall@sun.com>
parents: 413
diff changeset
   828
849
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   829
                # Will raise a DistutilsError on failure.
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   830
                syntax_check(module_file)
5fd94ce78823 3813 pkg build needs to fail when sub-builds fail
Dan Price <dp@eng.sun.com>
parents: 836
diff changeset
   831
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   832
                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
   833
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
   834
class clean_func(_clean):
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   835
        def initialize_options(self):
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   836
                _clean.initialize_options(self)
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   837
                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
   838
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   839
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
   840
        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
   841
        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
   842
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   843
        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
   844
                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
   845
        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
   846
                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
   847
        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
   848
                # nuke everything
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   849
                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
   850
                shutil.rmtree(dist_dir, True)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   851
                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
   852
                shutil.rmtree(build_dir, True)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   853
                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
   854
                shutil.rmtree(root_dir, True)
534
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
   855
                print("deleting " + pkgs_dir)
44a901d55161 676 'make install' fails if GNU install is first in path
Dan Price <dp@eng.sun.com>
parents: 513
diff changeset
   856
                shutil.rmtree(pkgs_dir, True)
1099
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   857
                print("deleting " + extern_dir)
bd94d4910b8a 8602 tidy top level of source directory
Dan Price <dp@eng.sun.com>
parents: 1024
diff changeset
   858
                shutil.rmtree(extern_dir, True)
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
   859
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   860
class test_func(Command):
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
   861
        # NOTE: these options need to be in sync with tests/run.py and the
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
   862
        # list of options stored in initialize_options below. The first entry
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
   863
        # in each tuple must be the exact name of a member variable.
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   864
        user_options = [
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
   865
            ("archivedir=", 'a', "archive failed tests <dir>"),
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   866
            ("baselinefile=", 'b', "baseline file <file>"),
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   867
            ("coverage", "c", "collect code coverage data"),
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   868
            ("genbaseline", 'g', "generate test baseline"),
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   869
            ("only=", "o", "only <regex>"),
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   870
            ("parseable", 'p', "parseable output"),
2272
d81ea073d050 3617 Testsuite should allow choice for base port to use
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2263
diff changeset
   871
            ("port=", "z", "lowest port to start a depot on"),
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
   872
            ("timing", "t", "timing file <file>"),
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   873
            ("verbosemode", 'v', "run tests in verbose mode"),
2340
194a87d123d4 18072 Automated GUI tests broken
Michal Pryc <Michal.Pryc@Oracle.Com>
parents: 2339
diff changeset
   874
            ("enableguitests", 'u', "enable IPS GUI tests, disabled by default"),
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
   875
            ("stoponerr", 'x', "stop when a baseline mismatch occurs"),
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
   876
            ("debugoutput", 'd', "emit debugging output"),
1716
10e09e28528a 12257 setup.py doesn't respect run.py options [fix traceback]
Dan Price <dp@eng.sun.com>
parents: 1715
diff changeset
   877
            ("showonexpectedfail", 'f',
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
   878
                "show all failure info, even for expected fails"),
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
   879
            ("startattest=", 's', "start at indicated test"),
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   880
        ]
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
   881
        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
   882
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   883
        def initialize_options(self):
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   884
                self.only = ""
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   885
                self.baselinefile = ""
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   886
                self.verbosemode = 0
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   887
                self.parseable = 0
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   888
                self.genbaseline = 0
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
   889
                self.timing = 0
1513
3ece69a26155 5032 make coverage should only report on the files in our gate
Danek Duvall <danek.duvall@sun.com>
parents: 1508
diff changeset
   890
                self.coverage = 0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
   891
                self.stoponerr = 0
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
   892
                self.debugoutput = 0
1716
10e09e28528a 12257 setup.py doesn't respect run.py options [fix traceback]
Dan Price <dp@eng.sun.com>
parents: 1715
diff changeset
   893
                self.showonexpectedfail = 0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
   894
                self.startattest = ""
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1674
diff changeset
   895
                self.archivedir = ""
2272
d81ea073d050 3617 Testsuite should allow choice for base port to use
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2263
diff changeset
   896
                self.port = 12001
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
   897
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
   898
        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
   899
                pass
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
   900
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
   901
        def run(self):
1101
35f360e2ee19 5247 Test suite should provide timing info
Brock Pytlik <bpytlik@sun.com>
parents: 1099
diff changeset
   902
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
   903
                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
   904
                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
   905
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   906
                # 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
   907
                cmd = [sys.executable, "run.py"]
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   908
                args = ""
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   909
                if "test" in sys.argv:
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   910
                        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
   911
                        cmd.extend(args)
448
bcfa99ac18b0 2664 test suite baseline enhancements
Brad Hall <bhall@eng.sun.com>
parents: 430
diff changeset
   912
                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
   913
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   914
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
   915
        def initialize_options(self):
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
   916
                _bdist.initialize_options(self)
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   917
                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
   918
2180
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   919
class info_func(Command):
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   920
        user_options = [
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   921
            ("pkg=", None, "Component package name")
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   922
        ]
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   923
        description = "Print component information"
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   924
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   925
        def initialize_options(self):
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   926
                self.pkg = ""
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   927
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   928
        def finalize_options(self):
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   929
                self.pkg = urllib.unquote(self.pkg.rsplit(".", 1)[0])
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   930
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   931
        pkginfo = {
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   932
            "library/python-2/cherrypy": (CPVER, CPVER, CPURL),
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   933
            "library/python-2/coverage": (COVVER, COVPVER, COVURL),
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   934
            "library/python-2/m2crypto": (M2CVER, M2CVER, M2CURL),
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   935
            "library/python-2/mako": (MAKOVER, MAKOVER, MAKOURL),
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   936
            "library/python-2/ply": (PLYVER, PLYVER, PLYURL),
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   937
            "library/python-2/pybonjour": (PBJVER, PBJVER, PBJURL),
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   938
            "library/python-2/pycurl": (PCVER, PCPVER, PCURL),
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   939
            "system/desktop/ldtp": (LDTPVER, LDTPVER, LDTPURL)
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   940
        }
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   941
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   942
        def run(self):
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   943
                if self.pkg in self.pkginfo:
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   944
                        print "-D SOURCE_VER=%s -D PKG_VER=%s " \
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   945
                            "-D SOURCE_URL=%s" % self.pkginfo[self.pkg]
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   946
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
   947
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   948
# 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
   949
compile_args = None
1637
0a60d77db8d9 13796 pkg(5) could stand to have its C modules optimized
Danek Duvall <danek.duvall@sun.com>
parents: 1632
diff changeset
   950
if osname in ("sunos", "linux", "darwin"):
0a60d77db8d9 13796 pkg(5) could stand to have its C modules optimized
Danek Duvall <danek.duvall@sun.com>
parents: 1632
diff changeset
   951
        compile_args = [ "-O3" ]
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
   952
link_args = None
613
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
   953
ext_modules = [
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
   954
        Extension(
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
   955
                'actions._actions',
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
   956
                _actions_srcs,
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
   957
                include_dirs = include_dirs,
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
   958
                extra_compile_args = compile_args,
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
   959
                extra_link_args = link_args
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
   960
                ),
1632
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   961
        Extension(
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   962
                'solver',
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   963
                solver_srcs,
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   964
                include_dirs = include_dirs + ["."],
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   965
                extra_compile_args = compile_args,
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   966
                extra_link_args = solver_link_args,
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   967
                define_macros = [('_FILE_OFFSET_BITS', '64')]
082a54aa7b58 13499 port solver to non-sunos platforms
Tom Mueller <Tom.Mueller@sun.com>
parents: 1557
diff changeset
   968
                ),
613
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
   969
        ]
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
   970
elf_libraries = None
742
909b912fa942 3011 new depot index page desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 708
diff changeset
   971
data_files = web_files
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   972
cmdclasses = {
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   973
        'install': install_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   974
        'build': build_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   975
        'build_py': build_py_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   976
        'bdist': dist_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   977
        'lint': lint_func,
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   978
        'clint': clint_func,
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
   979
        'pylint': pylint_func,
2364
7598ee41dcbc 18340 unquoted matching patterns cause spurious test case failures
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2345
diff changeset
   980
        'pylint_quiet': pylint_func_quiet,
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   981
        'clean': clean_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   982
        'clobber': clobber_func,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   983
        'test': test_func,
2180
50a104a28193 17669 Packages from IPS consolidation should include metadata on upstream packages
Danek Duvall <danek.duvall@oracle.com>
parents: 2176
diff changeset
   984
        'info': info_func,
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   985
        }
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
   986
383
08762e4dac3c 1068 cleanup pylint errors caused by portable package
Tom Mueller <Tom.Mueller@sun.com>
parents: 365
diff changeset
   987
# 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
   988
data_files += [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   989
        (man1_dir, man1_files),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   990
        (man1m_dir, man1m_files),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   991
        (man5_dir, man5_files),
2046
2522cde7adc2 13536 We need a way to audit one or more packages
Tim Foster <tim.s.foster@oracle.com>
parents: 2041
diff changeset
   992
        (resource_dir, resource_files),
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   993
        ]
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
   994
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
   995
if osname == 'sunos':
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   996
        # Solaris-specific extensions are added here
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   997
        data_files += [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   998
                (zones_dir, zones_files),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
   999
                (brand_dir, brand_files),
1483
2276b6786711 6793 p2v support for ipkg-branded zones
<gerald.jelinek@sun.com>
parents: 1452
diff changeset
  1000
                (etcbrand_dir, etcbrand_files),
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
  1001
                (smf_app_dir, smf_app_files),
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
  1002
                (smf_sys_dir, smf_sys_files),
1498
1800f38ca303 6133 need to add pkg commands in /etc/security/exec_attr with "Software Installation" profile
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1483
diff changeset
  1003
                (execattrd_dir, execattrd_files),
1800f38ca303 6133 need to add pkg commands in /etc/security/exec_attr with "Software Installation" profile
John Sonnenschein <John.Sonnenschein@Sun.COM>
parents: 1483
diff changeset
  1004
                (authattrd_dir, authattrd_files),
2310
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
  1005
                (sysrepo_dir, sysrepo_files),
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
  1006
                (sysrepo_logs_dir, sysrepo_log_stubs),
ce10607d5332 11684 desire option to not propagate certs to non-global zones
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2272
diff changeset
  1007
                (sysrepo_cache_dir, {})
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1008
                ]
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
  1009
6c5c87515614 160 Make IPS cross-platform for use across other supported OS's (missing files)
Tom Mueller <Tom.Mueller@Sun.COM>
parents:
diff changeset
  1010
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
  1011
        # 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
  1012
        # 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
  1013
        elf_libraries = ['elf']
613
886277645061 3956 Windows API test cases fail
Tom Mueller <Tom.Mueller@sun.com>
parents: 591
diff changeset
  1014
        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
  1015
                Extension(
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1016
                        'elf',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1017
                        elf_srcs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1018
                        include_dirs = include_dirs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1019
                        libraries = elf_libraries,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1020
                        extra_compile_args = compile_args,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1021
                        extra_link_args = link_args
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1022
                        ),
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1023
                ]
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
  1024
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1025
        # 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
  1026
        # 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
  1027
        if osname == 'sunos':
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1028
            elf_libraries += [ 'md' ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1029
            ext_modules += [
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1030
                    Extension(
430
3fb945d3bff3 2627 Test suite should have support for baselining
Brad Hall <bhall@eng.sun.com>
parents: 424
diff changeset
  1031
                            'arch',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1032
                            arch_srcs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1033
                            include_dirs = include_dirs,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1034
                            extra_compile_args = compile_args,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1035
                            extra_link_args = link_args,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1036
                            define_macros = [('_FILE_OFFSET_BITS', '64')]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1037
                            ),
691
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1038
                    Extension(
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1039
                            'pspawn',
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1040
                            pspawn_srcs,
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1041
                            include_dirs = include_dirs,
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1042
                            extra_compile_args = compile_args,
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1043
                            extra_link_args = link_args,
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1044
                            define_macros = [('_FILE_OFFSET_BITS', '64')]
cd1d9c1e82f3 4612 Alternative to os.fork needed for subprocess
johansen <johansen@sun.com>
parents: 661
diff changeset
  1045
                            ),
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1046
                    Extension(
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1047
                            'syscallat',
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1048
                            syscallat_srcs,
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1049
                            include_dirs = include_dirs,
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1050
                            extra_compile_args = compile_args,
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1051
                            extra_link_args = link_args,
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1052
                            define_macros = [('_FILE_OFFSET_BITS', '64')]
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2338
diff changeset
  1053
                            ),
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1054
                    ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1055
        else:
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1056
            elf_libraries += [ 'ssl' ]
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1057
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1058
setup(cmdclass = cmdclasses,
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
  1059
    name = 'pkg',
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1514
diff changeset
  1060
    version = '0.1',
395
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1061
    package_dir = {'pkg':'modules'},
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1062
    packages = packages,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1063
    data_files = data_files,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1064
    ext_package = 'pkg',
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1065
    ext_modules = ext_modules,
0ae5e72ba7ee 1958 Modify setup.py to handle pkgrecv
Tom Mueller <Tom.Mueller@sun.com>
parents: 384
diff changeset
  1066
    )