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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Aug 13 17:24:28 2013 UTC (13 months, 1 week ago) by swift
Branch: MAIN
Document setfiles in rlpkg, improve selocal resilience

(Portage version: 2.1.12.2/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.14-r3.ebuild,v 1.1 2013/07/07 16:03:07 swift Exp $
4
5 EAPI="5"
6 PYTHON_COMPAT=( python2_7 )
7 PYTHON_REQ_USE="xml"
8
9 inherit multilib python-r1 toolchain-funcs eutils
10
11 EXTRAS_VER="1.30"
12 SEMNG_VER="2.1.10"
13 SELNX_VER="2.1.13"
14 SEPOL_VER="2.1.9"
15
16 IUSE="audit pam dbus sesandbox"
17
18 DESCRIPTION="SELinux core utilities"
19 HOMEPAGE="http://userspace.selinuxproject.org"
20 SRC_URI="http://userspace.selinuxproject.org/releases/20130423/${P}.tar.gz
21 http://dev.gentoo.org/~swift/patches/policycoreutils/patchbundle-${P}-gentoo-r3.tar.gz
22 mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
23
24 LICENSE="GPL-2"
25 SLOT="0"
26 KEYWORDS="~amd64 ~x86"
27
28 COMMON_DEPS=">=sys-libs/libselinux-${SELNX_VER}[python]
29 >=sys-libs/glibc-2.4
30 >=sys-libs/libcap-1.10-r10
31 >=sys-libs/libsemanage-${SEMNG_VER}[python]
32 sys-libs/libcap-ng
33 >=sys-libs/libsepol-${SEPOL_VER}
34 sys-devel/gettext
35 dev-python/ipy
36 sesandbox? ( dev-libs/libcgroup )
37 dbus? (
38 sys-apps/dbus
39 dev-libs/dbus-glib
40 )
41 audit? ( >=sys-process/audit-1.5.1 )
42 pam? ( sys-libs/pam )
43 ${PYTHON_DEPS}"
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 S1="${WORKDIR}/${P}"
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 python_copy_sources
79 # Our extra code is outside the regular directory, so set it to the extra
80 # directory. We really should optimize this as it is ugly, but the extra
81 # code is needed for Gentoo at the same time that policycoreutils is present
82 # (so we cannot use an additional package for now).
83 S="${S2}"
84 python_copy_sources
85 }
86
87 src_compile() {
88 local use_audit="n";
89 local use_pam="n";
90 local use_dbus="n";
91 local use_sesandbox="n";
92
93 use audit && use_audit="y";
94 use pam && use_pam="y";
95 use dbus && use_dbus="y";
96 use sesandbox && use_sesandbox="y";
97
98 building() {
99 emake -C "${BUILD_DIR}" AUDIT_LOG_PRIVS="y" AUDITH="${use_audit}" PAMH="${use_pam}" INOTIFYH="${use_dbus}" SESANDBOX="${use_sesandbox}" CC="$(tc-getCC)" PYLIBVER="${EPYTHON}" || die
100 }
101 S="${S1}" # Regular policycoreutils
102 python_foreach_impl building
103 S="${S2}" # Extra set
104 python_foreach_impl building
105 }
106
107 src_install() {
108 local use_audit="n";
109 local use_pam="n";
110 local use_dbus="n";
111 local use_sesandbox="n";
112
113 use audit && use_audit="y";
114 use pam && use_pam="y";
115 use dbus && use_dbus="y";
116 use sesandbox && use_sesandbox="y";
117
118 # Python scripts are present in many places. There are no extension modules.
119 installation-policycoreutils() {
120 einfo "Installing policycoreutils"
121 emake -C "${BUILD_DIR}" DESTDIR="${D}" AUDITH="${use_audit}" PAMH="${use_pam}" INOTIFYH="${use_dbus}" SESANDBOX="${use_sesandbox}" AUDIT_LOG_PRIV="y" PYLIBVER="${EPYTHON}" install || return 1
122 }
123
124 installation-extras() {
125 einfo "Installing policycoreutils-extra"
126 emake -C "${S2}" DESTDIR="${D}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
127 }
128
129 S="${S1}" # policycoreutils
130 python_foreach_impl installation-policycoreutils
131 S="${S2}" # extras
132 python_foreach_impl installation-extras
133 S="${S1}" # back for later
134
135 # remove redhat-style init script
136 rm -fR "${D}/etc/rc.d"
137
138 # compatibility symlinks
139 dosym /sbin/setfiles /usr/sbin/setfiles
140 dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
141
142 # location for permissive definitions
143 dodir /var/lib/selinux
144 keepdir /var/lib/selinux
145
146 # Set version-specific scripts
147 for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
148 python_replicate_script "${ED}/usr/bin/${pyscript}"
149 done
150 for pyscript in semanage rlpkg; do
151 python_replicate_script "${ED}/usr/sbin/${pyscript}"
152 done
153
154 dodir /usr/share/doc/${PF}/mcstrans/examples
155 cp -dR "${S1}"/mcstrans/share/examples/* "${D}/usr/share/doc/${PF}/mcstrans/examples"
156 }

  ViewVC Help
Powered by ViewVC 1.1.20