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: selinux-base-2.20140311-r4.ebuild selinux-base-2.20140311-r3.ebuild ChangeLog
Date: Fri, 01 Aug 2014 21:05:15
Message-Id: 20140801210423.B8D262004F@flycatcher.gentoo.org
1 swift 14/08/01 21:04:23
2
3 Modified: selinux-base-2.20140311-r3.ebuild ChangeLog
4 Added: selinux-base-2.20140311-r4.ebuild
5 Log:
6 Stabilization of r3, and make r4 available for testing
7
8 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0x2EDD52403B68AF47)
9
10 Revision Changes Path
11 1.2 sec-policy/selinux-base/selinux-base-2.20140311-r3.ebuild
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20140311-r3.ebuild?rev=1.2&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20140311-r3.ebuild?rev=1.2&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20140311-r3.ebuild?r1=1.1&r2=1.2
16
17 Index: selinux-base-2.20140311-r3.ebuild
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20140311-r3.ebuild,v
20 retrieving revision 1.1
21 retrieving revision 1.2
22 diff -u -r1.1 -r1.2
23 --- selinux-base-2.20140311-r3.ebuild 29 May 2014 18:57:50 -0000 1.1
24 +++ selinux-base-2.20140311-r3.ebuild 1 Aug 2014 21:04:23 -0000 1.2
25 @@ -1,6 +1,6 @@
26 # Copyright 1999-2014 Gentoo Foundation
27 # Distributed under the terms of the GNU General Public License v2
28 -# $Header: /var/cvsroot/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20140311-r3.ebuild,v 1.1 2014/05/29 18:57:50 swift Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20140311-r3.ebuild,v 1.2 2014/08/01 21:04:23 swift Exp $
30 EAPI="5"
31
32 inherit eutils
33 @@ -14,7 +14,7 @@
34 LICENSE="GPL-2"
35 SLOT="0"
36
37 -KEYWORDS="~amd64 ~x86"
38 +KEYWORDS="amd64 x86"
39
40 RDEPEND=">=sys-apps/policycoreutils-2.1.10
41 virtual/udev
42
43
44
45 1.45 sec-policy/selinux-base/ChangeLog
46
47 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/ChangeLog?rev=1.45&view=markup
48 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/ChangeLog?rev=1.45&content-type=text/plain
49 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/ChangeLog?r1=1.44&r2=1.45
50
51 Index: ChangeLog
52 ===================================================================
53 RCS file: /var/cvsroot/gentoo-x86/sec-policy/selinux-base/ChangeLog,v
54 retrieving revision 1.44
55 retrieving revision 1.45
56 diff -u -r1.44 -r1.45
57 --- ChangeLog 29 May 2014 20:23:20 -0000 1.44
58 +++ ChangeLog 1 Aug 2014 21:04:23 -0000 1.45
59 @@ -1,6 +1,12 @@
60 # ChangeLog for sec-policy/selinux-base
61 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
62 -# $Header: /var/cvsroot/gentoo-x86/sec-policy/selinux-base/ChangeLog,v 1.44 2014/05/29 20:23:20 swift Exp $
63 +# $Header: /var/cvsroot/gentoo-x86/sec-policy/selinux-base/ChangeLog,v 1.45 2014/08/01 21:04:23 swift Exp $
64 +
65 +*selinux-base-2.20140311-r4 (01 Aug 2014)
66 +
67 + 01 Aug 2014; Sven Vermeulen <swift@g.o>
68 + +selinux-base-2.20140311-r4.ebuild, selinux-base-2.20140311-r3.ebuild:
69 + Stabilization of r3, and make r4 available for testing
70
71 29 May 2014; Sven Vermeulen <swift@g.o>
72 selinux-base-2.20140311-r2.ebuild:
73
74
75
76 1.1 sec-policy/selinux-base/selinux-base-2.20140311-r4.ebuild
77
78 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20140311-r4.ebuild?rev=1.1&view=markup
79 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20140311-r4.ebuild?rev=1.1&content-type=text/plain
80
81 Index: selinux-base-2.20140311-r4.ebuild
82 ===================================================================
83 # Copyright 1999-2014 Gentoo Foundation
84 # Distributed under the terms of the GNU General Public License v2
85 # $Header: /var/cvsroot/gentoo-x86/sec-policy/selinux-base/selinux-base-2.20140311-r4.ebuild,v 1.1 2014/08/01 21:04:23 swift Exp $
86 EAPI="5"
87
88 inherit eutils
89
90 IUSE="+peer_perms +open_perms +ubac +unconfined doc"
91
92 DESCRIPTION="Gentoo base policy for SELinux"
93 HOMEPAGE="http://www.gentoo.org/proj/en/hardened/selinux/"
94 SRC_URI="http://oss.tresys.com/files/refpolicy/refpolicy-${PV}.tar.bz2
95 http://dev.gentoo.org/~swift/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2"
96 LICENSE="GPL-2"
97 SLOT="0"
98
99 KEYWORDS="~amd64 ~x86"
100
101 RDEPEND=">=sys-apps/policycoreutils-2.1.10
102 virtual/udev
103 !<=sec-policy/selinux-base-policy-2.20130424"
104 DEPEND="${RDEPEND}
105 sys-devel/m4
106 >=sys-apps/checkpolicy-2.1.8"
107
108 S=${WORKDIR}/
109
110 src_prepare() {
111 # Apply the gentoo patches to the policy. These patches are only necessary
112 # for base policies, or for interface changes on modules.
113 EPATCH_MULTI_MSG="Applying SELinux policy updates ... " \
114 EPATCH_SUFFIX="patch" \
115 EPATCH_SOURCE="${WORKDIR}" \
116 EPATCH_FORCE="yes" \
117 epatch
118
119 cd "${S}/refpolicy"
120 make bare
121 # Fix bug 257111 - Correct the initial sid for cron-started jobs in the
122 # system_r role
123 sed -i -e 's:system_crond_t:system_cronjob_t:g' \
124 "${S}/refpolicy/config/appconfig-standard/default_contexts"
125 sed -i -e 's|system_r:cronjob_t|system_r:system_cronjob_t|g' \
126 "${S}/refpolicy/config/appconfig-mls/default_contexts"
127 sed -i -e 's|system_r:cronjob_t|system_r:system_cronjob_t|g' \
128 "${S}/refpolicy/config/appconfig-mcs/default_contexts"
129
130 epatch_user
131 }
132
133 src_configure() {
134 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs"
135
136 # Update the SELinux refpolicy capabilities based on the users' USE flags.
137
138 if ! use peer_perms; then
139 sed -i -e '/network_peer_controls/d' \
140 "${S}/refpolicy/policy/policy_capabilities"
141 fi
142
143 if ! use open_perms; then
144 sed -i -e '/open_perms/d' \
145 "${S}/refpolicy/policy/policy_capabilities"
146 fi
147
148 if ! use ubac; then
149 sed -i -e '/^UBAC/s/y/n/' "${S}/refpolicy/build.conf" \
150 || die "Failed to disable User Based Access Control"
151 fi
152
153 echo "DISTRO = gentoo" >> "${S}/refpolicy/build.conf"
154
155 # Prepare initial configuration
156 cd "${S}/refpolicy";
157 make conf || die "Make conf failed"
158
159 # Setup the policies based on the types delivered by the end user.
160 # These types can be "targeted", "strict", "mcs" and "mls".
161 for i in ${POLICY_TYPES}; do
162 cp -a "${S}/refpolicy" "${S}/${i}"
163 cd "${S}/${i}";
164
165 #cp "${FILESDIR}/modules-2.20120215.conf" "${S}/${i}/policy/modules.conf"
166 sed -i -e "/= module/d" "${S}/${i}/policy/modules.conf"
167
168 sed -i -e '/^QUIET/s/n/y/' -e "/^NAME/s/refpolicy/$i/" \
169 "${S}/${i}/build.conf" || die "build.conf setup failed."
170
171 if [[ "${i}" == "mls" ]] || [[ "${i}" == "mcs" ]];
172 then
173 # MCS/MLS require additional settings
174 sed -i -e "/^TYPE/s/standard/${i}/" "${S}/${i}/build.conf" \
175 || die "failed to set type to mls"
176 fi
177
178 if [ "${i}" == "targeted" ]; then
179 sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \
180 "${S}/${i}/config/appconfig-standard/seusers" \
181 || die "targeted seusers setup failed."
182 fi
183
184 if [ "${i}" != "targeted" ] && [ "${i}" != "strict" ] && use unconfined; then
185 sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \
186 "${S}/${i}/config/appconfig-${i}/seusers" \
187 || die "policy seusers setup failed."
188 fi
189 done
190 }
191
192 src_compile() {
193 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs"
194
195 for i in ${POLICY_TYPES}; do
196 cd "${S}/${i}"
197 make base || die "${i} compile failed"
198 if use doc; then
199 make html || die
200 fi
201 done
202 }
203
204 src_install() {
205 [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs"
206
207 for i in ${POLICY_TYPES}; do
208 cd "${S}/${i}"
209
210 make DESTDIR="${D}" install \
211 || die "${i} install failed."
212
213 make DESTDIR="${D}" install-headers \
214 || die "${i} headers install failed."
215
216 echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type"
217
218 echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types"
219
220 # libsemanage won't make this on its own
221 keepdir "/etc/selinux/${i}/policy"
222
223 if use doc; then
224 dohtml doc/html/*;
225 fi
226
227 insinto /usr/share/selinux/devel;
228 doins doc/policy.xml;
229
230 done
231
232 dodoc doc/Makefile.example doc/example.{te,fc,if}
233
234 doman man/man8/*.8;
235
236 insinto /etc/selinux
237 doins "${FILESDIR}/config"
238 }
239
240 pkg_preinst() {
241 has_version "<${CATEGORY}/${PN}-2.20101213-r13"
242 previous_less_than_r13=$?
243 }