Do-all-build-steps 2.04 KB
Newer Older
unknown's avatar
unknown committed
1 2 3
#!/bin/bash

WD=`pwd`
unknown's avatar
unknown committed
4
# Don't write a wrong path for BD !!!!!
unknown's avatar
unknown committed
5
BD=/my/tmp/BUILD
unknown's avatar
unknown committed
6 7 8 9 10 11 12
TMP_SCRIPT=$WD/Logs/00-temp-for-do-all-build-steps.$$

# We build on work
to_host=`hostname`
cc=gcc
ccc=gcc
EXTRA_CONFIG="--without-perl"
13
AM_MAKEFLAGS="-j 2"
unknown's avatar
unknown committed
14 15
echo "Building on $to_host"

unknown's avatar
unknown committed
16
rm -rf $BD/*
unknown's avatar
unknown committed
17
rm -f $WD/binary/*
18
mkdir -p $WD/binary
19
mkdir -p $WD/Logs
unknown's avatar
unknown committed
20
mkdir -p $BD/Logs
21

unknown's avatar
unknown committed
22 23 24 25 26
cat > $TMP_SCRIPT <<END
# Show executed commands
set -x
# Move to the right place
cd "$WD"
unknown's avatar
unknown committed
27
# Create a build directory tree
unknown's avatar
unknown committed
28
bk export $BD
unknown's avatar
unknown committed
29
cd "$BD"
unknown's avatar
unknown committed
30
chmod -R u+rw,g+rw .
unknown's avatar
unknown committed
31

unknown's avatar
unknown committed
32 33 34
#Make it easy to remove an old build
umask 002

unknown's avatar
unknown committed
35 36 37
CC=$cc CXX=$ccc 
export CC CXX

38
gmake -j 2 -k distclean
unknown's avatar
unknown committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
rm -f NEW-RPMS/*

# Stop on error
set -e

# Make everything readable for user and group
# chmod -R u+rw,g+rw .

/bin/rm -f */.deps/*.P
/bin/rm -f config.cache

aclocal; autoheader; aclocal; automake; autoconf

# Since we have moved the configure.in stuff from readline to the
# toplevel why do this? David 990630
# (cd readline; aclocal; autoheader; aclocal; automake; autoconf)

# A normal user starts here. We must use mit-threads. Otherwise it
# does not end up in the distribution.
./configure \
 --with-unix-socket-path=/var/tmp/mysql.sock \
 --with-low-memory \
unknown's avatar
unknown committed
61
 --with-mit-threads=yes $EXTRA_CONFIG \
62 63
 --enable-thread-safe-client \
 --without-berkeley-db
unknown's avatar
unknown committed
64

unknown's avatar
unknown committed
65
gmake -j 2 
unknown's avatar
unknown committed
66

67
time gmake -j 2 distcheck \
unknown's avatar
unknown committed
68 69
 EXTRA_CONF_ARGS="--with-unix-socket-path=/var/tmp/mysql.sock --with-low-memory $EXTRA_CONFIG"

unknown's avatar
unknown committed
70
sh $BD/Build-tools/Do-rpm
unknown's avatar
unknown committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88

rm -f $TMP_SCRIPT
END

log=$WD/Logs/Log-distcheck-`date +%y%m%d-%H%M`

if test $to_host = "mysql-work"
then
  # Try to get the right user for MySQL builds on work so that all
  # files is owned by the same user (mysql)
  ssh -n $to_host -l my "time bash $TMP_SCRIPT" > $log 2>&1
else
  time bash $TMP_SCRIPT > $log 2>&1
fi

# Create a commercial MySQL distribution (mysqlcom-VER.tar.gz) from
# the newly made source distribution

unknown's avatar
unknown committed
89
cd "$BD"
unknown's avatar
unknown committed
90
DIST=`ls -t mysql-*.tar.gz | head -1`
unknown's avatar
unknown committed
91
$BD/Build-tools/mysql-copyright --target=. $DIST
unknown's avatar
unknown committed
92 93 94 95

# move the binaries to the 'binary' directory
mv $BD/mysql*tar.gz $WD/binary
mv $BD/NEW-RPMS/* $WD/binary