Gentoo Archives: gentoo-commits

From: Sven Vermeulen <swift@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-refpolicy:next commit in: /
Date: Fri, 28 Nov 2014 10:04:20
Message-Id: 1417019344.6fa8e312341c91ad17a237666d45f188bd867da3.swift@gentoo
1 commit: 6fa8e312341c91ad17a237666d45f188bd867da3
2 Author: Jason Zaman <jason <AT> perfinion <DOT> com>
3 AuthorDate: Wed Nov 26 08:00:45 2014 +0000
4 Commit: Sven Vermeulen <swift <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 26 16:29:04 2014 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=6fa8e312
7
8 add in travis config for testing
9
10 ---
11 .travis.yml | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 1 file changed, 113 insertions(+)
13
14 diff --git a/.travis.yml b/.travis.yml
15 new file mode 100644
16 index 0000000..ce213a3
17 --- /dev/null
18 +++ b/.travis.yml
19 @@ -0,0 +1,113 @@
20 +# Originally by Nicolas Iooss from: https://github.com/fishilico/selinux-refpolicy-patched/blob/travis-upstream/.travis.yml
21 +
22 +language: python
23 +python:
24 + - "2.7"
25 +
26 +# for T in standard mls mcs ; do for D in arch debian gentoo ; do for I in n y ; do for M in y n ; do
27 +# echo " - TYPE=$T DISTRO=$D DIRECT_INITRC=$I MONOLITHIC=$M" ; done ; done ; done ; done
28 +env:
29 + - TYPE=standard DISTRO=gentoo DIRECT_INITRC=n MONOLITHIC=n
30 + - TYPE=mls DISTRO=gentoo DIRECT_INITRC=n MONOLITHIC=n
31 + - TYPE=mcs DISTRO=gentoo DIRECT_INITRC=n MONOLITHIC=n
32 +
33 +# Install SELinux userspace utilities dependencies
34 +before_install:
35 +# Show OS version information
36 + - lsb_release -a
37 + - sudo apt-get update -qq
38 + - sudo apt-get install -qq libaudit-dev libcap-ng-dev libustr-dev swig
39 +
40 +# Compile and install a newer version of SELinux userspace utilities
41 +install:
42 + # Setup the directory where SELinux utilities will be installed
43 + - export DESTDIR="$HOME/selinux-project"
44 + - mkdir "$DESTDIR"
45 + - export PATH="$DESTDIR/usr/bin:$DESTDIR/usr/sbin:$DESTDIR/bin:$DESTDIR/sbin:$PATH"
46 + - export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib:$LD_LIBRARY_PATH"
47 +
48 + # On Ubuntu 12.04, default CFLAGS make the build fail in libsepol/cil with:
49 + # error: declaration of 'index' shadows a global declarationo
50 + # So define our own CFLAGS
51 + - export CFLAGS="-O2 -pipe -fPIC -Wall"
52 +
53 + # Download SELinux userspace tools and libraries
54 + - wget https://github.com/SELinuxProject/selinux/archive/20140826-rc6.tar.gz
55 + - tar -xzf 20140826-rc6.tar.gz
56 + - mv selinux-20140826-rc6 selinux-src
57 +
58 + # Download setools
59 + - wget https://github.com/TresysTechnology/setools3/archive/setools-3.3.8.tar.gz
60 + - tar -xzf setools-3.3.8.tar.gz
61 + - mv setools3-setools-3.3.8 setools-src
62 +
63 + # Ubuntu 12.04 coreutils is too old to provide "ln --relative" :(
64 + - sed 's/ln -sf --relative /ln -sf /' -i selinux-src/libsepol/src/Makefile
65 + - sed 's/ln -sf --relative /ln -sf /' -i selinux-src/libselinux/src/Makefile
66 +
67 + # Compile and install SELinux libraries first
68 + - make -C selinux-src/libsepol install
69 + - make -C selinux-src/libselinux install
70 + - make -C selinux-src/libsemanage install
71 +
72 + # Now that the libraries are installed, use them to compile the tools
73 + - export CFLAGS="$CFLAGS -I$DESTDIR/usr/include"
74 + - export LDFLAGS="$LDFLAGS -L$DESTDIR/usr/lib"
75 +
76 + # Compile and install setools
77 + - cd setools-src
78 + - aclocal && autoreconf -if && automake
79 + - ./configure
80 + --prefix="$DESTDIR/usr"
81 + --disable-gui --disable-swig-tcl
82 + --disable-bwidget-check --disable-selinux-check
83 + --with-sepol-devel="$DESTDIR/usr"
84 + --with-selinux-devel="$DESTDIR/usr"
85 + - make -C libqpol DESTDIR= install
86 + - make -C libapol DESTDIR= install
87 + - cd ..
88 +
89 + # Compile and install SELinux tools
90 + - export LIBDIR="$DESTDIR/usr/lib"
91 + - export LIBEXECDIR="$DESTDIR/usr/lib"
92 + - export SHLIBDIR="$DESTDIR/usr/lib"
93 + - export SEMODULE_PATH="$DESTDIR/usr/bin"
94 + - make -C selinux-src/sepolgen install
95 + - make -C selinux-src/checkpolicy install
96 + - make -C selinux-src/policycoreutils install
97 +
98 + # Use the newly-built toolchain
99 + - export TEST_TOOLCHAIN="$DESTDIR"
100 +
101 +# XXX: not sure whether the definition in make command line are useful or whether the env definitions are enough
102 +# Use a heartbeat loop to produce output while compiling the policy, which takes quite a long time.
103 +script:
104 + - make bare
105 + - make TYPE="$TYPE" MONOLITHIC="$MONOLITHIC" conf
106 +
107 +# - if [ "$MONOLITHIC" = y ]; then
108 +# ( for A in $(seq 8) ; do sleep 300 ; echo "Heartbeat $((A*5)) minutes" ; done ) &
109 +# make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=y ;
110 +# fi
111 +# - if [ "$MONOLITHIC" = y ]; then make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=y file_contexts ; fi
112 +# - if [ "$MONOLITHIC" = y ]; then setfiles -c policy.$(checkpolicy -V | cut -d' ' -f1) file_contexts ; fi
113 +# - if [ "$MONOLITHIC" = n ]; then make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n base ; fi
114 +# - if [ "$MONOLITHIC" = n ]; then make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n modules ; fi
115 +# - if [ "$MONOLITHIC" = n ]; then
116 +# ( for A in $(seq 8) ; do sleep 300 ; echo "Heartbeat $((A*5)) minutes" ; done ) &
117 +# make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n validate ;
118 +# fi
119 +
120 + - make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n base
121 + - make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n modules
122 + - ( for A in $(seq 8) ; do sleep 300 ; echo "Heartbeat $((A*5)) minutes" ; done ) &
123 + make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n validate
124 +
125 +# Only build travis branches
126 +branches:
127 + only:
128 + - /^travis-.*/
129 +
130 +notifications:
131 + email: false
132 +