/[gentoo-x86]/sys-libs/libsemanage/libsemanage-2.1.6.ebuild
Gentoo

Contents of /sys-libs/libsemanage/libsemanage-2.1.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Tue Jun 26 05:04:33 2012 UTC (2 years, 2 months ago) by floppym
Branch: MAIN
Changes since 1.3: +2 -2 lines
Restrict pypy per Arfrever.

(Portage version: 2.2.0_alpha113/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-libs/libsemanage/libsemanage-2.1.6.ebuild,v 1.3 2012/04/29 10:07:19 swift Exp $
4
5 EAPI="3"
6 # Support for 4 depends on python.eclass
7 PYTHON_DEPEND="python? *"
8 SUPPORT_PYTHON_ABIS="1"
9 RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
10
11 inherit multilib python toolchain-funcs eutils
12
13 SEPOL_VER="2.1.4"
14 SELNX_VER="2.1.9"
15
16 DESCRIPTION="SELinux kernel and policy management library"
17 HOMEPAGE="http://userspace.selinuxproject.org"
18 SRC_URI="http://userspace.selinuxproject.org/releases/20120216/${P}.tar.gz
19 http://dev.gentoo.org/~swift/patches/libsemanage/libsemanage-2.1.6-nolevel.patch.gz"
20
21 LICENSE="GPL-2"
22 SLOT="0"
23 KEYWORDS="amd64 x86"
24 IUSE="python ruby"
25
26 RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}
27 >=sys-libs/libselinux-${SELNX_VER}
28 dev-libs/ustr
29 ruby? ( dev-lang/ruby )"
30 DEPEND="${RDEPEND}
31 sys-devel/bison
32 sys-devel/flex
33 ruby? ( >=dev-lang/swig-2.0.4-r1 )
34 python? ( >=dev-lang/swig-2.0.4-r1 )"
35
36 # tests are not meant to be run outside of the
37 # full SELinux userland repo
38 RESTRICT="test"
39
40 pkg_setup() {
41 if use python; then
42 python_pkg_setup
43 fi
44 }
45
46 src_prepare() {
47 echo "# Set this to true to save the linked policy." >> "${S}/src/semanage.conf"
48 echo "# This is normally only useful for analysis" >> "${S}/src/semanage.conf"
49 echo "# or debugging of policy." >> "${S}/src/semanage.conf"
50 echo "save-linked=false" >> "${S}/src/semanage.conf"
51 echo >> "${S}/src/semanage.conf"
52 echo "# Set this to 0 to disable assertion checking." >> "${S}/src/semanage.conf"
53 echo "# This should speed up building the kernel policy" >> "${S}/src/semanage.conf"
54 echo "# from policy modules, but may leave you open to" >> "${S}/src/semanage.conf"
55 echo "# dangerous rules which assertion checking" >> "${S}/src/semanage.conf"
56 echo "# would catch." >> "${S}/src/semanage.conf"
57 echo "expand-check=1" >> "${S}/src/semanage.conf"
58 echo >> "${S}/src/semanage.conf"
59 echo "# Modules in the module store can be compressed" >> "${S}/src/semanage.conf"
60 echo "# with bzip2. Set this to the bzip2 blocksize" >> "${S}/src/semanage.conf"
61 echo "# 1-9 when compressing. The higher the number," >> "${S}/src/semanage.conf"
62 echo "# the more memory is traded off for disk space." >> "${S}/src/semanage.conf"
63 echo "# Set to 0 to disable bzip2 compression." >> "${S}/src/semanage.conf"
64 echo "bzip-blocksize=0" >> "${S}/src/semanage.conf"
65 echo >> "${S}/src/semanage.conf"
66 echo "# Reduce memory usage for bzip2 compression and" >> "${S}/src/semanage.conf"
67 echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf"
68 echo "bzip-small=true" >> "${S}/src/semanage.conf"
69
70 # Apply patch to support non-leveled types (like strict or targeted)
71 epatch "${DISTDIR}/libsemanage-2.1.6-nolevel.patch.gz"
72 }
73
74 src_compile() {
75 emake AR="$(tc-getAR)" CC="$(tc-getCC)" all || die
76
77 if use python; then
78 python_copy_sources src
79 building() {
80 emake CC="$(tc-getCC)" PYLIBVER="python$(python_get_version)" PYPREFIX="python-$(python_get_version)" "$@"
81 }
82 python_execute_function -s --source-dir src building -- swigify
83 python_execute_function -s --source-dir src building -- pywrap
84 fi
85
86 if use ruby; then
87 emake -C src CC="$(tc-getCC)" rubywrap || die
88 fi
89 }
90
91 src_install() {
92 emake \
93 DESTDIR="${D}" \
94 LIBDIR="${D}usr/$(get_libdir)" \
95 SHLIBDIR="${D}$(get_libdir)" \
96 install || die
97 dosym "../../$(get_libdir)/libsemanage.so.1" "/usr/$(get_libdir)/libsemanage.so" || die
98
99 if use python; then
100 installation() {
101 emake \
102 DESTDIR="${D}" \
103 PYLIBVER="python$(python_get_version)" \
104 PYPREFIX="python-$(python_get_version)" \
105 LIBDIR="${D}usr/$(get_libdir)" \
106 install-pywrap
107 }
108 python_execute_function -s --source-dir src installation
109 fi
110
111 if use ruby; then
112 emake -C src \
113 DESTDIR="${D}" \
114 LIBDIR="${D}usr/$(get_libdir)" \
115 install-rubywrap || die
116 fi
117 }
118
119 pkg_postinst() {
120 if use python; then
121 python_mod_optimize semanage.py
122 fi
123 }
124
125 pkg_postrm() {
126 if use python; then
127 python_mod_cleanup semanage.py
128 fi
129 }

  ViewVC Help
Powered by ViewVC 1.1.20