# needed for building on EL6 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} # Python3 is currently only available on Fedora %if 0%{?fedora} %global with_python3 1 %endif %global srcname whitenoise %global commit0 9fafc3843781d8934ef34e9f76dc1d10052916cf %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global owner evansd Name: python-%{srcname} Version: 2.0.6 Release: 2%{?dist} Summary: Static file serving for Python web apps License: MIT URL: http://whitenoise.evans.io/ # pypi source does not contain tests Source0: https://github.com/%{owner}/%{srcname}/archive/%{commit0}.tar.gz#/%{srcname}-%{shortcommit0}.tar.gz BuildArch: noarch %description Radically simplified static file serving for python web apps. with a couple of lines of config whitenoise allows your web app to serve its own static files, making it a self-contained unit that can be deployed anywhere without relying on nginx, amazon s3 or any other external service. (Especially useful on Heroku, OpenShift and other PaaS providers.) %package -n python2-%{srcname} Summary: Static file serving for Python web apps License: MIT BuildRequires: python2-devel BuildRequires: python-django BuildRequires: python-requests BuildRequires: python-setuptools BuildRequires: pytest Requires: python-django %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} Radically simplified static file serving for python web apps. with a couple of lines of config whitenoise allows your web app to serve its own static files, making it a self-contained unit that can be deployed anywhere without relying on nginx, amazon s3 or any other external service. (Especially useful on Heroku, OpenShift and other PaaS providers.) %package -n python2-%{srcname}-doc Summary: Documentation for the Python Whitenoise module BuildRequires: python-sphinx BuildRequires: python-sphinx_rtd_theme # Can be removed after RHBZ#1282297 is pushed BuildRequires: fontawesome-fonts-web %description -n python2-%{srcname}-doc Documentation for the Python Whitenoise module %if 0%{?with_python3} %package -n python3-%{srcname} Summary: Static file serving for Python web apps License: MIT BuildRequires: python3-devel BuildRequires: python3-django BuildRequires: python3-pytest BuildRequires: python3-requests BuildRequires: python3-setuptools Requires: python3-django %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} Radically simplified static file serving for python web apps. with a couple of lines of config whitenoise allows your web app to serve its own static files, making it a self-contained unit that can be deployed anywhere without relying on nginx, amazon s3 or any other external service. (especially useful on heroku, openshift and other paas providers.) %package -n python3-%{srcname}-doc Summary: Documentation for the Python Whitenoise module BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme # Can be removed after RHBZ#1282297 is pushed BuildRequires: fontawesome-fonts-web %description -n python3-%{srcname}-doc Documentation for the Python Whitenoise module %endif # with_python3 %prep %setup -qc mv %{srcname}-%{commit0} python2 pushd python2 # remove dangling doc symlink rm docs/changelog.rst # copy common doc files to top dir cp -pr docs/ README.rst LICENSE ../ popd %if 0%{?with_python3} cp -a python2 python3 %endif # with_python3 %build pushd python2 %{__python} setup.py build # Build documentation pushd docs sphinx-build -b html -d build/doctrees . build/html # remove unneeded files which create rpmlint warnings rm -f build/html/.buildinfo rm -f build/html/objects.inv popd popd %if 0%{?with_python3} pushd python3 %{__python3} setup.py build # Build documentation pushd docs sphinx-build-3 -b html -d build/doctrees . build/html # remove unneeded files which create rpmlint warnings rm -f build/html/.buildinfo rm -f build/html/objects.inv popd 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 %{__python} setup.py install --skip-build --root %{buildroot} popd %check export DJANGO_SETTINGS_MODULE=tests.django_settings pushd python2 py.test popd %if 0%{?with_python3} pushd python3 py.test-3 popd %endif # with_python3 %files -n python2-%{srcname} %doc README.rst docs/ %{!?_licensedir:%global license %%doc} %license LICENSE %{python_sitelib}/%{srcname} %{python_sitelib}/%{srcname}-%{version}-py2.?.egg-info %files -n python2-%{srcname}-doc %doc python2/docs/build/html %license LICENSE %if 0%{?with_python3} %files -n python3-%{srcname} %doc README.rst docs/ %license LICENSE %{python3_sitelib}/%{srcname} %{python3_sitelib}/%{srcname}-%{version}-py3.?.egg-info %files -n python3-%{srcname}-doc %doc python3/docs/build/html %license LICENSE %endif # with_python3 %changelog * Sun Nov 29 2015 Piotr Popieluch - 2.0.6-2 - Add license to all subpackages - Create a python2 subpackage * Fri Nov 27 2015 Piotr Popieluch - 2.0.6-1 - Update to new version - Add missing BR - Change source from pypi to github - Use py.test - Add doc subpackage * Tue Nov 10 2015 Piotr Popieluch - 2.0.4-3 - Rewrite spec to support EL6 & EL7 * Thu Nov 05 2015 Piotr Popieluch - 2.0.4-2 - Remove shebang from gzip.py script * Thu Oct 22 2015 Piotr Popieluch - 2.0.4-1 - Initial package