/[gentoo-x86]/eclass/selinux-policy-2.eclass
Gentoo

Diff of /eclass/selinux-policy-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.4 Revision 1.5
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/selinux-policy-2.eclass,v 1.4 2009/08/02 02:58:25 pebenito Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/selinux-policy-2.eclass,v 1.5 2011/02/05 11:28:10 blueness Exp $
4 4
5# Eclass for installing SELinux policy, and optionally 5# Eclass for installing SELinux policy, and optionally
6# reloading the reference-policy based modules 6# reloading the reference-policy based modules.
7 7
8inherit eutils 8inherit eutils
9 9
10IUSE="" 10IUSE=""
11 11
30 unpack ${A} 30 unpack ${A}
31 31
32 for i in ${MODS}; do 32 for i in ${MODS}; do
33 modfiles="`find ${S}/refpolicy/policy/modules -iname $i.te` $modfiles" 33 modfiles="`find ${S}/refpolicy/policy/modules -iname $i.te` $modfiles"
34 modfiles="`find ${S}/refpolicy/policy/modules -iname $i.fc` $modfiles" 34 modfiles="`find ${S}/refpolicy/policy/modules -iname $i.fc` $modfiles"
35 # use .if from headers
36 done 35 done
37 36
38 for i in ${POLICY_TYPES}; do 37 for i in ${POLICY_TYPES}; do
39 mkdir "${S}"/${i} 38 mkdir "${S}"/${i}
40 cp "${S}"/refpolicy/doc/Makefile.example "${S}"/${i}/Makefile 39 cp "${S}"/refpolicy/doc/Makefile.example "${S}"/${i}/Makefile
41 40
42 cp ${modfiles} "${S}"/${i} 41 cp ${modfiles} "${S}"/${i}
43 42
44 if [ -n "${POLICY_PATCH}" ]; then 43 if [ -n "${POLICY_PATCH}" ]; then
44 for POLPATCH in "${POLICY_PATCH}";
45 do
45 cd "${S}"/${i} 46 cd "${S}"/${i}
47 einfo "Patching ${i}"
46 epatch "${POLICY_PATCH}" || die "failed patch ${i}" 48 epatch "${POLPATCH}" || die "failed patch ${POLPATCH}"
49 done
47 fi 50 fi
48 51
49 done 52 done
50} 53}
51 54
76 for i in ${MODS}; do 79 for i in ${MODS}; do
77 COMMAND="-i ${i}.pp ${COMMAND}" 80 COMMAND="-i ${i}.pp ${COMMAND}"
78 done 81 done
79 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted" 82 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
80 83
81 if has "loadpolicy" $FEATURES ; then
82 for i in ${POLICY_TYPES}; do 84 for i in ${POLICY_TYPES}; do
83 einfo "Inserting the following modules into the $i module store: ${MODS}" 85 einfo "Inserting the following modules into the $i module store: ${MODS}"
84 86
85 cd /usr/share/selinux/${i} 87 cd /usr/share/selinux/${i}
86 semodule -s ${i} ${COMMAND} 88 semodule -s ${i} ${COMMAND}
87 done 89 done
88 else
89 echo
90 echo
91 eerror "Policy has not been loaded. It is strongly suggested"
92 eerror "that the policy be loaded before continuing!!"
93 echo
94 einfo "Automatic policy loading can be enabled by adding"
95 einfo "\"loadpolicy\" to the FEATURES in make.conf."
96 echo
97 echo
98 ebeep 4
99 epause 4
100 fi
101} 90}
102 91
103EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst 92EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20