Jerry James 081470f
%if 0%{?fedora} || 0%{?rhel} >= 8
Jerry James 081470f
%global with_py3 1
Jerry James 081470f
%endif
Jerry James 36261fc
Jerry James 36261fc
Name:           subunit
97d8b53
Version:        1.1.0
97d8b53
Release:        1%{?dist}
Jerry James 36261fc
Summary:        C bindings for subunit
Jerry James 36261fc
Jerry James 36261fc
License:        ASL 2.0 or BSD
Jerry James 36261fc
URL:            https://launchpad.net/%{name}
Jerry James 36261fc
Source0:        https://launchpad.net/%{name}/trunk/%{version}/+download/%{name}-%{version}.tar.gz
Jerry James 36261fc
# Fedora-specific patch: remove the bundled copy of python-iso8601.
Jerry James 36261fc
Patch0:         %{name}-unbundle-iso8601.patch
97d8b53
# Patch to fix the python2 tests in 1.1.0
97d8b53
Patch1:         %{name}-test.patch
Jerry James 36261fc
Jerry James 36261fc
BuildRequires:  check-devel
Jerry James 36261fc
BuildRequires:  cppunit-devel
Jerry James 36261fc
BuildRequires:  perl(ExtUtils::MakeMaker)
Jerry James 36261fc
BuildRequires:  pkgconfig
Jerry James 36261fc
BuildRequires:  python2-devel
Jerry James 36261fc
BuildRequires:  python-extras
Jerry James 36261fc
BuildRequires:  python-iso8601
Jerry James 36261fc
BuildRequires:  python-setuptools
Jerry James 36261fc
BuildRequires:  python-testscenarios
Jerry James 8247687
BuildRequires:  python-testtools >= 0.9.37
Jerry James 36261fc
Jerry James 081470f
%if 0%{?with_py3}
Jerry James 081470f
BuildRequires:  python3-devel
Jerry James 081470f
BuildRequires:  python3-extras
Jerry James 081470f
BuildRequires:  python3-iso8601
Jerry James 081470f
BuildRequires:  python3-setuptools
97d8b53
BuildRequires:  python3-testscenarios
Jerry James 081470f
BuildRequires:  python3-testtools >= 0.9.37
Jerry James 081470f
%endif
Jerry James 081470f
Jerry James 36261fc
%description
Jerry James 36261fc
Subunit C bindings.  See the python-subunit package for test processing
Jerry James 36261fc
functionality.
Jerry James 36261fc
Jerry James 36261fc
%package devel
Jerry James 36261fc
Summary:        Header files for developing C applications that use subunit
Jerry James 36261fc
Requires:       %{name}%{?_isa} = %{version}-%{release}
Jerry James 36261fc
Jerry James 36261fc
%description devel
Jerry James 36261fc
Header files and libraries for developing C applications that use subunit.
Jerry James 36261fc
Jerry James 36261fc
%package cppunit
Jerry James 36261fc
Summary:        Subunit integration into cppunit
Jerry James 36261fc
Requires:       %{name}%{?_isa} = %{version}-%{release}
Jerry James 36261fc
Jerry James 36261fc
%description cppunit
Jerry James 36261fc
Subunit integration into cppunit.
Jerry James 36261fc
Jerry James 36261fc
%package cppunit-devel
Jerry James 36261fc
Summary:        Header files for applications that use cppunit and subunit
Jerry James 36261fc
Requires:       %{name}-cppunit%{?_isa} = %{version}-%{release}
Jerry James 36261fc
Requires:       %{name}-devel%{?_isa} = %{version}-%{release}
Jerry James 36261fc
Requires:       cppunit-devel%{?_isa}
Jerry James 36261fc
Jerry James 36261fc
%description cppunit-devel
Jerry James 36261fc
Header files and libraries for developing applications that use cppunit
Jerry James 36261fc
and subunit.
Jerry James 36261fc
Jerry James 36261fc
%package perl
Jerry James 36261fc
Summary:        Perl bindings for subunit
Jerry James 36261fc
BuildArch:      noarch
Jerry James 36261fc
Requires:       perl(:MODULE_COMPAT_%{perl_version})
Jerry James 36261fc
Jerry James 36261fc
%description perl
Jerry James 36261fc
Subunit perl bindings.  See the python-subunit package for test
Jerry James 36261fc
processing functionality.
Jerry James 36261fc
Jerry James 36261fc
%package shell
Jerry James 36261fc
Summary:        Shell bindings for subunit
Jerry James 36261fc
BuildArch:      noarch
Jerry James 36261fc
Jerry James 36261fc
%description shell
Jerry James 36261fc
Subunit shell bindings.  See the python-subunit package for test
Jerry James 36261fc
processing functionality.
Jerry James 36261fc
Jerry James 36261fc
%package -n python-%{name}
Jerry James 36261fc
Summary:        Streaming protocol for test results
Jerry James 36261fc
BuildArch:      noarch
Jerry James 36261fc
Requires:       python-extras
Jerry James 36261fc
Requires:       python-iso8601
Jerry James 8247687
Requires:       python-testtools >= 0.9.37
Jerry James 36261fc
Jerry James 36261fc
%description -n python-%{name}
Jerry James 36261fc
Subunit is a streaming protocol for test results.  The protocol is a
Jerry James 36261fc
binary encoding that is easily generated and parsed.  By design all the
Jerry James 36261fc
components of the protocol conceptually fit into the xUnit TestCase ->
Jerry James 36261fc
TestResult interaction.
Jerry James 36261fc
Jerry James 36261fc
Subunit comes with command line filters to process a subunit stream and
Jerry James 36261fc
language bindings for python, C, C++ and shell.  Bindings are easy to
Jerry James 36261fc
write for other languages.
Jerry James 36261fc
Jerry James 36261fc
A number of useful things can be done easily with subunit:
Jerry James 36261fc
- Test aggregation: Tests run separately can be combined and then
Jerry James 36261fc
  reported/displayed together.  For instance, tests from different
