#1 Allow building on EPEL 7 and 8
Opened 2 years ago by dciabrin. Modified 2 years ago
rpms/ dciabrin/kcov epel  into  rawhide

file modified
+23 -4
@@ -9,7 +9,7 @@ 

  

  Name:           kcov

  Version:        38

- Release:        2%{?dist}

+ Release:        3%{?dist}

  Summary:        Code coverage tool without special compilation options

  

  # Licenses of kcov itself and its bundled js libraries (see below)
@@ -30,6 +30,11 @@ 

  BuildRequires:  pkgconfig(zlib)

  BuildRequires:  python3

  

+ # required for building on EPEL 8

+ %if 0%{?rhel} > 7

+ BuildRequires:  openssl-devel

+ %endif

+ 

  %if 0%{?kcov_tests}

  BuildRequires:  gawk

  BuildRequires:  glibc-devel(x86-32)
@@ -69,6 +74,12 @@ 

  without special command-line arguments, and continuously produces output from

  long-running applications.

  

+ # cmake in EPEL 7 and 8 doesn't understand -B

+ %if 0%{?rhel} > 0 && 0%{?rhel} <= 8

+ %define kcov_flags -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON

+ %else

+ %define kcov_flags -B . -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON

+ %endif

  

  %prep

  %setup -q
@@ -78,14 +89,14 @@ 

  %build

  # NB: the test suite is not built using the %%cmake macro, on purpose.

  %if 0%{?kcov_tests}

- cmake -S tests -B build-tests -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON

+ (mkdir build-tests && cd build-tests && cmake ../tests %kcov_flags)

  %make_build -C build-tests

  %endif

  

- cmake -S tools -B build-tools -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON

+ (mkdir build-tools && cd build-tools && cmake ../tools %kcov_flags)

  %make_build -C build-tools

  

- %cmake -S . -B build

+ (mkdir build && cd build && %cmake .. %kcov_flags)

  %make_build -C build

  

  
@@ -103,10 +114,18 @@ 

  %license COPYING*

  %{_bindir}/*

  %{_mandir}/man1/*

+ # rhbz#1392354 On EPEL 7 _pkgdocdir macro is versioned, do not use it

+ %if 0%{?rhel} == 7

+ %{_docdir}/%{name}

+ %else

  %{_pkgdocdir}

+ %endif

  

  

  %changelog

+ * Mon Jul 27 2020 Damien Ciabrini <damien.ciabrini@gmail.com> - 38-3

+ - Allow building on EPEL 7 and 8

+ 

  * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 38-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

  

Change the way we call cmake to accommodate for the older version available in EPEL. Tweak the specfile to make it build for EPEL 7 and 8.

rebased onto d9ef521

2 years ago