Gentoo Archives: gentoo-commits

From: Sven Vermeulen <sven.vermeulen@××××××.be>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:master commit in: app-admin/setools/
Date: Tue, 29 May 2012 19:32:16
Message-Id: 1338319903.7eb8ad1e7b2835067fe1e7059d7d647f0e20d23e.SwifT@gentoo
1 commit: 7eb8ad1e7b2835067fe1e7059d7d647f0e20d23e
2 Author: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be>
3 AuthorDate: Tue May 29 19:31:43 2012 +0000
4 Commit: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be>
5 CommitDate: Tue May 29 19:31:43 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=7eb8ad1e
7
8 Adding correct module loading
9
10 ---
11 app-admin/setools/setools-3.3.7-r3.ebuild | 169 +++++++++++++++++++++++++++++
12 1 files changed, 169 insertions(+), 0 deletions(-)
13
14 diff --git a/app-admin/setools/setools-3.3.7-r3.ebuild b/app-admin/setools/setools-3.3.7-r3.ebuild
15 new file mode 100644
16 index 0000000..5269735
17 --- /dev/null
18 +++ b/app-admin/setools/setools-3.3.7-r3.ebuild
19 @@ -0,0 +1,169 @@
20 +# Copyright 1999-2012 Gentoo Foundation
21 +# Distributed under the terms of the GNU General Public License v2
22 +# $Header: /var/cvsroot/gentoo-x86/app-admin/setools/setools-3.3.7-r1.ebuild,v 1.3 2012/05/03 18:02:22 jdhore Exp $
23 +
24 +EAPI="2"
25 +PYTHON_DEPEND="python? *"
26 +SUPPORT_PYTHON_ABIS="1"
27 +RESTRICT_PYTHON_ABIS="*-jython"
28 +
29 +inherit autotools java-pkg-opt-2 python eutils
30 +
31 +DESCRIPTION="SELinux policy tools"
32 +HOMEPAGE="http://www.tresys.com/selinux/selinux_policy_tools.shtml"
33 +SRC_URI="http://oss.tresys.com/projects/setools/chrome/site/dists/${P}/${P}.tar.bz2
34 + http://dev.gentoo.org/~swift/patches/setools/${P}-01-fedora-patches.tar.gz
35 + http://dev.gentoo.org/~swift/patches/setools/${P}-03-gentoo-patches.tar.gz"
36 +
37 +LICENSE="GPL-2"
38 +SLOT="0"
39 +KEYWORDS="~amd64 ~x86"
40 +IUSE="X debug java python"
41 +
42 +DEPEND=">=sys-libs/libsepol-2.1.4
43 + sys-libs/libselinux
44 + sys-devel/bison
45 + sys-devel/flex
46 + >=dev-db/sqlite-3.2:3
47 + dev-libs/libxml2:2
48 + virtual/pkgconfig
49 + java? (
50 + >=dev-lang/swig-2.0.4
51 + >=virtual/jdk-1.4
52 + )
53 + python? ( >=dev-lang/swig-2.0.4 )
54 + X? (
55 + >=dev-lang/tk-8.4.9
56 + >=gnome-base/libglade-2.0
57 + >=x11-libs/gtk+-2.8:2
58 + )"
59 +
60 +RDEPEND=">=sys-libs/libsepol-2.1.4
61 + sys-libs/libselinux
62 + >=dev-db/sqlite-3.2:3
63 + dev-libs/libxml2:2
64 + java? ( >=virtual/jre-1.4 )
65 + X? (
66 + >=dev-lang/tk-8.4.9
67 + >=dev-tcltk/bwidget-1.8
68 + >=gnome-base/libglade-2.0
69 + >=x11-libs/gtk+-2.8:2
70 + )"
71 +
72 +RESTRICT="test"
73 +
74 +pkg_setup() {
75 + if use java; then
76 + java-pkg-opt-2_pkg_setup
77 + fi
78 +
79 + if use python; then
80 + python_pkg_setup
81 + PYTHON_DIRS="libapol/swig/python libpoldiff/swig/python libqpol/swig/python libseaudit/swig/python libsefs/swig/python python"
82 + fi
83 +}
84 +
85 +src_prepare() {
86 + EPATCH_MULTI_MSG="Applying various (Fedora-provided) setools fixes... " \
87 + EPATCH_SUFFIX="patch" \
88 + EPATCH_SOURCE="${WORKDIR}" \
89 + EPATCH_FORCE="yes" \
90 + epatch
91 +
92 + EPATCH_MULTI_MSG="Applying various (Gentoo) setool fixes... " \
93 + EPATCH_SUFFIX="patch" \
94 + EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \
95 + EPATCH_FORCE="yes" \
96 + epatch
97 +
98 + # Disable broken check for SWIG version.
99 + sed -e "s/AC_PROG_SWIG(2.0.0)/AC_PROG_SWIG/" -i configure.ac || die "sed failed"
100 + # Fix build failure due to double __init__.py installation
101 + sed -e "s/^wrappedpy_DATA = qpol.py \$(pkgpython_PYTHON)/wrappedpy_DATA = qpol.py/" -i libqpol/swig/python/Makefile.am || die
102 +
103 + local dir
104 + for dir in ${PYTHON_DIRS}; do
105 + # Python bindings are built/installed manually.
106 + sed -e "s/MAYBE_PYSWIG = python/MAYBE_PYSWIG =/" -i ${dir%python}Makefile.am || die "sed failed"
107 + # Make PYTHON_LDFLAGS replaceable during running `make`.
108 + sed -e "/^AM_LDFLAGS =/s/@PYTHON_LDFLAGS@/\$(PYTHON_LDFLAGS)/" -i ${dir}/Makefile.am || die "sed failed"
109 + done
110 +
111 + eautoreconf
112 +
113 + # Disable byte-compilation of Python modules.
114 + echo '#!/bin/sh' > py-compile
115 +}
116 +
117 +src_configure() {
118 + econf \
119 + --with-java-prefix=${JAVA_HOME} \
120 + --disable-selinux-check \
121 + --disable-bwidget-check \
122 + $(use_enable python swig-python) \
123 + $(use_enable java swig-java) \
124 + $(use_enable X swig-tcl) \
125 + $(use_enable X gui) \
126 + $(use_enable debug)
127 +
128 + # work around swig c99 issues. it does not require
129 + # c99 anyway.
130 + sed -i -e 's/-std=gnu99//' "${S}/libseaudit/swig/python/Makefile"
131 +}
132 +
133 +src_compile() {
134 + default
135 +
136 + if use python; then
137 + local dir
138 + for dir in ${PYTHON_DIRS}; do
139 + python_copy_sources ${dir}
140 + building() {
141 + emake \
142 + SWIG_PYTHON_CPPFLAGS="-I$(python_get_includedir)" \
143 + PYTHON_LDFLAGS="$(python_get_library -l)" \
144 + pyexecdir="$(python_get_sitedir)" \
145 + pythondir="$(python_get_sitedir)"
146 + }
147 + python_execute_function \
148 + --action-message "Building of Python bindings from ${dir} directory with \$(python_get_implementation) \$(python_get_version)" \
149 + --failure-message "Building of Python bindings from ${dir} directory with \$(python_get_implementation) \$(python_get_version) failed" \
150 + -s --source-dir ${dir} \
151 + building
152 + done
153 + fi
154 +}
155 +
156 +src_install() {
157 + emake DESTDIR="${D}" install || die "emake install failed"
158 +
159 + if use python; then
160 + local dir
161 + for dir in ${PYTHON_DIRS}; do
162 + installation() {
163 + emake \
164 + DESTDIR="${D}" \
165 + pyexecdir="$(python_get_sitedir)" \
166 + pythondir="$(python_get_sitedir)" \
167 + install
168 + }
169 + python_execute_function \
170 + --action-message "Installation of Python bindings from ${dir} directory with \$(python_get_implementation) \$(python_get_version)" \
171 + --failure-message "Installation of Python bindings from ${dir} directory with \$(python_get_implementation) \$(python_get_version) failed" \
172 + -s --source-dir ${dir} \
173 + installation
174 + done
175 + fi
176 +}
177 +
178 +pkg_postinst() {
179 + if use python; then
180 + python_mod_optimize setools
181 + fi
182 +}
183 +
184 +pkg_postrm() {
185 + if use python; then
186 + python_mod_cleanup setools
187 + fi
188 +}