Blame SPECS/capstone.spec

92d570
Name:           capstone
92d570
Version:        4.0.2
92d570
Release:        10%{?dist}
92d570
Summary:        A lightweight multi-platform, multi-architecture disassembly framework
92d570
92d570
%global         gituser         aquynh
92d570
%global         gitname         capstone
92d570
# 4.0.2 release
92d570
%global         commit          1d230532840a37ac032c6ab80128238fc930c6c1
92d570
%global         shortcommit     %(c=%{commit}; echo ${c:0:7})
92d570
92d570
License:        BSD
92d570
URL:            http://www.capstone-engine.org/
92d570
VCS:            https://github.com/aquynh/capstone/
92d570
#               https://github.com/aquynh/capstone/releases
92d570
# Source0:      https://github.com/%%{gituser}/%%{gitname}/archive/%%{commit}/%%{name}-%%{version}-%%{shortcommit}.tar.gz
92d570
Source0:        https://github.com/%{gituser}/%{gitname}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
92d570
92d570
# Test suite binary samples to be used for disassembly
92d570
# Source1:
92d570
92d570
# Fedora 29 makes python executable separate from python2 and python3. This patch makes
92d570
# it possible to specify PYTHON2 and PYTHON3 binary to be explicit that by "python" we mean "python2"
92d570
# Patch0:         capstone-python.patch
92d570
92d570
# Upstream patch which fixes libcapstone.pc.
92d570
# See: https://github.com/aquynh/capstone/issues/1339
92d570
# Patch1:         0001-Fix-include-path-in-pkg-config-for-Makefile-too-1339.patch
92d570
92d570
%global         common_desc %{expand:
92d570
Capstone is a disassembly framework with the target of becoming the ultimate
92d570
disasm engine for binary analysis and reversing in the security community.}
92d570
92d570
# Build with python3 package by default
92d570
%bcond_without  python3
92d570
92d570
# Build without python2 package for newer releases f32+ and rhel8+
92d570
%if (0%{?fedora} && 0%{?fedora} >= 32 ) || ( 0%{?rhel} && 0%{?rhel} >= 8 )
92d570
%bcond_with     python2
92d570
%else
92d570
%bcond_without  python2
92d570
%endif
92d570
92d570
92d570
%global srcname distribute
92d570
92d570
BuildRequires:  gcc
92d570
BuildRequires:  make
92d570
BuildRequires:  git
92d570
BuildRequires:  jna
92d570
BuildRequires:  java-devel
92d570
92d570
%if %{with python2}
92d570
BuildRequires:  python2
92d570
BuildRequires:  python2-devel
92d570
BuildRequires:  python2-setuptools
92d570
%endif
92d570
92d570
%if %{with python3}
92d570
BuildRequires:  python%{python3_pkgversion}
92d570
BuildRequires:  python%{python3_pkgversion}-devel
92d570
BuildRequires:  python%{python3_pkgversion}-setuptools
92d570
%endif
92d570
92d570
%global _hardened_build 1
92d570
92d570
92d570
%description
92d570
%{common_desc}
92d570
92d570
%package        devel
92d570
Summary:        Development files for %{name}
92d570
Requires:       %{name}%{?_isa} = %{version}-%{release}
92d570
92d570
%description    devel
92d570
%{common_desc}
92d570
The %{name}-devel package contains libraries and header files for
92d570
developing applications that use %{name}.
92d570
92d570
92d570
92d570
%if %{with python2}
92d570
%package        -n python2-capstone
92d570
%{?python_provide:%python_provide python2-capstone}
92d570
# Remove before F30
92d570
Provides:       %{name}-python = %{version}-%{release}
92d570
Provides:       %{name}-python%{?_isa} = %{version}-%{release}
92d570
Obsoletes:      %{name}-python < %{version}-%{release}
92d570
Summary:        Python bindings for %{name}
92d570
Requires:       %{name}%{?_isa} = %{version}-%{release}
92d570
92d570
%description    -n python2-capstone
92d570
%{common_desc}
92d570
The python2-capstone package contains python bindings for %{name}.
92d570
# with_python2
92d570
%endif
92d570
92d570
92d570
92d570
%if %{with python3}
92d570
%package	-n python%{python3_pkgversion}-capstone
92d570
%{?python_provide:%python_provide python%{python3_pkgversion}-capstone}
92d570
Provides:       %{name}-python%{python3_pkgversion} = %{version}-%{release}
92d570
Provides:       %{name}-python%{python3_pkgversion}%{?_isa} = %{version}-%{release}
92d570
Obsoletes:      %{name}-python%{python3_pkgversion} < %{version}-%{release}
92d570
Requires:       %{name}%{?_isa} = %{version}-%{release}
92d570
Summary:        Python3 bindings for %{name}
92d570
92d570
92d570
%description    -n python%{python3_pkgversion}-capstone
92d570
%{common_desc}
92d570
The python%{python3_pkgversion}-capstone package contains python3 bindings for %{name}.
92d570
#with python3
92d570
%endif
92d570
92d570
92d570
92d570
%package        java
92d570
Summary:        Java bindings for %{name}
92d570
Requires:       %{name} = %{version}-%{release}
92d570
BuildArch:      noarch
92d570
92d570
%description    java
92d570
%{common_desc}
92d570
The %{name}-java package contains java bindings for %{name}.
92d570
92d570
92d570
92d570
%prep
92d570
# autosetup -n %%{gitname}-%%{commit} -S git
92d570
%autosetup -n %{gitname}-%{version} -S git
92d570
92d570
92d570
92d570
%build
92d570
V=1 CFLAGS="%{optflags}" \
92d570
PREFIX="%{_prefix}" LIBDIRARCH="%{_lib}" INCDIR="%{_includedir}" \
92d570
%make_build PYTHON2=%{__python2} PYTHON3=%{__python3}
92d570
92d570
# Fix pkgconfig file
92d570
sed -i 's;%{buildroot};;' capstone.pc
92d570
grep -v archive capstone.pc > capstone.pc.tmp
92d570
mv capstone.pc.tmp capstone.pc
92d570
92d570
92d570
# build python bindings
92d570
pushd bindings/python
92d570
92d570
%if %{with python2}
92d570
%py2_build
92d570
%endif
92d570
92d570
%if %{with python3}
92d570
%py3_build
92d570
%endif
92d570
popd
92d570
92d570
# build java bindings needs some python
92d570
pushd bindings/java
92d570
%if %{with python3}
92d570
%make_build PYTHON2=%{__python3} PYTHON3=%{__python3} CFLAGS="%{optflags}" # %{?_smp_mflags} parallel seems broken
92d570
%else
92d570
%make_build PYTHON2=%{__python2} PYTHON3=%{__python2} CFLAGS="%{optflags}" # %{?_smp_mflags} parallel seems broken
92d570
%endif
92d570
popd
92d570
92d570
92d570
92d570
%install
92d570
DESTDIR=%{buildroot} PREFIX="%{_prefix}" LIBDIRARCH=%{_lib} \
92d570
INCDIR="%{_includedir}" make install
92d570
find %{buildroot} -name '*.la' -exec rm -f {} ';'
92d570
find %{buildroot} -name '*.a' -exec rm -f {} ';'
92d570
92d570
# install python bindings
92d570
pushd bindings/python
92d570
%if %{with python2}
92d570
%py2_install
92d570
%endif
92d570
92d570
%if %{with python3}
92d570
%py3_install
92d570
%endif
92d570
popd
92d570
92d570
# install java bindings
92d570
install -D -p -m 0644 bindings/java/%{name}.jar  %{buildroot}/%{_javadir}/%{name}.jar
92d570
92d570
92d570
92d570
%check
92d570
ln -s libcapstone.so.4 libcapstone.so
92d570
make check LD_LIBRARY_PATH="`pwd`"
92d570
92d570
92d570
%ldconfig_scriptlets
92d570
92d570
92d570
92d570
%files
92d570
%license LICENSE.TXT LICENSE_LLVM.TXT
92d570
%doc CREDITS.TXT ChangeLog README.md SPONSORS.TXT
92d570
%{_libdir}/*.so.*
92d570
%{_bindir}/cstool
92d570
92d570
92d570
92d570
%files devel
92d570
%{_includedir}/*
92d570
%{_libdir}/*.so
92d570
%{_libdir}/pkgconfig/*
92d570
92d570
92d570
92d570
%if %{with python2}
92d570
%files -n python2-capstone
92d570
%{python2_sitelib}/*egg-info
92d570
%{python2_sitelib}/%{name}
92d570
%endif
92d570
92d570
92d570
92d570
%if %{with python3}
92d570
%files -n python%{python3_pkgversion}-capstone
92d570
%{python3_sitelib}/*egg-info
92d570
%{python3_sitelib}/%{name}
92d570
%endif
92d570
92d570
92d570
92d570
%files java
92d570
%{_javadir}/
92d570
92d570
%changelog
92d570
* Fri Sep 02 2022 Miroslav Rezanina <mrezanin@redhat.com> - 4.0.2-10
92d570
- Import to CentOS 9 Stream / RHEL 9
92d570
92d570
* Sat Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 4.0.2-9
92d570
- Rebuilt for java-17-openjdk as system jdk
92d570
92d570
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.2-8
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
92d570
92d570
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.2-7
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
92d570
92d570
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 4.0.2-6
92d570
- Rebuilt for Python 3.10
92d570
92d570
* Fri May 14 2021 Michal Ambroz <rebus AT_ seznam.cz> - 4.0.2-5
92d570
- modernize specfile, using with bcond and py*_build macros
92d570
92d570
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.2-4
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
92d570
92d570
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.2-3
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
92d570
92d570
* Wed Jul 22 2020 Riccardo Schirone <rschirone91@gmail.com> - 4.0.2-2
92d570
- Use make_build macro instead of make (thanks to tstellar)
92d570
92d570
* Mon Jul 20 2020 Riccardo Schirone <rschirone91@gmail.com> - 4.0.2-1
92d570
- Rebase to upstream version 4.0.2
92d570
92d570
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 4.0.1-13
92d570
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
92d570
92d570
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 4.0.1-12
92d570
- Rebuilt for Python 3.9
92d570
92d570
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-11
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
92d570
92d570
* Tue Jan 21 2020 Kalev Lember <klember@redhat.com> - 4.0.1-10
92d570
- Avoid hardcoding /usr prefix
92d570
92d570
* Tue Oct 15 2019 Michal Ambroz <rebus AT_ seznam.cz> - 4.0.1-9
92d570
- do not build python2 package for rhel8
92d570
92d570
* Thu Oct 10 2019 Michal Ambroz <rebus AT_ seznam.cz> - 4.0.1-8
92d570
- fix descriptions of sub-packages
92d570
- remove buildroot from the build phase
92d570
92d570
* Thu Oct 10 2019 Michal Ambroz <rebus AT_ seznam.cz> - 4.0.1-7
92d570
- remove python2 from rawhide/fc32 package
92d570
92d570
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 4.0.1-6
92d570
- Rebuilt for Python 3.8.0rc1 (#1748018)
92d570
92d570
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 4.0.1-5
92d570
- Rebuilt for Python 3.8
92d570
92d570
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-4
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
92d570
92d570
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-3
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
92d570
92d570
* Sat Jan 12 2019 Richard W.M. Jones <rjones@redhat.com> - 4.0.1-2
92d570
- Add upstream patch which fixes libcapstone.pc
92d570
  https://github.com/aquynh/capstone/issues/1339
92d570
92d570
* Fri Jan 11 2019 Michal Ambroz <rebus _AT seznam.cz> - 4.0.1-1
92d570
- bump to 4.0.1 release
92d570
92d570
* Mon Aug 27 2018 Michal Ambroz <rebus _AT seznam.cz> - 3.0.5-1
92d570
- bump to 3.0.5
92d570
92d570
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.4-18
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
92d570
92d570
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 3.0.4-17
92d570
- Rebuilt for Python 3.7
92d570
92d570
* Tue Jun 26 2018 Michal Ambroz <rebus _AT seznam.cz> - 3.0.4-16
92d570
- unify the naming convention for the python packages
92d570
- fix the python3 package naming for EPEL7
92d570
92d570
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 3.0.4-15
92d570
- Rebuilt for Python 3.7
92d570
92d570
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.0.4-14
92d570
- Escape macros in %%changelog
92d570
92d570
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.4-13
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
92d570
92d570
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.0.4-12
92d570
- Add Provides for the old name without %%_isa
92d570
92d570
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.0.4-11
92d570
- Python 2 binary package renamed to python2-capstone
92d570
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
92d570
92d570
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.4-10
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
92d570
92d570
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.4-9
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
92d570
92d570
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.4-8
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
92d570
92d570
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 3.0.4-7
92d570
- Rebuild for Python 3.6
92d570
92d570
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.4-6
92d570
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
92d570
92d570
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.4-5
92d570
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
92d570
92d570
* Tue Oct 27 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.4-4
92d570
- Really add dist tag this time
92d570
92d570
* Sun Oct 25 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.4-3
92d570
- Fix issues found during package review: dist tag, git sources
92d570
92d570
* Thu Jul 16 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.4-2
92d570
- Fix EPEL6 build problems
92d570
92d570
* Wed Jul 15 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.4-1
92d570
- new version 3.0.4. Includes security fixes.
92d570
92d570
* Tue May 12 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.3-2
92d570
- Addressed issues found during package review.
92d570
92d570
* Fri May 08 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.3-1
92d570
-  Update to version 3.0.3
92d570
92d570
* Fri May 08 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.2-3
92d570
- Added python3 and hardened build support. Update java building.
92d570
- Various cleanups.
92d570
92d570
* Wed May 06 2015 Stefan Cornelius <scorneli@redhat.com> - 3.0.2-2
92d570
- Update to 3.0.2. Fix 64bit issues. add %%check.
92d570
92d570
* Sat Sep 27 2014 Adel Gadllah <adel.gadllah@gmail.com> - 2.1.2-2
92d570
- Addressed issues found during package review.
92d570
92d570
* Mon May 19 2014 Adel Gadllah <adel.gadllah@gmail.com> - 2.1.2-1
92d570
- Initial package