/[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.3 - (show annotations) (download)
Tue Aug 20 20:04:31 2013 UTC (12 months, 4 weeks ago) by swift
Branch: MAIN
Changes since 1.2: +2 -2 lines
Stabilize, the issue with file_contexts.local is important to get in stable

(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/sys-libs/libselinux/libselinux-2.1.13-r4.ebuild,v 1.2 2013/08/10 19:33:32 swift Exp $
4
5 EAPI="5"
6 PYTHON_COMPAT=( python2_7 python3_1 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 src_unpack() {
36 default
37 }
38
39 src_prepare() {
40 # fix up paths for multilib
41 sed -i \
42 -e "/^LIBDIR/s/lib/$(get_libdir)/" \
43 -e "/^SHLIBDIR/s/lib/$(get_libdir)/" \
44 src/Makefile utils/Makefile || die
45
46 EPATCH_MULTI_MSG="Applying libselinux patches ... " \
47 EPATCH_SUFFIX="patch" \
48 EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \
49 EPATCH_FORCE="yes" \
50 epatch
51
52 epatch_user
53
54 if use python; then
55 BUILD_DIR="${S}/src"
56 python_copy_sources
57 fi
58 }
59
60 each_ruby_compile() {
61 local RUBYLIBVER=$(${RUBY} -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
62 cd "${WORKDIR}/${P}"
63 cp -r src src-ruby-${RUBYLIBVER}
64 cd src-ruby-${RUBYLIBVER}
65
66 if [[ "${RUBYLIBVER}" == "1.8" ]]; then
67 emake CC="$(tc-getCC)" RUBY="${RUBY}" RUBYINC="-I$(ruby_get_hdrdir)" LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) -lpthread ${LDFLAGS}" rubywrap || die
68 else
69 emake CC="$(tc-getCC)" RUBY="${RUBY}" LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS} -lpthread" rubywrap || die
70 fi
71 }
72
73 src_compile() {
74 tc-export RANLIB
75 emake \
76 AR="$(tc-getAR)" \
77 CC="$(tc-getCC)" \
78 LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS} -lpthread" all || die
79
80 if use python; then
81 building() {
82 python_export PYTHON_INCLUDEDIR PYTHON_LIBPATH
83 emake CC="$(tc-getCC)" PYINC="-I${PYTHON_INCLUDEDIR}" PYTHONLIBDIR="${PYTHON_LIBPATH}" PYPREFIX="${EPYTHON##*/}" LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS} -lpthread" pywrap
84 }
85 python_foreach_impl building
86 fi
87
88 if use ruby; then
89 ruby-ng_src_compile
90 fi
91 }
92
93 each_ruby_install() {
94 local RUBYLIBVER=$(${RUBY} -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
95
96 cd "${WORKDIR}/${P}/src-ruby-${RUBYLIBVER}"
97 emake RUBY="${RUBY}" DESTDIR="${D}" install-rubywrap || die
98 }
99
100 src_install() {
101 emake DESTDIR="${D}" install || die
102
103 if use python; then
104 installation() {
105 emake DESTDIR="${D}" install-pywrap
106 }
107 python_foreach_impl installation
108 fi
109
110 if use ruby; then
111 ruby-ng_src_install
112 fi
113
114 use static-libs || rm "${D}"/usr/lib*/*.a
115 }
116
117 pkg_postinst() {
118 # Fix bug 473502
119 for POLTYPE in ${POLICY_TYPES};
120 do
121 mkdir -p /etc/selinux/${POLTYPE}/contexts/files
122 touch /etc/selinux/${POLTYPE}/contexts/files/file_contexts.local
123 done
124 }

  ViewVC Help
Powered by ViewVC 1.1.20