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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Nov 4 21:55:40 2013 UTC (11 months, 2 weeks ago) by swift
Branch: MAIN
New policycoreutils release

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

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-r4.ebuild,v 1.2 2013/11/04 20:29:50 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.2"
13 SELNX_VER="2.2"
14 SEPOL_VER="2.2"
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/20131030/${P}.tar.gz
21 http://dev.gentoo.org/~swift/patches/policycoreutils/patchbundle-${P}-gentoo-r1.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 epatch_user
72
73 python_copy_sources
74 # Our extra code is outside the regular directory, so set it to the extra
75 # directory. We really should optimize this as it is ugly, but the extra
76 # code is needed for Gentoo at the same time that policycoreutils is present
77 # (so we cannot use an additional package for now).
78 S="${S2}"
79 python_copy_sources
80 }
81
82 src_compile() {
83 local use_audit="n";
84 local use_pam="n";
85 local use_dbus="n";
86 local use_sesandbox="n";
87
88 use audit && use_audit="y";
89 use pam && use_pam="y";
90 use dbus && use_dbus="y";
91 use sesandbox && use_sesandbox="y";
92
93 building() {
94 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
95 }
96 S="${S1}" # Regular policycoreutils
97 python_foreach_impl building
98 S="${S2}" # Extra set
99 python_foreach_impl building
100 }
101
102 src_install() {
103 local use_audit="n";
104 local use_pam="n";
105 local use_dbus="n";
106 local use_sesandbox="n";
107
108 use audit && use_audit="y";
109 use pam && use_pam="y";
110 use dbus && use_dbus="y";
111 use sesandbox && use_sesandbox="y";
112
113 # Python scripts are present in many places. There are no extension modules.
114 installation-policycoreutils() {
115 einfo "Installing policycoreutils"
116 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
117 }
118
119 installation-extras() {
120 einfo "Installing policycoreutils-extra"
121 emake -C "${S2}" DESTDIR="${D}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
122 }
123
124 S="${S1}" # policycoreutils
125 python_foreach_impl installation-policycoreutils
126 S="${S2}" # extras
127 python_foreach_impl installation-extras
128 S="${S1}" # back for later
129
130 # remove redhat-style init script
131 rm -fR "${D}/etc/rc.d"
132
133 # compatibility symlinks
134 dosym /sbin/setfiles /usr/sbin/setfiles
135 dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
136
137 # location for permissive definitions
138 dodir /var/lib/selinux
139 keepdir /var/lib/selinux
140
141 # Set version-specific scripts
142 for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
143 python_replicate_script "${ED}/usr/bin/${pyscript}"
144 done
145 for pyscript in semanage rlpkg; do
146 python_replicate_script "${ED}/usr/sbin/${pyscript}"
147 done
148
149 dodir /usr/share/doc/${PF}/mcstrans/examples
150 cp -dR "${S1}"/mcstrans/share/examples/* "${D}/usr/share/doc/${PF}/mcstrans/examples"
151 }

  ViewVC Help
Powered by ViewVC 1.1.20