Gentoo Archives: gentoo-commits

From: "Sven Vermeulen (swift)" <swift@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sec-policy/selinux-base: metadata.xml ChangeLog selinux-base-2.20120215-r6.ebuild
Date: Sat, 31 Mar 2012 12:39:16
Message-Id: 20120331122914.A5EEF20061@flycatcher.gentoo.org
1 swift 12/03/31 12:29:14
2
3 Added: metadata.xml ChangeLog
4 selinux-base-2.20120215-r6.ebuild
5 Log:
6 Pushing out 2.20120215 SELinux policies
7
8 (Portage version: 2.1.10.49/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.1 sec-policy/selinux-base/metadata.xml
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/metadata.xml?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/metadata.xml?rev=1.1&content-type=text/plain
15
16 Index: metadata.xml
17 ===================================================================
18 <?xml version="1.0" encoding="UTF-8"?>
19 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
20 <pkgmetadata>
21 <herd>selinux</herd>
22 <longdescription>
23 Gentoo SELinux base policy. This contains policy for a system at the end of system installation.
24 There is no extra policy in this package.
25 </longdescription>
26 <use>
27 <flag name='peer_perms'>Enable the labeled networking peer permissions (SELinux policy capability).</flag>
28 <flag name='open_perms'>Enable the open permissions for file object classes (SELinux policy capability).</flag>
29 <flag name='ubac'>Enable User Based Access Control (UBAC) in the SELinux policy</flag>
30 </use>
31 </pkgmetadata>
32
33
34
35 1.1 sec-policy/selinux-base/ChangeLog
36
37 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/ChangeLog?rev=1.1&view=markup
38 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/ChangeLog?rev=1.1&content-type=text/plain
39
40 Index: ChangeLog
41 ===================================================================
42 # ChangeLog for sec-policy/selinux-base
43 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
44 # $Header: /var/cvsroot/gentoo-x86/sec-policy/selinux-base/ChangeLog,v 1.1 2012/03/31 12:29:14 swift Exp $
45
46 31 Mar 2012; <swift@g.o> +selinux-base-2.20120215-r6.ebuild,
47 +files/config, +metadata.xml:
48 Bumping to 2.20120215 policies
49
50 *selinux-base-2.20120215-r6 (31 Mar 2012)
51
52 31 Mar 2012; <swift@g.o> +selinux-base-2.20120215-r6.ebuild,
53 +files/config, +metadata.xml:
54 Initial base policy package (without additional modules)
55
56
57
58
59 1.1 sec-policy/selinux-base/selinux-base-2.20120215-r6.ebuild
60
61 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20120215-r6.ebuild?rev=1.1&view=markup
62 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20120215-r6.ebuild?rev=1.1&content-type=text/plain
63
64 Index: selinux-base-2.20120215-r6.ebuild
65 ===================================================================
66 # Copyright 1999-2012 Gentoo Foundation
67 # Distributed under the terms of the GNU General Public License v2
68 # $Header: /var/cvsroot/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20120215-r6.ebuild,v 1.1 2012/03/31 12:29:14 swift Exp $
69
70 EAPI="4"
71 IUSE="+peer_perms +open_perms +ubac doc"
72
73 inherit eutils
74
75 DESCRIPTION="Gentoo base policy for SELinux"
76 HOMEPAGE="http://www.gentoo.org/proj/en/hardened/selinux/"
77 SRC_URI="http://oss.tresys.com/files/refpolicy/refpolicy-${PV}.tar.bz2
78 http://dev.gentoo.org/~swift/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2"
79 LICENSE="GPL-2"
80 SLOT="0"
81
82 KEYWORDS="~amd64 ~x86"
83
84 RDEPEND=">=sys-apps/policycoreutils-2.1.10
85 >=sys-fs/udev-151
86 !<=sec-policy/selinux-base-policy-2.20120215"
87 DEPEND="${RDEPEND}
88 sys-devel/m4
89 >=sys-apps/checkpolicy-2.1.8"
90
91 S=${WORKDIR}/
92
93 src_prepare() {
94 # Apply the gentoo patches to the policy. These patches are only necessary
95 # for base policies, or for interface changes on modules.
96 EPATCH_MULTI_MSG="Applying SELinux policy updates ... " \
97 EPATCH_SUFFIX="patch" \
98 EPATCH_SOURCE="${WORKDIR}" \
99 EPATCH_FORCE="yes" \
100 epatch
101
102 cd "${S}/refpolicy"
103 # Fix bug 257111 - Correct the initial sid for cron-started jobs in the
104 # system_r role
105 sed -i -e 's:system_crond_t:system_cronjob_t:g' \
106 "${S}/refpolicy/config/appconfig-standard/default_contexts"
107 sed -i -e 's|system_r:cronjob_t|system_r:system_cronjob_t|g' \
108 "${S}/refpolicy/config/appconfig-mls/default_contexts"
109 sed -i -e 's|system_r:cronjob_t|system_r:system_cronjob_t|g' \
110 "${S}/refpolicy/config/appconfig-mcs/default_contexts"
111 }
112
113 src_configure() {
114 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs"
115
116 # Update the SELinux refpolicy capabilities based on the users' USE flags.
117
118 if ! use peer_perms; then
119 sed -i -e '/network_peer_controls/d' \
120 "${S}/refpolicy/policy/policy_capabilities"
121 fi
122
123 if ! use open_perms; then
124 sed -i -e '/open_perms/d' \
125 "${S}/refpolicy/policy/policy_capabilities"
126 fi
127
128 if ! use ubac; then
129 sed -i -e '/^UBAC/s/y/n/' "${S}/refpolicy/build.conf" \
130 || die "Failed to disable User Based Access Control"
131 fi
132
133 echo "DISTRO = gentoo" >> "${S}/refpolicy/build.conf"
134
135 # Setup the policies based on the types delivered by the end user.
136 # These types can be "targeted", "strict", "mcs" and "mls".
137 for i in ${POLICY_TYPES}; do
138 cp -a "${S}/refpolicy" "${S}/${i}"
139
140 cd "${S}/${i}";
141 make conf || die "Make conf in ${i} failed"
142
143 #cp "${FILESDIR}/modules-2.20120215.conf" "${S}/${i}/policy/modules.conf"
144 sed -i -e "/= module/d" "${S}/${i}/policy/modules.conf"
145
146 sed -i -e '/^QUIET/s/n/y/' -e "/^NAME/s/refpolicy/$i/" \
147 "${S}/${i}/build.conf" || die "build.conf setup failed."
148
149 if [[ "${i}" == "mls" ]] || [[ "${i}" == "mcs" ]];
150 then
151 # MCS/MLS require additional settings
152 sed -i -e "/^TYPE/s/standard/${i}/" "${S}/${i}/build.conf" \
153 || die "failed to set type to mls"
154 fi
155
156 if [ "${i}" == "targeted" ]; then
157 sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \
158 "${S}/${i}/config/appconfig-standard/seusers" \
159 || die "targeted seusers setup failed."
160 fi
161 done
162 }
163
164 src_compile() {
165 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs"
166
167 for i in ${POLICY_TYPES}; do
168 cd "${S}/${i}"
169 make base || die "${i} compile failed"
170 if use doc; then
171 make html || die
172 fi
173 done
174 }
175
176 src_install() {
177 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs"
178
179 for i in ${POLICY_TYPES}; do
180 cd "${S}/${i}"
181
182 make DESTDIR="${D}" install \
183 || die "${i} install failed."
184
185 make DESTDIR="${D}" install-headers \
186 || die "${i} headers install failed."
187
188 echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type"
189
190 echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types"
191
192 # libsemanage won't make this on its own
193 keepdir "/etc/selinux/${i}/policy"
194
195 if use doc; then
196 dohtml doc/html/*;
197 fi
198 done
199
200 dodoc doc/Makefile.example doc/example.{te,fc,if}
201
202 insinto /etc/selinux
203 doins "${FILESDIR}/config"
204 }
205
206 pkg_preinst() {
207 has_version "<${CATEGORY}/${PN}-2.20101213-r13"
208 previous_less_than_r13=$?
209 }