1 |
abcd 09/09/11 07:16:29 |
2 |
|
3 |
Added: schroot.initd schroot-1.2.3-pam.patch schroot.confd |
4 |
schroot-1.2.3-autotools.patch |
5 |
schroot-1.2.3-tests.patch |
6 |
Log: |
7 |
New ebuild. Thanks to Nick Fortino <nfortino@×××××.com> for initial ebuild and patches (bug #257334). |
8 |
(Portage version: -svn/cvs/Linux i686) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 dev-util/schroot/files/schroot.initd |
12 |
|
13 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/schroot/files/schroot.initd?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/schroot/files/schroot.initd?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: schroot.initd |
17 |
=================================================================== |
18 |
#!/sbin/runscript |
19 |
|
20 |
depend() { |
21 |
need localmount |
22 |
after net netmount |
23 |
} |
24 |
|
25 |
recover_sessions() { |
26 |
einfo "Recovering schroot sessions" |
27 |
eindent |
28 |
local chroot |
29 |
local chroots="$(schroot --all-sessions --list --quiet)" |
30 |
if [ -n "${chroots}" ]; then |
31 |
for chroot in ${chroots}; do |
32 |
ebegin "$chroot" |
33 |
schroot --chroot=$chroot --recover-session |
34 |
eend $? |
35 |
done |
36 |
else |
37 |
einfo "(none)" |
38 |
fi |
39 |
eoutdent |
40 |
einfo "...done" |
41 |
} |
42 |
|
43 |
end_sessions() { |
44 |
einfo "Ending schroot sessions" |
45 |
eindent |
46 |
local chroot |
47 |
local chroots="$(schroot --all-sessions --list --quiet)" |
48 |
if [ -n "${chroots}" ]; then |
49 |
for chroot in ${chroots}; do |
50 |
ebegin "$chroot" |
51 |
schroot --chroot=$chroot --recover-session |
52 |
eend $? |
53 |
done |
54 |
else |
55 |
einfo "(none)" |
56 |
fi |
57 |
eoutdent |
58 |
einfo "...done" |
59 |
} |
60 |
|
61 |
start() { |
62 |
if [ "${SESSIONS_RECOVER}" = "end" ]; then |
63 |
end_sessions |
64 |
else |
65 |
recover_sessions |
66 |
fi |
67 |
} |
68 |
|
69 |
|
70 |
|
71 |
1.1 dev-util/schroot/files/schroot-1.2.3-pam.patch |
72 |
|
73 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/schroot/files/schroot-1.2.3-pam.patch?rev=1.1&view=markup |
74 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/schroot/files/schroot-1.2.3-pam.patch?rev=1.1&content-type=text/plain |
75 |
|
76 |
Index: schroot-1.2.3-pam.patch |
77 |
=================================================================== |
78 |
removes the dependency on debian specific pam files. Updates the pam |
79 |
configuration to behave as it does on debian. |
80 |
|
81 |
contributed by Nick Fortino (nfortino@×××××.com) 1/15/2009 |
82 |
|
83 |
--- schroot-1.2.1/bin/schroot/pam/schroot.old |
84 |
+++ schroot-1.2.1/bin/schroot/pam/schroot |
85 |
@@ -23,12 +23,32 @@ |
86 |
# time restrainst on schroot usage. |
87 |
# account requisite pam_time.so |
88 |
|
89 |
-# The standard Unix authentication modules, used with |
90 |
-# NIS (man nsswitch) as well as normal /etc/passwd and |
91 |
-# /etc/shadow entries. |
92 |
-@include common-auth |
93 |
-@include common-account |
94 |
-@include common-session |
95 |
+# here are the per-package modules (the "Primary" block) |
96 |
+auth [success=1 default=ignore] pam_unix.so nullok_secure |
97 |
+# here's the fallback if no module succeeds |
98 |
+auth requisite pam_deny.so |
99 |
+# prime the stack with a positive return value if there isn't one already; |
100 |
+# this avoids us returning an error just because nothing sets a success code |
101 |
+# since the modules above will each just jump around |
102 |
+auth required pam_permit.so |
103 |
+ |
104 |
+# here are the per-package modules (the "Primary" block) |
105 |
+account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so |
106 |
+# here's the fallback if no module succeeds |
107 |
+account requisite pam_deny.so |
108 |
+# prime the stack with a positive return value if there isn't one already; |
109 |
+# this avoids us returning an error just because nothing sets a success code |
110 |
+# since the modules above will each just jump around |
111 |
+account required pam_permit.so |
112 |
+ |
113 |
+# here are the per-package modules (the "Primary" block) |
114 |
+session [default=1] pam_permit.so |
115 |
+# here's the fallback if no module succeeds |
116 |
+session requisite pam_deny.so |
117 |
+# prime the stack with a positive return value if there isn't one already; |
118 |
+# this avoids us returning an error just because nothing sets a success code |
119 |
+# since the modules above will each just jump around |
120 |
+session required pam_permit.so |
121 |
|
122 |
# Sets up user limits, please uncomment and read /etc/security/limits.conf |
123 |
# to enable this functionality. |
124 |
|
125 |
|
126 |
|
127 |
1.1 dev-util/schroot/files/schroot.confd |
128 |
|
129 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/schroot/files/schroot.confd?rev=1.1&view=markup |
130 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/schroot/files/schroot.confd?rev=1.1&content-type=text/plain |
131 |
|
132 |
Index: schroot.confd |
133 |
=================================================================== |
134 |
# This is a configuration file for /etc/init.d/schroot; it allows you |
135 |
# to perform common modifications to the behavior of schroot |
136 |
# initialization without editing the init script. |
137 |
|
138 |
# What do we want to do with "orphan" sessions when starting or |
139 |
# restarting? Recover them (leave empty or set to "recover") or just |
140 |
# end them (set to "end")? |
141 |
SESSIONS_RECOVER="recover" |
142 |
|
143 |
|
144 |
|
145 |
|
146 |
1.1 dev-util/schroot/files/schroot-1.2.3-autotools.patch |
147 |
|
148 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/schroot/files/schroot-1.2.3-autotools.patch?rev=1.1&view=markup |
149 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/schroot/files/schroot-1.2.3-autotools.patch?rev=1.1&content-type=text/plain |
150 |
|
151 |
Index: schroot-1.2.3-autotools.patch |
152 |
=================================================================== |
153 |
Fixes QA issues in configure.ac |
154 |
Removes automagic dependency on cppunit, and instead only builds tests |
155 |
when --enable-test is passed in. |
156 |
uses LIBS instead of LDFLAGS for linking libraries. Needed for building |
157 |
with --as-needed |
158 |
|
159 |
Contributed by Nick Fortino (nfortino@×××××.com) 2/2/2009 |
160 |
|
161 |
Updated by Jonathan Callen <abcd@g.o> 2009-09-11 |
162 |
|
163 |
--- schroot-1.2.3.orig/configure.ac |
164 |
+++ schroot-1.2.3/configure.ac |
165 |
@@ -174,6 +174,15 @@ if test "$enable_debug" = "yes"; then |
166 |
AC_DEFINE_UNQUOTED([SBUILD_DEBUG], [1], [Enable debugging]) |
167 |
fi |
168 |
|
169 |
+AC_ARG_ENABLE([test], [AS_HELP_STRING([--enable-test], [Build unit tests])], |
170 |
+ [ case "${enableval}" in |
171 |
+ yes) enable_test="yes" ;; |
172 |
+ no) enable_test="no" ;; |
173 |
+ unset) enable_test="no" ;; |
174 |
+ *) AC_MSG_RESULT([unknown]) |
175 |
+ AC_MSG_ERROR([bad value ${enableval} for --enable-test]) ;; |
176 |
+ esac]) |
177 |
+ |
178 |
# Checks for programs. |
179 |
AC_PROG_CXX |
180 |
AC_LANG([C++]) |
181 |
@@ -195,7 +204,10 @@ PKG_CHECK_MODULES([UUID], [uuid], |
182 |
HAVE_UUID=true], |
183 |
[HAVE_UUID=false]) |
184 |
|
185 |
+AS_IF([test "$enable_test" = "yes"], [ |
186 |
AM_PATH_CPPUNIT([1.10.0], [HAVE_CPPUNIT=true]) |
187 |
+]) |
188 |
+ |
189 |
AM_CONDITIONAL([USE_UNIT_TESTS], [test -n "$HAVE_CPPUNIT"]) |
190 |
|
191 |
SCHROOT_CFLAGS="$UUID_CFLAGS" |
192 |
@@ -240,19 +252,19 @@ AC_CHECK_LIB([lockdev], [dev_lock], |
193 |
AC_SUBST([LOCKDEV_LIBS]) |
194 |
|
195 |
AC_MSG_CHECKING([for boost::program_options::variables_map in -lboost_program_options-mt]) |
196 |
-saved_ldflags="${LDFLAGS}" |
197 |
-LDFLAGS="${LDFLAGS} -lboost_program_options-mt" |
198 |
+saved_LIBS="${LIBS}" |
199 |
+LIBS="${LIBS} -lboost_program_options-mt" |
200 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>], |
201 |
[boost::program_options::variables_map::variables_map dummy()])], |
202 |
[AC_MSG_RESULT([yes]) |
203 |
BOOST_LIBS="${BOOST_LIBS} -lboost_program_options-mt"], |
204 |
[AC_MSG_RESULT([no]) |
205 |
AC_MSG_FAILURE([libboost_program_options (Boost C++ Libraries) is not installed, but is required by schroot])]) |
206 |
-LDFLAGS="${saved_ldflags}" |
207 |
+LIBS="${saved_LIBS}" |
208 |
|
209 |
AC_MSG_CHECKING([for boost::program_options::options_description::options() in -lboost_program_options-mt]) |
210 |
-saved_ldflags="${LDFLAGS}" |
211 |
-LDFLAGS="${LDFLAGS} -lboost_program_options-mt" |
212 |
+saved_LIBS="${LIBS}" |
213 |
+LIBS="${LIBS} -lboost_program_options-mt" |
214 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>], |
215 |
[boost::program_options::options_description testgrp("test group"); |
216 |
bool notused = testgrp.options().empty(); |
217 |
@@ -261,33 +273,33 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([#includ |
218 |
BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="current"], |
219 |
[AC_MSG_RESULT([no]) |
220 |
BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="old"]) |
221 |
-LDFLAGS="${saved_ldflags}" |
222 |
+LIBS="${saved_LIBS}" |
223 |
AH_TEMPLATE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, [Set if boost::program_options::options_description::options() is not available]) |
224 |
if test "$BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS" = "old"; then |
225 |
AC_DEFINE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, 1) |
226 |
fi |
227 |
|
228 |
AC_MSG_CHECKING([for boost::regex in -lboost_regex-mt]) |
229 |
-saved_ldflags="${LDFLAGS}" |
230 |
-LDFLAGS="${LDFLAGS} -lboost_regex-mt" |
231 |
+saved_LIBS="${LIBS}" |
232 |
+LIBS="${LIBS} -lboost_regex-mt" |
233 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/regex.hpp>], |
234 |
[boost::regex("^foo[bar]$")])], |
235 |
[AC_MSG_RESULT([yes]) |
236 |
BOOST_LIBS="${BOOST_LIBS} -lboost_regex-mt"], |
237 |
[AC_MSG_RESULT([no]) |
238 |
AC_MSG_FAILURE([libboost_regex (Boost C++ Libraries) is not installed, but is required by schroot])]) |
239 |
-LDFLAGS="${saved_ldflags}" |
240 |
+LIBS="${saved_LIBS}" |
241 |
|
242 |
AC_MSG_CHECKING([for boost::filesystem in -lboost_filesystem-mt]) |
243 |
-saved_ldflags="${LDFLAGS}" |
244 |
-LDFLAGS="${LDFLAGS} -lboost_filesystem-mt" |
245 |
+saved_LIBS="${LIBS}" |
246 |
+LIBS="${LIBS} -lboost_filesystem-mt" |
247 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/filesystem.hpp>], |
248 |
[boost::filesystem::is_directory("/")])], |
249 |
[AC_MSG_RESULT([yes]) |
250 |
BOOST_LIBS="${BOOST_LIBS} -lboost_filesystem-mt"], |
251 |
[AC_MSG_RESULT([no]) |
252 |
AC_MSG_FAILURE([libboost_filesystem (Boost C++ Libraries) is not installed, but is required by schroot])]) |
253 |
-LDFLAGS="${saved_ldflags}" |
254 |
+LIBS="${saved_LIBS}" |
255 |
|
256 |
AC_SUBST([BOOST_LIBS]) |
257 |
|
258 |
|
259 |
|
260 |
|
261 |
1.1 dev-util/schroot/files/schroot-1.2.3-tests.patch |
262 |
|
263 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/schroot/files/schroot-1.2.3-tests.patch?rev=1.1&view=markup |
264 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/schroot/files/schroot-1.2.3-tests.patch?rev=1.1&content-type=text/plain |
265 |
|
266 |
Index: schroot-1.2.3-tests.patch |
267 |
=================================================================== |
268 |
diff -ruN schroot-1.2.1-old/test/Makefile.am schroot-1.2.1/test/Makefile.am |
269 |
--- schroot-1.2.1-old/test/Makefile.am |
270 |
+++ schroot-1.2.1/test/Makefile.am |
271 |
@@ -59,6 +59,22 @@ |
272 |
sbuild-util \ |
273 |
schroot-base-option-action \ |
274 |
cleanup-test-data |
275 |
+ |
276 |
+ROOT_TESTS = $(TESTS) |
277 |
+NONROOT_TESTS = setup-test-data \ |
278 |
+ sbuild-chroot \ |
279 |
+ sbuild-dirstream \ |
280 |
+ sbuild-environment \ |
281 |
+ sbuild-keyfile \ |
282 |
+ sbuild-log \ |
283 |
+ sbuild-nostream \ |
284 |
+ sbuild-parse-value \ |
285 |
+ sbuild-personality \ |
286 |
+ sbuild-run-parts \ |
287 |
+ sbuild-regex \ |
288 |
+ sbuild-util \ |
289 |
+ schroot-base-option-action \ |
290 |
+ cleanup-test-data |
291 |
endif |
292 |
|
293 |
libtest_la_SOURCES = \ |
294 |
@@ -132,5 +148,82 @@ |
295 |
setup-test-data \ |
296 |
cleanup-test-data |
297 |
|
298 |
+check-TESTS: $(TESTS) |
299 |
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ |
300 |
+ srcdir=$(srcdir); export srcdir; \ |
301 |
+ if [[ $EUID -ne 0 ]]; then \ |
302 |
+ list=' $(NONROOT_TESTS) '; \ |
303 |
+ else \ |
304 |
+ list=' $(ROOT_TESTS) '; \ |
305 |
+ fi; \ |
306 |
+ if test -n "$$list"; then \ |
307 |
+ for tst in $$list; do \ |
308 |
+ if test -f ./$$tst; then dir=./; \ |
309 |
+ elif test -f $$tst; then dir=; \ |
310 |
+ else dir="$(srcdir)/"; fi; \ |
311 |
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ |
312 |
+ all=`expr $$all + 1`; \ |
313 |
+ case " $(XFAIL_TESTS) " in \ |
314 |
+ *$$ws$$tst$$ws*) \ |
315 |
+ xpass=`expr $$xpass + 1`; \ |
316 |
+ failed=`expr $$failed + 1`; \ |
317 |
+ echo "XPASS: $$tst"; \ |
318 |
+ ;; \ |
319 |
+ *) \ |
320 |
+ echo "PASS: $$tst"; \ |
321 |
+ ;; \ |
322 |
+ esac; \ |
323 |
+ elif test $$? -ne 77; then \ |
324 |
+ all=`expr $$all + 1`; \ |
325 |
+ case " $(XFAIL_TESTS) " in \ |
326 |
+ *$$ws$$tst$$ws*) \ |
327 |
+ xfail=`expr $$xfail + 1`; \ |
328 |
+ echo "XFAIL: $$tst"; \ |
329 |
+ ;; \ |
330 |
+ *) \ |
331 |
+ failed=`expr $$failed + 1`; \ |
332 |
+ echo "FAIL: $$tst"; \ |
333 |
+ ;; \ |
334 |
+ esac; \ |
335 |
+ else \ |
336 |
+ skip=`expr $$skip + 1`; \ |
337 |
+ echo "SKIP: $$tst"; \ |
338 |
+ fi; \ |
339 |
+ done; \ |
340 |
+ if test "$$failed" -eq 0; then \ |
341 |
+ if test "$$xfail" -eq 0; then \ |
342 |
+ banner="All $$all tests passed"; \ |
343 |
+ else \ |
344 |
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ |
345 |
+ fi; \ |
346 |
+ else \ |
347 |
+ if test "$$xpass" -eq 0; then \ |
348 |
+ banner="$$failed of $$all tests failed"; \ |
349 |
+ else \ |
350 |
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ |
351 |
+ fi; \ |
352 |
+ fi; \ |
353 |
+ dashes="$$banner"; \ |
354 |
+ skipped=""; \ |
355 |
+ if test "$$skip" -ne 0; then \ |
356 |
+ skipped="($$skip tests were not run)"; \ |
357 |
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ |
358 |
+ dashes="$$skipped"; \ |
359 |
+ fi; \ |
360 |
+ report=""; \ |
361 |
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ |
362 |
+ report="Please report to $(PACKAGE_BUGREPORT)"; \ |
363 |
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ |
364 |
+ dashes="$$report"; \ |
365 |
+ fi; \ |
366 |
+ dashes=`echo "$$dashes" | sed s/./=/g`; \ |
367 |
+ echo "$$dashes"; \ |
368 |
+ echo "$$banner"; \ |
369 |
+ test -z "$$skipped" || echo "$$skipped"; \ |
370 |
+ test -z "$$report" || echo "$$report"; \ |
371 |
+ echo "$$dashes"; \ |
372 |
+ test "$$failed" -eq 0; \ |
373 |
+ else :; fi |
374 |
+ |
375 |
clean-local: |
376 |
$(srcdir)/cleanup-test-data |
377 |
diff -ruN schroot-1.2.1-old/test/setup-test-data schroot-1.2.1/test/setup-test-data |
378 |
--- schroot-1.2.1-old/test/setup-test-data |
379 |
+++ schroot-1.2.1/test/setup-test-data |
380 |
@@ -4,4 +4,9 @@ |
381 |
rm -rf testdata |
382 |
mkdir testdata |
383 |
cp -r ${srcdir}/*.ex* testdata |
384 |
-chown -R root:root testdata |
385 |
+if [[ $EUID -ne 0 ]]; then |
386 |
+ echo "You are not root, only performing partial setup" |
387 |
+else |
388 |
+ chown -R root:root testdata |
389 |
+fi |
390 |
+ |