summaryrefslogtreecommitdiff
path: root/Build-tools/Do-all-build-steps
blob: d52aeb4f18c4c446501ce2ef33c6e6756aef3be7 (plain)
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
93
94
#!/bin/bash

WD=`pwd`
# Don't write a wrong path for BD !!!!!
BD=/my/tmp/BUILD
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"
AM_MAKEFLAGS="-j 2"
echo "Building on $to_host"

rm -rf $BD/*
rm -f $WD/binary/*
mkdir -p $WD/Logs
mkdir -p $BD/Logs

cat > $TMP_SCRIPT <<END
# Show executed commands
set -x
# Move to the right place
cd "$WD"
# Create a build directory tree
bk export $BD
cd "$BD"
chmod -R u+rw,g+rw .

#Make it easy to remove an old build
umask 002

CC=$cc CXX=$ccc 
export CC CXX

gmake -j 2 -k distclean
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 \
 --with-mit-threads=yes $EXTRA_CONFIG \
 --enable-thread-safe-client \
 --without-berkeley-db

gmake -j 2 .

time gmake -j 2 distcheck \
 EXTRA_CONF_ARGS="--with-unix-socket-path=/var/tmp/mysql.sock --with-low-memory $EXTRA_CONFIG"

sh $BD/Build-tools/Do-rpm

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

cd "$BD"
DIST=`ls -t mysql-*.tar.gz | head -1`
$BD/Build-tools/mysql-copyright --target=. $DIST

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