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