/[gentoo-x86]/sec-policy/selinux-base-policy/selinux-base-policy-2.20101213-r5.ebuild
Gentoo

Contents of /sec-policy/selinux-base-policy/selinux-base-policy-2.20101213-r5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri May 20 19:13:51 2011 UTC (3 years, 7 months ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Removed deprecated revisions of base policy 2.20101213

(Portage version: 2.1.9.42/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sec-policy/selinux-base-policy/selinux-base-policy-2.20101213-r5.ebuild,v 1.1 2011/02/05 12:07:06 blueness Exp $
4
5 EAPI="1"
6 IUSE="+peer_perms open_perms"
7
8 inherit eutils
9
10 PATCHBUNDLE="${FILESDIR}/patchbundle-${PF}.tar.bz2"
11 DESCRIPTION="Gentoo base policy for SELinux"
12 HOMEPAGE="http://www.gentoo.org/proj/en/hardened/selinux/"
13 SRC_URI="http://oss.tresys.com/files/refpolicy/refpolicy-${PV}.tar.bz2"
14 LICENSE="GPL-2"
15 SLOT="0"
16
17 KEYWORDS="~amd64 ~x86"
18
19 RDEPEND=">=sys-apps/policycoreutils-1.30.30"
20 DEPEND="${RDEPEND}
21 sys-devel/m4
22 >=sys-apps/checkpolicy-1.30.12"
23
24 S=${WORKDIR}/
25
26 src_unpack() {
27 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
28 MOD_CONF_VER="20090730"
29
30 unpack ${A}
31
32 cd "${S}"
33 epatch "${PATCHBUNDLE}"
34 cd "${S}/refpolicy"
35 # Fix bug 257111
36 sed -i -e 's:system_crond_t:system_cronjob_t:g' \
37 "${S}/refpolicy/config/appconfig-standard/default_contexts"
38
39 if ! use peer_perms; then
40 sed -i -e '/network_peer_controls/d' \
41 "${S}/refpolicy/policy/policy_capabilities"
42 fi
43
44 if ! use open_perms; then
45 sed -i -e '/open_perms/d' \
46 "${S}/refpolicy/policy/policy_capabilities"
47 fi
48
49 for i in ${POLICY_TYPES}; do
50 cp -a "${S}/refpolicy" "${S}/${i}"
51
52 cd "${S}/${i}";
53 make conf || die "${i} reconfiguration failed"
54
55 cp "${FILESDIR}/modules.conf.${i}.${MOD_CONF_VER}" \
56 "${S}/${i}/policy/modules.conf" \
57 || die "failed to set up modules.conf"
58 sed -i -e '/^QUIET/s/n/y/' -e '/^MONOLITHIC/s/y/n/' \
59 -e "/^NAME/s/refpolicy/$i/" "${S}/${i}/build.conf" \
60 || die "build.conf setup failed."
61
62 echo "DISTRO = gentoo" >> "${S}/${i}/build.conf"
63
64 if [ "${i}" == "targeted" ]; then
65 sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \
66 "${S}/${i}/config/appconfig-standard/seusers" \
67 || die "targeted seusers setup failed."
68 fi
69 done
70 }
71
72 src_compile() {
73 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
74
75 for i in ${POLICY_TYPES}; do
76 cd "${S}/${i}"
77 make base || die "${i} compile failed"
78 done
79 }
80
81 src_install() {
82 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
83
84 for i in ${POLICY_TYPES}; do
85 cd "${S}/${i}"
86
87 make DESTDIR="${D}" install \
88 || die "${i} install failed."
89
90 make DESTDIR="${D}" install-headers \
91 || die "${i} headers install failed."
92
93 echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type"
94
95 echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types"
96
97 # libsemanage won't make this on its own
98 keepdir "/etc/selinux/${i}/policy"
99 done
100
101 dodoc doc/Makefile.example doc/example.{te,fc,if}
102
103 insinto /etc/selinux
104 doins "${FILESDIR}/config"
105 }
106
107 pkg_postinst() {
108 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
109
110 for i in ${POLICY_TYPES}; do
111 einfo "Inserting base module into ${i} module store."
112
113 cd "/usr/share/selinux/${i}"
114 semodule -s "${i}" -b base.pp
115 done
116 }

  ViewVC Help
Powered by ViewVC 1.1.20