maint: run `make dist` on Travis, use tarball to do build tests
[midnight-commander.git] / maint / utils / travis-build.sh
blob13e7bf14fccc539acf2eb75e41066e424817b57f
1 #!/bin/bash
3 # Midnight Commander - build and test common configurations
5 # Copyright (C) 2015
6 # The Free Software Foundation, Inc.
8 # Written by:
9 # Slava Zanko <slavazanko@gmail.com>, 2015
10 # Yury V. Zaytsev <yury@shurup.com>, 2015
12 # This file is part of the Midnight Commander.
14 # The Midnight Commander is free software: you can redistribute it
15 # and/or modify it under the terms of the GNU General Public License as
16 # published by the Free Software Foundation, either version 3 of the License,
17 # or (at your option) any later version.
19 # The Midnight Commander is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 set -e
28 set -x
30 function do_build() {
31 make
32 make check || true
33 make install
36 # Build distribution archive
37 mkdir -p distrib && cd $_
39 ../configure
40 make dist-bzip2
42 DISTFILE=$(ls mc-*.tar.bz2)
43 DISTDIR=$(echo $DISTFILE | sed 's/\.tar\.bz2$//g')
45 tar -xjf $DISTFILE
46 cd $DISTDIR
48 # Build default configuration (S-Lang)
49 mkdir -p build-default && pushd $_
51 ../configure \
52 --prefix="$(pwd)/INSTALL_ROOT" \
53 --with-screen=slang \
54 --enable-maintainer-mode \
55 --enable-mclib \
56 --enable-charset \
57 --enable-tests \
58 --enable-werror
60 do_build
62 popd
64 # Build default configuration (ncurses)
65 mkdir -p build-ncurses && pushd $_
67 ../configure \
68 --prefix="$(pwd)/INSTALL_ROOT" \
69 --with-screen=ncurses \
70 --enable-maintainer-mode \
71 --enable-mclib \
72 --enable-charset \
73 --enable-tests \
74 --enable-werror
76 do_build
78 popd
80 # Build all disabled
81 mkdir -p build-all-disabled && pushd $_
83 ../configure \
84 --prefix="$(pwd)/INSTALL_ROOT" \
85 --disable-maintainer-mode \
86 --disable-mclib \
87 --disable-charset \
88 --disable-largefile \
89 --disable-nls \
90 --disable-vfs \
91 --disable-background \
92 --without-mmap \
93 --without-x \
94 --without-gpm-mouse \
95 --without-subshell \
96 --enable-tests \
97 --enable-werror
99 do_build
101 popd