summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Julien Pivotto <roidelapluie@inuits.eu> 2016-05-21 22:27:22 +0200
committerAvatar Wulf C. Krueger <philantrop@exherbo.org> 2016-05-26 11:50:54 +0200
commit315c48f72f194a1c082bb4864d76e1c2d3b63e94 (patch)
tree1d1fdb69f6e50b28d7f6a89a04770d6d30a5b30c
parenta35c0cd1b4a2a032c47805cc359953e165ec7277 (diff)
downloadselinux-315c48f72f194a1c082bb4864d76e1c2d3b63e94.tar.gz
selinux-315c48f72f194a1c082bb4864d76e1c2d3b63e94.tar.xz
Add setools
Change-Id: I7a9fe825753f49e40f4e3622b4b57c5ec9388407 Reviewed-on: https://galileo.mailstation.de/gerrit/6006 Reviewed-by: Jenkins <wk@mailstation.de> Reviewed-by: Wulf C. Krueger <philantrop@exherbo.org>
-rw-r--r--packages/security/setools/files/setools-Allow-to-override-PKG_CONFIG.patch134
-rw-r--r--packages/security/setools/files/setools-Make-Makefile-AR-overwritable.patch40
-rw-r--r--packages/security/setools/files/setools-gcc-in-configure.diff17
-rw-r--r--packages/security/setools/files/setools_ac_pkg_swig_m4_fixed.diff35
-rw-r--r--packages/security/setools/setools-3.3.8.exheres-066
5 files changed, 292 insertions, 0 deletions
diff --git a/packages/security/setools/files/setools-Allow-to-override-PKG_CONFIG.patch b/packages/security/setools/files/setools-Allow-to-override-PKG_CONFIG.patch
new file mode 100644
index 0000000..def81ab
--- /dev/null
+++ b/packages/security/setools/files/setools-Allow-to-override-PKG_CONFIG.patch
@@ -0,0 +1,134 @@
+From: Julien Pivotto <roidelapluie@inuits.eu>
+Date: Thu, 12 May 2016 22:44:39 +0200
+Subject: [PATCH 2/2] setools3: Allow to override PKG_CONFIG
+Upstream: pending
+Source: exherbo
+
+---
+ configure.ac | 51 ++++++++++++++++++++++++---------------------------
+ 1 file changed, 24 insertions(+), 27 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8de2b7e..d595f0c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -692,30 +692,27 @@ AC_ARG_WITH(test-policies,
+
+ AC_CACHE_SAVE
+
+-dnl check for pkg-config
+-AC_CHECK_PROG(has_pkg_config, pkg-config, yes, no)
+-if test ${has_pkg_config} = "no"; then
+- AC_MSG_ERROR([pkg-config not found])
+-fi
++dnl check for ${PKG_CONFIG}
++PKG_PROG_PKG_CONFIG
+
+ AC_MSG_CHECKING([for libxml])
+-pkg-config --exists 'libxml-2.0'
++${PKG_CONFIG} --exists 'libxml-2.0'
+ if test $? -ne 0 ; then
+ AC_MSG_ERROR([setools requires libxml-2.0])
+ fi
+-XML_CFLAGS=`pkg-config --cflags libxml-2.0`
+-XML_LIBS=`pkg-config --libs libxml-2.0`
++XML_CFLAGS=`${PKG_CONFIG} --cflags libxml-2.0`
++XML_LIBS=`${PKG_CONFIG} --libs libxml-2.0`
+ AC_MSG_RESULT([yes])
+ AC_SUBST(XML_CFLAGS)
+ AC_SUBST(XML_LIBS)
+
+ AC_MSG_CHECKING([for sqlite3])
+-pkg-config --exists 'sqlite3 >= 3.2.0'
++${PKG_CONFIG} --exists 'sqlite3 >= 3.2.0'
+ if test $? -ne 0 ; then
+ AC_MSG_ERROR([setools requires sqlite3 3.2.0 or greater])
+ fi
+-SQLITE3_CFLAGS=`pkg-config --cflags sqlite3`
+-SQLITE3_LIBS=`pkg-config --libs sqlite3`
++SQLITE3_CFLAGS=`${PKG_CONFIG} --cflags sqlite3`
++SQLITE3_LIBS=`${PKG_CONFIG} --libs sqlite3`
+ AC_MSG_RESULT([yes])
+ AC_SUBST(SQLITE3_CFLAGS)
+ AC_SUBST(SQLITE3_LIBS)
+@@ -727,47 +724,47 @@ gtk_version_2_8=1
+ if test "x${build_gui}" = xyes; then
+
+ AC_MSG_CHECKING([for GTK])
+- pkg-config --atleast-version=2.4 gtk+-2.0
++ ${PKG_CONFIG} --atleast-version=2.4 gtk+-2.0
+ if test $? -ne 0; then
+ AC_MSG_ERROR([setools requires GTK+ 2.4 or greater])
+ fi
+- pkg-config --atleast-version=2.8 gtk+-2.0
++ ${PKG_CONFIG} --atleast-version=2.8 gtk+-2.0
+ gtk_version_2_8=$?
+- GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
+- GTK_LIBS=`pkg-config --libs gtk+-2.0`
++ GTK_CFLAGS=`${PKG_CONFIG} --cflags gtk+-2.0`
++ GTK_LIBS=`${PKG_CONFIG} --libs gtk+-2.0`
+ AC_MSG_RESULT([yes])
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+
+ AC_MSG_CHECKING([for libglade])
+- pkg-config --exists 'libglade-2.0'
++ ${PKG_CONFIG} --exists 'libglade-2.0'
+ if test $? -ne 0; then
+ AC_MSG_ERROR([setools requires libglade-2.0; make sure libglade2-devel is installed])
+ fi
+- GLADE_CFLAGS=`pkg-config --cflags libglade-2.0`
+- GLADE_LIBS=`pkg-config --libs libglade-2.0`
++ GLADE_CFLAGS=`${PKG_CONFIG} --cflags libglade-2.0`
++ GLADE_LIBS=`${PKG_CONFIG} --libs libglade-2.0`
+ AC_MSG_RESULT([yes])
+ AC_SUBST(GLADE_CFLAGS)
+ AC_SUBST(GLADE_LIBS)
+
+ AC_MSG_CHECKING([for gdk-pixbuf])
+- pkg-config --exists 'gdk-pixbuf-2.0'
++ ${PKG_CONFIG} --exists 'gdk-pixbuf-2.0'
+ if test $? -ne 0; then
+ AC_MSG_ERROR([setools requires gdk-pixbuf-2.0])
+ fi
+- PIXBUF_CFLAGS=`pkg-config --cflags gdk-pixbuf-2.0`
+- PIXBUF_LIBS=`pkg-config --libs gdk-pixbuf-2.0`
++ PIXBUF_CFLAGS=`${PKG_CONFIG} --cflags gdk-pixbuf-2.0`
++ PIXBUF_LIBS=`${PKG_CONFIG} --libs gdk-pixbuf-2.0`
+ AC_MSG_RESULT([yes])
+ AC_SUBST(PIXBUF_CFLAGS)
+ AC_SUBST(PIXBUF_LIBS)
+
+ AC_MSG_CHECKING([for gthread])
+- pkg-config --exists 'gthread-2.0'
++ ${PKG_CONFIG} --exists 'gthread-2.0'
+ if test $? -ne 0; then
+ AC_MSG_ERROR([setools requires gthread-2.0])
+ fi
+- GTHREAD_CFLAGS=`pkg-config --cflags gthread-2.0`
+- GTHREAD_LIBS=`pkg-config --libs gthread-2.0`
++ GTHREAD_CFLAGS=`${PKG_CONFIG} --cflags gthread-2.0`
++ GTHREAD_LIBS=`${PKG_CONFIG} --libs gthread-2.0`
+ AC_MSG_RESULT([yes])
+ AC_SUBST(GTHREAD_CFLAGS)
+ AC_SUBST(GTHREAD_LIBS)
+@@ -795,13 +792,13 @@ AC_CHECK_LIB(bz2,
+ )
+
+ #AC_MSG_CHECKING([for FUSE])
+-#pkg-config --exists fuse
++#${PKG_CONFIG} --exists fuse
+ #if test $? -ne 0; then
+ # AC_MSG_WARN([FUSE not found; libsefs tests will not be built])
+ # have_fuse="no"
+ #else
+-# FUSE_CFLAGS=`pkg-config --cflags fuse`
+-# FUSE_LIBS=`pkg-config --libs fuse`
++# FUSE_CFLAGS=`${PKG_CONFIG} --cflags fuse`
++# FUSE_LIBS=`${PKG_CONFIG} --libs fuse`
+ # AC_SUBST(FUSE_CFLAGS)
+ # AC_SUBST(FUSE_LIBS)
+ # have_fuse="yes"
+--
+2.6.1
+
diff --git a/packages/security/setools/files/setools-Make-Makefile-AR-overwritable.patch b/packages/security/setools/files/setools-Make-Makefile-AR-overwritable.patch
new file mode 100644
index 0000000..71d93dc
--- /dev/null
+++ b/packages/security/setools/files/setools-Make-Makefile-AR-overwritable.patch
@@ -0,0 +1,40 @@
+From: Julien Pivotto <roidelapluie@inuits.eu>
+Date: Thu, 12 May 2016 22:36:11 +0200
+Subject: [PATCH 1/2] libqpol: Make Makefile AR overwritable
+Upstream: pending
+Source: exherbo
+
+---
+ configure.ac | 2 ++
+ libqpol/src/Makefile.am | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index ae20da7..8de2b7e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -73,6 +73,8 @@ AC_C_BIGENDIAN
+ AC_CHECK_FUNCS(rand_r)
+ AC_SYS_LARGEFILE
+
++AC_CHECK_TOOL([AR], [ar])
++
+ AC_CACHE_SAVE
+
+ if test "x${enable_shared}" = xyes; then
+diff --git a/libqpol/src/Makefile.am b/libqpol/src/Makefile.am
+index 77213f4..61ed495 100644
+--- a/libqpol/src/Makefile.am
++++ b/libqpol/src/Makefile.am
+@@ -67,7 +67,7 @@ $(tmp_sepol): $(sepol_srcdir)/libsepol.a
+ mkdir -p $@
+ rm -f $@/*
+ cp $< $@
+- (cd $@; ar x libsepol.a)
++ (cd $@; $(AR) x libsepol.a)
+
+ $(qpolso_DATA): $(tmp_sepol) $(libqpol_so_OBJS) libqpol.map
+ $(CC) -shared -o $@ $(libqpol_so_OBJS) $(AM_LDFLAGS) $(LDFLAGS) -Wl,-soname,$(LIBQPOL_SONAME),--version-script=$(srcdir)/libqpol.map,-z,defs -Wl,--whole-archive $(sepol_srcdir)/libsepol.a -Wl,--no-whole-archive @SELINUX_LIB_FLAG@ -lselinux -lsepol -lbz2
+--
+2.6.1
+
diff --git a/packages/security/setools/files/setools-gcc-in-configure.diff b/packages/security/setools/files/setools-gcc-in-configure.diff
new file mode 100644
index 0000000..138bfb9
--- /dev/null
+++ b/packages/security/setools/files/setools-gcc-in-configure.diff
@@ -0,0 +1,17 @@
+Source: exherbo
+Upstream: no
+Reason: fix compilation with prefixed gcc
+
+diff --git a/configure.ac b/configure.ac
+index ae20da7..7b8e3d3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -661,7 +661,7 @@ EOF
+ changequote([,])dnl
+ selinux_save_CFLAGS="${CFLAGS}"
+ CFLAGS="${SELINUX_CFLAGS} ${SELINUX_LIB_FLAG} -lselinux -lsepol ${CFLAGS}"
+- gcc ${CFLAGS} -o conftest conftest.c >&5
++ ${CC} ${CFLAGS} -o conftest conftest.c >&5
+ selinux_policy_dir=`./conftest`
+ AC_MSG_RESULT(${selinux_policy_dir})
+ CFLAGS="${selinux_save_CFLAGS}"
diff --git a/packages/security/setools/files/setools_ac_pkg_swig_m4_fixed.diff b/packages/security/setools/files/setools_ac_pkg_swig_m4_fixed.diff
new file mode 100644
index 0000000..ee50ebb
--- /dev/null
+++ b/packages/security/setools/files/setools_ac_pkg_swig_m4_fixed.diff
@@ -0,0 +1,35 @@
+Description: Fix FTBFS with swig >= 2.0
+Author: Sebastian Ramacher <s.ramacher@gmx.at>
+Date: Tue, 28 Jun 2011 22:19:49 +0200
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631800
+Upstream: no
+Reason: Fix compilation issues
+Source: debian
+
+--- setools-3.3.6.ds.orig/m4/ac_pkg_swig.m4 2007-02-09 18:32:41.000000000 +0100
++++ setools-3.3.6.ds/m4/ac_pkg_swig.m4 2011-06-27 14:12:03.000000000 +0200
+@@ -106,15 +106,18 @@
+ if test -z "$available_patch" ; then
+ [available_patch=0]
+ fi
+- if test $available_major -ne $required_major \
+- -o $available_minor -ne $required_minor \
+- -o $available_patch -lt $required_patch ; then
+- AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org])
+- SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false'
+- else
++ if test $available_major -gt $required_major || \
++ ( test $available_major -eq $required_major && \
++ test $available_minor -gt $required_minor ) || \
++ ( test $available_major -eq $required_major && \
++ test $available_minor -eq $required_minor && \
++ test $available_patch -ge $required_patch ) ; then
+ AC_MSG_NOTICE([SWIG executable is '$SWIG'])
+ SWIG_LIB=`$SWIG -swiglib`
+ AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
++ else
++ AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org])
++ SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false'
+ fi
+ else
+ AC_MSG_WARN([cannot determine SWIG version])
diff --git a/packages/security/setools/setools-3.3.8.exheres-0 b/packages/security/setools/setools-3.3.8.exheres-0
new file mode 100644
index 0000000..b71355e
--- /dev/null
+++ b/packages/security/setools/setools-3.3.8.exheres-0
@@ -0,0 +1,66 @@
+# Copyright 2016 Julien Pivotto <roidelapluie@inuits.eu>
+# Distributed under the terms of the GNU General Public License v2
+
+REVISION=f1e5b208d507171968ca4d2eeefd7980f1004a3c
+
+# We only build some libraries (which are not yet ported to setools4)
+# For the rest of the setools please see setools:4
+MY_LIBRARIES_TO_BUILD=( libqpol libapol )
+
+require github [ user=TresysTechnology pn=setools3 rev="${REVISION}" ]
+require autotools [ supported_autoconf=[ 2.5 ] supported_automake=[ 1.13 ] ]
+
+SUMMARY="Security Enhanced Linux policy analysis development"
+DESCRIPTION="This library is used by the SELinux core utilities to analyse and
+develop SELinux policies."
+
+BUGS_TO="roidelapluie@inuits.eu"
+
+LICENCES="GPL-2"
+SLOT="3"
+PLATFORMS="~amd64"
+MYOPTIONS=""
+
+DEPENDENCIES="
+ build:
+ dev-lang/swig
+ build+run:
+ dev-db/sqlite:3
+ dev-libs/libxml2
+ security/libselinux[>=2.4]
+ security/libsepol[>=2.4]
+ test:
+ dev-util/cunit
+"
+
+DEFAULT_SRC_PREPARE_PATCHES=(
+ "${FILES}/${PN}-Make-Makefile-AR-overwritable.patch"
+ "${FILES}/${PN}-Allow-to-override-PKG_CONFIG.patch"
+ "${FILES}/${PN}_ac_pkg_swig_m4_fixed.diff"
+ "${FILES}/${PN}-gcc-in-configure.diff"
+)
+
+DEFAULT_SRC_CONFIGURE_PARAMS=(
+ --disable-selinux-check
+ --disable-bwidget-check
+ --disable-gui
+)
+
+DEFAULT_SRC_COMPILE_PARAMS=( AR="${AR}" )
+
+src_compile(){
+ for library in "${MY_LIBRARIES_TO_BUILD[@]}"; do
+ emake ${library}
+ done
+}
+
+src_test(){
+ LD_LIBRARY_PATH='../src' default
+}
+
+src_install(){
+ for library in "${MY_LIBRARIES_TO_BUILD[@]}"; do
+ emake -j1 DESTDIR="${IMAGE}" -C "${library}" install
+ done
+}
+