/[gentoo-x86]/sys-libs/libselinux/libselinux-2.1.13-r4.ebuild
Gentoo

Contents of /sys-libs/libselinux/libselinux-2.1.13-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sun Oct 27 18:18:51 2013 UTC (9 months ago) by swift
Branch: MAIN
Changes since 1.4: +8 -1 lines
Fix bug 488102 - Only call ruby-ng pkg_setup if USE=ruby is set

(Portage version: 2.2.1/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/libselinux/libselinux-2.1.13-r4.ebuild,v 1.4 2013/09/05 19:44:50 mgorny 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.1.9"
13
14 DESCRIPTION="SELinux userland library"
15 HOMEPAGE="http://userspace.selinuxproject.org"
16 SRC_URI="http://userspace.selinuxproject.org/releases/20130423/${P}.tar.gz
17 http://dev.gentoo.org/~swift/patches/${PN}/patchbundle-${P}-r3.tar.gz"
18
19 LICENSE="public-domain"
20 SLOT="0"
21 KEYWORDS="amd64 x86"
22 IUSE="python ruby static-libs"
23
24 RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}
25 >=dev-libs/libpcre-8.30-r2[static-libs?]
26 python? ( ${PYTHON_DEPS} )
27 ruby? ( $(ruby_implementations_depend) )"
28 DEPEND="${RDEPEND}
29 virtual/pkgconfig
30 ruby? ( >=dev-lang/swig-2.0.9 )
31 python? ( >=dev-lang/swig-2.0.9 )"
32
33 S="${WORKDIR}/${P}"
34
35 pkg_setup() {
36 # prevent ruby-ng to mess if ruby is not asked for
37 if use ruby; then
38 ruby-ng_pkg_setup
39 fi
40 }
41
42 src_unpack() {
43 default
44 }
45
46 src_prepare() {
47 # fix up paths for multilib
48 sed -i \
49 -e "/^LIBDIR/s/lib/$(get_libdir)/" \
50 -e "/^SHLIBDIR/s/lib/$(get_libdir)/" \
51 src/Makefile utils/Makefile || die
52
53 EPATCH_MULTI_MSG="Applying libselinux patches ... " \
54 EPATCH_SUFFIX="patch" \
55 EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \
56 EPATCH_FORCE="yes" \
57 epatch
58
59 epatch_user
60
61 if use python; then
62 BUILD_DIR="${S}/src"
63 python_copy_sources
64 fi
65 }
66
67 each_ruby_compile() {
68 local RUBYLIBVER=$(${RUBY} -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
69 cd "${WORKDIR}/${P}"
70 cp -r src src-ruby-${RUBYLIBVER}
71 cd src-ruby-${RUBYLIBVER}
72
73 if [[ "${RUBYLIBVER}" == "1.8" ]]; then
74 emake CC="$(tc-getCC)" RUBY="${RUBY}" RUBYINC="-I$(ruby_get_hdrdir)" LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) -lpthread ${LDFLAGS}" rubywrap || die
75 else
76 emake CC="$(tc-getCC)" RUBY="${RUBY}" LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS} -lpthread" rubywrap || die
77 fi
78 }
79
80 src_compile() {
81 tc-export RANLIB
82 emake \
83 AR="$(tc-getAR)" \
84 CC="$(tc-getCC)" \
85 LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS} -lpthread" all || die
86
87 if use python; then
88 building() {
89 python_export PYTHON_INCLUDEDIR PYTHON_LIBPATH
90 emake CC="$(tc-getCC)" PYINC="-I${PYTHON_INCLUDEDIR}" PYTHONLIBDIR="${PYTHON_LIBPATH}" PYPREFIX="${EPYTHON##*/}" LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS} -lpthread" pywrap
91 }
92 python_foreach_impl building
93 fi
94
95 if use ruby; then
96 ruby-ng_src_compile
97 fi
98 }
99
100 each_ruby_install() {
101 local RUBYLIBVER=$(${RUBY} -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
102
103 cd "${WORKDIR}/${P}/src-ruby-${RUBYLIBVER}"
104 emake RUBY="${RUBY}" DESTDIR="${D}" install-rubywrap || die
105 }
106
107 src_install() {
108 emake DESTDIR="${D}" install || die
109
110 if use python; then
111 installation() {
112 emake DESTDIR="${D}" install-pywrap
113 }
114 python_foreach_impl installation
115 fi
116
117 if use ruby; then
118 ruby-ng_src_install
119 fi
120
121 use static-libs || rm "${D}"/usr/lib*/*.a
122 }
123
124 pkg_postinst() {
125 # Fix bug 473502
126 for POLTYPE in ${POLICY_TYPES};
127 do
128 mkdir -p /etc/selinux/${POLTYPE}/contexts/files
129 touch /etc/selinux/${POLTYPE}/contexts/files/file_contexts.local
130 done
131 }

  ViewVC Help
Powered by ViewVC 1.1.20