pyelftools/pyelftools.spec

187 lines
5.7 KiB
RPMSpec
Raw Normal View History

2014-10-05 08:37:25 +00:00
%if 0%{?fedora} || 0%{?rhel} >= 8
2013-10-02 14:53:58 +00:00
%global __python_sitelib %{python2_sitelib}
2013-10-02 14:35:32 +00:00
%else
2013-10-02 14:53:58 +00:00
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%global __python_sitelib %{python_sitelib}
2013-10-02 14:35:32 +00:00
%{?__python2:%global __python2 %{__python}}
%endif
2013-08-16 18:14:27 +00:00
%global debug_package %{nil}
%global commitdate 20130619
%global commit a1d968102e82fea06692c367849bc25418780f77
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: pyelftools
Version: 0.22
Release: 0.11.git%{commitdate}.%{shortcommit}%{?dist}
2013-08-16 18:14:27 +00:00
Summary: Pure-Python library for parsing and analyzing ELF files
License: Public Domain
URL: https://github.com/eliben/%{name}
# We 'll use git snapshots, because upstream keeps master-branch
# in a usable, working state. See:
# https://github.com/eliben/pyelftools/wiki/Hacking-guide#contributing
Source0: %{url}/archive/%{commit}/%{name}-%{version}.git%{commitdate}.%{shortcommit}.tar.gz
Patch0: pyelftools-0.22-construct.patch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-construct
2014-10-05 08:37:25 +00:00
%if 0%{?fedora} || 0%{?rhel} >= 8
2013-08-16 18:14:27 +00:00
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-construct
%endif
%description
Pure-Python library for parsing and analyzing ELF files
and DWARF debugging information.
%package -n python-%{name}
Summary: Pure-Python library for parsing and analyzing ELF files
BuildArch: noarch
Requires: python-construct
Provides: %{name} = %{version}-%{release}
%description -n python-%{name}
Pure-Python library for parsing and analyzing ELF files
and DWARF debugging information.
2014-10-05 08:37:25 +00:00
%if 0%{?fedora} || 0%{?rhel} >= 8
2013-08-16 18:14:27 +00:00
%package -n python3-%{name}
Summary: Pure-Python library for parsing and analyzing ELF files
BuildArch: noarch
Requires: python3-construct
%description -n python3-%{name}
Pure-Python library for parsing and analyzing ELF files
and DWARF debugging information.
%endif
%prep
%setup -qn %{name}-%{commit}
%patch0 -p1
# remove bundled construct lib
rm -rf elftools/construct
# python3-package
2014-10-05 08:37:25 +00:00
%if 0%{?fedora} || 0%{?rhel} >= 8
2013-08-16 18:14:27 +00:00
rm -rf %{py3dir}
cp -a . %{py3dir}
# fix hashbang
sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/python3|' %{py3dir}/scripts/readelf.py
%endif
sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/python2|' scripts/readelf.py
%build
2013-10-02 14:35:32 +00:00
%{__python2} setup.py build
2013-08-16 18:14:27 +00:00
2014-10-05 08:37:25 +00:00
%if 0%{?fedora} || 0%{?rhel} >= 8
2013-08-16 18:14:27 +00:00
pushd %{py3dir}
%{__python3} setup.py build
%endif
%install
2013-10-02 14:35:32 +00:00
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
2013-08-16 18:14:27 +00:00
mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/pyreadelf
2014-10-05 08:37:25 +00:00
%if 0%{?fedora} || 0%{?rhel} >= 8
2013-08-16 18:14:27 +00:00
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/py3readelf
%endif
%check
2013-10-02 14:35:32 +00:00
%{__python2} test/run_all_unittests.py
%{__python2} test/run_examples_test.py
2013-08-16 18:14:27 +00:00
# tests may fail because of differences in output-formatting
# from binutils' readelf. See:
# https://github.com/eliben/pyelftools/wiki/Hacking-guide#tests
2013-10-02 14:35:32 +00:00
%{__python2} test/run_readelf_tests.py || :
2013-08-16 18:14:27 +00:00
2014-10-05 08:37:25 +00:00
%if 0%{?fedora} || 0%{?rhel} >= 8
2013-08-16 18:14:27 +00:00
%{__python3} test/run_all_unittests.py
%{__python3} test/run_examples_test.py
# tests may fail because of differences in output-formatting
# from binutils' readelf. See:
# https://github.com/eliben/pyelftools/wiki/Hacking-guide#tests
%{__python3} test/run_readelf_tests.py || :
%endif
%files -n python-%{name}
%doc CHANGES LICENSE README* TODO
2013-10-02 14:35:32 +00:00
%{__python_sitelib}/*elftools*
2013-08-16 18:14:27 +00:00
%{_bindir}/pyreadelf
2014-10-05 08:37:25 +00:00
%if 0%{?fedora} || 0%{?rhel} >= 8
2013-08-16 18:14:27 +00:00
%files -n python3-%{name}
%doc CHANGES LICENSE README* TODO
%{python3_sitelib}/*elftools*
%{_bindir}/py3readelf
%endif
%changelog
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.22-0.11.git20130619.a1d9681
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2016-12-19 17:20:36 +00:00
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.22-0.10.git20130619.a1d9681
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22-0.9.git20130619.a1d9681
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.22-0.8.git20130619.a1d9681
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22-0.7.git20130619.a1d9681
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22-0.6.git20130619.a1d9681
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22-0.5.git20130619.a1d9681
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22-0.4.git20130619.a1d9681
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 0.22-0.3.git20130619.a1d9681
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
2013-10-02 14:35:32 +00:00
* Wed Oct 02 2013 Björn Esser <bjoern.esser@gmail.com> - 0.22-0.2.git20130619.a1d9681
- adaptions for new Python-guidelines
2013-08-16 18:14:27 +00:00
* Fri Aug 16 2013 Björn Esser <bjoern.esser@gmail.com> - 0.22-0.1.git20130619.a1d9681
- update to latest pre-release git snapshot
- add python3-package
- build on all arches to get some conclusion from testsuite,
but create noarch pkgs
* Sat Jun 08 2013 Terje Rosten <terje.rosten@ntnu.no> - 0.21-2
- Remove bundled construct lib
* Thu May 09 2013 Terje Rosten <terje.rosten@ntnu.no> - 0.21-1
- 0.21
- Run test
- Updated source url
- Drop defattr
* Wed Jun 06 2012 Kushal Das <kushal@fedoraproject.org> 0.20-1
- Intial package (#829676)