author | Alan Coopersmith <Alan.Coopersmith@Oracle.COM> |
Tue, 17 Mar 2015 21:23:44 -0700 | |
changeset 1517 | 177cd3dc7436 |
parent 1316 | 35498bf7aa6c |
permissions | -rwxr-xr-x |
493
f43507b5737d
6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
478
diff
changeset
|
1 |
#! /bin/ksh93 |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
2 |
# |
1316
35498bf7aa6c
changes in pkg version scheme for S12
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1219
diff
changeset
|
3 |
# Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
4 |
# |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
5 |
# Permission is hereby granted, free of charge, to any person obtaining a |
919
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
6 |
# copy of this software and associated documentation files (the "Software"), |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
7 |
# to deal in the Software without restriction, including without limitation |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
8 |
# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
9 |
# and/or sell copies of the Software, and to permit persons to whom the |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
10 |
# Software is furnished to do so, subject to the following conditions: |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
11 |
# |
919
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
12 |
# The above copyright notice and this permission notice (including the next |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
13 |
# paragraph) shall be included in all copies or substantial portions of the |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
14 |
# Software. |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
15 |
# |
919
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
16 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
17 |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
18 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
19 |
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
20 |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
21 |
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
22 |
# DEALINGS IN THE SOFTWARE. |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
23 |
# |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
24 |
# |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
25 |
# Create and fill a package staging area for X |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
26 |
# |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
27 |
# This script should be run from the base of the build tree. |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
28 |
# |
970
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
29 |
# Arguments: |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
30 |
# -v Enable verbose mode |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
31 |
# -p <publisher> Set publisher name in built repo to <publisher> |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
32 |
# |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
33 |
|
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
34 |
# Make sure that we aren't affected by the personal environment of |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
35 |
# whoever is running this script |
970
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
36 |
PATH=/usr/bin:/usr/ccs/bin:/opt/onbld/bin:${PATH} |
493
f43507b5737d
6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
478
diff
changeset
|
37 |
SHELL=/bin/ksh93 |
970
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
38 |
export PATH |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
39 |
|
1003
a4d17d6bc179
6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
970
diff
changeset
|
40 |
progname="$0" |
a4d17d6bc179
6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
970
diff
changeset
|
41 |
function fatal_error |
a4d17d6bc179
6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
970
diff
changeset
|
42 |
{ |
a4d17d6bc179
6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
970
diff
changeset
|
43 |
print -u2 "${progname}: ERROR: $*" |
a4d17d6bc179
6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
970
diff
changeset
|
44 |
exit 1 |
a4d17d6bc179
6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
970
diff
changeset
|
45 |
} |
a4d17d6bc179
6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
970
diff
changeset
|
46 |
|
970
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
47 |
# Path to directory in build tree containing build tools |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
48 |
BUILD_TOOLS="$(pwd)/open-src/util/build-tools/" |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
49 |
|
970
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
50 |
VERBOSE_FLAGS="" # verbosity flags passed to make |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
51 |
PUBLISHER_FLAGS="" # publisher flags passed to make |
731
d06e4a0dca56
6781710 Removal of Xsun on x86/x64 [PSARC 2008/033]: X consolidation portion
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
725
diff
changeset
|
52 |
|
970
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
53 |
set -- $(getopt p:v $*) |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
54 |
if [ $? != 0 ] ; then |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
55 |
print -u2 USAGE: $0 [-v] |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
56 |
exit 2 |
561
3c2df35483af
6756343 Split FSWxorg-fonts into smaller packages & integrate to Nevada gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
513
diff
changeset
|
57 |
fi |
493
f43507b5737d
6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
478
diff
changeset
|
58 |
|
970
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
59 |
for i in $* ; do |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
60 |
case $i in |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
61 |
-p) PUBLISHER_FLAGS="PKGPUBLISHER=$2"; shift 2;; |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
62 |
-v) VERBOSE_FLAGS="-v"; shift;; |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
63 |
esac |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
64 |
done |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
65 |
|
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
66 |
|
970
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
67 |
[ -d log ] || mkdir log |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
68 |
LOG="$(pwd)/log/make-pkgs" |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
69 |
CHECK_LOG="$(pwd)/log/check-pkgs" |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
70 |
|
1316
35498bf7aa6c
changes in pkg version scheme for S12
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1219
diff
changeset
|
71 |
# Get build version from hg by searching for most recent tag matching s12* |
1219
c56d74aaef4d
7104496 pkg branch version updates for S11 updates & SRU's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1189
diff
changeset
|
72 |
BUILD_TAG="$(hg parent --template '{latesttag}\n' | \ |
1316
35498bf7aa6c
changes in pkg version scheme for S12
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents:
1219
diff
changeset
|
73 |
perl -l -n -e 'if ($_ =~ m/^s12_(\d+)/) {print $_}')" |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
74 |
|
1219
c56d74aaef4d
7104496 pkg branch version updates for S11 updates & SRU's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1189
diff
changeset
|
75 |
if [[ -z "${BUILD_TAG}" ]] ; then |
c56d74aaef4d
7104496 pkg branch version updates for S11 updates & SRU's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1189
diff
changeset
|
76 |
fatal_error "BUILD_TAG could not be found from hg parent" |
29
449a687b3d6f
6424854 Decomposition of SUNWxwplt [PSARC 2006/302]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
0
diff
changeset
|
77 |
fi |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
78 |
|
1219
c56d74aaef4d
7104496 pkg branch version updates for S11 updates & SRU's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1189
diff
changeset
|
79 |
print "Building packages for X Consolidation, build ${BUILD_TAG}" |
970
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
80 |
|
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
81 |
MACH="$(uname -p)" |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
82 |
|
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
83 |
# Remove old packages |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
84 |
/bin/rm -rf "proto/pkg_${MACH}" |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
85 |
|
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
86 |
XMAKE="${BUILD_TOOLS}/xmake ${VERBOSE_FLAGS} -k" |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
87 |
|
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
88 |
cd pkg |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
89 |
${XMAKE} clean > "${LOG}" 2>&1 |
1219
c56d74aaef4d
7104496 pkg branch version updates for S11 updates & SRU's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1189
diff
changeset
|
90 |
${XMAKE} install "${PUBLISHER_FLAGS}" > "${LOG}" 2>&1 |
970
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
91 |
print "Result log is in ${LOG}" |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
92 |
|
1130
e9cbce844ef6
7041591 duplicate and missing dependencies in x11 IPS packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1057
diff
changeset
|
93 |
print "Checking built packages" |
1219
c56d74aaef4d
7104496 pkg branch version updates for S11 updates & SRU's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1189
diff
changeset
|
94 |
${XMAKE} check > "${CHECK_LOG}" 2>&1 |
1130
e9cbce844ef6
7041591 duplicate and missing dependencies in x11 IPS packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1057
diff
changeset
|
95 |
print "Package check log is in ${CHECK_LOG}" |
e9cbce844ef6
7041591 duplicate and missing dependencies in x11 IPS packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1057
diff
changeset
|
96 |
|
970
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
97 |
"${BUILD_TOOLS}/find-build-errors" -s "${LOG}" |
272328fe1b4a
6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
98 |
|
493
f43507b5737d
6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
478
diff
changeset
|
99 |
exit 0 |