Jerry James 36261fc
  languages can be shown as a seamless whole.
Jerry James 36261fc
- Test archiving: A test run may be recorded and replayed later.
Jerry James 36261fc
- Test isolation: Tests that may crash or otherwise interact badly with
Jerry James 36261fc
  each other can be run separately and then aggregated, rather than
Jerry James 36261fc
  interfering with each other.
Jerry James 36261fc
- Grid testing: subunit can act as the necessary serialization and
Jerry James 36261fc
  deserialization to get test runs on distributed machines to be
Jerry James 36261fc
  reported in real time.
Jerry James 36261fc
Jerry James 081470f
%if 0%{?with_py3}
Jerry James 081470f
%package -n python3-%{name}
Jerry James 081470f
Summary:        Streaming protocol for test results
Jerry James 081470f
BuildArch:      noarch
Jerry James 081470f
Requires:       python3-extras
Jerry James 081470f
Requires:       python3-iso8601
Jerry James 081470f
Requires:       python3-testtools >= 0.9.37
Jerry James 081470f
Jerry James 081470f
%description -n python3-%{name}
Jerry James 081470f
Subunit is a streaming protocol for test results.  The protocol is a
Jerry James 081470f
binary encoding that is easily generated and parsed.  By design all the
Jerry James 081470f
components of the protocol conceptually fit into the xUnit TestCase ->
Jerry James 081470f
TestResult interaction.
Jerry James 081470f
Jerry James 081470f
Subunit comes with command line filters to process a subunit stream and
Jerry James 081470f
language bindings for python, C, C++ and shell.  Bindings are easy to
Jerry James 081470f
write for other languages.
Jerry James 081470f
Jerry James 081470f
A number of useful things can be done easily with subunit:
Jerry James 081470f
- Test aggregation: Tests run separately can be combined and then
Jerry James 081470f
  reported/displayed together.  For instance, tests from different
Jerry James 081470f
  languages can be shown as a seamless whole.
Jerry James 081470f
- Test archiving: A test run may be recorded and replayed later.
Jerry James 081470f
- Test isolation: Tests that may crash or otherwise interact badly with
Jerry James 081470f
  each other can be run separately and then aggregated, rather than
Jerry James 081470f
  interfering with each other.
