]> git.pld-linux.org Git - packages/python-django-appconf.git/blob - python-django-appconf.spec
rebuild with python 3.10
[packages/python-django-appconf.git] / python-django-appconf.spec
1 #
2 # Conditional build:
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
7
8 %define module          appconf
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}
13 Version:        1.0.2
14 Release:        6
15 License:        BSD
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
22 %if %{with python2}
23 BuildRequires:  python-modules
24 BuildRequires:  python-setuptools
25 %if %{with tests}
26 BuildRequires:  python-coverage
27 BuildRequires:  python-django
28 BuildRequires:  python-django-discover-runner
29 BuildRequires:  python-flake8
30 %endif
31 %endif
32 %if %{with doc}
33 BuildRequires:  sphinx-pdg-2
34 %endif
35 %if %{with python3}
36 BuildRequires:  python3-modules
37 BuildRequires:  python3-setuptools
38 %if %{with tests}
39 BuildRequires:  python3-coverage
40 BuildRequires:  python3-django
41 BuildRequires:  python3-django-discover-runner
42 BuildRequires:  python3-flake8
43 %endif
44 %endif
45 Requires:       python-django
46 BuildArch:      noarch
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49 %description
50 A helper class for handling configuration defaults of packaged Django
51 apps gracefully.
52
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
57
58 %description -n python3-%{pypi_name}
59 A helper class for handling configuration defaults of packaged Django
60 apps gracefully.
61
62 %package apidocs
63 Summary:        %{pypi_name} API documentation
64 Summary(pl.UTF-8):      Dokumentacja API %{pypi_name}
65 Group:          Documentation
66
67 %description apidocs
68 API documentation for %{pypi_name}.
69
70 %description apidocs -l pl.UTF-8
71 Dokumentacja API %{pypi_name}.
72
73 %prep
74 %setup -q -n %{pypi_name}-%{version}
75
76 %build
77 %if %{with python2}
78 %py_build %{?with_tests:test}
79
80 %if %{with tests}
81 export PYTHONPATH=.:$PYTHONPATH
82 export DJANGO_SETTINGS_MODULE=tests.test_settings
83 coverage run %{_bindir}/django-admin test -v2 test
84 %endif
85
86 %endif
87
88 %if %{with python3}
89 %py3_build %{?with_tests:test}
90 %endif
91
92 %if %{with doc}
93 # generate html docs
94 sphinx-build-2 docs html
95 # remove the sphinx-build leftovers
96 rm -r html/.{doctrees,buildinfo}
97 %endif
98
99 %install
100 %if %{with python2}
101 %py_install
102 %py_postclean
103 %endif
104
105 %if %{with python3}
106 %py3_install
107 %endif
108
109 %clean
110 rm -rf $RPM_BUILD_ROOT
111
112 %if %{with python2}
113 %files
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
118 %endif
119
120 %if %{with python3}
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
126 %endif
127
128 %if %{with doc}
129 %files apidocs
130 %defattr(644,root,root,755)
131 %doc html/*
132 %endif
This page took 0.103822 seconds and 3 git commands to generate.