diff options
author | Jason Zaman <perfinion@gentoo.org> | 2015-02-12 18:04:48 +0000 |
---|---|---|
committer | Jason Zaman <perfinion@gentoo.org> | 2015-02-12 18:04:48 +0000 |
commit | 6ae3253b70cf34269f96b8be9a5f5e8280a7223f (patch) | |
tree | 878f72d6a325342d67eab3250d80b6f2ee83ec7f /app-admin/setools | |
parent | Add net-im/emesene to the MSN clients that need to be removed. See #525100 (diff) | |
download | gentoo-2-6ae3253b70cf34269f96b8be9a5f5e8280a7223f.tar.gz gentoo-2-6ae3253b70cf34269f96b8be9a5f5e8280a7223f.tar.bz2 gentoo-2-6ae3253b70cf34269f96b8be9a5f5e8280a7223f.zip |
fix compile error with 2.4 userland, bug 539462
(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 0x7EF137EC935B0EAF)
Diffstat (limited to 'app-admin/setools')
-rw-r--r-- | app-admin/setools/ChangeLog | 10 | ||||
-rw-r--r-- | app-admin/setools/files/setools3-userspace-2.4-compatibility.patch | 114 | ||||
-rw-r--r-- | app-admin/setools/setools-3.3.8-r6.ebuild | 167 |
3 files changed, 289 insertions, 2 deletions
diff --git a/app-admin/setools/ChangeLog b/app-admin/setools/ChangeLog index c3474f0e9224..ca75feb366b5 100644 --- a/app-admin/setools/ChangeLog +++ b/app-admin/setools/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-admin/setools -# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/setools/ChangeLog,v 1.93 2014/08/05 10:06:33 swift Exp $ +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/setools/ChangeLog,v 1.94 2015/02/12 18:04:48 perfinion Exp $ + +*setools-3.3.8-r6 (12 Feb 2015) + + 12 Feb 2015; Jason Zaman <perfinion@gentoo.org> + +files/setools3-userspace-2.4-compatibility.patch, +setools-3.3.8-r6.ebuild: + fix compile error with 2.4 userland, bug 539462 05 Aug 2014; Sven Vermeulen <swift@gentoo.org> -setools-3.3.8-r2.ebuild, -setools-3.3.8-r4.ebuild: diff --git a/app-admin/setools/files/setools3-userspace-2.4-compatibility.patch b/app-admin/setools/files/setools3-userspace-2.4-compatibility.patch new file mode 100644 index 000000000000..c8fc3f52905d --- /dev/null +++ b/app-admin/setools/files/setools3-userspace-2.4-compatibility.patch @@ -0,0 +1,114 @@ +From f1e5b208d507171968ca4d2eeefd7980f1004a3c Mon Sep 17 00:00:00 2001 +From: Chris PeBenito <cpebenito@tresys.com> +Date: Thu, 12 Feb 2015 08:55:12 -0500 +Subject: [PATCH] Update for 2015-02-02 Userspace release (2.4) + +SETools now requires libsepol 2.4 and libselinux 2.4. +--- + configure.ac | 6 +++--- + libqpol/src/policy_define.c | 4 ++-- + libqpol/src/policy_extend.c | 4 ++-- + libqpol/src/syn_rule_query.c | 6 +++--- + secmds/replcon.cc | 2 +- + 5 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 80395e6..ae20da7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -25,9 +25,9 @@ libseaudit_version=4.5 + setoolsdir='${prefix}/share/setools-3.3' + javadir='${prefix}/share/java' + +-version_min_sepol_major=1 +-version_min_sepol_minor=12 +-version_min_sepol_patch=27 ++version_min_sepol_major=2 ++version_min_sepol_minor=4 ++version_min_sepol_patch=0 + + dnl *** end of tunable values *** + +diff --git a/libqpol/src/policy_define.c b/libqpol/src/policy_define.c +index 229779c..15f70ba 100644 +--- a/libqpol/src/policy_define.c ++++ b/libqpol/src/policy_define.c +@@ -1661,7 +1661,7 @@ int define_compute_type_helper(int which, avrule_t ** rule) + goto bad; + } + class_perm_node_init(perm); +- perm->class = i + 1; ++ perm->tclass = i + 1; + perm->data = datum->s.value; + perm->next = avrule->perms; + avrule->perms = perm; +@@ -1901,7 +1901,7 @@ int define_te_avtab_helper(int which, avrule_t ** rule) + goto out; + } + class_perm_node_init(cur_perms); +- cur_perms->class = i + 1; ++ cur_perms->tclass = i + 1; + if (!perms) + perms = cur_perms; + if (tail) +diff --git a/libqpol/src/policy_extend.c b/libqpol/src/policy_extend.c +index 5325a87..1417271 100644 +--- a/libqpol/src/policy_extend.c ++++ b/libqpol/src/policy_extend.c +@@ -843,7 +843,7 @@ static int qpol_syn_rule_table_insert_sepol_avrule(qpol_policy_t * policy, qpol_ + for (class_node = rule->perms; class_node; class_node = class_node->next) { + key.rule_type = rule->specified; + key.source_val = key.target_val = i + 1; +- key.class_val = class_node->class; ++ key.class_val = class_node->tclass; + key.cond = cond; + if (qpol_syn_rule_table_insert_entry(policy, table, &key, new_rule)) + goto err; +@@ -856,7 +856,7 @@ static int qpol_syn_rule_table_insert_sepol_avrule(qpol_policy_t * policy, qpol_ + key.rule_type = rule->specified; + key.source_val = i + 1; + key.target_val = j + 1; +- key.class_val = class_node->class; ++ key.class_val = class_node->tclass; + key.cond = cond; + if (qpol_syn_rule_table_insert_entry(policy, table, &key, new_rule)) + goto err; +diff --git a/libqpol/src/syn_rule_query.c b/libqpol/src/syn_rule_query.c +index 3e63204..d7578f1 100644 +--- a/libqpol/src/syn_rule_query.c ++++ b/libqpol/src/syn_rule_query.c +@@ -67,7 +67,7 @@ static void *syn_rule_class_state_get_cur(const qpol_iterator_t * iter) + return NULL; + } + +- return db->class_val_to_struct[srcs->cur->class - 1]; ++ return db->class_val_to_struct[srcs->cur->tclass - 1]; + } + + static int syn_rule_class_state_next(qpol_iterator_t * iter) +@@ -465,10 +465,10 @@ int qpol_syn_avrule_get_perm_iter(const qpol_policy_t * policy, const qpol_syn_a + } + + for (node = internal_rule->perms; node; node = node->next) { +- for (i = 0; i < db->class_val_to_struct[node->class - 1]->permissions.nprim; i++) { ++ for (i = 0; i < db->class_val_to_struct[node->tclass - 1]->permissions.nprim; i++) { + if (!(node->data & (1 << i))) + continue; +- tmp = sepol_av_to_string(db, node->class, (sepol_access_vector_t) (1 << i)); ++ tmp = sepol_av_to_string(db, node->tclass, (sepol_access_vector_t) (1 << i)); + if (tmp) { + tmp++; /* remove prepended space */ + for (cur = 0; cur < perm_list_sz; cur++) +diff --git a/secmds/replcon.cc b/secmds/replcon.cc +index 34f7c1a..307c39f 100644 +--- a/secmds/replcon.cc ++++ b/secmds/replcon.cc +@@ -60,7 +60,7 @@ static struct option const longopts[] = { + {NULL, 0, NULL, 0} + }; + +-extern int lsetfilecon_raw(const char *, security_context_t) __attribute__ ((weak)); ++extern int lsetfilecon_raw(const char *, const char *) __attribute__ ((weak)); + + /** + * As that setools must work with older libselinux versions that may diff --git a/app-admin/setools/setools-3.3.8-r6.ebuild b/app-admin/setools/setools-3.3.8-r6.ebuild new file mode 100644 index 000000000000..3b3be066523b --- /dev/null +++ b/app-admin/setools/setools-3.3.8-r6.ebuild @@ -0,0 +1,167 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/setools/setools-3.3.8-r6.ebuild,v 1.1 2015/02/12 18:04:48 perfinion Exp $ + +EAPI="5" +PYTHON_COMPAT=( python2_7 ) + +inherit autotools java-pkg-opt-2 python-r1 eutils + +DESCRIPTION="SELinux policy tools" +HOMEPAGE="http://www.tresys.com/selinux/selinux_policy_tools.shtml" +SRC_URI="http://oss.tresys.com/projects/setools/chrome/site/dists/${P}/${P}.tar.bz2 + http://dev.gentoo.org/~swift/patches/setools/${P}-01-fedora-patches.tar.gz + http://dev.gentoo.org/~swift/patches/setools/${P}-03-gentoo-patches.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="X debug java python" + +DEPEND=">=sys-devel/automake-1.12.1 + >=sys-libs/libsepol-2.4 + >=sys-libs/libselinux-2.4 + sys-devel/bison + sys-devel/flex + >=dev-db/sqlite-3.2:3 + dev-libs/libxml2:2 + virtual/pkgconfig + java? ( + dev-lang/swig:1 + >=virtual/jdk-1.4 + ) + python? ( + ${PYTHON_DEPS} + dev-lang/swig:1 + ) + X? ( + >=dev-lang/tk-8.4.9 + >=gnome-base/libglade-2.0 + >=x11-libs/gtk+-2.8:2 + )" + +RDEPEND=">=sys-libs/libsepol-2.1.4 + >=sys-libs/libselinux-2.3 + >=dev-db/sqlite-3.2:3 + dev-libs/libxml2:2 + java? ( >=virtual/jre-1.4 ) + X? ( + >=dev-lang/tk-8.4.9 + >=dev-tcltk/bwidget-1.8 + >=gnome-base/libglade-2.0 + >=x11-libs/gtk+-2.8:2 + )" + +RESTRICT="test" +# setools dirs that contain python code to build +PYTHON_DIRS="libapol/swig/python libpoldiff/swig/python libqpol/swig/python libseaudit/swig/python libsefs/swig/python python" + +pkg_setup() { + local myld=$(tc-getLD) + + if use java; then + java-pkg-opt-2_pkg_setup + fi + + ${myld} -v | grep -q "GNU gold" && \ + ewarn "Bug #467136 shows us that the gold linker doesn't work with setools for now." +} + +src_prepare() { + epatch "${FILESDIR}/setools3-userspace-2.4-compatibility.patch" + + EPATCH_MULTI_MSG="Applying various (Fedora-provided) setools fixes... " \ + EPATCH_SUFFIX="patch" \ + EPATCH_SOURCE="${WORKDIR}" \ + EPATCH_FORCE="yes" \ + epatch + + EPATCH_MULTI_MSG="Applying various (Gentoo) setool fixes... " \ + EPATCH_SUFFIX="patch" \ + EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \ + EPATCH_EXCLUDE="0010-fix-lsetfilecon_raw-call-bug-509532.patch 0005-update-on-py_functions-for-python3.patch" \ + EPATCH_FORCE="yes" \ + epatch + + # Disable broken check for SWIG version. + sed -e "s/AC_PROG_SWIG(2.0.0)/AC_PROG_SWIG/" -i configure.ac || die "sed failed" + # Use swig1.3 + sed -e 's/AC_PATH_PROG(\[SWIG\],\[swig\])/AC_PATH_PROG([SWIG],[swig1.3])/' -i m4/ac_pkg_swig.m4 || die "failed to set swig1.3" + # Fix build failure due to double __init__.py installation + sed -e "s/^wrappedpy_DATA = qpol.py \$(pkgpython_PYTHON)/wrappedpy_DATA = qpol.py/" -i libqpol/swig/python/Makefile.am || die + + local dir + for dir in ${PYTHON_DIRS}; do + # Python bindings are built/installed manually. + sed -e "s/MAYBE_PYSWIG = python/MAYBE_PYSWIG =/" -i ${dir%python}Makefile.am || die "sed failed" + # Make PYTHON_LDFLAGS replaceable during running `make`. + sed -e "/^AM_LDFLAGS =/s/@PYTHON_LDFLAGS@/\$(PYTHON_LDFLAGS)/" -i ${dir}/Makefile.am || die "sed failed" + done + + # bug #424581, Need to use MKDIR_P for automake 1.12+. + find . -name 'Makefile.*' -exec sed -i -e 's:mkdir_p:MKDIR_P:g' {} + || die; + + eautoreconf + + # Disable byte-compilation of Python modules. + echo '#!/bin/sh' > py-compile + + epatch_user +} + +src_configure() { + econf \ + --with-java-prefix=${JAVA_HOME} \ + --disable-selinux-check \ + --disable-bwidget-check \ + $(use_enable python swig-python) \ + $(use_enable java swig-java) \ + $(use_enable X swig-tcl) \ + $(use_enable X gui) \ + $(use_enable debug) + + # work around swig c99 issues. it does not require + # c99 anyway. + sed -i -e 's/-std=gnu99//' "${S}/libseaudit/swig/python/Makefile" +} + +src_compile() { + emake LD="$(tc-getLD).bfd" || die "Failed to build setools" + + if use python; then + building() { + python_export PYTHON_INCLUDEDIR + python_export PYTHON_SITEDIR + python_export PYTHON_LIBS + emake LD="$(tc-getLD).bfd" \ + SWIG_PYTHON_CPPFLAGS="-I${PYTHON_INCLUDEDIR}" \ + PYTHON_LDFLAGS="${PYTHON_LIBS}" \ + pyexecdir="${PYTHON_SITEDIR}" \ + pythondir="${PYTHON_SITEDIR}" \ + -C ${1}; + } + local dir + for dir in ${PYTHON_DIRS}; do + python_foreach_impl building ${dir}; + done + fi +} + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" + + if use python; then + installation() { + python_export PYTHON_SITEDIR + emake DESTDIR="${D}" \ + pyexecdir="${PYTHON_SITEDIR}" \ + pythondir="${PYTHON_SITEDIR}" \ + -C ${1} install + } + + local dir + for dir in ${PYTHON_DIRS}; do + python_foreach_impl installation ${dir}; + done + fi +} |