From 3842551cef42793daff7c0c27e573cf6f1f9b514 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Fri, 6 Jan 2017 16:15:00 -0700 Subject: [PATCH] Ship python2-pycparser Modernize spec --- python-pycparser.spec | 57 +++++++++++++++++++++++-------------------- sources | 1 - 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/python-pycparser.spec b/python-pycparser.spec index 87975dd..e2fba73 100644 --- a/python-pycparser.spec +++ b/python-pycparser.spec @@ -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 - 2.14-9 +- Ship python2-pycparser +- Modernize spec + * Fri Dec 09 2016 Charalampos Stratakis - 2.14-8 - Rebuild for Python 3.6 diff --git a/sources b/sources index 7cba823..01a75b8 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -82ab1fa524198908050550e7780b85e1 release_v2.10.tar.gz dfa652c012a97ed0168889797873b73f release_v2.14.tar.gz