summaryrefslogtreecommitdiff
path: root/storage/tokudb/scripts/testbuildfromsrc.bash
blob: 136841ea2846ec963c07fd6ebb1f98c20cfe095d (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
#!/usr/bin/env bash

# for all source tarballs and their coresponding md5 files, build a binary release tarball

system=$(uname -s|tr [:upper:] [:lower:])
arch=$(uname -m)

function expand() {
    echo $* | tr ,: " "
}

for f in *.md5; do
    if [[ $f =~ (.*).tar.gz.md5 ]] ; then
        mysqlsrc=${BASH_REMATCH[1]}
    else
        exit 1
    fi
    if [ -d $mysqlsrc ] ; then continue; fi
    md5sum --check $mysqlsrc.tar.gz.md5
    if [ $? != 0 ] ; then exit 1; fi
    tar xzf $mysqlsrc.tar.gz
    if [ $? != 0 ] ; then exit 1; fi
    mkdir $mysqlsrc/build.RelWithDebInfo
    pushd $mysqlsrc/build.RelWithDebInfo
    if [ $? != 0 ] ; then exit 1; fi
    cmake -D BUILD_CONFIG=mysql_release -D CMAKE_BUILD_TYPE=RelWithDebInfo -D BUILD_TESTING=OFF ..
    if [ $? != 0 ] ; then exit 1; fi
    make -j4 package
    if [ $? != 0 ] ; then exit 1; fi
    if [ ! -f $mysqlsrc-$system-$arch.tar.gz ] ; then exit 1; fi
    popd
done