1
1
#! /bin/bash -ex
2
2
3
3
if [ -f /etc/debian_version ]; then
4
- PYTHON=python3
5
4
export DEBIAN_FRONTEND=noninteractive
6
5
7
- apt-get update
6
+ apt-get -q update
8
7
9
- apt-get -y install $COMPILER pkg-config flake8 virtualenv \
8
+ apt-get -yq install $COMPILER pkg-config flake8 virtualenv \
10
9
apache2-bin {apache2,libkrb5,libssl,gss-ntlmssp}-dev \
11
- $PYTHON {,-dev,-requests} lib{socket,nss}-wrapper \
12
- flex bison krb5-{kdc,admin-server,pkinit} curl
10
+ python3 {,-dev,-requests} lib{socket,nss}-wrapper \
11
+ flex bison krb5-{kdc,admin-server,pkinit} curl libfaketime
13
12
14
- apt-get -y install $PYTHON -requests-gssapi 2> /dev/null || true
15
-
16
- flake8
17
- elif [ -f /etc/redhat-release ]; then
18
- DY=yum
19
- PYTHON=python2
20
- if [ -f /etc/fedora-release ]; then
21
- DY=dnf
22
- PYTHON=python3
23
- fi
24
-
25
- $DY -y install $COMPILER $PYTHON -{gssapi,requests} \
26
- krb5-{server,workstation,pkinit} curl \
13
+ apt-get -yq install python3-requests-gssapi 2> /dev/null || true
14
+ elif [ -f /etc/fedora-release ]; then
15
+ dnf -y install $COMPILER python3-{gssapi,requests{,-gssapi},flake8} \
16
+ krb5-{server,workstation,pkinit} curl libfaketime \
27
17
{httpd,krb5,openssl,gssntlmssp}-devel {socket,nss}_wrapper \
28
- autoconf automake libtool which bison make $PYTHON \
18
+ autoconf automake libtool which bison make python3 \
29
19
flex mod_session redhat-rpm-config /usr/bin/virtualenv
30
-
31
- $DY -y install python-requests-gssapi 2> /dev/null || true
32
20
else
33
21
echo " Distro not found!"
34
22
false
35
23
fi
36
24
25
+ if [ x$FLAKE == xyes ]; then
26
+ flake8
27
+ fi
28
+
37
29
CFLAGS=" -Werror"
38
30
if [ x$COMPILER == xclang ]; then
39
31
CFLAGS+=" -Wno-missing-field-initializers"
@@ -45,7 +37,7 @@ if [ x$COMPILER == xclang ]; then
45
37
cp=$( which clang)
46
38
mv $cp $cp .real
47
39
cat > $cp << EOF
48
- #!/usr/bin/env python
40
+ #!/usr/bin/env python3
49
41
import os
50
42
import sys
51
43
argv = [a for a in sys.argv if a != "-fstack-clash-protection" \
56
48
chmod +x $cp
57
49
fi
58
50
59
- virtualenv --system-site-packages -p $( which $PYTHON ) .venv
51
+ virtualenv --system-site-packages -p $( which python3 ) .venv
60
52
source .venv/bin/activate
61
53
pip install requests{,-gssapi}
62
54
63
55
scratch=/tmp/build/mod_auth_gssapi-* /_build/sub/testsdir
64
56
65
57
autoreconf -fiv
66
58
./configure # overridden by below, but needs to generate Makefile
67
- make distcheck DISTCHECK_CONFIGURE_FLAGS=" CFLAGS=\" $CFLAGS \" CC=$( which $COMPILER ) " || (cat $scratch /tests.log $scratch /httpd/logs/error_log; exit -1)
59
+ DCF=" CFLAGS=\" $CFLAGS \" CC=$( which $COMPILER ) "
60
+ make distcheck DISTCHECK_CONFIGURE_FLAGS=" $DCF " ||
61
+ (cat $scratch /tests.log $scratch /httpd/logs/error_log; exit -1)
0 commit comments