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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Mon Jul 11 01:59:36 2011 UTC (3 years ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Removed all pre 2.20xx base policies

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

  ViewVC Help
Powered by ViewVC 1.1.20