#4 Allow mock to be built for epel 8, and without tests
Closed 5 years ago by msuchy. Opened 5 years ago by kanarip.
rpms/ kanarip/mock epel8  into  master

Allow mock to be built for epel 8, and without tests
Jeroen van Meeuwen (Kolab Systems) • 5 years ago  
file modified
+12 -5
@@ -1,4 +1,6 @@ 

- %if 0%{?fedora} || 0%{?mageia}

+ %bcond_without tests

+ 

+ %if 0%{?fedora} || 0%{?mageia} || 0%{?rhel} >= 8

  %global use_python3 1

  %global use_python2 0

  %else
@@ -58,8 +60,9 @@ 

  Requires: python3-rpm

  Requires: python3-pyroute2

  BuildRequires: python3-devel

- #check

+ %if %{with tests}

  BuildRequires: python3-pylint

+ %endif

  %else

  Requires: python-ctypes

  Requires: python2-distro
@@ -71,20 +74,22 @@ 

  Requires: rpm-python

  %endif

  BuildRequires: python2-devel

- %if 0%{?fedora} || 0%{?mageia}

+ %if 0%{?fedora} || 0%{?mageia} || 0%{?rhel} >= 8

  Requires: dnf

  Suggests: yum

  Requires: dnf-plugins-core

  Recommends: btrfs-progs

  Recommends: dnf-utils

  Suggests: qemu-user-static

- %endif

+ %else

  %if 0%{?rhel} == 7

  Requires: btrfs-progs

  Requires: yum >= 2.4

  Requires: yum-utils

  %endif

- %if 0%{?fedora}

+ %endif

+ 

+ %if 0%{?fedora} || 0%{?rhel} >= 8

  BuildRequires: perl-interpreter

  %else

  BuildRequires: perl
@@ -178,8 +183,10 @@ 

  install -d %{buildroot}/var/cache/mock

  

  %check

+ %if %{with tests}

  # ignore the errors for now, just print them and hopefully somebody will fix it one day

  pylint-3 py/mockbuild/ py/*.py py/mockbuild/plugins/* || :

+ %endif

  

  %files

  %defattr(0644, root, mock)

This allows us to avoid the python3-pylint build requirement.

Today I found that we also need "systemd-container" on RHEL 8, too. Currently that requirement is only set on Fedora:

%if 0%{?fedora}
Requires: systemd-container
%endif

Don't you want to move this upstream first? Upstream maintains spec file, and the one in Fedora is synchronized IIRC (with updated tarballs).
https://github.com/rpm-software-management/mock/blob/devel/mock/mock.spec

Pull-Request has been closed by msuchy

5 years ago

And thank you for your contribution.