]>
Commit | Line | Data |
---|---|---|
a0a71f6f JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests (installed package required) | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module zope.i18nmessageid | |
9 | Summary: Message Identifiers for internationalization | |
10 | Summary(pl.UTF-8): Identyfikatory komunikatów do lokalizacji | |
11 | Name: python-%{module} | |
12 | Version: 5.0.1 | |
9a6320fe | 13 | Release: 3 |
a0a71f6f JB |
14 | License: ZPL v2.1 |
15 | Group: Libraries/Python | |
16 | Source0: https://files.pythonhosted.org/packages/source/z/zope.i18nmessageid/zope.i18nmessageid-%{version}.tar.gz | |
17 | # Source0-md5: 2ee5f51c26e2a5a040ba2defb3f9d8a7 | |
18 | URL: https://www.zope.dev/ | |
19 | %if %{with python2} | |
20 | BuildRequires: python >= 1:2.7 | |
21 | BuildRequires: python-devel >= 1:2.7 | |
22 | BuildRequires: python-setuptools | |
23 | %if %{with tests} | |
24 | BuildRequires: python-six | |
25 | BuildRequires: python-zope.testing | |
26 | BuildRequires: python-zope.testrunner | |
27 | %endif | |
28 | %endif | |
29 | %if %{with python3} | |
30 | BuildRequires: python3 >= 1:3.5 | |
31 | BuildRequires: python3-devel >= 1:3.5 | |
32 | BuildRequires: python3-setuptools | |
33 | %if %{with tests} | |
34 | BuildRequires: python3-six | |
35 | BuildRequires: python3-zope.testing | |
36 | BuildRequires: python3-zope.testrunner | |
37 | %endif | |
38 | %endif | |
39 | BuildRequires: rpm-pythonprov | |
40 | BuildRequires: rpmbuild(macros) >= 1.714 | |
41 | %if %{with doc} | |
42 | BuildRequires: sphinx-pdg | |
43 | %endif | |
44 | Requires: python-modules >= 1:2.7 | |
a0a71f6f JB |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
46 | ||
47 | %description | |
48 | Message Identifiers for internationalization. | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | Identyfikatory komunikatów do lokalizacji. | |
52 | ||
53 | %package -n python3-%{module} | |
54 | Summary: Message Identifiers for internationalization | |
55 | Summary(pl.UTF-8): Identyfikatory komunikatów do lokalizacji | |
56 | Group: Libraries/Python | |
57 | Requires: python3-modules >= 1:3.5 | |
58 | ||
59 | %description -n python3-%{module} | |
60 | Message Identifiers for internationalization. | |
61 | ||
62 | %description -n python3-%{module} -l pl.UTF-8 | |
63 | Identyfikatory komunikatów do lokalizacji. | |
64 | ||
65 | %package apidocs | |
66 | Summary: API documentation for Python zope.i18nmessageid module | |
67 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona zope.i18nmessageid | |
68 | Group: Documentation | |
69 | ||
70 | %description apidocs | |
71 | API documentation for Python zope.i18nmessageid module. | |
72 | ||
73 | %description apidocs -l pl.UTF-8 | |
74 | Dokumentacja API modułu Pythona zope.i18nmessageid. | |
75 | ||
76 | %prep | |
77 | %setup -q -n %{module}-%{version} | |
78 | ||
79 | %build | |
80 | %if %{with python2} | |
81 | %py_build %{?with_tests:test} | |
82 | %endif | |
83 | ||
84 | %if %{with python3} | |
85 | %py3_build %{?with_tests:test} | |
86 | %endif | |
87 | ||
88 | %if %{with doc} | |
89 | PYTHONPATH=$(pwd)/src \ | |
90 | %{__make} -C docs html | |
91 | %endif | |
92 | ||
93 | %install | |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
96 | %if %{with python2} | |
97 | %py_install | |
98 | ||
99 | %py_postclean | |
100 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/zope/i18nmessageid/*.[ch] | |
101 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/zope/i18nmessageid/tests.* | |
102 | %endif | |
103 | ||
104 | %if %{with python3} | |
105 | %py3_install | |
106 | ||
107 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/zope/i18nmessageid/*.[ch] | |
108 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/zope/i18nmessageid/tests.* | |
109 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/zope/i18nmessageid/__pycache__/tests.* | |
110 | %endif | |
111 | ||
112 | %clean | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %if %{with python2} | |
116 | %files | |
117 | %defattr(644,root,root,755) | |
118 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst | |
119 | %dir %{py_sitedir}/zope/i18nmessageid | |
120 | %{py_sitedir}/zope/i18nmessageid/*.py[co] | |
121 | %attr(755,root,root) %{py_sitedir}/zope/i18nmessageid/_zope_i18nmessageid_message.so | |
122 | %{py_sitedir}/zope.i18nmessageid-*.egg-info | |
123 | %{py_sitedir}/zope.i18nmessageid-*-nspkg.pth | |
124 | %endif | |
125 | ||
126 | %if %{with python3} | |
127 | %files -n python3-%{module} | |
128 | %defattr(644,root,root,755) | |
129 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst | |
130 | %dir %{py3_sitedir}/zope/i18nmessageid | |
131 | %{py3_sitedir}/zope/i18nmessageid/*.py | |
132 | %{py3_sitedir}/zope/i18nmessageid/__pycache__ | |
133 | %attr(755,root,root) %{py3_sitedir}/zope/i18nmessageid/_zope_i18nmessageid_message.cpython-*.so | |
134 | %{py3_sitedir}/zope.i18nmessageid-*.egg-info | |
135 | %{py3_sitedir}/zope.i18nmessageid-*-nspkg.pth | |
136 | %endif | |
137 | ||
138 | %if %{with doc} | |
139 | %files apidocs | |
140 | %defattr(644,root,root,755) | |
141 | %doc docs/_build/html/{_modules,_static,*.html,*.js} | |
142 | %endif |