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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Aug 14 21:19:21 2009 UTC (5 years ago) by pebenito
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Mark selinux policy 20080525 stable, clear old ebuilds.
(Portage version: 13960-svn/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-20070928.ebuild,v 1.3 2009/07/22 13:12:36 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="20070928"
28
29 unpack ${A}
30
31 cd "${S}/refpolicy"
32 # epatch ${FILESDIR}/${PN}-${PV}.diff
33
34 for i in ${POLICY_TYPES}; do
35 mkdir -p "${S}/${i}/policy"
36 cp "${FILESDIR}/modules.conf.${i}.${MOD_CONF_VER}" \
37 "${S}/${i}/policy/modules.conf"
38 done
39 }
40
41 src_compile() {
42 local OPTS="MONOLITHIC=n DISTRO=gentoo QUIET=y"
43 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
44
45 cd "${S}/refpolicy"
46
47 make ${OPTS} generate || die "Failed to create generated module files"
48
49 make ${OPTS} xml || die "XML generation failed."
50
51 for i in ${POLICY_TYPES}; do
52 # make ${OPTS} TYPE=${i} NAME=${i} LOCAL_ROOT="${S}/${i}" conf \
53 # || die "${i} modules.conf update failed"
54
55 make ${OPTS} TYPE=${i} NAME=${i} LOCAL_ROOT="${S}/${i}" base \
56 || die "${i} compile failed"
57 done
58 }
59
60 src_install() {
61 local OPTS="MONOLITHIC=n DISTRO=gentoo QUIET=y DESTDIR=${D}"
62 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
63
64 cd "${S}/refpolicy"
65
66 for i in ${POLICY_TYPES}; do
67 make ${OPTS} TYPE=${i} NAME=${i} LOCAL_ROOT="${S}/${i}" install \
68 || die "${i} install failed."
69
70 make ${OPTS} TYPE=${i} NAME=${i} install-headers \
71 || die "${i} headers install failed."
72
73 echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type"
74
75 echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types"
76
77 # libsemanage won't make this on its own
78 keepdir "/etc/selinux/${i}/policy"
79 done
80
81 dodoc doc/Makefile.example doc/example.{te,fc,if}
82
83 insinto /etc/selinux
84 doins "${FILESDIR}/config"
85 }
86
87 pkg_postinst() {
88 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
89
90 if has "loadpolicy" $FEATURES ; then
91 for i in ${POLICY_TYPES}; do
92 einfo "Inserting base module into ${i} module store."
93
94 cd "/usr/share/selinux/${i}"
95 semodule -s "${i}" -b base.pp
96 done
97 else
98 echo
99 echo
100 eerror "Policy has not been loaded. It is strongly suggested"
101 eerror "that the policy be loaded before continuing!!"
102 echo
103 einfo "Automatic policy loading can be enabled by adding"
104 einfo "\"loadpolicy\" to the FEATURES in make.conf."
105 echo
106 echo
107 ebeep 4
108 epause 4
109 fi
110 }

  ViewVC Help
Powered by ViewVC 1.1.20