From 20eece19409bf24f29e20d646ce6e2a050af662f Mon Sep 17 00:00:00 2001 From: rpmbuild Date: Tue, 15 Oct 2019 03:00:48 +0200 Subject: [PATCH] do not build py2 for rhel8 --- capstone.rpmlintrc | 6 ++++++ capstone.spec | 23 +++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 capstone.rpmlintrc diff --git a/capstone.rpmlintrc b/capstone.rpmlintrc new file mode 100644 index 0000000..edf9709 --- /dev/null +++ b/capstone.rpmlintrc @@ -0,0 +1,6 @@ +from Config import addFilter + +addFilter('capstone.*: macro-in-comment.*') +addFilter('capstone.*: rpm-buildroot-usage %build sed -i .s;%{buildroot};;.*') +addFilter('capstone.*: specfile-error warning: Macro expanded in comment on line ..: %{gituser}/%{gitname}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz') + diff --git a/capstone.spec b/capstone.spec index 47aafbe..1e1d41b 100644 --- a/capstone.spec +++ b/capstone.spec @@ -1,6 +1,6 @@ Name: capstone Version: 4.0.1 -Release: 8%{?dist} +Release: 9%{?dist} Summary: A lightweight multi-platform, multi-architecture disassembly framework %global gituser aquynh @@ -30,11 +30,14 @@ Patch1: 0001-Fix-include-path-in-pkg-config-for-Makefile-too-1339.patch Capstone is a disassembly framework with the target of becoming the ultimate disasm engine for binary analysis and reversing in the security community.} -%global with_python3 1 -%bcond_with python2 -# Build also the python2 package -%if %{with python2} || (0%{?fedora} && 0%{?fedora} <= 31 ) || ( 0%{?rhel} && 0%{?rhel} <= 8 ) -%global with_python2 1 +# Build with python3 package by default +%bcond_without python3 + +# Build without python2 package for newer releases f32+ and rhel8+ +%if (0%{?fedora} && 0%{?fedora} >= 32 ) || ( 0%{?rhel} && 0%{?rhel} >= 8 ) +%bcond_with python2 +%else +%bcond_without python2 %endif @@ -56,6 +59,7 @@ BuildRequires: python%{python3_pkgversion} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %endif # if with_python3 + %global _hardened_build 1 @@ -86,7 +90,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %description -n python2-capstone %{common_desc} The python2-capstone package contains python bindings for %{name}. -%endif # _with_python3 +%endif # with_python2 @@ -148,7 +152,7 @@ CFLAGS="%{optflags}" %{__python3} setup.py build %endif # with_python3 popd -# build java bindings +# build java bindings needs some python pushd bindings/java %if 0%{?with_python3} make PYTHON2=%{__python3} PYTHON3=%{__python3} CFLAGS="%{optflags}" # %{?_smp_mflags} parallel seems broken @@ -231,6 +235,9 @@ install -D -p -m 0644 bindings/java/%{name}.jar %{buildroot}/%{_javadir}/%{name %{_javadir}/ %changelog +* Tue Oct 15 2019 Michal Ambroz - 4.0.1-9 +- do not build python2 package for rhel8 + * Thu Oct 10 2019 Michal Ambroz - 4.0.1-8 - fix descriptions of sub-packages - remove buildroot from the build phase