%if 0%{?fedora}
%global with_python3 1
%else
%global with_python3 0
%endif
Name: python-gccinvocation
Version: 0.1
Release: 15%{?dist}
Summary: Library for parsing GCC command-line options
License: LGPLv2+
URL: https://github.com/fedora-static-analysis/gccinvocation
Source0: https://pypi.python.org/packages/source/g/gccinvocation/gccinvocation-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
%if 0%{?with_python3}
BuildRequires: python3-devel
# ^^^: used during selftests
%endif
%global _description\
"gccinvocation" is a python module that can parse gcc command lines and\
extract data of interest e.g. include paths, defines, etc.
%description %_description
%package -n python2-gccinvocation
Summary: %summary
%{?python_provide:%python_provide python2-gccinvocation}
%description -n python2-gccinvocation %_description
%if 0%{?with_python3}
%package -n python3-gccinvocation
Summary: Library for parsing GCC command-line options
Group: Applications/System
%description -n python3-gccinvocation
"gccinvocation" is a python module that can parse gcc command lines and
extract data of interest e.g. include paths, defines, etc.
%endif # with_python3
%prep
%setup -q -n gccinvocation-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3
%build
%{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # with_python3
%install
%{__python} setup.py install --skip-build --root %{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # with_python3
%check
%{__python} gccinvocation.py -v
%if 0%{?with_python3}
%{__python3} gccinvocation.py -v
%endif # with_python3
%files -n python2-gccinvocation
%doc README.rst lgpl-2.1.txt
%{python_sitelib}/gccinvocation-%{version}-py2.?.egg-info
%{python_sitelib}/gccinvocation.py
%{python_sitelib}/gccinvocation.py[co]
%files -n python3-gccinvocation
%if 0%{?with_python3}
%doc README.rst lgpl-2.1.txt
%{python3_sitelib}/gccinvocation-%{version}-py3.?.egg-info
%{python3_sitelib}/gccinvocation.py
%{python3_sitelib}/__pycache__/gccinvocation.cpython-*.py[co]
%endif # with_python3
%changelog
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.1-15
- Rebuilt for Python 3.7
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.1-13
- Python 2 binary package renamed to python2-gccinvocation
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.1-10
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-9
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Tue Jun 25 2013 David Malcolm <dmalcolm@redhat.com> - 0.1-2
- remove redundant clean of buildroot from install phase; change BR from
python-devel to python2-devel; add trailing period to description
* Fri May 31 2013 David Malcolm <dmalcolm@redhat.com> - 0.1-1
- initial packaging