|
| 1 | +#!/bin/bash -ex |
| 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 | +if [ -f /etc/debian_version ]; then |
| 10 | + apt-get update |
| 11 | + DEBIAN_FRONTEND=noninteractive apt-get -y install $COMPILER \ |
| 12 | + apache2-bin {apache2,libkrb5,libssl,gss-ntlmssp}-dev \ |
| 13 | + python-{dev,requests,gssapi} lib{socket,nss}-wrapper \ |
| 14 | + flex bison krb5-{kdc,admin-server} virtualenv pkg-config |
| 15 | + |
| 16 | + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=880599 - too old |
| 17 | + virtualenv --system-site-packages .venv |
| 18 | + source .venv/bin/activate |
| 19 | + pip install requests_kerberos |
| 20 | +elif [ -f /etc/fedora-release ]; then |
| 21 | + # https://bugzilla.redhat.com/show_bug.cgi?id=1483553 means that this will |
| 22 | + # fail no matter what, but it will properly install the packages. |
| 23 | + dnf -y install $COMPILER python-gssapi krb5-{server,workstation} \ |
| 24 | + {httpd,krb5,openssl,gssntlmssp}-devel {socket,nss}_wrapper \ |
| 25 | + python-requests{,-kerberos} autoconf automake libtool which bison \ |
| 26 | + flex mod_session redhat-rpm-config \ |
| 27 | + || true |
| 28 | + |
| 29 | + if [ x$COMPILER == xclang ]; then |
| 30 | + CFLAGS+=" -Wno-unused-command-line-argument" |
| 31 | + fi |
| 32 | +else |
| 33 | + echo "Distro not found!" |
| 34 | + false |
| 35 | +fi |
| 36 | + |
| 37 | +autoreconf -fiv |
| 38 | +./configure CFLAGS="$CFLAGS" CC=$(which $COMPILER) |
| 39 | +make |
| 40 | +make check |
0 commit comments