/[gentoo-x86]/sys-apps/policycoreutils/policycoreutils-2.1.10-r4.ebuild
Gentoo

Contents of /sys-apps/policycoreutils/policycoreutils-2.1.10-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Tue Jul 10 20:01:25 2012 UTC (2 years ago) by swift
Branch: MAIN
Support refpolicy style audit2allow (#417199)

(Portage version: 2.1.10.65/cvs/Linux x86_64)

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-apps/policycoreutils/policycoreutils-2.1.10-r3.ebuild,v 1.2 2012/06/26 05:02:43 floppym Exp $
4    
5     EAPI="4"
6     PYTHON_DEPEND="*"
7     PYTHON_USE_WITH="xml"
8     SUPPORT_PYTHON_ABIS="1"
9     RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
10    
11     inherit multilib python toolchain-funcs eutils
12    
13     EXTRAS_VER="1.21"
14     SEMNG_VER="2.1.6"
15     SELNX_VER="2.1.9"
16     SEPOL_VER="2.1.4"
17    
18     IUSE="audit pam dbus sesandbox"
19    
20     DESCRIPTION="SELinux core utilities"
21     HOMEPAGE="http://userspace.selinuxproject.org"
22     SRC_URI="http://userspace.selinuxproject.org/releases/20120216/${P}.tar.gz
23     http://dev.gentoo.org/~swift/patches/policycoreutils/patchbundle-${P}-gentoo-r2.tar.gz
24     mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
25    
26     LICENSE="GPL-2"
27     SLOT="0"
28     KEYWORDS="~amd64 ~x86"
29    
30     COMMON_DEPS=">=sys-libs/libselinux-${SELNX_VER}[python]
31     >=sys-libs/glibc-2.4
32     >=sys-libs/libcap-1.10-r10
33     >=sys-libs/libsemanage-${SEMNG_VER}[python]
34     sys-libs/libcap-ng
35     >=sys-libs/libsepol-${SEPOL_VER}
36     sys-devel/gettext
37     dev-python/ipy
38     sesandbox? ( dev-libs/libcgroup )
39     dbus? (
40     sys-apps/dbus
41     dev-libs/dbus-glib
42     )
43     audit? ( >=sys-process/audit-1.5.1 )
44     pam? ( sys-libs/pam )"
45    
46     ### libcgroup -> seunshare
47     ### dbus -> restorecond
48    
49     # pax-utils for scanelf used by rlpkg
50     RDEPEND="${COMMON_DEPS}
51     dev-python/sepolgen
52     app-misc/pax-utils"
53    
54     DEPEND="${COMMON_DEPS}"
55    
56     S2=${WORKDIR}/policycoreutils-extra
57    
58     src_prepare() {
59     # rlpkg is more useful than fixfiles
60     sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
61     || die "fixfiles sed 1 failed"
62     sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
63     || die "fixfiles sed 2 failed"
64    
65     EPATCH_MULTI_MSG="Applying policycoreutils patches ... " \
66     EPATCH_SUFFIX="patch" \
67     EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \
68     EPATCH_FORCE="yes" \
69     epatch
70    
71     # Overwrite gl.po, id.po and et.po with valid PO file
72     cp "${S}/po/sq.po" "${S}/po/gl.po" || die "failed to copy ${S}/po/sq.po to gl.po"
73     cp "${S}/po/sq.po" "${S}/po/id.po" || die "failed to copy ${S}/po/sq.po to id.po"
74     cp "${S}/po/sq.po" "${S}/po/et.po" || die "failed to copy ${S}/po/sq.po to et.po"
75     # Fixes for Python 3 support in the extras
76     cd "${S2}";
77     epatch "${FILESDIR}/policycoreutils-extra-1.21-fix-python3.patch"
78     }
79    
80     src_compile() {
81     local use_audit="n";
82     local use_pam="n";
83     local use_dbus="n";
84     local use_sesandbox="n";
85    
86     use audit && use_audit="y";
87     use pam && use_pam="y";
88     use dbus && use_dbus="y";
89     use sesandbox && use_sesandbox="y";
90    
91     python_copy_sources semanage sandbox
92     building() {
93     einfo "Compiling policycoreutils"
94     emake -C "${S}" AUDIT_LOG_PRIVS="y" AUDITH="${use_audit}" PAMH="${use_pam}" INOTIFYH="${use_dbus}" SESANDBOX="${use_sesandbox}" CC="$(tc-getCC)" PYLIBVER="python$(python_get_version)" || die
95     einfo "Compiling policycoreutils-extra "
96     emake -C "${S2}" AUDIT_LOG_PRIVS="y" AUDITH="${use_audit}" PAMH="${use_pam}" INOTIFYH="${use_dbus}" SESANDBOX="${use_sesandbox}" CC="$(tc-getCC)" PYLIBVER="python$(python_get_version)" || die
97     }
98     python_execute_function -s --source-dir semanage building
99     }
100    
101     src_install() {
102     local use_audit="n";
103     local use_pam="n";
104     local use_dbus="n";
105     local use_sesandbox="n";
106    
107     use audit && use_audit="y";
108     use pam && use_pam="y";
109     use dbus && use_dbus="y";
110     use sesandbox && use_sesandbox="y";
111    
112     # Python scripts are present in many places. There are no extension modules.
113     installation() {
114     einfo "Installing policycoreutils"
115     emake -C "${S}" DESTDIR="${T}/images/${PYTHON_ABI}" AUDITH="${use_audit}" PAMH="${use_pam}" INOTIFYH="${use_dbus}" SESANDBOX="${use_sesandbox}" AUDIT_LOG_PRIV="y" PYLIBVER="python$(python_get_version)" install || return 1
116    
117     einfo "Installing policycoreutils-extra"
118     emake -C "${S2}" DESTDIR="${T}/images/${PYTHON_ABI}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
119     }
120     python_execute_function installation
121     python_merge_intermediate_installation_images "${T}/images"
122    
123     # remove redhat-style init script
124     rm -fR "${D}/etc/rc.d"
125    
126     # compatibility symlinks
127     dosym /sbin/setfiles /usr/sbin/setfiles
128     dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
129    
130     # location for permissive definitions
131     dodir /var/lib/selinux
132     keepdir /var/lib/selinux
133     }
134    
135     pkg_postinst() {
136     python_mod_optimize seobject.py
137     }
138    
139     pkg_postrm() {
140     python_mod_cleanup seobject.py
141     }

  ViewVC Help
Powered by ViewVC 1.1.20