%if 0%{?fedora} > 12 %global with_python3 1 %endif %global modname q Name: python-q Version: 2.3 Release: 1%{?dist} Summary: Quick-and-dirty debugging output for tired programmers Group: Development/Libraries License: ASL 2.0 URL: http://pypi.python.org/pypi/q Source0: http://pypi.python.org/packages/source/%{modname}/%{modname}/%{modname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel %if 0%{?with_python3} BuildRequires: python3-devel %endif %description Quick-and-dirty debugging output for tired programmers. %if 0%{?with_python3} %package -n python3-q Summary: Quick-and-dirty debugging output for tired programmers Group: Development/Libraries %description -n python3-q Quick-and-dirty debugging output for tired programmers. %endif %prep %setup -q -n %{modname}-%{version} # Remove bundled egg-info in case it exists rm -rf %{modname}.egg-info %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root=%{buildroot} popd %endif %{__python} setup.py install -O1 --skip-build --root=%{buildroot} %files %doc PKG-INFO %{python_sitelib}/%{modname}.py* %{python_sitelib}/%{modname}-%{version}* %if 0%{?with_python3} %files -n python3-q %doc PKG-INFO %{python3_sitelib}/%{modname}.py %{python3_sitelib}/__pycache__/%{modname}.* %{python3_sitelib}/%{modname}-%{version}-* %endif %changelog * Wed Apr 10 2013 Ralph Bean - 2.3-1 - Initial package for Fedora