Merge remote-tracking branch 'origin/rawhide' into epel8

This commit is contained in:
Michal Ambroz 2022-11-01 16:51:13 +01:00
commit 21dbd6a233
3 changed files with 53 additions and 78 deletions

2
.gitignore vendored
View file

@ -12,3 +12,5 @@
/python-yara-4.0.5.tar.gz
/python-yara-4.1.0.tar.gz
/python-yara-4.1.3.tar.gz
/python-yara-4.2.0.tar.gz
/python-yara-4.2.3.tar.gz

View file

@ -1,23 +1,17 @@
Name: python-yara
Version: 4.1.3
%global baserelease 2
Version: 4.2.3
%global baserelease 1
Summary: Python binding for the YARA pattern matching tool
License: ASL 2.0
URL: http://github.com/VirusTotal/yara-python/
VCS: http://github.com/VirusTotal/yara-python/
# http://VirusTotal.github.io/yara/
# https://github.com/VirusTotal/yara-python/releases
URL: https://github.com/VirusTotal/yara-python/
# By default build from a release tarball.
# If you want to rebuild from a unversioned commit from git do that with
# rpmbuild --rebuild python-yara.src.dpm --without release
%bcond_without release
%global srcname yara
%global gituser VirusTotal
%global gitname %{srcname}-python
%global commit dc838e211e45442d219012099aaa63efa812c4be
%global gitdate 20210427
%global commit 8106b84fa967bcd2fff4f5a40e558c36bb8d54e8
%global gitdate 20220809
%global shortcommit %(c=%{commit}; echo ${c:0:7})
@ -29,27 +23,17 @@ of malware families (or whatever you want to describe) based on textual or
binary patterns. Each description, a.k.a rule, consists of a set of strings
and a Boolean expression which determine its logic.}
# Do the check during build
%if 0%{?fedora} || ( 0%{?rhel} && 0%{?rhel} >= 7 )
%global with_check 1
# Build with python2 support for RHEL7
%if ( 0%{?rhel} && 0%{?rhel} < 8 )
%bcond_without python2
%endif
%if ( 0%{?fedora} && 0%{?fedora} >= 30 ) || ( 0%{?rhel} && 0%{?rhel} >= 8 )
# by default build without the python2 support on systems f30+ or rhel8+
%bcond_with python2
%else
# build with the python2 support on system up to f29 and/or rhel7
%bcond_without python2
%endif
%if 0%{?with_release}
Release: %{baserelease}%{?dist}
Source0: https://github.com/%{gituser}/%{gitname}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source0: https://github.com/VirusTotal/yara-python/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
%else
Release: %{baserelease}.%{gitdate}git%{shortcommit}%{?dist}
Source0: https://github.com/%{gituser}/%{gitname}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
Source0: https://github.com/VirusTotal/yara-python/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
%endif
BuildRequires: gcc
@ -60,7 +44,7 @@ BuildRequires: yara-devel >= %{version}
BuildRequires: /usr/bin/sphinx-build
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-nose
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-setuptools
@ -75,24 +59,23 @@ BuildRequires: python2-setuptools
%{common_description}
#====================================================================
%package -n python%{python3_pkgversion}-%{srcname}
%package -n python%{python3_pkgversion}-yara
Summary: Python3 binding for the YARA pattern matching tool
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%{?python_provide:%python_provide python%{python3_pkgversion}-yara}
%description -n python%{python3_pkgversion}-%{srcname}
%description -n python%{python3_pkgversion}-yara
%{common_description}
%if 0%{?with_python2} > 0
%package -n python2-%{srcname}
%package -n python2-yara
Summary: Python2 binding for the YARA pattern matching tool
%{?python_provide:%python_provide python2-%{srcname}}
%{?python_provide:%python_provide python2-yara}
%description -n python2-%{srcname}
%description -n python2-yara
%{common_description}
%endif
@ -100,11 +83,11 @@ Summary: Python2 binding for the YARA pattern matching tool
%prep
%if 0%{?with_release}
# Build from git release version
%autosetup -n %{gitname}-%{version}
%autosetup -n yara-python-%{version}
%else
# Build from git commit
%autosetup -n %{gitname}-%{commit}
%autosetup -n yara-python-%{commit}
%endif
@ -130,62 +113,52 @@ Summary: Python2 binding for the YARA pattern matching tool
#====================================================================
%check
%if 0%{?with_check}
# ==============================================================================
# Tests for python3 used to always fail on testModuleData testcase
# Tests for python3 used to randomly fail on testCompare testcase
# reported to upstream - https://github.com/VirusTotal/yara-python/issues/21
# temporarily run the failing tests but ignore the results for those 2
# EXCLUDE='--exclude=^testCompare$|^testModuleData$'
# seems to be fixed in 3.9.0
EXCLUDE='--exclude=^nothing$'
# Yara is not prepared to run on s390 - more tests failing on s390
# http://s390.koji.fedoraproject.org/kojifiles/work/tasks/9135/2399135/build.log
# https://github.com/VirusTotal/yara-python/issues/25
# 3.6.3 - testCompileFile started failing - https://kojipkgs.fedoraproject.org//work/tasks/9619/20589619/build.log
# https://github.com/VirusTotal/yara-python/issues/54
# seems to be fixed in 3.9.0
%ifarch s390 s390x %{power64}
# EXCLUDE='--exclude=^testCompare$|^testModuleData$|^testEntrypoint$|^testIn$|^testIntegerFunctions$|^testCompileFile$'
EXCLUDE='--exclude=^nothing$'
%endif
# 3.9.0 - testModuleData is always failing for architecture armv7hl
# testModuleData is always failing for architecture armv7hl
# Remove once Fedora 36 is EOL
%ifarch armv7hl
EXCLUDE='--exclude=^testModuleData$'
%endif
# Find the NOSETEST binary or use false if not present
NOSETESTS3=`ls /usr/bin/nosetests-3.* || which false `
PYTHONPATH=%{buildroot}/%{python3_sitearch}/ "$NOSETESTS3" -v "$EXCLUDE"
# Run potentially ignored tests separately so we can at least see the results
PYTHONPATH=%{buildroot}/%{python3_sitearch}/ "$NOSETESTS3" -v ./tests.py:TestYara.testCompare \
./tests.py:TestYara.testModuleData ./tests.py:TestYara.testEntrypoint \
./tests.py:TestYara.testIn ./tests.py:TestYara.testIntegerFunctions \
./tests.py:TestYara.testCompileFile || true
# with_check
EXCLUDE='not testModuleData'
%endif
%pytest -k "$EXCLUDE" tests.py -v
#====================================================================
%files -n python%{python3_pkgversion}-%{srcname}
%files -n python%{python3_pkgversion}-yara
%license LICENSE
%doc README.rst
%{python3_sitearch}/%{srcname}*
%{python3_sitearch}/yara*
%if 0%{?with_python2} > 0
%files -n python2-%{srcname}
%files -n python2-yara
%license LICENSE
%doc README.rst
%{python2_sitearch}/%{srcname}*
%{python2_sitearch}/yara*
%endif
#====================================================================
%changelog
* Tue Nov 01 2022 Michal Ambroz <rebus at, seznam.cz> - 4.2.3-1
- Rebuilt for yara-4.2.3 - second service :)
* Tue Aug 09 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> - 4.2.0-5
- Rebuilt for yara-4.2.3
* Mon Aug 08 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> - 4.2.0-4
- Skip testModuleData again for F36, fixes rhbz#2116289
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 4.2.0-2
- Rebuilt for Python 3.11
* Fri May 27 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> - 4.2.0-1
- Bump to 4.2.0 rhbz#2063287 fixes FTBFS rhbz#2064646
- Minor changes to spec, like using https for URL
- Simplify some of checks for different builds
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Nov 10 2021 Michal Ambroz <rebus at, seznam.cz> - 4.1.3-2
- rebuild due to koji hickup

View file

@ -1 +1 @@
SHA512 (python-yara-4.1.3.tar.gz) = 9c96ae78df7694dd55b8bdde4fad49043f120b94477fa9d7090610665072626eba4fa410cd9292205e0b18bb9f384f07288c0340232e163294b91051b84dcab2
SHA512 (python-yara-4.2.3.tar.gz) = 588875d820f4e1b2aa5c6bbe83814ba2756f5ed301ba652efd280d5ca9745f7388f1f9eaa3875d11de5644ce9c41dcb76eebbee86269f8d6723c7d16ffa134be