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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Tue Apr 16 10:04:05 2013 UTC (17 months, 1 week ago) by swift
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Some cleanup (older release unstables)

(Portage version: 2.1.11.60/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 swift 1.3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/policycoreutils-2.1.10-r1.ebuild,v 1.2 2012/06/26 05:02:43 floppym Exp $
4 swift 1.1
5     EAPI="3"
6     PYTHON_DEPEND="*"
7     PYTHON_USE_WITH="xml"
8     SUPPORT_PYTHON_ABIS="1"
9 floppym 1.2 RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
10 swift 1.1
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/policycoreutils-2.1.10-sesandbox.patch.gz
24     http://dev.gentoo.org/~swift/patches/policycoreutils/policycoreutils-2.1.10-fix-makefile-pam-audit.patch.gz
25     http://dev.gentoo.org/~swift/patches/policycoreutils/policycoreutils-2.1.10-fix-seunshare.patch.gz
26     http://dev.gentoo.org/~swift/patches/policycoreutils/policycoreutils-2.1.10-fix-nodbus_or_libcg.patch.gz
27     mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2
28     mirror://gentoo/policycoreutils-2.0.85-python3.tar.gz"
29    
30     LICENSE="GPL-2"
31     SLOT="0"
32     KEYWORDS="~amd64 ~x86"
33    
34     COMMON_DEPS=">=sys-libs/libselinux-${SELNX_VER}[python]
35     >=sys-libs/glibc-2.4
36     >=sys-libs/libcap-1.10-r10
37     >=sys-libs/libsemanage-${SEMNG_VER}[python]
38     sys-libs/libcap-ng
39     >=sys-libs/libsepol-${SEPOL_VER}
40     sys-devel/gettext
41     sesandbox? ( dev-libs/libcgroup )
42     dbus? (
43     sys-apps/dbus
44     dev-libs/dbus-glib
45     )
46     audit? ( >=sys-process/audit-1.5.1 )
47     pam? ( sys-libs/pam )"
48    
49     ### libcgroup -> seunshare
50     ### dbus -> restorecond
51    
52     # pax-utils for scanelf used by rlpkg
53     RDEPEND="${COMMON_DEPS}
54     dev-python/sepolgen
55     app-misc/pax-utils"
56    
57     DEPEND="${COMMON_DEPS}"
58    
59     S2=${WORKDIR}/policycoreutils-extra
60    
61     src_prepare() {
62     # rlpkg is more useful than fixfiles
63     sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
64     || die "fixfiles sed 1 failed"
65     sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
66     || die "fixfiles sed 2 failed"
67     # We currently do not support MCS, so the sandbox code in policycoreutils
68     # is not usable yet. However, work for MCS is on the way and a reported
69     # vulnerability (bug #374897) might go by unnoticed if we ignore it now.
70     # As such, we will
71     # - prepare support for switching name from "sandbox" to "sesandbox"
72     epatch "${DISTDIR}/policycoreutils-2.1.10-sesandbox.patch.gz"
73     # Disable auto-detection of PAM and audit related stuff and override
74     epatch "${DISTDIR}/policycoreutils-2.1.10-fix-makefile-pam-audit.patch.gz"
75     # - Fix build failure on seunshare
76     epatch "${DISTDIR}/policycoreutils-2.1.10-fix-seunshare.patch.gz"
77     # - Make sandbox & dbus-depending stuff (restorecond) USE-triggered
78     epatch "${DISTDIR}/policycoreutils-2.1.10-fix-nodbus_or_libcg.patch.gz"
79     # Overwrite gl.po, id.po and et.po with valid PO file
80     cp "${S}/po/sq.po" "${S}/po/gl.po" || die "failed to copy ${S}/po/sq.po to gl.po"
81     cp "${S}/po/sq.po" "${S}/po/id.po" || die "failed to copy ${S}/po/sq.po to id.po"
82     cp "${S}/po/sq.po" "${S}/po/et.po" || die "failed to copy ${S}/po/sq.po to et.po"
83     # Fixed scripts for Python 3 support
84     cp "${WORKDIR}/seobject.py" "${S}/semanage/seobject.py" || die "failed to copy seobject.py"
85     cp "${WORKDIR}/semanage" "${S}/semanage/semanage" || die "failed to copy semanage"
86     cp "${WORKDIR}/chcat" "${S}/scripts/chcat" || die "failed to copy chcat"
87     cp "${WORKDIR}/audit2allow" "${S}/audit2allow/audit2allow" || die "failed to copy audit2allow"
88     }
89    
90     src_compile() {
91     local use_audit="n";
92     local use_pam="n";
93     local use_dbus="n";
94     local use_sesandbox="n";
95    
96     use audit && use_audit="y";
97     use pam && use_pam="y";
98     use dbus && use_dbus="y";
99     use sesandbox && use_sesandbox="y";
100    
101     python_copy_sources semanage sandbox
102     building() {
103     einfo "Compiling policycoreutils"
104     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
105     einfo "Compiling policycoreutils-extra "
106     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
107     }
108     python_execute_function -s --source-dir semanage building
109     }
110    
111     src_install() {
112     local use_audit="n";
113     local use_pam="n";
114     local use_dbus="n";
115     local use_sesandbox="n";
116    
117     use audit && use_audit="y";
118     use pam && use_pam="y";
119     use dbus && use_dbus="y";
120     use sesandbox && use_sesandbox="y";
121    
122     # Python scripts are present in many places. There are no extension modules.
123     installation() {
124     einfo "Installing policycoreutils"
125     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
126    
127     einfo "Installing policycoreutils-extra"
128     emake -C "${S2}" DESTDIR="${T}/images/${PYTHON_ABI}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
129     }
130     python_execute_function installation
131     python_merge_intermediate_installation_images "${T}/images"
132    
133     # remove redhat-style init script
134     rm -fR "${D}/etc/rc.d"
135    
136     # compatibility symlinks
137     dosym /sbin/setfiles /usr/sbin/setfiles
138     dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
139    
140     # location for permissive definitions
141     dodir /var/lib/selinux
142     keepdir /var/lib/selinux
143     }
144    
145     pkg_postinst() {
146     python_mod_optimize seobject.py
147     }
148    
149     pkg_postrm() {
150     python_mod_cleanup seobject.py
151     }

  ViewVC Help
Powered by ViewVC 1.1.20