subunit/subunit.spec

244 lines
8.2 KiB
RPMSpec
Raw Normal View History

2020-08-11 16:22:47 +08:00
Name: subunit
2023-09-05 17:26:31 +08:00
Version: 1.4.2
Release: 1
2020-08-11 16:22:47 +08:00
Summary: C bindings for subunit
2023-09-05 17:26:31 +08:00
License: Apache-2.0 OR BSD-3-Clause
2020-08-11 16:22:47 +08:00
URL: https://launchpad.net/subunit
Source0: https://launchpad.net/subunit/trunk/%{version}/+download/%{name}-%{version}.tar.gz
2023-09-05 17:26:31 +08:00
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: pkgconfig
BuildRequires: pkgconfig(cppunit)
BuildRequires: python3-devel
BuildRequires: python3-pip
BuildRequires: python3-wheel
2020-08-11 16:22:47 +08:00
BuildRequires: python3-testtools >= 1.8.0
2023-09-05 17:26:31 +08:00
BuildRequires: python3-testscenarios
BuildRequires: pkgconfig(check)
2019-12-09 19:58:38 +08:00
%description
2020-06-24 19:20:07 +08:00
Subunit C bindings. See the python-subunit package for test processing
2019-12-09 19:58:38 +08:00
functionality.
%package devel
2020-08-11 16:22:47 +08:00
Summary: Header files for developing C applications that use subunit
Requires: %{name}%{?_isa} = %{version}-%{release}
2019-12-09 19:58:38 +08:00
%description devel
2020-06-24 19:20:07 +08:00
Header files and libraries for developing C applications that use subunit.
%package cppunit
2020-08-11 16:22:47 +08:00
Summary: Subunit integration into cppunit
Requires: %{name}%{?_isa} = %{version}-%{release}
2020-06-24 19:20:07 +08:00
%description cppunit
Subunit integration into cppunit.
%package cppunit-devel
2020-08-11 16:22:47 +08:00
Summary: Header files for applications that use cppunit and subunit
Requires: %{name}-cppunit%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release} cppunit-devel%{?_isa}
2020-06-24 19:20:07 +08:00
%description cppunit-devel
Header files and libraries for developing applications that use cppunit
and subunit.
2019-12-09 19:58:38 +08:00
%package perl
2020-08-11 16:22:47 +08:00
Summary: Perl bindings for subunit
BuildArch: noarch
Requires: perl(:MODULE_COMPAT_%{perl_version})
2019-12-09 19:58:38 +08:00
%description perl
2020-06-24 19:20:07 +08:00
Subunit perl bindings. See the python-subunit package for test
processing functionality.
2019-12-09 19:58:38 +08:00
%package shell
2020-08-11 16:22:47 +08:00
Summary: Shell bindings for subunit
BuildArch: noarch
2019-12-09 19:58:38 +08:00
%description shell
2020-06-24 19:20:07 +08:00
Subunit shell bindings. See the python-subunit package for test
processing functionality.
2019-12-09 19:58:38 +08:00
%package -n python3-%{name}
2023-09-05 17:26:31 +08:00
# The bundled iso8601 library is MIT licensed
License: (Apache-2.0 OR BSD-3-Clause) AND MIT
2020-08-11 16:22:47 +08:00
Summary: Streaming protocol for test results
BuildArch: noarch
2023-09-05 17:26:31 +08:00
Provides: bundled(python3-iso8601) = 0.1.4
2019-12-09 19:58:38 +08:00
%description -n python3-%{name}
Subunit is a streaming protocol for test results. The protocol is a
2020-06-24 19:20:07 +08:00
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 -n python3-%{name}-test
2020-08-11 16:22:47 +08:00
Summary: Test code for the python 3 subunit bindings
BuildArch: noarch
Requires: python3-%{name} = %{version}-%{release} %{name}-filters = %{version}-%{release}
2023-09-05 17:26:31 +08:00
2020-06-24 19:20:07 +08:00
%description -n python3-%{name}-test
%{summary}.
2019-12-09 19:58:38 +08:00
2020-06-24 19:20:07 +08:00
%package filters
2020-08-11 16:22:47 +08:00
Summary: Command line filters for processing subunit streams
BuildArch: noarch
Requires: python3-%{name} = %{version}-%{release} python3-gobject gtk3 >= 3.20
Requires: libnotify >= 0.7.7 python3-junitxml
2020-06-24 19:20:07 +08:00
%description filters
Command line filters for processing subunit streams.
%package static
2020-08-11 16:22:47 +08:00
Summary: Static C library for subunit
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
2020-06-24 19:20:07 +08:00
%description static
Subunit C bindings in a static library, for building statically linked
test cases.
%prep
2023-09-05 17:26:31 +08:00
%autosetup -n %{name}-%{version} -p1
2020-06-24 19:20:07 +08:00
fixtimestamp() {
touch -r $1.orig $1
rm $1.orig
}
sed "/^tests_LDADD/ilibcppunit_subunit_la_LIBADD = -lcppunit libsubunit.la\n" \
-i Makefile.am
for fil in $(grep -Frl "%{_bindir}/env python"); do
2023-09-05 17:26:31 +08:00
sed -i.orig 's,%{_bindir}/env python3,%{_bindir}/python3,' $fil
2020-06-24 19:20:07 +08:00
fixtimestamp $fil
2019-12-09 19:58:38 +08:00
done
2023-09-05 17:26:31 +08:00
2019-12-09 19:58:38 +08:00
%build
export INSTALLDIRS=perl
2023-09-05 17:26:31 +08:00
# Build for python3
2019-12-09 19:58:38 +08:00
export PYTHON=%{_bindir}/python3
2020-06-24 19:20:07 +08:00
%configure --enable-shared --enable-static
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}
2023-09-05 17:26:31 +08:00
%pyproject_build
2019-12-09 19:58:38 +08:00
%install
2023-09-05 17:26:31 +08:00
%pyproject_install
2019-12-09 19:58:38 +08:00
chmod 0755 %{buildroot}%{python3_sitelib}/%{name}/run.py
2020-06-24 19:20:07 +08:00
chmod 0755 %{buildroot}%{python3_sitelib}/%{name}/tests/sample-script.py
chmod 0755 %{buildroot}%{python3_sitelib}/%{name}/tests/sample-two-script.py
2023-09-05 17:26:31 +08:00
2021-02-22 16:17:49 +08:00
%make_install INSTALL="%{_bindir}/install -p"
2023-09-05 17:26:31 +08:00
2020-06-24 19:20:07 +08:00
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
2019-12-09 19:58:38 +08:00
cp -p shell/share/%{name}.sh %{buildroot}%{_sysconfdir}/profile.d
2023-09-05 17:26:31 +08:00
2020-06-24 19:20:07 +08:00
rm -f %{buildroot}%{_libdir}/*.la
mkdir -p %{buildroot}%{perl_vendorlib}
2019-12-09 19:58:38 +08:00
mv %{buildroot}%{perl_privlib}/Subunit* %{buildroot}%{perl_vendorlib}
2020-06-24 19:20:07 +08:00
rm -fr %{buildroot}%{perl_archlib}
2023-09-05 17:26:31 +08:00
2020-06-24 19:20:07 +08:00
chmod 0755 %{buildroot}%{_bindir}/subunit-diff
2023-09-05 17:26:31 +08:00
chmod 0755 %{buildroot}%{python3_sitelib}/%{name}/filter_scripts/*.py
chmod 0644 %{buildroot}%{python3_sitelib}/%{name}/filter_scripts/__init__.py
2020-06-24 19:20:07 +08:00
chmod 0755 %{buildroot}%{python3_sitelib}/%{name}/tests/sample-script.py
chmod 0755 %{buildroot}%{python3_sitelib}/%{name}/tests/sample-two-script.py
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
2019-12-09 19:58:38 +08:00
%check
2023-09-05 17:26:31 +08:00
export LD_LIBRARY_PATH=$PWD/.libs
2019-12-09 19:58:38 +08:00
export PYTHON=%{__python3}
make check
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -c "import subunit.iso8601"
%files
%doc NEWS README.rst
%license Apache-2.0 BSD COPYING
%{_libdir}/lib%{name}.so.*
%files devel
2020-06-24 19:20:07 +08:00
%doc c/README
2019-12-09 19:58:38 +08:00
%dir %{_includedir}/%{name}/
%{_includedir}/%{name}/child.h
2020-06-24 19:20:07 +08:00
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/lib%{name}.pc
%files cppunit
%{_libdir}/libcppunit_%{name}.so.*
%files cppunit-devel
%doc c++/README
2019-12-09 19:58:38 +08:00
%{_includedir}/%{name}/SubunitTestProgressListener.h
2020-06-24 19:20:07 +08:00
%{_libdir}/libcppunit_%{name}.so
%{_libdir}/pkgconfig/libcppunit_%{name}.pc
2019-12-09 19:58:38 +08:00
%files perl
%license Apache-2.0 BSD COPYING
%{_bindir}/%{name}-diff
%{perl_vendorlib}/*
%files shell
%doc shell/README
%license Apache-2.0 BSD COPYING
%config(noreplace) %{_sysconfdir}/profile.d/%{name}.sh
%files -n python3-%{name}
%license Apache-2.0 BSD COPYING
%{python3_sitelib}/%{name}/
2023-09-05 17:26:31 +08:00
%{python3_sitelib}/python_%{name}-%{version}.dist-info/
2020-06-24 19:20:07 +08:00
%exclude %{python3_sitelib}/%{name}/tests/
%files -n python3-%{name}-test
%{python3_sitelib}/%{name}/tests/
%files static
%{_libdir}/*.a
%files filters
%{_bindir}/*
%exclude %{_bindir}/%{name}-diff
2019-12-09 19:58:38 +08:00
%changelog
2023-09-05 17:26:31 +08:00
* Tue Sep 05 2023 wangkai <13474090681@163.com> - 1.4.2-1
- Update to 1.4.2
- Use pyproject to compile package
- Modify iso8601 to bundle
* Fri Aug 04 2023 yaoxin <yao_xin001@hoperun.com> - 1.4.0-3
- Fix test failure caused by python update to 3.11
* Thu Jul 07 2022 yaoxin <yaoxin30@h-partners.com> - 1.4.0-2
- Resolve the compilation fails, due to python-testtools update to 2.5.0
* Mon Jul 12 2021 huangtianhua <huangtianhua@huawei.com> - 1.4.0-1
- Upgrade to 1.4.0 and drop the patches which have been upstreamed
2021-02-22 16:17:49 +08:00
* Mon Feb 22 2021 wangxiyuan <wangxiyuan1007@gmail.com> - 1.3.0-15
- CleanUp python2 residual content and backport a python3 known issue.
2021-02-03 12:06:18 +08:00
* Wed Feb 03 2021 maminjie <maminjie1@huawei.com> - 1.3.0-14
- Port to python-iso8601 0.1.12
2020-08-11 16:22:47 +08:00
* Tue Aug 11 2020 yanan li <liyanan032@huawei.com> - 1.3.0-13
- Remove python2-subunit subpackage
2020-06-24 19:20:07 +08:00
* Wed Jun 24 2020 sunguoshuai <sunguoshuai@huawei.com> - 1.3.0-12
- Update to 1.3.0-12
2019-12-09 19:58:38 +08:00
* Thu Dec 5 2019 wanjiankang <wanjiankang@huawei.com> - 1.3.0-3
- Initial RPM