Do-all-build-steps 2.08 KB
Newer Older
1
#!/bin/sh
bk@work.mysql.com's avatar
bk@work.mysql.com committed
2 3

WD=`pwd`
4
# Don't write a wrong path for BD !!!!!
5 6 7 8 9 10 11 12 13
if [ -w /my/tmp ]
then
  BD=/my/tmp/BUILD
elif [ -n "$TMPDIR" ]
then
  BD=$TMPDIR/BUILD
else
  BD=/tmp/BUILD
fi
bk@work.mysql.com's avatar
bk@work.mysql.com committed
14 15 16 17 18 19 20
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"
21
AM_MAKEFLAGS="-j 2"
bk@work.mysql.com's avatar
bk@work.mysql.com committed
22 23
echo "Building on $to_host"

24
rm -rf $BD/*
25
rm -f $WD/binary/*
26
mkdir -p $WD/binary
27
mkdir -p $WD/Logs
28
mkdir -p $BD/Logs
29

bk@work.mysql.com's avatar
bk@work.mysql.com committed
30 31 32 33 34
cat > $TMP_SCRIPT <<END
# Show executed commands
set -x
# Move to the right place
cd "$WD"
35
# Create a build directory tree
36
bk export $BD
37
cd "$BD"
monty@work.mysql.com's avatar
monty@work.mysql.com committed
38
chmod -R u+rw,g+rw .
bk@work.mysql.com's avatar
bk@work.mysql.com committed
39

40
# Make it easy to remove an old build
41 42
umask 002

bk@work.mysql.com's avatar
bk@work.mysql.com committed
43 44 45
CC=$cc CXX=$ccc 
export CC CXX

46
gmake -j 2 -k distclean
bk@work.mysql.com's avatar
bk@work.mysql.com committed
47 48 49 50 51 52 53 54 55
rm -f NEW-RPMS/*

# Stop on error
set -e

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

aclocal; autoheader; aclocal; automake; autoconf
56
(cd bdb/dist && sh s_all)
57
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
bk@work.mysql.com's avatar
bk@work.mysql.com committed
58

59
# A normal user starts here. We must use mit-threads, bdb and innobase.
tim@work.mysql.com's avatar
Merge  
tim@work.mysql.com committed
60
# Otherwise they do not end up in the distribution.
bk@work.mysql.com's avatar
bk@work.mysql.com committed
61 62 63
./configure \
 --with-unix-socket-path=/var/tmp/mysql.sock \
 --with-low-memory \
64
 --with-mit-threads=yes $EXTRA_CONFIG \
65
 --enable-thread-safe-client \
66
 --with-berkeley-db \
67
 --with-innobase-db
bk@work.mysql.com's avatar
bk@work.mysql.com committed
68

sasha@mysql.sashanet.com's avatar
sasha@mysql.sashanet.com committed
69
gmake -j 2 
bk@work.mysql.com's avatar
bk@work.mysql.com committed
70

71
time gmake -j 2 distcheck \
bk@work.mysql.com's avatar
bk@work.mysql.com committed
72 73
 EXTRA_CONF_ARGS="--with-unix-socket-path=/var/tmp/mysql.sock --with-low-memory $EXTRA_CONFIG"

74
sh $BD/Build-tools/Do-rpm
bk@work.mysql.com's avatar
bk@work.mysql.com committed
75 76 77 78

rm -f $TMP_SCRIPT
END

79 80
set -e

bk@work.mysql.com's avatar
bk@work.mysql.com committed
81 82
log=$WD/Logs/Log-distcheck-`date +%y%m%d-%H%M`

83
echo "Logging script $TMP_SCRIPT into $log"
84

bk@work.mysql.com's avatar
bk@work.mysql.com committed
85 86 87 88
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)
89
  ssh -n $to_host -l my "time sh $TMP_SCRIPT" > $log 2>&1
bk@work.mysql.com's avatar
bk@work.mysql.com committed
90
else
91
  time sh $TMP_SCRIPT > $log 2>&1
bk@work.mysql.com's avatar
bk@work.mysql.com committed
92 93 94 95 96
fi

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

97
cd "$BD"
bk@work.mysql.com's avatar
bk@work.mysql.com committed
98
DIST=`ls -t mysql-*.tar.gz | head -1`
99
$BD/Build-tools/mysql-copyright --target=. $DIST
100 101 102 103

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