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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Nov 10 14:17:26 2013 UTC (5 months, 1 week ago) by swift
Branch: MAIN
Changes since 1.1: +2 -1 lines
Fix bug #490488 - Add dependency to audit

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

1 # Copyright 1999-2013 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.2.ebuild,v 1.1 2013/11/04 21:54:51 swift Exp $
4
5 EAPI="5"
6 PYTHON_COMPAT=( python2_7 python3_2 )
7 USE_RUBY="ruby18 ruby19"
8 RUBY_OPTIONAL="yes"
9
10 inherit multilib python-r1 toolchain-funcs eutils ruby-ng
11
12 SEPOL_VER="2.2"
13 SELNX_VER="2.2"
14
15 DESCRIPTION="SELinux kernel and policy management library"
16 HOMEPAGE="http://userspace.selinuxproject.org"
17 SRC_URI="http://userspace.selinuxproject.org/releases/20131030/${P}.tar.gz"
18
19 LICENSE="GPL-2"
20 SLOT="0"
21 KEYWORDS="~amd64 ~x86"
22 IUSE="python ruby"
23
24 RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}
25 >=sys-libs/libselinux-${SELNX_VER}
26 dev-libs/ustr
27 sys-process/audit
28 ruby? (
29 $(ruby_implementations_depend)
30 )"
31 DEPEND="${RDEPEND}
32 sys-devel/bison
33 sys-devel/flex
34 ruby? ( >=dev-lang/swig-2.0.4-r1 )
35 python? (
36 >=dev-lang/swig-2.0.4-r1
37 ${PYTHON_DEPS}
38 )"
39
40 S="${WORKDIR}/${P}"
41
42 # tests are not meant to be run outside of the
43 # full SELinux userland repo
44 RESTRICT="test"
45
46 pkg_setup() {
47 # prevent ruby-ng to mess if ruby is not asked for
48 if use ruby; then
49 ruby-ng_pkg_setup
50 fi
51 }
52
53 src_unpack() {
54 default
55 }
56
57 src_prepare() {
58 echo "# Set this to true to save the linked policy." >> "${S}/src/semanage.conf"
59 echo "# This is normally only useful for analysis" >> "${S}/src/semanage.conf"
60 echo "# or debugging of policy." >> "${S}/src/semanage.conf"
61 echo "save-linked=false" >> "${S}/src/semanage.conf"
62 echo >> "${S}/src/semanage.conf"
63 echo "# Set this to 0 to disable assertion checking." >> "${S}/src/semanage.conf"
64 echo "# This should speed up building the kernel policy" >> "${S}/src/semanage.conf"
65 echo "# from policy modules, but may leave you open to" >> "${S}/src/semanage.conf"
66 echo "# dangerous rules which assertion checking" >> "${S}/src/semanage.conf"
67 echo "# would catch." >> "${S}/src/semanage.conf"
68 echo "expand-check=1" >> "${S}/src/semanage.conf"
69 echo >> "${S}/src/semanage.conf"
70 echo "# Modules in the module store can be compressed" >> "${S}/src/semanage.conf"
71 echo "# with bzip2. Set this to the bzip2 blocksize" >> "${S}/src/semanage.conf"
72 echo "# 1-9 when compressing. The higher the number," >> "${S}/src/semanage.conf"
73 echo "# the more memory is traded off for disk space." >> "${S}/src/semanage.conf"
74 echo "# Set to 0 to disable bzip2 compression." >> "${S}/src/semanage.conf"
75 echo "bzip-blocksize=0" >> "${S}/src/semanage.conf"
76 echo >> "${S}/src/semanage.conf"
77 echo "# Reduce memory usage for bzip2 compression and" >> "${S}/src/semanage.conf"
78 echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf"
79 echo "bzip-small=true" >> "${S}/src/semanage.conf"
80
81 epatch_user
82
83 if use python; then
84 BUILD_DIR="${S}/src"
85 python_copy_sources
86 fi
87 }
88
89 each_ruby_compile() {
90 local RUBYLIBVER=$(${RUBY} -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
91 cd "${WORKDIR}/${P}"
92 cp -r src src-ruby-${RUBYLIBVER}
93 cd src-ruby-${RUBYLIBVER}
94
95 emake -C src CC="$(tc-getCC)" RUBY="${RUBY}" rubywrap || die
96 }
97
98 src_compile() {
99 emake AR="$(tc-getAR)" CC="$(tc-getCC)" all || die
100
101 if use python; then
102 building() {
103 python_export PYTHON_INCLUDEDIR PYTHON_LIBPATH
104 emake CC="$(tc-getCC)" PYINC="-I${PYTHON_INCLUDEDIR}" PYTHONLBIDIR="${PYTHON_LIBPATH}" PYPREFIX="${EPYTHON##*/}" "$@"
105 }
106 python_foreach_impl building swigify
107 python_foreach_impl building pywrap
108 fi
109
110 if use ruby; then
111 ruby-ng_src_compile
112 fi
113 }
114
115 each_ruby_install() {
116 local RUBYLIBVER=$(${RUBY} -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
117
118 cd "${WORKDIR}/${P}/src-ruby-${RUBYLIBVER}"
119 emake -C src RUBY="${RUBY}" DESTDIR="${D}" install-rubywrap || die
120 }
121
122 src_install() {
123 emake \
124 DESTDIR="${D}" \
125 LIBDIR="${D}usr/$(get_libdir)" \
126 SHLIBDIR="${D}$(get_libdir)" \
127 install || die
128 dosym "../../$(get_libdir)/libsemanage.so.1" "/usr/$(get_libdir)/libsemanage.so" || die
129
130 if use python; then
131 installation() {
132 emake DESTDIR="${D}" install-pywrap
133 }
134 python_foreach_impl installation
135 fi
136
137 if use ruby; then
138 ruby-ng_src_install
139 fi
140 }

  ViewVC Help
Powered by ViewVC 1.1.20