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