a14076a
%bcond_with tests
a14076a
a14076a
%if %{with tests}
a14076a
%ifarch x86_64
a14076a
%global kcov_tests 1
a14076a
%endif
a14076a
%endif
a14076a
a14076a
51dd511
Name:           kcov
3ded071
Version:        38
12a36b2
Release:        4%{?dist}
51dd511
Summary:        Code coverage tool without special compilation options
51dd511
51dd511
# Licenses of kcov itself and its bundled js libraries (see below)
51dd511
License:        GPLv2 and BSD and MIT
51dd511
URL:            https://simonkagstrom.github.io/%{name}
51dd511
Source:         https://github.com/SimonKagstrom/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
51dd511
51dd511
# https://github.com/SimonKagstrom/kcov/blob/v35/src/solib-parser/lib.c#L87-L97
51dd511
ExcludeArch:    s390 s390x
51dd511
51dd511
BuildRequires:  binutils-devel
51dd511
BuildRequires:  cmake
4de9a0f
BuildRequires:  coreutils
51dd511
BuildRequires:  gcc-c++
51dd511
BuildRequires:  pkgconfig(libcurl)
51dd511
BuildRequires:  pkgconfig(libdw)
51dd511
BuildRequires:  pkgconfig(libelf)
51dd511
BuildRequires:  pkgconfig(zlib)
4de9a0f
BuildRequires:  python3
a14076a
a14076a
%if 0%{?kcov_tests}
4de9a0f
BuildRequires:  gawk
a14076a
BuildRequires:  glibc-devel(x86-32)
4de9a0f
BuildRequires:  procps
a14076a
%endif
0c038c7
BuildRequires: make
51dd511
51dd511
# NB: Last I tried to unbundle those dependencies I hit a first roadblock in
51dd511
# the sense that all three were available in Fedora but packaged differently
51dd511
# and none of the versions matched:
51dd511
#
51dd511
# - js-jquery.noarch (compat package js-jquery2.noarch too)
51dd511
# - nodejs-handlebars.noarch
51dd511
# - xstatic-jquery-tablesorter-common.noarch
51dd511
#
51dd511
# All three packages drop files in different locations, following different
51dd511
# patterns. NodeJS modules in particular look a bit more involved.
51dd511
#
51dd511
# Since those dependencies are merely used to slightly improve static HTML
51dd511
# reports, I'd rather not spend mindless efforts unbundling things that are
51dd511
# not ultimately exposed by the package. They are embedded in the kcov(1)
51dd511
# program and written by `html-writer.cc` as static strings.
51dd511
#
51dd511
# It would make more sense to unbundle those if they were used as libraries
51dd511
# instead of just assets. Here it seems overkill. I'm registering them as
51dd511
# bundled provides even though they don't appear as individual files to at
51dd511
# least keep awareness of what I consider a non-issue.
51dd511
#
51dd511
# -- dridi
51dd511
Provides:       bundled(handlebars) = 2.2.0
51dd511
Provides:       bundled(jquery) = 2.1.1
51dd511
Provides:       bundled(jquery-tablesorter) = 2.17.1
51dd511
51dd511
51dd511
%description
51dd511
Kcov is a code coverage tester for compiled programs, Python scripts and shell
51dd511
scripts.  It allows collecting code coverage information from executables
51dd511
without special command-line arguments, and continuously produces output from
51dd511
long-running applications.
51dd511
51dd511
51dd511
%prep
51dd511
%setup -q
51dd511
rm -frv external/ # remove LLDB headers bundled for MacOS
51dd511
51dd511
51dd511
%build
a14076a
# NB: the test suite is not built using the %%cmake macro, on purpose.
a14076a
%if 0%{?kcov_tests}
a14076a
cmake -S tests -B build-tests -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
a14076a
%make_build -C build-tests
a14076a
%endif
a14076a
a14076a
cmake -S tools -B build-tools -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
a14076a
%make_build -C build-tools
a14076a
a14076a
%cmake -S . -B build
a14076a
%make_build -C build
51dd511
51dd511
51dd511
%install
a14076a
%make_install -C build
a14076a
a14076a
a14076a
%check
a14076a
%if 0%{?kcov_tests}
a14076a
tests/tools/run-tests build/src/kcov /tmp/ build-tests/ $(pwd) -v
a14076a
%endif
51dd511
51dd511
51dd511
%files
51dd511
%license COPYING*
51dd511
%{_bindir}/*
51dd511
%{_mandir}/man1/*
6495f4c
%{_pkgdocdir}
51dd511
51dd511
51dd511
%changelog
12a36b2
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 38-4
12a36b2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
12a36b2
79d8cf5
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 38-3
79d8cf5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
79d8cf5
de408a5
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 38-2
de408a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
de408a5
3ded071
* Sat Jan 18 2020 Dridi Boukelmoune <dridi@fedoraproject.org> - 38-1
3ded071
- Bump to version 38
3ded071
4de9a0f
* Tue Oct 01 2019 Dridi Boukelmoune <dridi@fedoraproject.org> - 37-1
4de9a0f
- Bump to version 37
4de9a0f
- Remove python2 workaround
4de9a0f
a14076a
* Fri Aug 09 2019 Dridi Boukelmoune <dridi@fedoraproject.org> - 36-2
a14076a
- Temporarily move python shebangs to python2
a14076a
- Build the test suite on x86_64 and run it conditionally
a14076a
- Build tools/line2addr (but don't install it)
a14076a
6495f4c
* Wed Aug 07 2019 Dridi Boukelmoune <dridi@fedoraproject.org> - 36-1
6495f4c
- Bump to version 36
6495f4c
adb0074
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 35-3
adb0074
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
adb0074
c83b01d
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 35-2
c83b01d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
c83b01d
51dd511
* Wed Aug 15 2018 Dridi Boukelmoune <dridi@fedoraproject.org> - 35-1
51dd511
- Initial spec