Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%else
%global with_python3 0
%endif

Name:           python-gccinvocation
Version:        0.1
Release:        2%{?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

%description
"gccinvocation" is a python module that can parse gcc command lines and
extract data of interest e.g. include paths, defines, etc.

%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
%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-3?.py[co]
%endif # with_python3


%changelog
* 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