/[gentoo-x86]/app-admin/setools/setools-3.3.8-r2.ebuild
Gentoo

Contents of /app-admin/setools/setools-3.3.8-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Jun 27 17:05:33 2013 UTC (17 months ago) by swift
Branch: MAIN
Changes since 1.1: +2 -2 lines
Stabilizing setools (support swig1.3)

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

1 # Copyright 1999-2013 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.8-r2.ebuild,v 1.1 2013/04/22 18:36:25 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}-01-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:1
32 >=virtual/jdk-1.4
33 )
34 python? ( dev-lang/swig:1 )
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 # Use swig1.3
82 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"
83 # Fix build failure due to double __init__.py installation
84 sed -e "s/^wrappedpy_DATA = qpol.py \$(pkgpython_PYTHON)/wrappedpy_DATA = qpol.py/" -i libqpol/swig/python/Makefile.am || die
85
86 local dir
87 for dir in ${PYTHON_DIRS}; do
88 # Python bindings are built/installed manually.
89 sed -e "s/MAYBE_PYSWIG = python/MAYBE_PYSWIG =/" -i ${dir%python}Makefile.am || die "sed failed"
90 # Make PYTHON_LDFLAGS replaceable during running `make`.
91 sed -e "/^AM_LDFLAGS =/s/@PYTHON_LDFLAGS@/\$(PYTHON_LDFLAGS)/" -i ${dir}/Makefile.am || die "sed failed"
92 done
93
94 # temporary work around bug #424581 until automake-1.12 is stable (then
95 # depend on it). Need to use MKDIR_P in the mean time for 1.12+.
96 has_version ">=sys-devel/automake-1.12.1" && { find . -name 'Makefile.*' -exec sed -i -e 's:mkdir_p:MKDIR_P:g' {} + || die; }
97
98 eautoreconf
99
100 # Disable byte-compilation of Python modules.
101 echo '#!/bin/sh' > py-compile
102
103 epatch_user
104 }
105
106 src_configure() {
107 econf \
108 --with-java-prefix=${JAVA_HOME} \
109 --disable-selinux-check \
110 --disable-bwidget-check \
111 $(use_enable python swig-python) \
112 $(use_enable java swig-java) \
113 $(use_enable X swig-tcl) \
114 $(use_enable X gui) \
115 $(use_enable debug)
116
117 # work around swig c99 issues. it does not require
118 # c99 anyway.
119 sed -i -e 's/-std=gnu99//' "${S}/libseaudit/swig/python/Makefile"
120 }
121
122 src_compile() {
123 emake || die "Failed to build setools"
124
125 if use python; then
126 local dir
127 for dir in ${PYTHON_DIRS}; do
128 python_copy_sources ${dir}
129 building() {
130 emake \
131 SWIG_PYTHON_CPPFLAGS="-I$(python_get_includedir)" \
132 PYTHON_LDFLAGS="$(python_get_library -l)" \
133 pyexecdir="$(python_get_sitedir)" \
134 pythondir="$(python_get_sitedir)"
135 }
136 python_execute_function \
137 --action-message "Building of Python bindings from ${dir} directory with \$(python_get_implementation) \$(python_get_version)" \
138 --failure-message "Building of Python bindings from ${dir} directory with \$(python_get_implementation) \$(python_get_version) failed" \
139 -s --source-dir ${dir} \
140 building
141 done
142 fi
143 }
144
145 src_install() {
146 emake DESTDIR="${D}" install || die "emake install failed"
147
148 if use python; then
149 local dir
150 for dir in ${PYTHON_DIRS}; do
151 installation() {
152 emake \
153 DESTDIR="${D}" \
154 pyexecdir="$(python_get_sitedir)" \
155 pythondir="$(python_get_sitedir)" \
156 install
157 }
158 python_execute_function \
159 --action-message "Installation of Python bindings from ${dir} directory with \$(python_get_implementation) \$(python_get_version)" \
160 --failure-message "Installation of Python bindings from ${dir} directory with \$(python_get_implementation) \$(python_get_version) failed" \
161 -s --source-dir ${dir} \
162 installation
163 done
164 fi
165 }
166
167 pkg_postinst() {
168 if use python; then
169 python_mod_optimize setools
170 fi
171 }
172
173 pkg_postrm() {
174 if use python; then
175 python_mod_cleanup setools
176 fi
177 }

  ViewVC Help
Powered by ViewVC 1.1.20