mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-01 10:31:19 +00:00
68 lines
2.2 KiB
YAML
68 lines
2.2 KiB
YAML
# 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 ..
|
|
|
|
# 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:
|
|
# error: declaration of 'index' shadows a global declarationo
|
|
# So define our own CFLAGS
|
|
- export CFLAGS="-O2 -pipe -fPIC -Wall"
|
|
|
|
# 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
|
|
|
|
# Compile and install SELinux libraries first
|
|
- make -C selinux-src/libsepol install
|
|
- make -C selinux-src/libselinux install
|
|
|
|
# Now that the libraries are installed, use them to compile the tools
|
|
- export CFLAGS="$CFLAGS -I$DESTDIR/usr/include"
|
|
- export LDFLAGS="$LDFLAGS -L$DESTDIR/usr/lib"
|
|
- sudo ln -sf "$DESTDIR/usr/lib/libsepol.a" /usr/lib/libsepol.a
|
|
|
|
# Ubuntu 12.04's flex generates a redundant decl
|
|
- sed -i -e "/Wwrite-strings/s/,/, '-Wno-redundant-decls',/" setup.py
|
|
|
|
install:
|
|
- pip install tox
|
|
|
|
script:
|
|
- tox --version
|
|
- tox -e $TOX_ENV
|