11#! /bin/bash -ex
22
33if [ -f /etc/debian_version ]; then
4- PYTHON=python3
54 export DEBIAN_FRONTEND=noninteractive
65
7- apt-get update
6+ apt-get -q update
87
9- apt-get -y install $COMPILER pkg-config flake8 virtualenv \
8+ apt-get -yq install $COMPILER pkg-config flake8 virtualenv \
109 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
1312
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 \
2717 {httpd,krb5,openssl,gssntlmssp}-devel {socket,nss}_wrapper \
28- autoconf automake libtool which bison make $PYTHON \
18+ autoconf automake libtool which bison make python3 \
2919 flex mod_session redhat-rpm-config /usr/bin/virtualenv
30-
31- $DY -y install python-requests-gssapi 2> /dev/null || true
3220else
3321 echo " Distro not found!"
3422 false
3523fi
3624
25+ if [ x$FLAKE == xyes ]; then
26+ flake8
27+ fi
28+
3729CFLAGS=" -Werror"
3830if [ x$COMPILER == xclang ]; then
3931 CFLAGS+=" -Wno-missing-field-initializers"
@@ -45,7 +37,7 @@ if [ x$COMPILER == xclang ]; then
4537 cp=$( which clang)
4638 mv $cp $cp .real
4739 cat > $cp << EOF
48- #!/usr/bin/env python
40+ #!/usr/bin/env python3
4941import os
5042import sys
5143argv = [a for a in sys.argv if a != "-fstack-clash-protection" \
5648 chmod +x $cp
5749fi
5850
59- virtualenv --system-site-packages -p $( which $PYTHON ) .venv
51+ virtualenv --system-site-packages -p $( which python3 ) .venv
6052source .venv/bin/activate
6153pip install requests{,-gssapi}
6254
6355scratch=/tmp/build/mod_auth_gssapi-* /_build/sub/testsdir
6456
6557autoreconf -fiv
6658./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