%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-q
Version: 2.4
Release: 1%{?dist}
Summary: Quick and dirty python debugging output
License: ASL 2.0
URL: https://pypi.python.org/pypi/q
Source0: https://pypi.python.org/packages/source/q/q/q-%{version}.tar.gz
# Fix for using @q decorator
# Submitted upstream: https://github.com/zestyping/q/pull/11
Patch0: https://github.com/zestyping/q/pull/11.diff
# Python3 support
# https://github.com/zestyping/q/pull/9
Patch1: https://github.com/zestyping/q/pull/9.patch
BuildArch: noarch
BuildRequires: python2-devel
%if 0%{?with_python3}
BuildRequires: python3-devel
%endif # with_python3
%description
If you've ever been frustrated trying to debug with print because a web
application or a unittesting framework is swallowing your debugging output,
q will make you jump for joy.
import q
variable = 'Hmmm... something happened here'
q(variable)
cat /tmp/q
%if 0%{?with_python3}
%package -n python3-q
Summary: Quick and dirty python3 debugging output
%description -n python3-q
If you've ever been frustrated trying to debug with print because a web
application or a unittesting framework is swallowing your debugging output,
q will make you jump for joy.
import q
variable = 'Hmmm... something happened here'
q(variable)
cat /tmp/q
This package contains the q module for python3
%endif # with_python3
%prep
%setup -q -n q-%{version}
%patch0 -p1
%patch1 -p1
%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
rm -rf %{buildroot}
%{__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
%files
%doc README.md
%{python_sitelib}/*
%if 0%{?with_python3}
%files -n python3-q
%doc README.md
%{python3_sitelib}/*
%endif # with_python3
%changelog
* Wed May 22 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 2.4-1
- New upstream with some enhancements from severl people.
- Build with python3 support.
* Thu Apr 11 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 2.3-2
- New upstream release.
- README file from upstream's SCM
- Note patches we have for upstream
* Tue Mar 19 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1-1
- Initial Fedora build