%global _python_bytecompile_extra 0

Name:           rpmlint
Version:        1.10
Release:        21
Summary:        Check the RPM package of tools for common errors
License:        GPLv2
URL:            https://github.com/rpm-software-management/rpmlint
Source0:        https://github.com/rpm-software-management/rpmlint/archive/rpmlint-%{version}.tar.gz
Source1:        rpmlint.config
Source2:        rpmlint-etc.config

Patch0001:      rpmlint-1.10-ignore-debuginfo-useless-provides.patch
Patch0002:      rpmlint-1.10-flake-cleanups.patch
Patch0003:      rpmlint-1.10-missing-files-exception.patch
Patch0004:      rpmlint-1.10-py37mtime.patch
Patch0005:      rpmlint-1.10-py37magic.patch
Patch0006:      rpmlint-1.10-ugly-workaroud-for-RPM-4.14-vs-4.15-python3-bindings-incompatibility.patch
Patch0007:      0001-AppDataCheck-Pass-nonet-to-appstream-util-if-Network.patch
Patch0008:      0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch

BuildArch:      noarch

BuildRequires:  python3-devel rpm-python3 >= 4.4.2.2 python3-pytest sed >= 3.95
Requires:       python3 rpm-python3 >= 4.4.2.2
Requires:       perl-interpreter cpio binutils desktop-file-utils gzip bzip2 xz %{_bindir}/groff

%description
Rpmlint is to check the RPM package of tools for common errors.  You can
check Binary and source packages as well as spec files.

%package help
Summary:        Help document for the rpmlint package

%description help
Help document for the rpmlint package.

%prep
%autosetup -n %{name}-%{name}-%{version} -p1

sed -i -e /MenuCheck/d Config.py
cp -p config config.example
install -pm 644 %{SOURCE2} config

%build
make COMPILE_PYC=1 PYTHON=%{__python3}

%install
touch rpmlint.pyc rpmlint.pyo
%make_install ETCDIR=%{_sysconfdir} MANDIR=%{_mandir} \
  LIBDIR=%{_datadir}/rpmlint BINDIR=%{_bindir} PYTHON=%{__python3}

install -pm 644 %{SOURCE1} %{buildroot}%{_datadir}/rpmlint/config


%files
%doc README.md config.example COPYING
%config(noreplace) %{_sysconfdir}/rpmlint/
%{_bindir}/{rpmdiff,rpmlint}
%{_datadir}/rpmlint/
%exclude %{_sysconfdir}/bash_completion.d/

%files help
%{_mandir}/man1/*

%changelog
* Tue Nov 14 2023 liubo <liubo1@xfusion.com> - 1.10-21
- Extend scm_regex to capture more SCM system files

* Tue Oct 17 2023 liubo <liubo1@xfusion.com> - 1.10-20
- AppDataCheck: Pass --nonet to appstream-util if NetworkEnabled is False

* Wed Nov  4 2020 Guoshuai Sun <sunguoshuai@huawei.com> - 1.10-19
- Ugly workaroud for RPM 4.14 vs 4.15 python3 bindings incompatibility

* Tue Feb 18 2020 wanjiankang <wanjiankang@huawei.com> - 1.10-18
- Package init
