/[gentoo-x86]/sys-apps/policycoreutils/policycoreutils-2.1.13-r8.ebuild
Gentoo

Contents of /sys-apps/policycoreutils/policycoreutils-2.1.13-r8.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun Mar 10 15:52:57 2013 UTC (21 months, 1 week ago) by swift
Branch: MAIN
Add selinux_gentoo init script, supports bug #456914

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

1 # Copyright 1999-2013 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.13-r7.ebuild,v 1.1 2013/03/09 10:57:09 swift Exp $
4
5 EAPI="4"
6 PYTHON_DEPEND="2:2.7"
7 PYTHON_USE_WITH="xml"
8 SUPPORT_PYTHON_ABIS="1"
9 RESTRICT_PYTHON_ABIS="*-jython *-pypy-* 3.*"
10
11 inherit multilib python toolchain-funcs eutils
12
13 EXTRAS_VER="1.25"
14 SEMNG_VER="2.1.9"
15 SELNX_VER="2.1.12"
16 SEPOL_VER="2.1.8"
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/20120924/${P}.tar.gz
23 http://dev.gentoo.org/~swift/patches/policycoreutils/patchbundle-${P}-gentoo-r4.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
76 epatch_user
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 use sesandbox && use_sesandbox="y";
110
111 # Python scripts are present in many places. There are no extension modules.
112 installation() {
113 einfo "Installing policycoreutils"
114 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
115
116 einfo "Installing policycoreutils-extra"
117 emake -C "${S2}" DESTDIR="${T}/images/${PYTHON_ABI}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
118 }
119 python_execute_function installation
120 python_merge_intermediate_installation_images "${T}/images"
121
122 # remove redhat-style init script
123 rm -fR "${D}/etc/rc.d"
124
125 # compatibility symlinks
126 dosym /sbin/setfiles /usr/sbin/setfiles
127 dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
128
129 # location for permissive definitions
130 dodir /var/lib/selinux
131 keepdir /var/lib/selinux
132 }
133
134 pkg_postinst() {
135 python_mod_optimize seobject.py
136 }
137
138 pkg_postrm() {
139 python_mod_cleanup seobject.py
140 }

  ViewVC Help
Powered by ViewVC 1.1.20