/[gentoo-x86]/sys-apps/policycoreutils/policycoreutils-2.3_rc1.ebuild
Gentoo

Contents of /sys-apps/policycoreutils/policycoreutils-2.3_rc1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat May 10 14:04:59 2014 UTC (4 years, 6 months ago) by swift
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Spring cleanup

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

1 # Copyright 1999-2014 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.3_rc1.ebuild,v 1.1 2014/04/28 19:44:09 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 MY_P="${P//_/-}"
12
13 EXTRAS_VER="1.31"
14 SEMNG_VER="2.3_rc1"
15 SELNX_VER="2.3_rc1"
16 SEPOL_VER="2.3_rc1"
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/2.3-rc1/${MY_P}.tar.gz
23 http://dev.gentoo.org/~swift/patches/policycoreutils/patchbundle-${P}.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 ${PYTHON_DEPS}"
46
47 ### libcgroup -> seunshare
48 ### dbus -> restorecond
49
50 # pax-utils for scanelf used by rlpkg
51 RDEPEND="${COMMON_DEPS}
52 dev-python/sepolgen
53 app-misc/pax-utils"
54
55 DEPEND="${COMMON_DEPS}"
56
57 S="${WORKDIR}/${MY_P}"
58 S1="${WORKDIR}/${MY_P}"
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
68 EPATCH_MULTI_MSG="Applying policycoreutils patches ... " \
69 EPATCH_SUFFIX="patch" \
70 EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \
71 EPATCH_FORCE="yes" \
72 epatch
73
74 epatch_user
75
76 python_copy_sources
77 # Our extra code is outside the regular directory, so set it to the extra
78 # directory. We really should optimize this as it is ugly, but the extra
79 # code is needed for Gentoo at the same time that policycoreutils is present
80 # (so we cannot use an additional package for now).
81 S="${S2}"
82 python_copy_sources
83 }
84
85 src_compile() {
86 local use_audit="n";
87 local use_pam="n";
88 local use_dbus="n";
89 local use_sesandbox="n";
90
91 use audit && use_audit="y";
92 use pam && use_pam="y";
93 use dbus && use_dbus="y";
94 use sesandbox && use_sesandbox="y";
95
96 building() {
97 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
98 }
99 S="${S1}" # Regular policycoreutils
100 python_foreach_impl building
101 S="${S2}" # Extra set
102 python_foreach_impl building
103 }
104
105 src_install() {
106 local use_audit="n";
107 local use_pam="n";
108 local use_dbus="n";
109 local use_sesandbox="n";
110
111 use audit && use_audit="y";
112 use pam && use_pam="y";
113 use dbus && use_dbus="y";
114 use sesandbox && use_sesandbox="y";
115
116 # Python scripts are present in many places. There are no extension modules.
117 installation-policycoreutils() {
118 einfo "Installing policycoreutils"
119 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
120 }
121
122 installation-extras() {
123 einfo "Installing policycoreutils-extra"
124 emake -C "${BUILD_DIR}" DESTDIR="${D}" INOTIFYH="${use_dbus}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
125 }
126
127 S="${S1}" # policycoreutils
128 python_foreach_impl installation-policycoreutils
129 S="${S2}" # extras
130 python_foreach_impl installation-extras
131 S="${S1}" # back for later
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 # Set version-specific scripts
145 for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
146 python_replicate_script "${ED}/usr/bin/${pyscript}"
147 done
148 for pyscript in semanage rlpkg; do
149 python_replicate_script "${ED}/usr/sbin/${pyscript}"
150 done
151
152 dodir /usr/share/doc/${PF}/mcstrans/examples
153 cp -dR "${S1}"/mcstrans/share/examples/* "${D}/usr/share/doc/${PF}/mcstrans/examples"
154 }

  ViewVC Help
Powered by ViewVC 1.1.20