]>
Commit | Line | Data |
---|---|---|
cd408d92 MK |
1 | # TODO: |
2 | # - fix tests, needs: manuel and zope.testrunner | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_with doc # don't build doc | |
6 | %bcond_with tests # do not perform "make test" | |
7 | %bcond_without python2 # CPython 2.x module | |
8 | %bcond_without python3 # CPython 3.x module | |
9 | ||
10 | # NOTES: | |
11 | # - 'module' should match the Python import path (first component?) | |
12 | # - 'egg_name' should equal to Python egg name | |
13 | # - 'pypi_name' must match the Python Package Index name | |
14 | %define module ZConfig | |
15 | %define egg_name %{module} | |
16 | %define pypi_name %{module} | |
17 | Summary: Structured Configuration Library | |
18 | Summary(pl.UTF-8): Biblioteka ustrukturyzowanych plików konfiguracyjnych | |
19 | Name: python-%{pypi_name} | |
20 | Version: 3.2.0 | |
a3b4d340 | 21 | Release: 6 |
cd408d92 MK |
22 | License: ZPL 2.1 |
23 | Group: Libraries/Python | |
24 | Source0: https://files.pythonhosted.org/packages/source/Z/%{pypi_name}/%{pypi_name}-%{version}.tar.gz | |
25 | # Source0-md5: 1f7206c3efaaed21e492153156107e89 | |
26 | URL: https://github.com/zopefoundation/ZConfig/ | |
27 | BuildRequires: rpm-pythonprov | |
28 | BuildRequires: rpmbuild(macros) >= 1.714 | |
29 | %if %{with python2} | |
30 | BuildRequires: python-modules | |
31 | BuildRequires: python-setuptools | |
32 | %endif | |
33 | %if %{with python3} | |
34 | BuildRequires: python3-modules | |
35 | BuildRequires: python3-setuptools | |
36 | %endif | |
37 | # when using /usr/bin/env or other in-place substitutions | |
38 | #BuildRequires: sed >= 4.0 | |
39 | # replace with other requires if defined in setup.py | |
40 | Requires: python-modules | |
41 | BuildArch: noarch | |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | %description | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | ||
48 | %package -n python3-%{pypi_name} | |
49 | Summary: - | |
50 | Summary(pl.UTF-8): - | |
51 | Group: Libraries/Python | |
52 | Requires: python3-modules | |
53 | ||
54 | %description -n python3-%{pypi_name} | |
55 | ||
56 | %description -n python3-%{pypi_name} -l pl.UTF-8 | |
57 | ||
58 | %package apidocs | |
59 | Summary: API documentation for Python %{module} module | |
60 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module} | |
61 | Group: Documentation | |
62 | ||
63 | %description apidocs | |
64 | API documentation for Pythona %{module} module. | |
65 | ||
66 | %description apidocs -l pl.UTF-8 | |
67 | Dokumentacja API modułu Pythona %{module}. | |
68 | ||
69 | %prep | |
70 | %setup -q -n %{pypi_name}-%{version} | |
71 | ||
72 | %build | |
73 | %if %{with python2} | |
74 | %py_build %{?with_tests:test} | |
75 | %endif | |
76 | ||
77 | %if %{with python3} | |
78 | %py3_build %{?with_tests:test} | |
79 | %endif | |
80 | ||
81 | %if %{with doc} | |
82 | cd docs | |
83 | %{__make} -j1 html | |
84 | rm -rf _build/html/_sources | |
85 | %endif | |
86 | ||
87 | %install | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %if %{with python2} | |
91 | %py_install | |
92 | ||
93 | # when files are installed in other way that standard 'setup.py | |
94 | # they need to be (re-)compiled | |
95 | # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages! | |
96 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
97 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
98 | ||
99 | %py_postclean | |
100 | %endif | |
101 | ||
102 | %if %{with python3} | |
103 | %py3_install | |
104 | %endif | |
105 | ||
106 | %clean | |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | ||
109 | %if %{with python2} | |
110 | %files | |
111 | %defattr(644,root,root,755) | |
112 | %doc CHANGES.rst README.rst | |
113 | %{py_sitescriptdir}/%{module} | |
114 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
115 | %endif | |
116 | ||
117 | %if %{with python3} | |
118 | %files -n python3-%{pypi_name} | |
119 | %defattr(644,root,root,755) | |
120 | %doc CHANGES.rst README.rst | |
121 | %{py3_sitescriptdir}/%{module} | |
122 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
123 | %attr(755,root,root) %{_bindir}/zconfig | |
124 | %attr(755,root,root) %{_bindir}/zconfig_schema2html | |
125 | %endif | |
126 | ||
127 | %if %{with doc} | |
128 | %files apidocs | |
129 | %defattr(644,root,root,755) | |
130 | %doc docs/_build/html/* | |
131 | %endif |