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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Mon Dec 3 08:19:54 2012 UTC (2 years ago) by swift
Branch: MAIN
Fix RANLIB and ruby support

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

1 swift 1.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/libselinux/libselinux-2.1.12-r1.ebuild,v 1.2 2012/11/17 16:55:33 swift Exp $
4    
5     EAPI="4"
6     PYTHON_DEPEND="python? *"
7     SUPPORT_PYTHON_ABIS="1"
8     RESTRICT_PYTHON_ABIS="2.5 *-jython *-pypy-*"
9     USE_RUBY="ruby18 ruby19"
10     RUBY_OPTIONAL="yes"
11    
12     inherit multilib python toolchain-funcs eutils ruby-ng
13    
14     SEPOL_VER="2.1.8"
15    
16     DESCRIPTION="SELinux userland library"
17     HOMEPAGE="http://userspace.selinuxproject.org"
18     SRC_URI="http://userspace.selinuxproject.org/releases/20120924/${P}.tar.gz
19     http://dev.gentoo.org/~swift/patches/${PN}/patchbundle-${P}-r2.tar.gz"
20    
21     LICENSE="public-domain"
22     SLOT="0"
23     KEYWORDS="~amd64 ~x86"
24     IUSE="python ruby static-libs"
25    
26     RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}
27     >=dev-libs/libpcre-8.30-r2[static-libs?]
28     ruby? ( $(ruby_implementations_depend) )"
29     DEPEND="${RDEPEND}
30     virtual/pkgconfig
31     ruby? ( dev-lang/swig )
32     python? ( dev-lang/swig )"
33    
34     S="${WORKDIR}/${P}"
35    
36     pkg_setup() {
37     if use python; then
38     python_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    
62     each_ruby_compile() {
63     local RUBYLIBVER=$(${RUBY} -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
64     cd "${WORKDIR}/${P}"
65     cp -r src src-ruby-${RUBYLIBVER}
66     cd src-ruby-${RUBYLIBVER}
67    
68     if [[ "${RUBYLIBVER}" == "1.8" ]]; then
69     emake CC="$(tc-getCC)" RUBY="${RUBY}" RUBYINC="-I$(ruby_get_hdrdir)" LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS}" rubywrap || die
70     else
71     emake CC="$(tc-getCC)" RUBY="${RUBY}" LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS}" rubywrap || die
72     fi
73     }
74    
75     src_compile() {
76     tc-export RANLIB
77     emake \
78     AR="$(tc-getAR)" \
79     CC="$(tc-getCC)" \
80     LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS}" all || die
81    
82     if use python; then
83     python_copy_sources src
84     building() {
85     emake CC="$(tc-getCC)" PYINC="-I$(python_get_includedir)" PYTHONLIBDIR="$(python_get_library -l)" PYPREFIX="python-$(python_get_version)" LDFLAGS="-fPIC $($(tc-getPKG_CONFIG) libpcre --libs) ${LDFLAGS}" pywrap
86     }
87     python_execute_function -s --source-dir src building
88     fi
89    
90     if use ruby; then
91     ruby-ng_src_compile
92     fi
93     }
94    
95     each_ruby_install() {
96     local RUBYLIBVER=$(${RUBY} -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
97    
98     cd "${WORKDIR}/${P}/src-ruby-${RUBYLIBVER}"
99     emake RUBY="${RUBY}" DESTDIR="${D}" install-rubywrap || die
100     }
101    
102     src_install() {
103     emake DESTDIR="${D}" install || die
104    
105     if use python; then
106     installation() {
107     emake DESTDIR="${D}" PYLIBVER="python$(python_get_version)" PYPREFIX="python-$(python_get_version)" install-pywrap
108     }
109     python_execute_function -s --source-dir src installation
110     fi
111    
112     if use ruby; then
113     ruby-ng_src_install
114     fi
115    
116     use static-libs || rm "${D}"/usr/lib*/*.a
117     }
118    
119     pkg_postinst() {
120     if use python; then
121     python_mod_optimize selinux
122     fi
123     }
124    
125     pkg_postrm() {
126     if use python; then
127     python_mod_cleanup selinux
128     fi
129     }

  ViewVC Help
Powered by ViewVC 1.1.20