f7bade0
%global with_docs 1
f7bade0
%global with_check 1
1cc30e9
1cc30e9
%global srcname whitenoise
fdfdf0e
%global commit0 8883095d68e6f9792e1dac97f63225b859b775c8
1cc30e9
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
1cc30e9
%global owner evansd
1cc30e9
1cc30e9
Name:           python-%{srcname}
fdfdf0e
Version:        4.1
fdfdf0e
Release:        1%{?dist}
1cc30e9
Summary:        Static file serving for Python web apps
1cc30e9
1cc30e9
License:        MIT
1cc30e9
URL:            http://whitenoise.evans.io/
1cc30e9
# pypi source does not contain tests
1cc30e9
Source0:        https://github.com/%{owner}/%{srcname}/archive/%{commit0}.tar.gz#/%{srcname}-%{shortcommit0}.tar.gz
1cc30e9
1cc30e9
BuildArch:      noarch
1cc30e9
1cc30e9
%description
1cc30e9
Radically simplified static file serving for python web apps. with a couple of
1cc30e9
lines of config whitenoise allows your web app to serve its own static files,
1cc30e9
making it a self-contained unit that can be deployed anywhere without relying
1cc30e9
on nginx, amazon s3 or any other external service. (Especially useful on
1cc30e9
Heroku, OpenShift and other PaaS providers.)
1cc30e9
1cc30e9
1cc30e9
%package -n python3-%{srcname}
1cc30e9
Summary:        Static file serving for Python web apps
1cc30e9
License:        MIT
1cc30e9
fdfdf0e
BuildRequires:  python3-brotli
1cc30e9
BuildRequires:  python3-devel
1cc30e9
BuildRequires:  python3-django
1cc30e9
BuildRequires:  python3-pytest
1cc30e9
BuildRequires:  python3-requests
1cc30e9
BuildRequires:  python3-setuptools
1cc30e9
Requires:       python3-django
1cc30e9
%{?python_provide:%python_provide python3-%{srcname}}
1cc30e9
442e2b2
1cc30e9
%description -n python3-%{srcname}
1cc30e9
Radically simplified static file serving for python web apps. with a couple of
1cc30e9
lines of config whitenoise allows your web app to serve its own static files,
1cc30e9
making it a self-contained unit that can be deployed anywhere without relying
1cc30e9
on nginx, amazon s3 or any other external service. (especially useful on
1cc30e9
heroku, openshift and other paas providers.)
1cc30e9
1cc30e9
f7bade0
%if 0%{?with_docs}
1cc30e9
%package -n python3-%{srcname}-doc
1cc30e9
Summary:        Documentation for the Python Whitenoise module
1cc30e9
BuildRequires:  python3-sphinx
1cc30e9
BuildRequires:  python3-sphinx_rtd_theme
1cc30e9
1cc30e9
%description -n python3-%{srcname}-doc
1cc30e9
Documentation for the Python Whitenoise module
f7bade0
%endif # with_docs
1cc30e9
1cc30e9
1cc30e9
%prep
f7bade0
%autosetup -n %{srcname}-%{commit0}
1cc30e9
# remove dangling doc symlink
1cc30e9
rm docs/changelog.rst
1cc30e9
# copy common doc files to top dir
1cc30e9
cp -pr docs/ README.rst LICENSE ../
1cc30e9
1cc30e9
1cc30e9
%build
f7bade0
%py3_build
f7bade0
1cc30e9
# Build documentation
f7bade0
%if 0%{?with_docs}
1cc30e9
pushd docs
fdfdf0e
sphinx-build-3 -b html -d build/doctrees . html
1cc30e9
# remove unneeded files which create rpmlint warnings
fdfdf0e
rm -f html/.buildinfo
1cc30e9
popd
f7bade0
%endif # with_docs
1cc30e9
1cc30e9
1cc30e9
%install
f7bade0
%py3_install
1cc30e9
1cc30e9
f7bade0
%if %{?with_check}
1cc30e9
%check
1cc30e9
export DJANGO_SETTINGS_MODULE=tests.django_settings
469a70f
export LANG=en_US.UTF-8
fdfdf0e
python3 -m unittest discover
f7bade0
%endif # with_check
1cc30e9
1cc30e9
1cc30e9
%files -n python3-%{srcname}
fdfdf0e
%doc README.rst
1cc30e9
%license LICENSE
1cc30e9
%{python3_sitelib}/%{srcname}
1cc30e9
%{python3_sitelib}/%{srcname}-%{version}-py3.?.egg-info
1cc30e9
1cc30e9
f7bade0
%if 0%{?with_docs}
1cc30e9
%files -n python3-%{srcname}-doc
fdfdf0e
%doc docs/html
1cc30e9
%license LICENSE
f7bade0
%endif # with_docs
1cc30e9
1cc30e9
1cc30e9
%changelog
fdfdf0e
* Tue Oct 02 2018 Piotr Popieluch <piotr1212@gmail.com> - 4.1-1
fdfdf0e
- Update to 4.1
fdfdf0e
- Remove Python 2 subpackage
fdfdf0e
a277e90
* Sun Jul 29 2018 Piotr Popieluch <piotr1212@gmail.com> - 3.3.1-4
a277e90
- Update python_sitelib to python2_sitelib macro
a277e90
67a0c00
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.1-3
67a0c00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
67a0c00
3ee4eb3
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 3.3.1-2
3ee4eb3
- Rebuilt for Python 3.7
3ee4eb3
469a70f
* Mon Mar 19 2018 Piotr Popieluch <piotr1212@gmail.com> - 3.3.1-2
469a70f
- Update to 3.3.1
469a70f
- Disable checks on python3 until we have support for Django2
469a70f
c40e64f
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-6
c40e64f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c40e64f
f53f2c0
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-5
f53f2c0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f53f2c0
1be8e46
* Fri Jun 30 2017 Piotr Popieluch <piotr1212@gmail.com> - 3.1-4
1be8e46
- Upate requires to include Python version
1be8e46
cc23ffc
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-3
cc23ffc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
cc23ffc
6e97336
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 3.1-2
6e97336
- Rebuild for Python 3.6
6e97336
959cf15
* Sun Sep 25 2016 Piotr Popieluch <piotr1212@gmail.com> - - 3.1-1
959cf15
- Update to 3.1
442e2b2
f7bade0
* Sun Sep 25 2016 Piotr Popieluch <piotr1212@gmail.com> - 2.0.6-5
f7bade0
- Update to newer package guidelines
f7bade0
- EL6 support
f7bade0
438b880
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.6-4
438b880
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
438b880
6e55eb7
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-3
6e55eb7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
6e55eb7
1cc30e9
* Sun Nov 29 2015 Piotr Popieluch <piotr1212@gmail.com> - 2.0.6-2
1cc30e9
- Add license to all subpackages
1cc30e9
- Create a python2 subpackage
1cc30e9
1cc30e9
* Fri Nov 27 2015 Piotr Popieluch <piotr1212@gmail.com> - 2.0.6-1
1cc30e9
- Update to new version
1cc30e9
- Add missing BR
1cc30e9
- Change source from pypi to github
1cc30e9
- Use py.test
1cc30e9
- Add doc subpackage
1cc30e9
1cc30e9
* Tue Nov 10 2015 Piotr Popieluch <piotr1212@gmail.com> - 2.0.4-3
1cc30e9
- Rewrite spec to support EL6 & EL7
1cc30e9
1cc30e9
* Thu Nov 05 2015 Piotr Popieluch <piotr1212@gmail.com> - 2.0.4-2
1cc30e9
- Remove shebang from gzip.py script
1cc30e9
1cc30e9
* Thu Oct 22 2015 Piotr Popieluch <piotr1212@gmail.com> - 2.0.4-1
1cc30e9
- Initial package