Skip to content

Commit 8ce2404

Browse files
Add Travis support
Signed-off-by: Robbie Harwood <[email protected]> Reviewed-by: Simo Sorce <[email protected]>
1 parent b5b41c8 commit 8ce2404

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

.travis.sh

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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

.travis.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
sudo: required
2+
3+
# not required, but less confusing if defined
4+
language: C
5+
6+
services:
7+
- docker
8+
9+
env:
10+
- DISTRO=fedora:rawhide COMPILER=gcc
11+
- DISTRO=fedora:rawhide COMPILER=clang
12+
- DISTRO=debian:sid COMPILER=clang
13+
14+
script:
15+
- >
16+
docker run
17+
-v `pwd`:/tmp/build
18+
-w /tmp/build
19+
-e COMPILER=$COMPILER
20+
$DISTRO /bin/bash -ex .travis.sh

0 commit comments

Comments
 (0)