1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
cd `dirname $0`
MYDIR=`pwd`
WDIR=/tmp/${USER}/ps$$
rm -rf ${WDIR}
mkdir -p ${WDIR}
LWDIR=/tmp/${USER}/lps$$
rm -rf ${LWDIR}
mkdir -p ${LWDIR}
LHOST=`hostname`.`cat /etc/resolv.conf | grep domain| sed 's/domain \(.*\)/\1/'`
LUSER=$USER
build() {
HOST=$1
shift
CONFIGS=$@
printf "Building ${CONFIGS} on host ${HOST} ... "
do_build $HOST $CONFIGS
if [ $? -eq 0 ]; then
echo OK
else
echo FAIL
exit 1
fi
}
do_build() {
HOST=$1
shift
CONFIGS=$@
cd ${MYDIR}
tar cf ${LWDIR}/ps.tar ./PtySupport >> build.log 2>&1
cat << EOF | ssh ${HOST} sh -s
rm -rf ${WDIR}
mkdir -p ${WDIR}
EOF
scp ${LWDIR}/ps.tar ${HOST}:${WDIR} >> build.log 2>&1
cat << EOF | ssh ${HOST} sh -s
cd ${WDIR}
tar xf ./ps.tar || return 1
cd PtySupport
PATH=${PATH}:/usr/ccs/bin
export PATH
for i in ${CONFIGS}; do
make CONF=\$i >> build.log 2>&1 || return 1
done
cd dist
scp -r * ${LUSER}@${LHOST}:${LWDIR} >> build.log 2>&1
EOF
}
copy_to_release() {
echo Copying executables...
set -x
cp ${LWDIR}/Solaris_x64/GNU-Solaris-x86/ptysupport ../release/bin/nativeexecution/SunOS-x86_64/pty
cp ${LWDIR}/Solaris_x86/GNU-Solaris-x86/ptysupport ../release/bin/nativeexecution/SunOS-x86/pty
cp ${LWDIR}/MacOS_x64/GNU-MacOSX/ptysupport ../release/bin/nativeexecution/MacOSX-x86_64/pty
cp ${LWDIR}/MacOS_x86/GNU-MacOSX/ptysupport ../release/bin/nativeexecution/MacOSX-x86/pty
cp ${LWDIR}/Linux_x86/GNU-Linux-x86/ptysupport ../release/bin/nativeexecution/Linux-x86/pty
cp ${LWDIR}/Linux_x64/GNU-Linux-x86/ptysupport ../release/bin/nativeexecution/Linux-x86_64/pty
cp ${LWDIR}/Linux_sparc64/GNU-Linux-Sparc/ptysupport ../release/bin/nativeexecution/Linux-sparc_64/pty
cp ${LWDIR}/Solaris_sparc/GNU-Solaris-Sparc/ptysupport ../release/bin/nativeexecution/SunOS-sparc/pty
cp ${LWDIR}/Solaris_sparc64/GNU-Solaris-Sparc/ptysupport ../release/bin/nativeexecution/SunOS-sparc_64/pty
# Only 32-bit version for Windows...
cp ${LWDIR}/Windows_x86/Cygwin-Windows/ptysupport.exe ../release/bin/nativeexecution/Windows-x86/pty
cp ${LWDIR}/Windows_x86/Cygwin-Windows/ptysupport.exe ../release/bin/nativeexecution/Windows-x86_64/pty
}
|