diff --git a/.gitignore b/.gitignore index e69de29..becc514 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/subunit-0.0.18.tar.gz diff --git a/sources b/sources index e69de29..c9cdd3f 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +6cbed838fefd8be7380197822eb0a98a subunit-0.0.18.tar.gz diff --git a/subunit-unbundle-iso8601.patch b/subunit-unbundle-iso8601.patch new file mode 100644 index 0000000..65485a2 --- /dev/null +++ b/subunit-unbundle-iso8601.patch @@ -0,0 +1,145 @@ +--- ./COPYING.orig 2012-05-02 03:41:14.000000000 -0600 ++++ ./COPYING 2014-02-13 20:00:00.000000000 -0700 +@@ -29,8 +29,6 @@ Code that has been incorporated into Sub + naturally be under its own license, and will retain that license. + + A known list of such code is maintained here: +-* The python/iso8601 module by Michael Twomey, distributed under an MIT style +- licence - see python/iso8601/LICENSE for details. + * The runtests.py and python/subunit/tests/TestUtil.py module are GPL test + support modules. There are not installed by Subunit - they are only ever + used on the build machine. Copyright 2004 Canonical Limited. +--- ./Makefile.in.orig 2014-01-29 12:16:23.000000000 -0700 ++++ ./Makefile.in 2014-02-13 20:00:00.000000000 -0700 +@@ -303,11 +303,6 @@ EXTRA_DIST = \ + perl/lib/Subunit.pm \ + perl/lib/Subunit/Diff.pm \ + perl/subunit-diff \ +- python/iso8601/LICENSE \ +- python/iso8601/README \ +- python/iso8601/README.subunit \ +- python/iso8601/setup.py \ +- python/iso8601/test_iso8601.py \ + python/subunit/tests/__init__.py \ + python/subunit/tests/sample-script.py \ + python/subunit/tests/sample-two-script.py \ +@@ -359,7 +354,6 @@ pkgpython_PYTHON = \ + python/subunit/chunked.py \ + python/subunit/details.py \ + python/subunit/filters.py \ +- python/subunit/iso8601.py \ + python/subunit/progress_model.py \ + python/subunit/run.py \ + python/subunit/v2.py \ +--- ./python/subunit/__init__.py.orig 2014-01-29 12:14:12.000000000 -0700 ++++ ./python/subunit/__init__.py 2014-02-13 20:00:00.000000000 -0700 +@@ -138,7 +138,8 @@ except ImportError: + "_StringException, check your version.") + from testtools import testresult, CopyStreamResult + +-from subunit import chunked, details, iso8601, test_results ++from iso8601 import iso8601 ++from subunit import chunked, details, test_results + from subunit.v2 import ByteStreamToStreamResult, StreamResultToBytes + + # same format as sys.version_info: "A tuple containing the five components of +--- ./python/subunit/_output.py.orig 2014-01-12 17:07:19.000000000 -0700 ++++ ./python/subunit/_output.py 2014-02-13 20:00:00.000000000 -0700 +@@ -23,7 +23,7 @@ from optparse import ( + import sys + + from subunit import make_stream_binary +-from subunit.iso8601 import UTC ++from iso8601.iso8601 import UTC + from subunit.v2 import StreamResultToBytes + + +--- ./python/subunit/test_results.py.orig 2014-01-29 12:10:33.000000000 -0700 ++++ ./python/subunit/test_results.py 2014-02-13 20:00:00.000000000 -0700 +@@ -26,7 +26,7 @@ from testtools.content import ( + ) + from testtools import StreamResult + +-from subunit import iso8601 ++from iso8601 import iso8601 + import subunit + + +--- ./python/subunit/tests/test_output_filter.py.orig 2014-01-12 17:07:19.000000000 -0700 ++++ ./python/subunit/tests/test_output_filter.py 2014-02-13 20:00:00.000000000 -0700 +@@ -34,7 +34,7 @@ from testtools.matchers import ( + ) + from testtools.testresult.doubles import StreamResult + +-from subunit.iso8601 import UTC ++from iso8601.iso8601 import UTC + from subunit.v2 import StreamResultToBytes, ByteStreamToStreamResult + from subunit._output import ( + _ALL_ACTIONS, +--- ./python/subunit/tests/test_subunit_filter.py.orig 2013-06-16 03:58:35.000000000 -0600 ++++ ./python/subunit/tests/test_subunit_filter.py 2014-02-13 20:00:00.000000000 -0700 +@@ -20,7 +20,7 @@ from datetime import datetime + import os + import subprocess + import sys +-from subunit import iso8601 ++from iso8601 import iso8601 + import unittest + + from testtools import TestCase +--- ./python/subunit/tests/test_test_protocol2.py.orig 2013-08-24 18:01:39.000000000 -0600 ++++ ./python/subunit/tests/test_test_protocol2.py 2014-02-13 20:00:00.000000000 -0700 +@@ -23,7 +23,7 @@ from testtools.tests.test_testresult imp + from testtools.testresult.doubles import StreamResult + + import subunit +-import subunit.iso8601 as iso8601 ++from iso8601 import iso8601 + + CONSTANT_ENUM = b'\xb3)\x01\x0c\x03foo\x08U_\x1b' + CONSTANT_INPROGRESS = b'\xb3)\x02\x0c\x03foo\x8e\xc1-\xb5' +--- ./python/subunit/tests/test_test_protocol.py.orig 2013-11-23 15:54:11.000000000 -0700 ++++ ./python/subunit/tests/test_test_protocol.py 2014-02-13 20:00:00.000000000 -0700 +@@ -42,7 +42,7 @@ from subunit.tests import ( + _remote_exception_str, + _remote_exception_str_chunked, + ) +-import subunit.iso8601 as iso8601 ++from iso8601 import iso8601 + + + def details_to_str(details): +--- ./python/subunit/tests/test_test_results.py.orig 2013-06-16 03:59:10.000000000 -0600 ++++ ./python/subunit/tests/test_test_results.py 2014-02-13 20:00:00.000000000 -0700 +@@ -28,7 +28,7 @@ from testtools.content import ( + from testtools.testresult.doubles import ExtendedTestResult + + import subunit +-import subunit.iso8601 as iso8601 ++from iso8601 import iso8601 + import subunit.test_results + + import testtools +--- ./python/subunit/v2.py.orig 2013-08-24 18:38:39.000000000 -0600 ++++ ./python/subunit/v2.py 2014-02-13 20:00:00.000000000 -0700 +@@ -27,7 +27,7 @@ from extras import safe_hasattr, try_imp + builtins = try_imports(['__builtin__', 'builtins']) + + import subunit +-import subunit.iso8601 as iso8601 ++from iso8601 import iso8601 + + __all__ = [ + 'ByteStreamToStreamResult', +--- ./README.orig 2014-01-29 02:32:50.000000000 -0700 ++++ ./README 2014-02-13 20:00:00.000000000 -0700 +@@ -15,9 +15,6 @@ + + See the COPYING file for full details on the licensing of Subunit. + +- subunit reuses iso8601 by Michael Twomey, distributed under an MIT style +- licence - see python/iso8601/LICENSE for details. +- + Subunit + ------- + diff --git a/subunit.spec b/subunit.spec new file mode 100644 index 0000000..eb606de --- /dev/null +++ b/subunit.spec @@ -0,0 +1,227 @@ +# There is no python3 subpackage due to lack of a python3 variant of +# testscenarios (see https://bugs.launchpad.net/testscenarios/+bug/941963). +# Once that has been resolved, a python3 subpackage will be produced. + +Name: subunit +Version: 0.0.18 +Release: 2%{?dist} +Summary: C bindings for subunit + +License: ASL 2.0 or BSD +URL: https://launchpad.net/%{name} +Source0: https://launchpad.net/%{name}/trunk/%{version}/+download/%{name}-%{version}.tar.gz +# Fedora-specific patch: remove the bundled copy of python-iso8601. +Patch0: %{name}-unbundle-iso8601.patch + +BuildRequires: check-devel +BuildRequires: cppunit-devel +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: pkgconfig +BuildRequires: python2-devel +BuildRequires: python-extras +BuildRequires: python-iso8601 +BuildRequires: python-setuptools +BuildRequires: python-testscenarios +BuildRequires: python-testtools >= 0.9.35 + +%description +Subunit C bindings. See the python-subunit package for test processing +functionality. + +%package devel +Summary: Header files for developing C applications that use subunit +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Header files and libraries for developing C applications that use subunit. + +%package cppunit +Summary: Subunit integration into cppunit +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description cppunit +Subunit integration into cppunit. + +%package cppunit-devel +Summary: Header files for applications that use cppunit and subunit +Requires: %{name}-cppunit%{?_isa} = %{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} +Requires: cppunit-devel%{?_isa} + +%description cppunit-devel +Header files and libraries for developing applications that use cppunit +and subunit. + +%package perl +Summary: Perl bindings for subunit +BuildArch: noarch +Requires: perl(:MODULE_COMPAT_%{perl_version}) + +%description perl +Subunit perl bindings. See the python-subunit package for test +processing functionality. + +%package shell +Summary: Shell bindings for subunit +BuildArch: noarch + +%description shell +Subunit shell bindings. See the python-subunit package for test +processing functionality. + +%package -n python-%{name} +Summary: Streaming protocol for test results +BuildArch: noarch +Requires: python-extras +Requires: python-iso8601 +Requires: python-testtools >= 0.9.35 + +%description -n python-%{name} +Subunit is a streaming protocol for test results. The protocol is a +binary encoding that is easily generated and parsed. By design all the +components of the protocol conceptually fit into the xUnit TestCase -> +TestResult interaction. + +Subunit comes with command line filters to process a subunit stream and +language bindings for python, C, C++ and shell. Bindings are easy to +write for other languages. + +A number of useful things can be done easily with subunit: +- Test aggregation: Tests run separately can be combined and then + reported/displayed together. For instance, tests from different + languages can be shown as a seamless whole. +- Test archiving: A test run may be recorded and replayed later. +- Test isolation: Tests that may crash or otherwise interact badly with + each other can be run separately and then aggregated, rather than + interfering with each other. +- Grid testing: subunit can act as the necessary serialization and + deserialization to get test runs on distributed machines to be + reported in real time. + +%package filters +Summary: Command line filters for processing subunit streams +BuildArch: noarch +Requires: python-%{name} = %{version}-%{release} +Requires: pygtk2 + +%description filters +Command line filters for processing subunit streams. + +%prep +%setup -q +%patch0 + +# Remove bundled code +rm -fr python/iso8601 python/subunit/iso8601.py + +# Help the dependency generator +for filt in filters/*; do + sed 's,/usr/bin/env ,/usr/bin/,' $filt > ${filt}.new + chmod 0755 ${filt}.new + touch -r $filt ${filt}.new + mv -f ${filt}.new $filt +done + +# Fix underlinked library +sed "/libcppunit_subunit_la_/s,\$(LIBS),& -lcppunit -L$PWD/.libs -lsubunit," \ + -i Makefile.in + +%build +export INSTALLDIRS=perl +%configure --disable-static + +# Get rid of undesirable hardcoded rpaths; workaround libtool reordering +# -Wl,--as-needed after all the libraries. +sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ + -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \ + -e 's|CC=.g..|& -Wl,--as-needed|' \ + -i libtool + +make %{?_smp_mflags} + +%install +%make_install INSTALL="%{_bindir}/install -p" + +# Install the shell interface +mkdir -p %{buildroot}%{_sysconfdir}/profile.d +cp -p shell/share/%{name}.sh %{buildroot}%{_sysconfdir}/profile.d + +# Remove unwanted libtool files +rm -f %{buildroot}%{_libdir}/*.la + +# Fix perl installation +mkdir -p %{buildroot}%{perl_vendorlib} +mv %{buildroot}%{perl_privlib}/Subunit* %{buildroot}%{perl_vendorlib} +rm -fr %{buildroot}%{perl_archlib} + +# Fix permissions +chmod 0755 %{buildroot}%{python2_sitelib}/%{name}/run.py +chmod 0755 %{buildroot}%{_bindir}/subunit-diff + +# Fix timestamps +touch -r c/include/%{name}/child.h %{buildroot}%{_includedir}/%{name}/child.h +touch -r c++/SubunitTestProgressListener.h \ + %{buildroot}%{_includedir}/%{name}/SubunitTestProgressListener.h +touch -r perl/subunit-diff %{buildroot}%{_bindir}/subunit-diff +for fil in filters/*; do + touch -r $fil %{buildroot}%{_bindir}/$(basename $fil) +done + +%check +export LD_LIBRARY_PATH=$PWD/.libs +export PYTHONPATH=$PWD/python/subunit:$PWD/python/subunit/tests +make check + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%post cppunit -p /sbin/ldconfig + +%postun cppunit -p /sbin/ldconfig + +%files +%doc Apache-2.0 BSD COPYING NEWS README +%{_libdir}/lib%{name}.so.* + +%files devel +%doc c/README +%dir %{_includedir}/%{name}/ +%{_includedir}/%{name}/child.h +%{_libdir}/lib%{name}.so +%{_libdir}/pkgconfig/lib%{name}.pc + +%files cppunit +%{_libdir}/libcppunit_%{name}.so.* + +%files cppunit-devel +%doc c++/README +%{_includedir}/%{name}/SubunitTestProgressListener.h +%{_libdir}/libcppunit_%{name}.so +%{_libdir}/pkgconfig/libcppunit_%{name}.pc + +%files perl +%doc Apache-2.0 BSD COPYING +%{_bindir}/%{name}-diff +%{perl_vendorlib}/* + +%files shell +%doc Apache-2.0 BSD COPYING shell/README +%config(noreplace) %{_sysconfdir}/profile.d/%{name}.sh + +%files -n python-%{name} +%doc Apache-2.0 BSD COPYING +%{python2_sitelib}/%{name}/ + +%files filters +%{_bindir}/* +%exclude %{_bindir}/%{name}-diff + +%changelog +* Thu Apr 24 2014 Jerry James - 0.0.18-2 +- Add license text to all independent packages +- Add perl module Requires to the -perl subpackage +- Fix timestamps after install + +* Fri Feb 14 2014 Jerry James - 0.0.18-1 +- Initial RPM