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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Jul 10 20:13:17 2012 UTC (2 years, 1 month ago) by swift
Branch: MAIN
Changes since 1.2: +3 -5 lines
Stabilization

(Portage version: 2.1.10.65/cvs/Linux x86_64)

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"
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-r1.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 dbus? (
39 sys-apps/dbus
40 dev-libs/dbus-glib
41 )
42 audit? ( >=sys-process/audit-1.5.1 )
43 pam? ( sys-libs/pam )"
44
45 ### libcgroup -> seunshare
46 ### dbus -> restorecond
47
48 # pax-utils for scanelf used by rlpkg
49 RDEPEND="${COMMON_DEPS}
50 dev-python/sepolgen
51 app-misc/pax-utils"
52
53 DEPEND="${COMMON_DEPS}"
54
55 S2=${WORKDIR}/policycoreutils-extra
56
57 src_prepare() {
58 # rlpkg is more useful than fixfiles
59 sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
60 || die "fixfiles sed 1 failed"
61 sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
62 || die "fixfiles sed 2 failed"
63
64 EPATCH_MULTI_MSG="Applying policycoreutils patches ... " \
65 EPATCH_SUFFIX="patch" \
66 EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \
67 EPATCH_FORCE="yes" \
68 epatch
69
70 # Overwrite gl.po, id.po and et.po with valid PO file
71 cp "${S}/po/sq.po" "${S}/po/gl.po" || die "failed to copy ${S}/po/sq.po to gl.po"
72 cp "${S}/po/sq.po" "${S}/po/id.po" || die "failed to copy ${S}/po/sq.po to id.po"
73 cp "${S}/po/sq.po" "${S}/po/et.po" || die "failed to copy ${S}/po/sq.po to et.po"
74 # Fixes for Python 3 support in the extras
75 cd "${S2}";
76 epatch "${FILESDIR}/policycoreutils-extra-1.21-fix-python3.patch"
77 }
78
79 src_compile() {
80 local use_audit="n";
81 local use_pam="n";
82 local use_dbus="n";
83 local use_sesandbox="n";
84
85 use audit && use_audit="y";
86 use pam && use_pam="y";
87 use dbus && use_dbus="y";
88 use sesandbox && use_sesandbox="y";
89
90 python_copy_sources semanage sandbox
91 building() {
92 einfo "Compiling policycoreutils"
93 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
94 einfo "Compiling policycoreutils-extra "
95 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
96 }
97 python_execute_function -s --source-dir semanage building
98 }
99
100 src_install() {
101 local use_audit="n";
102 local use_pam="n";
103 local use_dbus="n";
104 local use_sesandbox="n";
105
106 use audit && use_audit="y";
107 use pam && use_pam="y";
108 use dbus && use_dbus="y";
109
110 # Python scripts are present in many places. There are no extension modules.
111 installation() {
112 einfo "Installing policycoreutils"
113 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
114
115 einfo "Installing policycoreutils-extra"
116 emake -C "${S2}" DESTDIR="${T}/images/${PYTHON_ABI}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
117 }
118 python_execute_function installation
119 python_merge_intermediate_installation_images "${T}/images"
120
121 # remove redhat-style init script
122 rm -fR "${D}/etc/rc.d"
123
124 # compatibility symlinks
125 dosym /sbin/setfiles /usr/sbin/setfiles
126 dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
127
128 # location for permissive definitions
129 dodir /var/lib/selinux
130 keepdir /var/lib/selinux
131 }
132
133 pkg_postinst() {
134 python_mod_optimize seobject.py
135 }
136
137 pkg_postrm() {
138 python_mod_cleanup seobject.py
139 }

  ViewVC Help
Powered by ViewVC 1.1.20