/[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.1 Revision 1.2
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.1 2006/10/09 23:48:24 pebenito Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/selinux-policy-2.eclass,v 1.2 2006/10/25 11:27:36 pebenito 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
22DEPEND="${RDEPEND} 22DEPEND="${RDEPEND}
23 sys-devel/m4 23 sys-devel/m4
24 >=sys-apps/checkpolicy-1.30.12" 24 >=sys-apps/checkpolicy-1.30.12"
25 25
26selinux-policy-2_src_unpack() { 26selinux-policy-2_src_unpack() {
27 local modfiles
28 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
29
27 unpack ${A} 30 unpack ${A}
28
29 local modfiles
30 31
31 for i in ${MODS}; do 32 for i in ${MODS}; do
32 modfiles="`find ${S}/refpolicy/policy/modules -iname $i.te` $modfiles" 33 modfiles="`find ${S}/refpolicy/policy/modules -iname $i.te` $modfiles"
33 modfiles="`find ${S}/refpolicy/policy/modules -iname $i.fc` $modfiles" 34 modfiles="`find ${S}/refpolicy/policy/modules -iname $i.fc` $modfiles"
34 # use .if from headers 35 # use .if from headers
41 cp ${modfiles} ${S}/${i} 42 cp ${modfiles} ${S}/${i}
42 done 43 done
43} 44}
44 45
45selinux-policy-2_src_compile() { 46selinux-policy-2_src_compile() {
47 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
48
46 for i in ${POLICY_TYPES}; do 49 for i in ${POLICY_TYPES}; do
47 make NAME=$i -C ${S}/${i} || die "${i} compile failed" 50 make NAME=$i -C ${S}/${i} || die "${i} compile failed"
48 done 51 done
49} 52}
50 53
51selinux-policy-2_src_install() { 54selinux-policy-2_src_install() {
55 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
52 BASEDIR="/usr/share/selinux" 56 local BASEDIR="/usr/share/selinux"
53 57
54 for i in ${POLICY_TYPES}; do 58 for i in ${POLICY_TYPES}; do
55 for j in ${MODS}; do 59 for j in ${MODS}; do
56 echo "Installing ${i} ${j} policy package" 60 echo "Installing ${i} ${j} policy package"
57 insinto ${BASEDIR}/${i} 61 insinto ${BASEDIR}/${i}
64 # build up the command in the case of multiple modules 68 # build up the command in the case of multiple modules
65 local COMMAND 69 local COMMAND
66 for i in ${MODS}; do 70 for i in ${MODS}; do
67 COMMAND="-i ${i}.pp ${COMMAND}" 71 COMMAND="-i ${i}.pp ${COMMAND}"
68 done 72 done
73 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="strict targeted"
69 74
70 if has "loadpolicy" $FEATURES ; then 75 if has "loadpolicy" $FEATURES ; then
71 for i in ${POLICY_TYPES}; do 76 for i in ${POLICY_TYPES}; do
72 einfo "Inserting the following modules into the $i module store: ${MODS}" 77 einfo "Inserting the following modules into the $i module store: ${MODS}"
73 78

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20