# SELinux userspace portions originally by Nicolas Iooss # from: https://github.com/fishilico/selinux-refpolicy-patched/blob/travis-upstream/.travis.yml --- language: python env: - TOX_ENV=py27-coverage - TOX_ENV=py33-coverage - TOX_ENV=py34-coverage - TOX_ENV=pep8 before_install: - lsb_release -a - bison -V - flex -V - sudo apt-get update -qq # Install SELinux userspace utilities dependencies - sudo apt-get install -qq libaudit-dev libcap-ng-dev libustr-dev libpcre3-dev # Install newer swig - curl -sS -L http://prdownloads.sourceforge.net/swig/swig-2.0.12.tar.gz | tar xz - cd swig-2.0.12 - ./configure - make - sudo make install - cd .. # Download current SELinux userspace tools and libraries - curl -sS -L https://github.com/SELinuxProject/selinux/archive/20150202.tar.gz | tar xz - mv selinux-20150202 selinux-src - patch -p1 -d selinux-src < patches/libsepol-2.4-mls-semantic-level-expand.patch # Ubuntu 12.04 coreutils is too old to provide "ln --relative" :( - sed 's/ln -sf --relative /ln -sf /' -i selinux-src/libsepol/src/Makefile - sed 's/ln -sf --relative /ln -sf /' -i selinux-src/libselinux/src/Makefile # Drop sepolicy to break setools dependence (sepolicy isn't used anyway) - sed -i -e 's/sepolicy//' selinux-src/policycoreutils/Makefile # Compile and install SELinux toolchain # On Ubuntu 12.04, default CFLAGS make the build fail in libsepol/cil with: # error: declaration of 'index' shadows a global declarationo - sudo make CFLAGS="-O2 -pipe -fPIC -Wall" -C selinux-src install # Ubuntu 12.04's flex generates a redundant decl in libqpol - sed -i -e "/Wwrite-strings/s/,/, '-Wno-redundant-decls',/" setup.py install: - pip install tox script: - tox --version - tox -e $TOX_ENV