Simplify travis-ci build handling of SELinux toolchain.

Overwrite any toolchain parts that may exist on the travis-ci build images
This commit is contained in:
Chris PeBenito 2015-03-05 15:41:30 -05:00
parent 0e9f62f6bd
commit 51fb40a617
1 changed files with 9 additions and 26 deletions

View File

@ -24,29 +24,17 @@ env:
- TYPE=mls DISTRO=gentoo DIRECT_INITRC=y MONOLITHIC=y - TYPE=mls DISTRO=gentoo DIRECT_INITRC=y MONOLITHIC=y
- TYPE=mls DISTRO=gentoo DIRECT_INITRC=y MONOLITHIC=n - TYPE=mls DISTRO=gentoo DIRECT_INITRC=y MONOLITHIC=n
# Install SELinux userspace utilities dependencies
before_install: before_install:
# Show OS version information
- lsb_release -a - lsb_release -a
- bison -V
- flex -V
- sudo apt-get update -qq - sudo apt-get update -qq
- sudo apt-get install -qq libaudit-dev libcap-ng-dev libustr-dev libustr-dev libpcre3-dev swig
# Compile and install a newer version of SELinux userspace utilities # Install SELinux userspace utilities dependencies
install: - sudo apt-get install -qq libaudit-dev libcap-ng-dev libustr-dev libpcre3-dev swig
# Setup the directory where SELinux utilities will be installed
- export DESTDIR="$HOME/selinux-project"
- mkdir "$DESTDIR"
- export PATH="$DESTDIR/usr/bin:$DESTDIR/usr/sbin:$DESTDIR/bin:$DESTDIR/sbin:$PATH"
- export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib:$LD_LIBRARY_PATH"
# On Ubuntu 12.04, default CFLAGS make the build fail in libsepol/cil with: # Download current SELinux userspace tools and libraries
# error: declaration of 'index' shadows a global declarationo - curl -sS -L https://github.com/SELinuxProject/selinux/archive/20150202.tar.gz | tar xz
# So define our own CFLAGS
- export CFLAGS="-O2 -pipe -fPIC -Wall"
# Download SELinux userspace tools and libraries
- wget https://github.com/SELinuxProject/selinux/archive/20150202.tar.gz
- tar -xzf 20150202.tar.gz
- mv selinux-20150202 selinux-src - mv selinux-20150202 selinux-src
# Ubuntu 12.04 coreutils is too old to provide "ln --relative" :( # Ubuntu 12.04 coreutils is too old to provide "ln --relative" :(
@ -57,14 +45,9 @@ install:
- sed -i -e 's/sepolicy//' selinux-src/policycoreutils/Makefile - sed -i -e 's/sepolicy//' selinux-src/policycoreutils/Makefile
# Compile and install SELinux toolchain # Compile and install SELinux toolchain
- export LIBDIR="$DESTDIR/usr/lib" # On Ubuntu 12.04, default CFLAGS make the build fail in libsepol/cil with:
- export LIBEXECDIR="$DESTDIR/usr/lib" # error: declaration of 'index' shadows a global declarationo
- export SHLIBDIR="$DESTDIR/usr/lib" - sudo make CFLAGS="-O2 -pipe -fPIC -Wall" -C selinux-src install
- export SEMODULE_PATH="$DESTDIR/usr/bin"
- make -C selinux-src install
# Use the newly-built toolchain
- export TEST_TOOLCHAIN="$DESTDIR"
# Drop build.conf settings to listen to env vars # Drop build.conf settings to listen to env vars
- sed -r -i -e '/(DIRECT_INITRC|MONOLITHIC|TYPE|DISTRO)/d' build.conf - sed -r -i -e '/(DIRECT_INITRC|MONOLITHIC|TYPE|DISTRO)/d' build.conf