-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy path.travis.sh
67 lines (55 loc) · 2 KB
/
.travis.sh
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
#!/bin/bash -ex
if [ -f /etc/debian_version ]; then
PYTHON=python3
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y install $COMPILER pkg-config flake8 virtualenv \
apache2-bin {apache2,libkrb5,libssl,gss-ntlmssp}-dev \
$PYTHON{,-dev,-requests} lib{socket,nss}-wrapper \
flex bison krb5-{kdc,admin-server,pkinit} curl
apt-get -y install $PYTHON-requests-gssapi 2>/dev/null || true
flake8
elif [ -f /etc/redhat-release ]; then
DY=yum
PYTHON=python2
if [ -f /etc/fedora-release ]; then
DY=dnf
PYTHON=python3
fi
$DY -y install $COMPILER $PYTHON-{gssapi,requests} \
krb5-{server,workstation,pkinit} curl \
{httpd,krb5,openssl,gssntlmssp}-devel {socket,nss}_wrapper \
autoconf automake libtool which bison make $PYTHON \
flex mod_session redhat-rpm-config /usr/bin/virtualenv
$DY -y install python-requests-gssapi 2>/dev/null || true
else
echo "Distro not found!"
false
fi
CFLAGS="-Werror"
if [ x$COMPILER == xclang ]; then
CFLAGS+=" -Wno-missing-field-initializers"
CFLAGS+=" -Wno-missing-braces -Wno-cast-align"
# So this is just a sad hack to get around:
# clang-7: error: unknown argument: '-fstack-clash-protection'
# which doesn't seem to have a solution right now.
cp=$(which clang)
mv $cp $cp.real
cat > $cp <<EOF
#!/usr/bin/env python
import os
import sys
argv = [a for a in sys.argv if a != "-fstack-clash-protection" \
and not a.startswith("-specs")]
argv[0] = "${cp}.real"
os.execve(argv[0], argv, {})
EOF
chmod +x $cp
fi
virtualenv --system-site-packages -p $(which $PYTHON) .venv
source .venv/bin/activate
pip install requests{,-gssapi}
scratch=/tmp/build/mod_auth_gssapi-*/_build/sub/testsdir
autoreconf -fiv
./configure # overridden by below, but needs to generate Makefile
make distcheck DISTCHECK_CONFIGURE_FLAGS="CFLAGS=\"$CFLAGS\" CC=$(which $COMPILER)" || (cat $scratch/tests.log $scratch/httpd/logs/error_log; exit -1)