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

Contents of /sec-policy/selinux-base-policy/selinux-base-policy-2.20090814.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat Nov 12 20:53:21 2011 UTC (2 years, 10 months ago) by swift
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Removing the SELinux 2.20101213 policies

(Portage version: 2.1.10.11/cvs/Linux x86_64)

1 # Copyright 1999-2009 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.20090814.ebuild,v 1.1 2009/08/14 18:58:38 pebenito Exp $
4
5 IUSE=""
6
7 inherit eutils
8
9 DESCRIPTION="Gentoo base policy for SELinux"
10 HOMEPAGE="http://www.gentoo.org/proj/en/hardened/selinux/"
11 SRC_URI="http://oss.tresys.com/files/refpolicy/refpolicy-${PV}.tar.bz2"
12 LICENSE="GPL-2"
13 SLOT="0"
14
15 KEYWORDS="~amd64 ~x86"
16
17 RDEPEND=">=sys-apps/policycoreutils-1.30.30"
18 DEPEND="${RDEPEND}
19 sys-devel/m4
20 >=sys-apps/checkpolicy-1.30.12"
21
22 S=${WORKDIR}/
23
24 src_unpack() {
25 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
26 MOD_CONF_VER="20090730"
27
28 unpack ${A}
29
30 # cd "${S}/refpolicy"
31 # epatch ${FILESDIR}/${PN}-${PV}.diff
32
33 for i in ${POLICY_TYPES}; do
34 cp -a "${S}/refpolicy" "${S}/${i}"
35
36 cp "${FILESDIR}/modules.conf.${i}.${MOD_CONF_VER}" \
37 "${S}/${i}/policy/modules.conf" \
38 || die "failed to set up modules.conf"
39 sed -i -e '/^QUIET/s/n/y/' -e '/^MONOLITHIC/s/y/n/' \
40 -e "/^NAME/s/refpolicy/$i/" "${S}/${i}/build.conf" \
41 || die "build.conf setup failed."
42
43 echo "DISTRO = gentoo" >> "${S}/${i}/build.conf"
44
45 if [ "${i}" == "targeted" ]; then
46 sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \
47 "${S}/${i}/config/appconfig-standard/seusers" \
48 || die "targeted seusers setup failed."
49
50 # add compat
51 sed -i -e '/user_u/s/user_r/user_r system_r/' "${S}/${i}/policy/users" \
52 || die "targeted user compat failed."
53 fi
54 done
55 }
56
57 src_compile() {
58 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
59
60 for i in ${POLICY_TYPES}; do
61 cd "${S}/${i}"
62
63 make base || die "${i} compile failed"
64 done
65 }
66
67 src_install() {
68 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
69
70 for i in ${POLICY_TYPES}; do
71 cd "${S}/${i}"
72
73 make DESTDIR="${D}" install \
74 || die "${i} install failed."
75
76 make DESTDIR="${D}" install-headers \
77 || die "${i} headers install failed."
78
79 echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type"
80
81 echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types"
82
83 # libsemanage won't make this on its own
84 keepdir "/etc/selinux/${i}/policy"
85 done
86
87 dodoc doc/Makefile.example doc/example.{te,fc,if}
88
89 insinto /etc/selinux
90 doins "${FILESDIR}/config"
91 }
92
93 pkg_postinst() {
94 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
95
96 if has "loadpolicy" $FEATURES ; then
97 for i in ${POLICY_TYPES}; do
98 einfo "Inserting base module into ${i} module store."
99
100 cd "/usr/share/selinux/${i}"
101 semodule -s "${i}" -b base.pp
102 done
103 else
104 echo
105 echo
106 eerror "Policy has not been loaded. It is strongly suggested"
107 eerror "that the policy be loaded before continuing!!"
108 echo
109 einfo "Automatic policy loading can be enabled by adding"
110 einfo "\"loadpolicy\" to the FEATURES in make.conf."
111 echo
112 echo
113 ebeep 4
114 epause 4
115 fi
116 }

  ViewVC Help
Powered by ViewVC 1.1.20