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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20