/[gentoo-x86]/app-admin/setools/setools-3.3.7-r6.ebuild
Gentoo

Contents of /app-admin/setools/setools-3.3.7-r6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Nov 23 20:49:43 2012 UTC (21 months, 3 weeks ago) by swift
Branch: MAIN
Fix bugs #436338 and #430262

(Portage version: 2.1.11.31/cvs/Linux x86_64, signed Manifest commit with key 0xCDBA2FDB)

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

  ViewVC Help
Powered by ViewVC 1.1.20