/[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.13 Revision 1.14
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 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.13 2012/07/26 12:53:01 swift Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/selinux-policy-2.eclass,v 1.14 2012/09/08 18:36:12 swift 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
8# @ECLASS: selinux-policy-2.eclass 8# @ECLASS: selinux-policy-2.eclass
54# This variable is the same POLICY_TYPES variable that we tell SELinux 54# This variable is the same POLICY_TYPES variable that we tell SELinux
55# users to set in /etc/make.conf. Therefor, it is not the module that should 55# users to set in /etc/make.conf. Therefor, it is not the module that should
56# override it, but the user. 56# override it, but the user.
57: ${POLICY_TYPES:="targeted strict mcs mls"} 57: ${POLICY_TYPES:="targeted strict mcs mls"}
58 58
59inherit eutils 59extra_eclass=""
60case ${BASEPOL} in
61 9999) extra_eclass="git-2";
62 EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/hardened-refpolicy.git";
63 EGIT_SOURCEDIR="${WORKDIR}/refpolicy";;
64esac
65
66inherit eutils ${extra_eclass}
60 67
61IUSE="" 68IUSE=""
62 69
63HOMEPAGE="http://www.gentoo.org/proj/en/hardened/selinux/" 70HOMEPAGE="http://www.gentoo.org/proj/en/hardened/selinux/"
64if [[ -n ${BASEPOL} ]]; 71if [[ -n ${BASEPOL} ]] && [[ "${BASEPOL}" != "9999" ]];
65then 72then
66 SRC_URI="http://oss.tresys.com/files/refpolicy/refpolicy-${PV}.tar.bz2 73 SRC_URI="http://oss.tresys.com/files/refpolicy/refpolicy-${PV}.tar.bz2
67 http://dev.gentoo.org/~swift/patches/selinux-base-policy/patchbundle-selinux-base-policy-${BASEPOL}.tar.bz2" 74 http://dev.gentoo.org/~swift/patches/selinux-base-policy/patchbundle-selinux-base-policy-${BASEPOL}.tar.bz2"
75elif [[ "${BASEPOL}" != "9999" ]];
76then
77 SRC_URI="http://oss.tresys.com/files/refpolicy/refpolicy-${PV}.tar.bz2"
68else 78else
69 SRC_URI="http://oss.tresys.com/files/refpolicy/refpolicy-${PV}.tar.bz2" 79 SRC_URI=""
70fi 80fi
71 81
72LICENSE="GPL-2" 82LICENSE="GPL-2"
73SLOT="0" 83SLOT="0"
74S="${WORKDIR}/" 84S="${WORKDIR}/"
99# @FUNCTION: selinux-policy-2_src_unpack 109# @FUNCTION: selinux-policy-2_src_unpack
100# @DESCRIPTION: 110# @DESCRIPTION:
101# Unpack the policy sources as offered by upstream (refpolicy). In case of EAPI 111# Unpack the policy sources as offered by upstream (refpolicy). In case of EAPI
102# older than 2, call src_prepare too. 112# older than 2, call src_prepare too.
103selinux-policy-2_src_unpack() { 113selinux-policy-2_src_unpack() {
114 if [[ "${BASEPOL}" != "9999" ]];
115 then
104 unpack ${A} 116 unpack ${A}
117 else
118 git-2_src_unpack
119 fi
105 120
106 # Call src_prepare explicitly for EAPI 0 or 1 121 # Call src_prepare explicitly for EAPI 0 or 1
107 has "${EAPI:-0}" 0 1 && selinux-policy-2_src_prepare 122 has "${EAPI:-0}" 0 1 && selinux-policy-2_src_prepare
108} 123}
109 124
125 140
126 # Create 3rd_party location for user-contributed policies 141 # Create 3rd_party location for user-contributed policies
127 cd "${S}/refpolicy/policy/modules" && mkdir 3rd_party; 142 cd "${S}/refpolicy/policy/modules" && mkdir 3rd_party;
128 143
129 # Patch the sources with the base patchbundle 144 # Patch the sources with the base patchbundle
130 if [[ -n ${BASEPOL} ]]; 145 if [[ -n ${BASEPOL} ]] && [[ "${BASEPOL}" != "9999" ]];
131 then 146 then
132 cd "${S}" 147 cd "${S}"
133 EPATCH_MULTI_MSG="Applying SELinux policy updates ... " \ 148 EPATCH_MULTI_MSG="Applying SELinux policy updates ... " \
134 EPATCH_SUFFIX="patch" \ 149 EPATCH_SUFFIX="patch" \
135 EPATCH_SOURCE="${WORKDIR}" \ 150 EPATCH_SOURCE="${WORKDIR}" \

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.20