Ship python2-pycparser
Modernize spec
This commit is contained in:
parent
e840c4099b
commit
3842551cef
@ -1,13 +1,11 @@
|
||||
%if 0%{?fedora} > 12
|
||||
%if 0%{?fedora}
|
||||
%global with_python3 1
|
||||
%else
|
||||
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
|
||||
%endif
|
||||
|
||||
Name: python-pycparser
|
||||
Summary: C parser and AST generator written in Python
|
||||
Version: 2.14
|
||||
Release: 8%{?dist}
|
||||
Release: 9%{?dist}
|
||||
License: BSD
|
||||
Group: System Environment/Libraries
|
||||
URL: http://github.com/eliben/pycparser
|
||||
@ -33,18 +31,28 @@ BuildRequires: python3-devel python3-setuptools
|
||||
BuildRequires: python3-ply
|
||||
%endif # if with_python3
|
||||
|
||||
Requires: python-ply >= 3.6
|
||||
|
||||
%description
|
||||
pycparser is a complete parser for the C language, written in pure Python.
|
||||
It is a module designed to be easily integrated into applications that
|
||||
need to parse C source code.
|
||||
|
||||
%package -n python2-pycparser
|
||||
Summary: C parser and AST generator written in Python
|
||||
Group: System Environment/Libraries
|
||||
Requires: python-ply >= 3.6
|
||||
%{?python_provide:%python_provide python2-pycparser}
|
||||
|
||||
%description -n python2-pycparser
|
||||
pycparser is a complete parser for the C language, written in pure Python.
|
||||
It is a module designed to be easily integrated into applications that
|
||||
need to parse C source code.
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%package -n python3-pycparser
|
||||
Summary: C parser and AST generator written in Python
|
||||
Group: System Environment/Libraries
|
||||
Requires: python3-ply
|
||||
%{?python_provide:%python_provide python3-pycparser}
|
||||
|
||||
%description -n python3-pycparser
|
||||
pycparser is a complete parser for the C language, written in pure Python.
|
||||
@ -60,60 +68,55 @@ need to parse C source code.
|
||||
rm -rf pycparser/ply
|
||||
|
||||
# examples
|
||||
%{__python} %{SOURCE1} examples
|
||||
%{__python2} %{SOURCE1} examples
|
||||
dos2unix LICENSE
|
||||
|
||||
%if 0%{?with_python3}
|
||||
rm -rf %{py3dir}
|
||||
cp -a . %{py3dir}
|
||||
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
|
||||
%endif # with_python3
|
||||
|
||||
%build
|
||||
%{__python} setup.py build
|
||||
%py2_build
|
||||
pushd build/lib/pycparser
|
||||
%{__python} _build_tables.py
|
||||
%{__python2} _build_tables.py
|
||||
popd
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py build
|
||||
%py3_build
|
||||
pushd build/lib/pycparser
|
||||
%{__python3} _build_tables.py
|
||||
popd
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
%install
|
||||
%{__python} setup.py install --skip-build --root %{buildroot}
|
||||
%py2_install
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py install --skip-build --root %{buildroot}
|
||||
popd
|
||||
%py3_install
|
||||
%endif # with_python3
|
||||
|
||||
%check
|
||||
%{__python} tests/all_tests.py
|
||||
%{__python2} tests/all_tests.py
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%{__python3} tests/all_tests.py
|
||||
pushd %{py3dir}
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
%files
|
||||
%doc examples LICENSE
|
||||
%files -n python2-pycparser
|
||||
%license LICENSE
|
||||
%doc examples
|
||||
%{python_sitelib}/pycparser/
|
||||
%{python_sitelib}/pycparser-*.egg-info
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%files -n python3-pycparser
|
||||
%license LICENSE
|
||||
%doc examples
|
||||
%{python3_sitelib}/pycparser/
|
||||
%{python3_sitelib}/pycparser-*.egg-info
|
||||
%endif # with_python3
|
||||
|
||||
%changelog
|
||||
* Fri Jan 6 2017 Orion Poplawski <orion@cora.nwra.com> - 2.14-9
|
||||
- Ship python2-pycparser
|
||||
- Modernize spec
|
||||
|
||||
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 2.14-8
|
||||
- Rebuild for Python 3.6
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user