3 %bcond_with doc # don't build doc
4 %bcond_with tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
9 %define egg_name django_appconf
10 %define pypi_name django-appconf
11 Summary: A helper class for handling configuration defaults of packaged apps gracefully
12 Name: python-%{pypi_name}
16 Source0: https://files.pythonhosted.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: cc11511a47088bc56531df67cd5d6261
18 Group: Libraries/Python
19 URL: http://pypi.python.org/pypi/django-appconf/
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-modules
24 BuildRequires: python-setuptools
26 BuildRequires: python-coverage
27 BuildRequires: python-django
28 BuildRequires: python-django-discover-runner
29 BuildRequires: python-flake8
33 BuildRequires: sphinx-pdg-2
36 BuildRequires: python3-modules
37 BuildRequires: python3-setuptools
39 BuildRequires: python3-coverage
40 BuildRequires: python3-django
41 BuildRequires: python3-django-discover-runner
42 BuildRequires: python3-flake8
45 Requires: python-django
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 A helper class for handling configuration defaults of packaged Django
53 %package -n python3-%{pypi_name}
54 Summary: A helper class for handling configuration defaults of packaged apps gracefully
55 Group: Libraries/Python
56 Requires: python3-django
58 %description -n python3-%{pypi_name}
59 A helper class for handling configuration defaults of packaged Django
63 Summary: %{pypi_name} API documentation
64 Summary(pl.UTF-8): Dokumentacja API %{pypi_name}
68 API documentation for %{pypi_name}.
70 %description apidocs -l pl.UTF-8
71 Dokumentacja API %{pypi_name}.
74 %setup -q -n %{pypi_name}-%{version}
78 %py_build %{?with_tests:test}
81 export PYTHONPATH=.:$PYTHONPATH
82 export DJANGO_SETTINGS_MODULE=tests.test_settings
83 coverage run %{_bindir}/django-admin test -v2 test
89 %py3_build %{?with_tests:test}
94 sphinx-build-2 docs html
95 # remove the sphinx-build leftovers
96 rm -r html/.{doctrees,buildinfo}
110 rm -rf $RPM_BUILD_ROOT
114 %defattr(644,root,root,755)
115 %doc README.rst LICENSE
116 %{py_sitescriptdir}/%{module}
117 %{py_sitescriptdir}/%{egg_name}-%{version}-py%{py_ver}.egg-info
121 %files -n python3-%{pypi_name}
122 %defattr(644,root,root,755)
123 %doc README.rst LICENSE
124 %{py3_sitescriptdir}/%{module}
125 %{py3_sitescriptdir}/%{egg_name}-%{version}-py%{py3_ver}.egg-info
130 %defattr(644,root,root,755)