summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Callen <abcd@gentoo.org>2009-09-11 07:16:29 +0000
committerJonathan Callen <abcd@gentoo.org>2009-09-11 07:16:29 +0000
commit810dc3a36026adcabc41c67958dbde45545389fc (patch)
treeb21aabd8e6de328e9f9d47567e248ab2f1d5b756 /dev-util/schroot
parentRemove broken version. (diff)
downloadgentoo-2-810dc3a36026adcabc41c67958dbde45545389fc.tar.gz
gentoo-2-810dc3a36026adcabc41c67958dbde45545389fc.tar.bz2
gentoo-2-810dc3a36026adcabc41c67958dbde45545389fc.zip
New ebuild. Thanks to Nick Fortino <nfortino@gmail.com> for initial ebuild and patches (bug #257334).
(Portage version: -svn/cvs/Linux i686)
Diffstat (limited to 'dev-util/schroot')
-rw-r--r--dev-util/schroot/ChangeLog13
-rw-r--r--dev-util/schroot/files/schroot-1.2.3-autotools.patch105
-rw-r--r--dev-util/schroot/files/schroot-1.2.3-pam.patch46
-rw-r--r--dev-util/schroot/files/schroot-1.2.3-tests.patch123
-rw-r--r--dev-util/schroot/files/schroot.confd9
-rw-r--r--dev-util/schroot/files/schroot.initd50
-rw-r--r--dev-util/schroot/metadata.xml12
-rw-r--r--dev-util/schroot/schroot-1.2.3.ebuild77
8 files changed, 435 insertions, 0 deletions
diff --git a/dev-util/schroot/ChangeLog b/dev-util/schroot/ChangeLog
new file mode 100644
index 000000000000..1ba582ebff1c
--- /dev/null
+++ b/dev-util/schroot/ChangeLog
@@ -0,0 +1,13 @@
+# ChangeLog for dev-util/schroot
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/schroot/ChangeLog,v 1.1 2009/09/11 07:16:29 abcd Exp $
+
+*schroot-1.2.3 (11 Sep 2009)
+
+ 11 Sep 2009; Jonathan Callen <abcd@gentoo.org> +schroot-1.2.3.ebuild,
+ +files/schroot-1.2.3-autotools.patch, +files/schroot-1.2.3-pam.patch,
+ +files/schroot-1.2.3-tests.patch, +files/schroot.confd,
+ +files/schroot.initd, +metadata.xml:
+ New ebuild. Thanks to Nick Fortino <nfortino@gmail.com> for initial ebuild
+ and patches (bug #257334).
+
diff --git a/dev-util/schroot/files/schroot-1.2.3-autotools.patch b/dev-util/schroot/files/schroot-1.2.3-autotools.patch
new file mode 100644
index 000000000000..f672864e574e
--- /dev/null
+++ b/dev-util/schroot/files/schroot-1.2.3-autotools.patch
@@ -0,0 +1,105 @@
+Fixes QA issues in configure.ac
+ Removes automagic dependency on cppunit, and instead only builds tests
+ when --enable-test is passed in.
+ uses LIBS instead of LDFLAGS for linking libraries. Needed for building
+ with --as-needed
+
+Contributed by Nick Fortino (nfortino@gmail.com) 2/2/2009
+
+Updated by Jonathan Callen <abcd@gentoo.org> 2009-09-11
+
+--- schroot-1.2.3.orig/configure.ac
++++ schroot-1.2.3/configure.ac
+@@ -174,6 +174,15 @@ if test "$enable_debug" = "yes"; then
+ AC_DEFINE_UNQUOTED([SBUILD_DEBUG], [1], [Enable debugging])
+ fi
+
++AC_ARG_ENABLE([test], [AS_HELP_STRING([--enable-test], [Build unit tests])],
++ [ case "${enableval}" in
++ yes) enable_test="yes" ;;
++ no) enable_test="no" ;;
++ unset) enable_test="no" ;;
++ *) AC_MSG_RESULT([unknown])
++ AC_MSG_ERROR([bad value ${enableval} for --enable-test]) ;;
++ esac])
++
+ # Checks for programs.
+ AC_PROG_CXX
+ AC_LANG([C++])
+@@ -195,7 +204,10 @@ PKG_CHECK_MODULES([UUID], [uuid],
+ HAVE_UUID=true],
+ [HAVE_UUID=false])
+
++AS_IF([test "$enable_test" = "yes"], [
+ AM_PATH_CPPUNIT([1.10.0], [HAVE_CPPUNIT=true])
++])
++
+ AM_CONDITIONAL([USE_UNIT_TESTS], [test -n "$HAVE_CPPUNIT"])
+
+ SCHROOT_CFLAGS="$UUID_CFLAGS"
+@@ -240,19 +252,19 @@ AC_CHECK_LIB([lockdev], [dev_lock],
+ AC_SUBST([LOCKDEV_LIBS])
+
+ AC_MSG_CHECKING([for boost::program_options::variables_map in -lboost_program_options-mt])
+-saved_ldflags="${LDFLAGS}"
+-LDFLAGS="${LDFLAGS} -lboost_program_options-mt"
++saved_LIBS="${LIBS}"
++LIBS="${LIBS} -lboost_program_options-mt"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
+ [boost::program_options::variables_map::variables_map dummy()])],
+ [AC_MSG_RESULT([yes])
+ BOOST_LIBS="${BOOST_LIBS} -lboost_program_options-mt"],
+ [AC_MSG_RESULT([no])
+ AC_MSG_FAILURE([libboost_program_options (Boost C++ Libraries) is not installed, but is required by schroot])])
+-LDFLAGS="${saved_ldflags}"
++LIBS="${saved_LIBS}"
+
+ AC_MSG_CHECKING([for boost::program_options::options_description::options() in -lboost_program_options-mt])
+-saved_ldflags="${LDFLAGS}"
+-LDFLAGS="${LDFLAGS} -lboost_program_options-mt"
++saved_LIBS="${LIBS}"
++LIBS="${LIBS} -lboost_program_options-mt"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
+ [boost::program_options::options_description testgrp("test group");
+ bool notused = testgrp.options().empty();
+@@ -261,33 +273,33 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([#includ
+ BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="current"],
+ [AC_MSG_RESULT([no])
+ BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="old"])
+-LDFLAGS="${saved_ldflags}"
++LIBS="${saved_LIBS}"
+ AH_TEMPLATE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, [Set if boost::program_options::options_description::options() is not available])
+ if test "$BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS" = "old"; then
+ AC_DEFINE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, 1)
+ fi
+
+ AC_MSG_CHECKING([for boost::regex in -lboost_regex-mt])
+-saved_ldflags="${LDFLAGS}"
+-LDFLAGS="${LDFLAGS} -lboost_regex-mt"
++saved_LIBS="${LIBS}"
++LIBS="${LIBS} -lboost_regex-mt"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/regex.hpp>],
+ [boost::regex("^foo[bar]$")])],
+ [AC_MSG_RESULT([yes])
+ BOOST_LIBS="${BOOST_LIBS} -lboost_regex-mt"],
+ [AC_MSG_RESULT([no])
+ AC_MSG_FAILURE([libboost_regex (Boost C++ Libraries) is not installed, but is required by schroot])])
+-LDFLAGS="${saved_ldflags}"
++LIBS="${saved_LIBS}"
+
+ AC_MSG_CHECKING([for boost::filesystem in -lboost_filesystem-mt])
+-saved_ldflags="${LDFLAGS}"
+-LDFLAGS="${LDFLAGS} -lboost_filesystem-mt"
++saved_LIBS="${LIBS}"
++LIBS="${LIBS} -lboost_filesystem-mt"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/filesystem.hpp>],
+ [boost::filesystem::is_directory("/")])],
+ [AC_MSG_RESULT([yes])
+ BOOST_LIBS="${BOOST_LIBS} -lboost_filesystem-mt"],
+ [AC_MSG_RESULT([no])
+ AC_MSG_FAILURE([libboost_filesystem (Boost C++ Libraries) is not installed, but is required by schroot])])
+-LDFLAGS="${saved_ldflags}"
++LIBS="${saved_LIBS}"
+
+ AC_SUBST([BOOST_LIBS])
+
diff --git a/dev-util/schroot/files/schroot-1.2.3-pam.patch b/dev-util/schroot/files/schroot-1.2.3-pam.patch
new file mode 100644
index 000000000000..2cc6d659e558
--- /dev/null
+++ b/dev-util/schroot/files/schroot-1.2.3-pam.patch
@@ -0,0 +1,46 @@
+removes the dependency on debian specific pam files. Updates the pam
+configuration to behave as it does on debian.
+
+contributed by Nick Fortino (nfortino@gmail.com) 1/15/2009
+
+--- schroot-1.2.1/bin/schroot/pam/schroot.old
++++ schroot-1.2.1/bin/schroot/pam/schroot
+@@ -23,12 +23,32 @@
+ # time restrainst on schroot usage.
+ # account requisite pam_time.so
+
+-# The standard Unix authentication modules, used with
+-# NIS (man nsswitch) as well as normal /etc/passwd and
+-# /etc/shadow entries.
+-@include common-auth
+-@include common-account
+-@include common-session
++# here are the per-package modules (the "Primary" block)
++auth [success=1 default=ignore] pam_unix.so nullok_secure
++# here's the fallback if no module succeeds
++auth requisite pam_deny.so
++# prime the stack with a positive return value if there isn't one already;
++# this avoids us returning an error just because nothing sets a success code
++# since the modules above will each just jump around
++auth required pam_permit.so
++
++# here are the per-package modules (the "Primary" block)
++account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so
++# here's the fallback if no module succeeds
++account requisite pam_deny.so
++# prime the stack with a positive return value if there isn't one already;
++# this avoids us returning an error just because nothing sets a success code
++# since the modules above will each just jump around
++account required pam_permit.so
++
++# here are the per-package modules (the "Primary" block)
++session [default=1] pam_permit.so
++# here's the fallback if no module succeeds
++session requisite pam_deny.so
++# prime the stack with a positive return value if there isn't one already;
++# this avoids us returning an error just because nothing sets a success code
++# since the modules above will each just jump around
++session required pam_permit.so
+
+ # Sets up user limits, please uncomment and read /etc/security/limits.conf
+ # to enable this functionality.
diff --git a/dev-util/schroot/files/schroot-1.2.3-tests.patch b/dev-util/schroot/files/schroot-1.2.3-tests.patch
new file mode 100644
index 000000000000..6c9dff970d62
--- /dev/null
+++ b/dev-util/schroot/files/schroot-1.2.3-tests.patch
@@ -0,0 +1,123 @@
+diff -ruN schroot-1.2.1-old/test/Makefile.am schroot-1.2.1/test/Makefile.am
+--- schroot-1.2.1-old/test/Makefile.am
++++ schroot-1.2.1/test/Makefile.am
+@@ -59,6 +59,22 @@
+ sbuild-util \
+ schroot-base-option-action \
+ cleanup-test-data
++
++ROOT_TESTS = $(TESTS)
++NONROOT_TESTS = setup-test-data \
++ sbuild-chroot \
++ sbuild-dirstream \
++ sbuild-environment \
++ sbuild-keyfile \
++ sbuild-log \
++ sbuild-nostream \
++ sbuild-parse-value \
++ sbuild-personality \
++ sbuild-run-parts \
++ sbuild-regex \
++ sbuild-util \
++ schroot-base-option-action \
++ cleanup-test-data
+ endif
+
+ libtest_la_SOURCES = \
+@@ -132,5 +148,82 @@
+ setup-test-data \
+ cleanup-test-data
+
++check-TESTS: $(TESTS)
++ @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
++ srcdir=$(srcdir); export srcdir; \
++ if [[ $EUID -ne 0 ]]; then \
++ list=' $(NONROOT_TESTS) '; \
++ else \
++ list=' $(ROOT_TESTS) '; \
++ fi; \
++ if test -n "$$list"; then \
++ for tst in $$list; do \
++ if test -f ./$$tst; then dir=./; \
++ elif test -f $$tst; then dir=; \
++ else dir="$(srcdir)/"; fi; \
++ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
++ all=`expr $$all + 1`; \
++ case " $(XFAIL_TESTS) " in \
++ *$$ws$$tst$$ws*) \
++ xpass=`expr $$xpass + 1`; \
++ failed=`expr $$failed + 1`; \
++ echo "XPASS: $$tst"; \
++ ;; \
++ *) \
++ echo "PASS: $$tst"; \
++ ;; \
++ esac; \
++ elif test $$? -ne 77; then \
++ all=`expr $$all + 1`; \
++ case " $(XFAIL_TESTS) " in \
++ *$$ws$$tst$$ws*) \
++ xfail=`expr $$xfail + 1`; \
++ echo "XFAIL: $$tst"; \
++ ;; \
++ *) \
++ failed=`expr $$failed + 1`; \
++ echo "FAIL: $$tst"; \
++ ;; \
++ esac; \
++ else \
++ skip=`expr $$skip + 1`; \
++ echo "SKIP: $$tst"; \
++ fi; \
++ done; \
++ if test "$$failed" -eq 0; then \
++ if test "$$xfail" -eq 0; then \
++ banner="All $$all tests passed"; \
++ else \
++ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
++ fi; \
++ else \
++ if test "$$xpass" -eq 0; then \
++ banner="$$failed of $$all tests failed"; \
++ else \
++ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
++ fi; \
++ fi; \
++ dashes="$$banner"; \
++ skipped=""; \
++ if test "$$skip" -ne 0; then \
++ skipped="($$skip tests were not run)"; \
++ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
++ dashes="$$skipped"; \
++ fi; \
++ report=""; \
++ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
++ report="Please report to $(PACKAGE_BUGREPORT)"; \
++ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
++ dashes="$$report"; \
++ fi; \
++ dashes=`echo "$$dashes" | sed s/./=/g`; \
++ echo "$$dashes"; \
++ echo "$$banner"; \
++ test -z "$$skipped" || echo "$$skipped"; \
++ test -z "$$report" || echo "$$report"; \
++ echo "$$dashes"; \
++ test "$$failed" -eq 0; \
++ else :; fi
++
+ clean-local:
+ $(srcdir)/cleanup-test-data
+diff -ruN schroot-1.2.1-old/test/setup-test-data schroot-1.2.1/test/setup-test-data
+--- schroot-1.2.1-old/test/setup-test-data
++++ schroot-1.2.1/test/setup-test-data
+@@ -4,4 +4,9 @@
+ rm -rf testdata
+ mkdir testdata
+ cp -r ${srcdir}/*.ex* testdata
+-chown -R root:root testdata
++if [[ $EUID -ne 0 ]]; then
++ echo "You are not root, only performing partial setup"
++else
++ chown -R root:root testdata
++fi
++
diff --git a/dev-util/schroot/files/schroot.confd b/dev-util/schroot/files/schroot.confd
new file mode 100644
index 000000000000..b62263175721
--- /dev/null
+++ b/dev-util/schroot/files/schroot.confd
@@ -0,0 +1,9 @@
+# This is a configuration file for /etc/init.d/schroot; it allows you
+# to perform common modifications to the behavior of schroot
+# initialization without editing the init script.
+
+# What do we want to do with "orphan" sessions when starting or
+# restarting? Recover them (leave empty or set to "recover") or just
+# end them (set to "end")?
+SESSIONS_RECOVER="recover"
+
diff --git a/dev-util/schroot/files/schroot.initd b/dev-util/schroot/files/schroot.initd
new file mode 100644
index 000000000000..a9a15e2349fb
--- /dev/null
+++ b/dev-util/schroot/files/schroot.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+
+depend() {
+ need localmount
+ after net netmount
+}
+
+recover_sessions() {
+ einfo "Recovering schroot sessions"
+ eindent
+ local chroot
+ local chroots="$(schroot --all-sessions --list --quiet)"
+ if [ -n "${chroots}" ]; then
+ for chroot in ${chroots}; do
+ ebegin "$chroot"
+ schroot --chroot=$chroot --recover-session
+ eend $?
+ done
+ else
+ einfo "(none)"
+ fi
+ eoutdent
+ einfo "...done"
+}
+
+end_sessions() {
+ einfo "Ending schroot sessions"
+ eindent
+ local chroot
+ local chroots="$(schroot --all-sessions --list --quiet)"
+ if [ -n "${chroots}" ]; then
+ for chroot in ${chroots}; do
+ ebegin "$chroot"
+ schroot --chroot=$chroot --recover-session
+ eend $?
+ done
+ else
+ einfo "(none)"
+ fi
+ eoutdent
+ einfo "...done"
+}
+
+start() {
+ if [ "${SESSIONS_RECOVER}" = "end" ]; then
+ end_sessions
+ else
+ recover_sessions
+ fi
+}
diff --git a/dev-util/schroot/metadata.xml b/dev-util/schroot/metadata.xml
new file mode 100644
index 000000000000..146152b8dacc
--- /dev/null
+++ b/dev-util/schroot/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>no-herd</herd>
+<maintainer>
+ <email>abcd@gentoo.org</email>
+ <name>Jonathan Callen</name>
+</maintainer>
+<use>
+ <flag name="dchroot">Enables the building of a wrapper named "dchroot", replacing <pkg>dev-util/dchroot</pkg>.</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-util/schroot/schroot-1.2.3.ebuild b/dev-util/schroot/schroot-1.2.3.ebuild
new file mode 100644
index 000000000000..bb63f399aa24
--- /dev/null
+++ b/dev-util/schroot/schroot-1.2.3.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/schroot/schroot-1.2.3.ebuild,v 1.1 2009/09/11 07:16:29 abcd Exp $
+
+EAPI="2"
+
+inherit autotools base
+
+DESCRIPTION="Utility to execute commands in a chroot environment"
+HOMEPAGE="http://packages.debian.org/source/sid/schroot"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}.orig.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE="+dchroot debug doc nls test"
+
+COMMON_DEPEND="
+ >=dev-libs/boost-1.34.0
+ dev-libs/lockdev
+ sys-libs/pam
+"
+
+DEPEND="${COMMON_DEPEND}
+ nls? ( sys-devel/gettext )
+ test? ( >=dev-util/cppunit-1.10.0 )
+"
+RDEPEND="${COMMON_DEPEND}
+ dchroot? ( !dev-util/dchroot )
+ nls? ( virtual/libintl )
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-autotools.patch"
+ "${FILESDIR}/${P}-tests.patch"
+)
+
+src_prepare() {
+ base_src_prepare
+
+ if use test; then
+ # Fix bug where aclocal doesn't find cppunit.m4 from the system...
+ ln -s /usr/share/aclocal/cppunit.m4 m4/
+ export AT_M4DIR=m4
+ else
+ # Don't depend on cppunit unless we are testing
+ sed -i '/AM_PATH_CPPUNIT/d' configure.ac
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable dchroot) \
+ $(use_enable dchroot dchroot-dsa) \
+ $(use_enable debug) \
+ $(use_enable nls) \
+ --enable-shared \
+ --disable-static \
+ --localstatedir=/var
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ newinitd "${FILESDIR}"/schroot.initd schroot || die "installation of init.d script failed"
+ newconfd "${FILESDIR}"/schroot.confd schroot || die "installation of conf.d file failed"
+
+ dodoc AUTHORS ChangeLog NEWS README THANKS TODO || die "installation of docs failed"
+ if use doc; then
+ insinto /usr/share/doc/${PF}/html/sbuild
+ doins doc/sbuild/html/* || die "installation of html docs failed"
+ insinto /usr/share/doc/${PF}/html/schroot
+ doins doc/schroot/html/* || die "installation of html docs failed"
+ fi
+}