2020-10-29 23:19:11 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-11-10 08:11:53 +00:00
|
|
|
set -ex
|
|
|
|
|
|
|
|
IS_FEDORA=0
|
|
|
|
IS_CENTOS=0
|
2020-12-10 19:08:00 +00:00
|
|
|
IS_ALPINE=0
|
2020-11-10 08:11:53 +00:00
|
|
|
grep -q '^NAME=.*\(CentOS\)' /etc/os-release && IS_CENTOS=1
|
|
|
|
grep -q '^NAME=.*\(Fedora\)' /etc/os-release && IS_FEDORA=1
|
2020-12-10 19:08:00 +00:00
|
|
|
grep -q '^NAME=.*\(Alpine\)' /etc/os-release && IS_ALPINE=1
|
2020-11-10 08:11:53 +00:00
|
|
|
|
|
|
|
do_clean() {
|
|
|
|
git clean -fdx
|
|
|
|
}
|
|
|
|
|
|
|
|
uname -a
|
2020-12-10 19:08:00 +00:00
|
|
|
! command -v locale &>/dev/null || locale -a
|
2020-11-10 08:11:53 +00:00
|
|
|
meson --version
|
|
|
|
|
2020-12-11 10:11:57 +00:00
|
|
|
! command -v dpkg &>/dev/null || dpkg -l
|
|
|
|
! command -v yum &>/dev/null || yum list installed
|
2020-12-10 19:08:00 +00:00
|
|
|
! command -v apk &>/dev/null || apk -v info
|
2020-11-10 08:11:53 +00:00
|
|
|
|
2020-11-10 18:05:02 +00:00
|
|
|
# The formatting depends on the version of python black.
|
|
|
|
# We have a dedicated test that checks our formatting, which
|
|
|
|
# uses the right version. We should disable the check during
|
|
|
|
# `make check`.
|
|
|
|
export NMTST_SKIP_PYTHON_BLACK=1
|
|
|
|
|
2020-12-11 15:08:07 +00:00
|
|
|
# We have a unit test that check that `ci-fairy generate-template`
|
|
|
|
# is equal to our .gitlab-ci.yml file. However, on gitlab-ci we
|
|
|
|
# also have a dedicate test for the same thing. We don't need
|
|
|
|
# to run that test as part of the build. Disable it.
|
|
|
|
export NMTST_SKIP_CHECK_GITLAB_CI=1
|
|
|
|
|
2020-11-10 08:11:53 +00:00
|
|
|
do_clean; BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
|
|
|
|
rm -rf /tmp/nm-docs-html;
|
|
|
|
mv build/INST/share/gtk-doc/html /tmp/nm-docs-html
|
|
|
|
do_clean; BUILD_TYPE=meson CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
|
|
|
|
do_clean; BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
|
|
|
|
do_clean; BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
|
|
|
|
|
|
|
|
do_clean; test $IS_FEDORA = 1 -o $IS_CENTOS = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -W meson
|
|
|
|
do_clean; test $IS_FEDORA = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
|
|
|
|
|
2020-11-10 17:43:53 +00:00
|
|
|
do_clean
|
2020-11-10 08:11:53 +00:00
|
|
|
if [ "$NM_BUILD_TARBALL" = 1 ]; then
|
|
|
|
SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r
|
|
|
|
mv ./NetworkManager-1*.tar.xz /tmp/
|
|
|
|
mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm /tmp/
|
|
|
|
do_clean
|
|
|
|
mv /tmp/nm-docs-html ./docs-html
|
|
|
|
mv /tmp/NetworkManager-1*.tar.xz /tmp/NetworkManager-1*.src.rpm ./
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "BUILD SUCCESSFUL!!"
|