aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux/travis-build.sh
blob: 223d145e5fb648fc8bb2d19b3d92c995ca54bfa0 (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
#!/bin/bash

set -ex

MAKE_CONFIGURE="--enable-make"
if [[ "x${TARGET}" = "xblogc-make-embedded" ]]; then
    MAKE_CONFIGURE="--enable-make-embedded"
    TARGET="check"
fi
if [[ "x${TARGET}" = "xblogc-github-lambda" ]]; then
    MAKE_CONFIGURE="--enable-make-embedded"
fi


rm -rf build
mkdir -p build

pushd build > /dev/null
../configure \
    CFLAGS="-Wall -g -O0" \
    --enable-ronn \
    --disable-silent-rules \
    --enable-tests \
    --enable-valgrind \
    --enable-git-receiver \
    --enable-runserver \
    ${MAKE_CONFIGURE}
popd > /dev/null

if [[ "x${TARGET}" = "xblogc-github-lambda" ]]; then
    make -C build LDFLAGS="-all-static" blogc

    rm -rf root
    mkdir -p root

    PV="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)"

    install -m 755 build/blogc root/blogc
    install -m 644 src/blogc-github-lambda/lambda_function.py root/lambda_function.py
    install -m 644 LICENSE root/LICENSE
    strip root/blogc

    pushd root/ > /dev/null
    zip --symlinks -rq "../blogc-github-lambda-${PV}.zip" *
    popd > /dev/null
else
    make -C build "${TARGET}"
fi