Print this page
Catchup caiman build from 008, plus build/pkg caiman in /tmp/build_$USER
| Split |
Close |
| Expand all |
| Collapse all |
--- old/build/caiman/build.sh
+++ new/build/caiman/build.sh
1 1 #!/usr/bin/bash
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License, Version 1.0 only
7 7 # (the "License"). You may not use this file except in compliance
8 8 # with the License.
9 9 #
10 10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 11 # or http://www.opensolaris.org/os/licensing.
12 12 # See the License for the specific language governing permissions
13 13 # and limitations under the License.
14 14 #
15 15 # When distributing Covered Code, include this CDDL HEADER in each
16 16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 17 # If applicable, add the following below this CDDL HEADER, with the
18 18 # fields enclosed by brackets "[]" replaced with your own identifying
19 19 # information: Portions Copyright [yyyy] [name of copyright owner]
20 20 #
21 21 # CDDL HEADER END
22 22 #
23 23 #
24 24 # Copyright 2011-2012 OmniTI Computer Consulting, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 27
28 28 SHELL=/usr/bin/bash
29 29 export SHELL
30 30 SKIP_ROOT_CHECK=1
31 31 if [[ -n "$SUDO_USER" ]]; then
32 32 echo "Don't run under sudo, just build as you"
33 33 exit
34 34 fi
35 35
36 36 # Load support functions
37 37 . ../../lib/functions.sh
38 38
39 39 PROG=caiman
40 40 VER=$RELVER
41 41 PKG=caiman
42 42 SUMMARY="$PROG"
43 43 DESC="$SUMMARY"
|
↓ open down ↓ |
43 lines elided |
↑ open up ↑ |
44 44
45 45 #all of the ips depends should be available from OmniTI repos
46 46
47 47 BUILD_DEPENDS_IPS="developer/sunstudio12.1 system/boot/wanboot system/boot/wanboot/internal developer/build/onbld system/library developer/versioning/git developer/swig"
48 48
49 49 GIT=git
50 50
51 51 PKGSERVER=$PKGSRVR
52 52 PKGPREFIX=""
53 53 PREFIX=""
54 -TMPDIR=/code
55 54 BUILDDIR=$PROG-$VER
56 55 CODEMGR_WS=$TMPDIR/$BUILDDIR/caiman
56 +ON_CLOSED_BINS="$CODEMGR_WS/closed"
57 +export ON_CLOSED_BINS
57 58
58 -CAIMAN_CODEMGR_WS="CODEMGR\_WS=\/code\/$BUILDDIR\/caiman"
59 +CAIMAN_CODEMGR_SEDSTRING="s/CODEMGR_WS=.*/CODEMGR_WS=`echo $CODEMGR_WS | sed 's/\//\\\\\//g'`/g"
59 60 CAIMAN_PKG_REDIST="PKGPUBLISHER_REDIST=omnios; export PKGPUBLISHER_REDIST;"
60 61 CAIMAN_PKG_BRANCH="PKGVERS_BRANCH=$PVER; export PKGVERS_BRANCH;"
61 62
62 63 sunstudio_location() {
63 64 logmsg "Ensuring that Sun Studio is where Caiman thinks it is..."
64 65 if [[ -d /opt/SUNWspro ]]; then
65 66 logmsg "--- fake SUNWspro directory exists, good"
66 67 else
67 68 logmsg "--- making fake SUNWspro directory"
68 69 logcmd mkdir -p /opt/SUNWspro || \
69 70 logerr "--- Error: failed to make directory"
70 71 fi
71 72 if [[ -L /opt/SUNWspro/sunstudio12.1 ]]; then
72 73 logmsg "--- sunstudio12.1 link exists, good"
73 74 else
74 75 logmsg "--- soft-linking to /opt/sunstudio12.1"
75 76 logcmd ln -s /opt/sunstudio12.1 /opt/SUNWspro/sunstudio12.1 || \
76 77 logerr "--- Failed: ln -s /opt/sunstudio12.1/ /opt/SUNWspro"
77 78 fi
78 79 }
79 80
80 81 #In order for the clone to work while running as root, you must have ssh'ed into the box with agent forwarding turned on. Also the sudo'er file must either have the default, group, or user set to allow SSL_AUTH_SOCK.
81 82
82 83 clone_source(){
83 84 logmsg "Creating build dir $TMPDIR/$BUILDDIR"
84 85 logcmd mkdir -p $TMPDIR/$BUILDDIR || logerr "Failed to create build directory"
85 86 logmsg "Entering $TMPDIR/$BUILDDIR"
86 87 pushd $TMPDIR/$BUILDDIR > /dev/null
87 88 if [[ -d caiman ]]; then
88 89 logmsg "Removing existing cloned repo"
89 90 logcmd rm -rf caiman
90 91 fi
91 92 logmsg "Cloning OMNI caiman Source..."
92 93 logcmd $GIT clone anon@src.omniti.com:~omnios/core/caiman || \
93 94 logerr "Failed to $GIT clone repo"
|
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
94 95 logmsg "Leaving $TMPDIR/$BUILDDIR"
95 96 popd > /dev/null
96 97 }
97 98
98 99 modify_build_script() {
99 100 logmsg "Entering $CODEMGR_WS"
100 101 pushd $CODEMGR_WS > /dev/null
101 102 logmsg "Changing omnios.sh variables to what we want them to be..."
102 103 logcmd cp usr/src/tools/env/omnios.sh . || \
103 104 logerr "Could not copy build environment"
104 - logcmd /usr/bin/gsed -i -e 's/^.*export CODEMGR_WS=.*/export '$CAIMAN_CODEMGR_WS'/g;' omnios.sh || \
105 - logerr "/usr/bin/gsed failed"
105 + logcmd /usr/bin/sed -I -e $CAIMAN_CODEMGR_SEDSTRING omnios.sh || \
106 + logerr "/usr/bin/sed failed"
106 107 logcmd `echo $CAIMAN_PKG_REDIST >> omnios.sh`
107 108 logcmd `echo $CAIMAN_PKG_BRANCH >> omnios.sh`
108 109 logmsg "Leaving $CODEMGR_WS"
109 110 popd > /dev/null
110 111
111 112 }
112 113
114 +closed_bins() {
115 + logmsg "Entering $CODEMGR_WS"
116 + pushd $CODEMGR_WS > /dev/null
117 + logmsg "Getting Closed Source Bins..."
118 + for bin in on-closed-bins.i386.tar.bz2 on-closed-bins-nd.i386.tar.bz2 ; do
119 + if [[ ! -f $bin ]]; then
120 + logcmd curl -s -O http://mirrors.omniti.com/illumos-gate/$bin
121 + fi
122 + logcmd tar xpf $bin
123 + done
124 + logmsg "Leaving $CODEMGR_WS"
125 + popd > /dev/null
126 +}
127 +
113 128 build_pkgs() {
114 129 logmsg "Entering $CODEMGR_WS"
115 130 pushd $CODEMGR_WS > /dev/null
116 131 logmsg "Building caiman pkgs..."
117 - logcmd /opt/onbld/bin/nightly omnios.sh || logerr "Nighly failed"
132 + logcmd /opt/onbld/bin/nightly omnios.sh || logerr "Nightly failed"
118 133 logmsg "Leaving $CODEMGR_WS"
119 134 popd > /dev/null
120 135 }
121 136
122 137 push_pkgs() {
123 138 logmsg "Entering $CODEMGR_WS"
124 139 pushd $CODEMGR_WS > /dev/null
125 140 logmsg "Pushing caiman pkgs to $PKGSERVER..."
126 141 logcmd pkgrecv -s packages/i386/nightly-nd/repo.redist/ -d $PKGSERVER 'pkg:/*'
127 142 logmsg "Leaving $CODEMGR_WS"
128 143 popd > /dev/null
129 144 }
130 145
131 146 init
132 147 prep_build
133 148 sunstudio_location
134 149 clone_source
135 150 modify_build_script
151 +closed_bins
136 152 build_pkgs
137 153 push_pkgs
138 154 clean_up
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX