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