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

Name:           python-django-debug-toolbar
Version:        1.3.0
Release:        2%{?dist}
Summary:        Configurable set of panels that display various debug information

License:        BSD
URL:            https://github.com/django-debug-toolbar/django-debug-toolbar
Source0:        http://pypi.python.org/packages/source/d/django-debug-toolbar/django-debug-toolbar-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  python-sqlparse
BuildRequires:  python-django
Requires:       python-django

%description
The Django Debug Toolbar is a configurable set of panels that display various
debug information about the current request/response and when clicked, display 
more details about the panel's content.

Currently, the following panels have been written and are working:

 -   Django version
 -   Request timer
 -   A list of settings in settings.py
 -   Common HTTP headers
 -   GET/POST/cookie/session variable display
 -   Templates and context used, and their template paths
 -   SQL queries including time to execute and links to EXPLAIN each query
 -   List of signals, their args and receivers
 -   Logging output via Python's built-in logging, or via the logbook module

%if 0%{?with_python3}
%package -n python3-django-debug-toolbar
Requires:      python3-django
BuildRequires: python3-django

Summary:       Configurable set of panels that display various debug information

%description -n python3-django-debug-toolbar
The Django Debug Toolbar is a configurable set of panels that display various
debug information about the current request/response and when clicked, display 
more details about the panel's content.

Currently, the following panels have been written and are working:

 -   Django version
 -   Request timer
 -   A list of settings in settings.py
 -   Common HTTP headers
 -   GET/POST/cookie/session variable display
 -   Templates and context used, and their template paths
 -   SQL queries including time to execute and links to EXPLAIN each query
 -   List of signals, their args and receivers
 -   Logging output via Python's built-in logging, or via the logbook module

%endif

%prep
%setup -qc
mv django-debug-toolbar-%{version} python2
pushd python2

# copy LICENSE etc. to top level dir
cp -a LICENSE ..
cp -a README.rst PKG-INFO ..

# remove bundled egg-info
rm -rf django_debug_toolbar.egg-info

# "Fix" zero length file error
echo "# empty file" > debug_toolbar/models.py
popd

%if 0%{?with_python3}
cp -a python2 python3
%endif # with_python3

%build
pushd python2
%{__python2} setup.py build
popd

%if 0%{?with_python3}
pushd python3
%{__python3} setup.py build
popd
%endif # with_python3

%install
%if 0%{?with_python3}
pushd python3
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # with_python3

pushd python2
%{__python2} setup.py install --skip-build --root %{buildroot}
popd

%check
pushd python2
%{__python2} setup.py test
popd

%files
%doc README.rst PKG-INFO
%license LICENSE
%{python2_sitelib}/debug_toolbar
%{python2_sitelib}/django_debug_toolbar-%{version}-py%{python_version}.egg-info

%if %{with_python3}
%files -n python3-django-debug-toolbar
%doc README.rst PKG-INFO
%license LICENSE
%{python3_sitelib}/debug_toolbar
%{python3_sitelib}/django_debug_toolbar-%{version}-py%{python3_version}.egg-info
%endif

%changelog
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Mar 13 2015 Matthias Runge <mrunge@redhat.com> - 1.3.0-1
- update to 1.3.0
- modernize spec, add python3 support

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue Jan 07 2014 Matthias Runge <mrunge@redhat.com> - 1.0.1-1
- update to 1.0.1 (rhbz#1049249)

* Thu Jan 02 2014 Matthias Runge <mrunge@redhat.com> - 1.0-1
- update to version 1.0 (rhbz#1023925)

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Mon Aug 06 2012 Matthias Runge <mrunge@matthias-runge.de> - 0.9.4-1
- update to upstream version 0.9.4

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Mar 23 2012 Matthias Runge <mrunge@matthias-runge.de> 0.9.3-2
- change requirement from Django to python-django

* Mon Jan 23 2012 Matthias Runge <mrunge@matthias-runge.de> 0.9.3-1
- initial packaging