Jerry James 081470f
- Grid testing: subunit can act as the necessary serialization and
Jerry James 081470f
  deserialization to get test runs on distributed machines to be
Jerry James 081470f
  reported in real time.
Jerry James 081470f
%endif
Jerry James 081470f
Jerry James 36261fc
%package filters
Jerry James 36261fc
Summary:        Command line filters for processing subunit streams
Jerry James 36261fc
BuildArch:      noarch
Jerry James 36261fc
Requires:       python-%{name} = %{version}-%{release}
Jerry James 36261fc
Requires:       pygtk2
Jerry James 36261fc
Jerry James 36261fc
%description filters
Jerry James 36261fc
Command line filters for processing subunit streams.
Jerry James 36261fc
Jerry James 36261fc
%prep
Jerry James 36261fc
%setup -q
Jerry James 36261fc
%patch0
97d8b53
%patch1
Jerry James 36261fc
Jerry James 36261fc
# Remove bundled code
Jerry James 36261fc
rm -fr python/iso8601 python/subunit/iso8601.py
Jerry James 36261fc
Jerry James 36261fc
# Help the dependency generator
Jerry James 36261fc
for filt in filters/*; do
Jerry James 36261fc
  sed 's,/usr/bin/env ,/usr/bin/,' $filt > ${filt}.new
Jerry James 36261fc
  chmod 0755 ${filt}.new
Jerry James 36261fc
  touch -r $filt ${filt}.new
Jerry James 36261fc
  mv -f ${filt}.new $filt
Jerry James 36261fc
done
Jerry James 36261fc
Jerry James 36261fc
# Fix underlinked library
Jerry James 36261fc
sed "/libcppunit_subunit_la_/s,\$(LIBS),& -lcppunit -L$PWD/.libs -lsubunit," \
Jerry James 36261fc
    -i Makefile.in
Jerry James 36261fc
Jerry James 081470f
%if 0%{?with_py3}
Jerry James 081470f
# Prepare to build for python 3
Jerry James 081470f
cp -a python python3
Jerry James 081470f
%endif
Jerry James 081470f
Jerry James 36261fc
%build
Jerry James 36261fc
export INSTALLDIRS=perl
Jerry James 36261fc
%configure --disable-static
Jerry James 36261fc
Jerry James 36261fc
# Get rid of undesirable hardcoded rpaths; workaround libtool reordering
Jerry James 36261fc
# -Wl,--as-needed after all the libraries.
Jerry James 36261fc
sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
Jerry James 36261fc
    -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
Jerry James 36261fc
    -e 's|CC=.g..|& -Wl,--as-needed|' \
Jerry James 36261fc
    -i libtool
Jerry James 36261fc
Jerry James 36261fc
make %{?_smp_mflags}
Jerry James 36261fc
Jerry James 081470f
%{__python2} setup.py build
Jerry James 081470f
Jerry James 081470f
%if 0%{?with_py3}
Jerry James 081470f
mv python python2
Jerry James 081470f
mv python3 python
Jerry James 081470f
%{__python3} setup.py build
Jerry James 081470f
mv python python3
Jerry James 081470f
mv python2 python
Jerry James 081470f
%endif
d48d9cf
Jerry James 36261fc
%install
Jerry James ac835d0
# Install for python 3
Jerry James 081470f
%if 0%{?with_py3}
Jerry James 081470f
mv python python2
Jerry James 081470f
mv python3 python
Jerry James 081470f
%{__python3} setup.py install --skip-build --root %{buildroot}
Jerry James 081470f
chmod 0755 %{buildroot}%{python3_sitelib}/%{name}/run.py
Jerry James ac835d0
rm -f %{buildroot}%{_bindir}/*
Jerry James 081470f
mv python python3
Jerry James 081470f
mv python2 python
Jerry James 081470f
%endif
Jerry James 36261fc
Jerry James ac835d0
# We set pkgpython_PYTHON for efficiency to disable automake python compilation
Jerry James ac835d0
%make_install pkgpython_PYTHON='' INSTALL="%{_bindir}/install -p"
Jerry James ac835d0
Jerry James ac835d0
# Install for python 2
Jerry James ac835d0
%{__python2} setup.py install --skip-build --root %{buildroot}
Jerry James ac835d0
Jerry James 36261fc
# Install the shell interface
Jerry James 36261fc
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
Jerry James 36261fc
cp -p shell/share/%{name}.sh %{buildroot}%{_sysconfdir}/profile.d
Jerry James 36261fc
Jerry James 36261fc
# Remove unwanted libtool files
Jerry James 36261fc
rm -f %{buildroot}%{_libdir}/*.la
Jerry James 36261fc
Jerry James 36261fc
# Fix perl installation
Jerry James 36261fc
mkdir -p %{buildroot}%{perl_vendorlib}
Jerry James 36261fc
mv %{buildroot}%{perl_privlib}/Subunit* %{buildroot}%{perl_vendorlib}
Jerry James 36261fc
rm -fr %{buildroot}%{perl_archlib}
Jerry James 36261fc
Jerry James 36261fc
# Fix permissions
Jerry James 36261fc
chmod 0755 %{buildroot}%{python2_sitelib}/%{name}/run.py
Jerry James 36261fc
chmod 0755 %{buildroot}%{_bindir}/subunit-diff
Jerry James 36261fc
Jerry James 36261fc
# Fix timestamps
Jerry James 36261fc
touch -r c/include/%{name}/child.h %{buildroot}%{_includedir}/%{name}/child.h
Jerry James 36261fc
touch -r c++/SubunitTestProgressListener.h \
Jerry James 36261fc
      %{buildroot}%{_includedir}/%{name}/SubunitTestProgressListener.h
Jerry James 36261fc
touch -r perl/subunit-diff %{buildroot}%{_bindir}/subunit-diff
Jerry James 36261fc
for fil in filters/*; do
Jerry James 36261fc
  touch -r $fil %{buildroot}%{_bindir}/$(basename $fil)
Jerry James 36261fc
done
Jerry James 36261fc
Jerry James 081470f
# Don't distribute the python tests
Jerry James 081470f
rm -fr %{buildroot}%{python2_sitelib}/subunit/tests
Jerry James 081470f
rm -fr %{buildroot}%{python3_sitelib}/subunit/tests
Jerry James 081470f
Jerry James 36261fc
%check
97d8b53
# Run the tests for python2
Jerry James 36261fc
export LD_LIBRARY_PATH=$PWD/.libs
Jerry James 36261fc
export PYTHONPATH=$PWD/python/subunit:$PWD/python/subunit/tests
Jerry James 36261fc
make check
Jerry James 36261fc
97d8b53
%if 0%{?with_py3}
97d8b53
# Run the tests for python3
97d8b53
mv python python2
97d8b53
mv python3 python
97d8b53
export PYTHON=%{__python3}
97d8b53
make check
97d8b53
mv python python3
97d8b53
mv python2 python
97d8b53
%endif
97d8b53
Jerry James 36261fc
%post -p /sbin/ldconfig
Jerry James 36261fc
Jerry James 36261fc
%postun -p /sbin/ldconfig
Jerry James 36261fc
Jerry James 36261fc
%post cppunit -p /sbin/ldconfig
Jerry James 36261fc
Jerry James 36261fc
%postun cppunit -p /sbin/ldconfig
Jerry James 36261fc
Jerry James 36261fc
%files
Jerry James 8247687
%doc NEWS README
Jerry James 8247687
%license Apache-2.0 BSD COPYING
Jerry James 36261fc
%{_libdir}/lib%{name}.so.*
Jerry James 36261fc
Jerry James 36261fc
%files devel
Jerry James 36261fc
%doc c/README
Jerry James 36261fc
%dir %{_includedir}/%{name}/
Jerry James 36261fc
%{_includedir}/%{name}/child.h
Jerry James 36261fc
%{_libdir}/lib%{name}.so
Jerry James 36261fc
%{_libdir}/pkgconfig/lib%{name}.pc
Jerry James 36261fc
Jerry James 36261fc
%files cppunit
Jerry James 36261fc
%{_libdir}/libcppunit_%{name}.so.*
Jerry James 36261fc
Jerry James 36261fc
%files cppunit-devel
Jerry James 36261fc
%doc c++/README
Jerry James 36261fc
%{_includedir}/%{name}/SubunitTestProgressListener.h
Jerry James 36261fc
%{_libdir}/libcppunit_%{name}.so
Jerry James 36261fc
%{_libdir}/pkgconfig/libcppunit_%{name}.pc
Jerry James 36261fc
Jerry James 36261fc
%files perl
Jerry James 8247687
%license Apache-2.0 BSD COPYING
Jerry James 36261fc
%{_bindir}/%{name}-diff
Jerry James 36261fc
%{perl_vendorlib}/*
Jerry James 36261fc
Jerry James 36261fc
%files shell
Jerry James 8247687
%doc shell/README
Jerry James 8247687
%license Apache-2.0 BSD COPYING
Jerry James 36261fc
%config(noreplace) %{_sysconfdir}/profile.d/%{name}.sh
Jerry James 36261fc
Jerry James 36261fc
%files -n python-%{name}
Jerry James 8247687
%license Apache-2.0 BSD COPYING
Jerry James 36261fc
%{python2_sitelib}/%{name}/
d48d9cf
%{python2_sitelib}/python_%{name}-%{version}-*.egg-info
Jerry James 36261fc
Jerry James 081470f
%if 0%{?with_py3}
Jerry James 081470f
%files -n python3-%{name}
Jerry James 081470f
%license Apache-2.0 BSD COPYING
Jerry James 081470f
%{python3_sitelib}/%{name}/
Jerry James 081470f
%{python3_sitelib}/python_%{name}-%{version}-*.egg-info
Jerry James 081470f
%endif
Jerry James 081470f
Jerry James 36261fc
%files filters
Jerry James 36261fc
%{_bindir}/*
Jerry James 36261fc
%exclude %{_bindir}/%{name}-diff
Jerry James 36261fc
Jerry James 36261fc
%changelog
97d8b53
* Fri Jun 12 2015 Jerry James <loganjerry@gmail.com> - 1.1.0-1
97d8b53
- New upstream release
97d8b53
- Enable python3 tests
97d8b53
4aa45ba
* Wed Jun 03 2015 Jitka Plesnikova <jplesnik@redhat.com> - 1.0.0-3
4aa45ba
- Perl 5.22 rebuild
4aa45ba
a6e8042
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.0.0-2
a6e8042
- Rebuilt for GCC 5 C++11 ABI change
a6e8042
Jerry James 081470f
* Tue Dec  9 2014 Jerry James <loganjerry@gmail.com> - 1.0.0-1
Jerry James 081470f
- New upstream release (bz 1171483 and 1172204)
Jerry James 081470f
- Add python3 subpackage (bz 1172195)
Jerry James 081470f
d48d9cf
* Wed Nov 19 2014 Pádraig Brady <pbrady@redhat.com> - 0.0.21-2
d48d9cf
- Make python-subunit egginfo available for pip etc.
d48d9cf
Jerry James 8247687
* Fri Sep 19 2014 Jerry James <loganjerry@gmail.com> - 0.0.21-1
Jerry James 8247687
- New upstream release
Jerry James 8247687
- Fix license handling
Jerry James 8247687
b2f6f01
* Wed Aug 27 2014 Jitka Plesnikova <jplesnik@redhat.com> - 0.0.18-5
b2f6f01
- Perl 5.20 rebuild
b2f6f01
620c8d4
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.18-4
620c8d4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
620c8d4
e0ec266
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.18-3
e0ec266
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
e0ec266
Jerry James 36261fc
* Thu Apr 24 2014 Jerry James <loganjerry@gmail.com> - 0.0.18-2
Jerry James 36261fc
- Add license text to all independent packages
Jerry James 36261fc
- Add perl module Requires to the -perl subpackage
Jerry James 36261fc
- Fix timestamps after install
Jerry James 36261fc
Jerry James 36261fc
* Fri Feb 14 2014 Jerry James <loganjerry@gmail.com> - 0.0.18-1
Jerry James 36261fc
- Initial RPM