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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Mar 16 04:06:54 2008 UTC (6 years, 6 months ago) by pebenito
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
clean out old selinux policy ebuilds.
(Portage version: 2.1.4.4)

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

  ViewVC Help
Powered by ViewVC 1.1.20