adaptions for new Python-guidelines
This commit is contained in:
parent
8b33398520
commit
0df0c98029
@ -1,3 +1,11 @@
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
||||
%global __python_sitearch %{python2_sitearch}
|
||||
%else
|
||||
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
|
||||
%global __python_sitearch %{python_sitearch}
|
||||
%{?__python2:%global __python2 %{__python}}
|
||||
%endif
|
||||
|
||||
%global debug_package %{nil}
|
||||
%global commitdate 20130619
|
||||
%global commit a1d968102e82fea06692c367849bc25418780f77
|
||||
@ -5,7 +13,7 @@
|
||||
|
||||
Name: pyelftools
|
||||
Version: 0.22
|
||||
Release: 0.1.git%{commitdate}.%{shortcommit}%{?dist}
|
||||
Release: 0.2.git%{commitdate}.%{shortcommit}%{?dist}
|
||||
Summary: Pure-Python library for parsing and analyzing ELF files
|
||||
|
||||
License: Public Domain
|
||||
@ -78,7 +86,7 @@ sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/python2|' scripts/readelf.py
|
||||
|
||||
|
||||
%build
|
||||
%{__python} setup.py build
|
||||
%{__python2} setup.py build
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
||||
pushd %{py3dir}
|
||||
@ -87,7 +95,7 @@ pushd %{py3dir}
|
||||
|
||||
|
||||
%install
|
||||
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
|
||||
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
|
||||
mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/pyreadelf
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
||||
@ -98,12 +106,12 @@ mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/py3readelf
|
||||
|
||||
|
||||
%check
|
||||
%{__python} test/run_all_unittests.py
|
||||
%{__python} test/run_examples_test.py
|
||||
%{__python2} test/run_all_unittests.py
|
||||
%{__python2} 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
|
||||
%{__python} test/run_readelf_tests.py || :
|
||||
%{__python2} test/run_readelf_tests.py || :
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
||||
%{__python3} test/run_all_unittests.py
|
||||
@ -117,7 +125,7 @@ mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/py3readelf
|
||||
|
||||
%files -n python-%{name}
|
||||
%doc CHANGES LICENSE README* TODO
|
||||
%{python_sitelib}/*elftools*
|
||||
%{__python_sitelib}/*elftools*
|
||||
%{_bindir}/pyreadelf
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
||||
@ -129,6 +137,9 @@ mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/py3readelf
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Oct 02 2013 Björn Esser <bjoern.esser@gmail.com> - 0.22-0.2.git20130619.a1d9681
|
||||
- adaptions for new Python-guidelines
|
||||
|
||||
* 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
|
||||
|
Loading…
Reference in New Issue
Block a user