/[gentoo-x86]/sys-libs/libselinux/libselinux-2.3-r2.ebuild
Gentoo

Contents of /sys-libs/libselinux/libselinux-2.3-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Apr 8 18:28:33 2015 UTC (3 years, 7 months ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
Drop old Python implementations

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

1 # Copyright 1999-2015 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.3-r2.ebuild,v 1.3 2015/01/26 10:35:15 ago Exp $
4
5 EAPI="5"
6 PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
7 USE_RUBY="ruby19 ruby20"
8
9 PATCHBUNDLE="4"
10
11 # No, I am not calling ruby-ng
12 inherit multilib python-r1 toolchain-funcs eutils multilib-minimal
13
14 MY_P="${P//_/-}"
15
16 SEPOL_VER="2.3"
17
18 DESCRIPTION="SELinux userland library"
19 HOMEPAGE="http://userspace.selinuxproject.org"
20 SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20140506/${MY_P}.tar.gz
21 http://dev.gentoo.org/~swift/patches/${PN}/patchbundle-${PN}-${PATCHBUNDLE}.tar.gz"
22
23 LICENSE="public-domain"
24 SLOT="0"
25 KEYWORDS="amd64 x86"
26
27 IUSE="python ruby static-libs ruby_targets_ruby19 ruby_targets_ruby20"
28
29 RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}[${MULTILIB_USEDEP}]
30 >=dev-libs/libpcre-8.33-r1[static-libs?,${MULTILIB_USEDEP}]
31 python? ( ${PYTHON_DEPS} )
32 ruby? (
33 ruby_targets_ruby19? ( dev-lang/ruby:1.9 )
34 ruby_targets_ruby20? ( dev-lang/ruby:2.0 )
35 )"
36 DEPEND="${RDEPEND}
37 virtual/pkgconfig
38 python? ( >=dev-lang/swig-2.0.9 )"
39
40 S="${WORKDIR}/${MY_P}"
41
42 src_prepare() {
43 EPATCH_MULTI_MSG="Applying libselinux patches ... " \
44 EPATCH_SUFFIX="patch" \
45 EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \
46 EPATCH_FORCE="yes" \
47 epatch
48
49 epatch_user
50
51 multilib_copy_sources
52 }
53
54 multilib_src_compile() {
55 tc-export PKG_CONFIG RANLIB
56 local PCRE_CFLAGS=$(${PKG_CONFIG} libpcre --cflags)
57 local PCRE_LIBS=$(${PKG_CONFIG} libpcre --libs)
58 export PCRE_{CFLAGS,LIBS}
59
60 emake \
61 AR="$(tc-getAR)" \
62 CC="$(tc-getCC)" \
63 LIBDIR="\$(PREFIX)/$(get_libdir)" \
64 SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
65 LDFLAGS="-fPIC ${LDFLAGS} -pthread" \
66 all
67
68 if multilib_is_native_abi && use python; then
69 building() {
70 python_export PYTHON_INCLUDEDIR PYTHON_LIBPATH
71 emake \
72 CC="$(tc-getCC)" \
73 PYINC="-I${PYTHON_INCLUDEDIR}" \
74 PYTHONLIBDIR="${PYTHON_LIBPATH}" \
75 PYPREFIX="${EPYTHON##*/}" \
76 LDFLAGS="-fPIC ${LDFLAGS} -lpthread" \
77 pywrap
78 }
79 python_foreach_impl building
80 fi
81
82 if multilib_is_native_abi && use ruby; then
83 building() {
84 einfo "Calling rubywrap for ${1}"
85 # Clean up .lo file to force rebuild
86 test -f src/selinuxswig_ruby_wrap.lo && rm src/selinuxswig_ruby_wrap.lo
87 emake \
88 CC="$(tc-getCC)" \
89 RUBY=${1} \
90 RUBYINSTALL=$(${1} -e 'print RbConfig::CONFIG["vendorarchdir"]') \
91 LDFLAGS="-fPIC ${LDFLAGS} -lpthread" \
92 rubywrap
93 }
94 for RUBYTARGET in ${USE_RUBY}; do
95 use ruby_targets_${RUBYTARGET} || continue
96
97 building ${RUBYTARGET}
98 done
99 fi
100 }
101
102 multilib_src_install() {
103 LIBDIR="\$(PREFIX)/$(get_libdir)" SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
104 emake DESTDIR="${D}" install
105
106 if multilib_is_native_abi && use python; then
107 installation() {
108 LIBDIR="\$(PREFIX)/$(get_libdir)" emake DESTDIR="${D}" install-pywrap
109 python_optimize # bug 531638
110 }
111 python_foreach_impl installation
112 fi
113
114 if multilib_is_native_abi && use ruby; then
115 installation() {
116 einfo "Calling install-rubywrap for ${1}"
117 # Forcing (re)build here as otherwise the resulting SO file is used for all ruby versions
118 rm src/selinuxswig_ruby_wrap.lo
119 LIBDIR="\$(PREFIX)/$(get_libdir)" emake DESTDIR="${D}" \
120 RUBY=${1} \
121 RUBYINSTALL="${D}/$(${1} -e 'print RbConfig::CONFIG["vendorarchdir"]')" \
122 install-rubywrap
123 }
124 for RUBYTARGET in ${USE_RUBY}; do
125 use ruby_targets_${RUBYTARGET} || continue
126
127 installation ${RUBYTARGET}
128 done
129 fi
130
131 use static-libs || rm "${D}"/usr/lib*/*.a
132 }
133
134 pkg_postinst() {
135 # Fix bug 473502
136 for POLTYPE in ${POLICY_TYPES};
137 do
138 mkdir -p /etc/selinux/${POLTYPE}/contexts/files
139 touch /etc/selinux/${POLTYPE}/contexts/files/file_contexts.local
140 # Fix bug 516608
141 for EXPRFILE in file_contexts file_contexts.homedirs file_contexts.local ; do
142 sefcontext_compile /etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE};
143 done
144 done
145 }

  ViewVC Help
Powered by ViewVC 1.1.20