]>
Commit | Line | Data |
---|---|---|
2f514ebb | 1 | # |
628c8e46 JB |
2 | # Conditional build: |
3 | %bcond_without doc # HTML documentation build | |
ca45e258 | 4 | %bcond_without python2 # CPython 2.x module |
8e9dea4c | 5 | %bcond_without python3 # CPython 3.x module |
7dfde63c | 6 | %bcond_with tests # unit tests [fail with pytest 3.0?] |
8e9dea4c | 7 | |
2f514ebb | 8 | %define module py |
628c8e46 JB |
9 | Summary: Library with cross-python path, ini-parsing, io, code, log facilities |
10 | Summary(pl.UTF-8): Biblioteka wspierająca obsługę ścieżek, ini, we/wy, kodowania i logowania w wielu Pythonach | |
2f514ebb | 11 | Name: python-%{module} |
a9ac4645 | 12 | Version: 1.7.0 |
6ee66108 | 13 | Release: 2 |
628c8e46 | 14 | License: MIT |
2f514ebb | 15 | Group: Development/Languages/Python |
7dfde63c | 16 | #Source0Download: https://pypi.org/simple/py/ |
5edc3003 | 17 | Source0: https://files.pythonhosted.org/packages/source/p/py/py-%{version}.tar.gz |
a9ac4645 | 18 | # Source0-md5: e53ac12db4286737837ef3ccb4158301 |
8e9dea4c ER |
19 | Source1: http://docs.python.org/objects.inv?/python-objects.inv |
20 | # Source1-md5: 3d3c0b594b2e91d559418c107d973633 | |
628c8e46 | 21 | Patch0: %{name}-offline.patch |
7dfde63c | 22 | URL: https://pypi.org/project/py/ |
ca45e258 | 23 | %if %{with python2} |
7dfde63c | 24 | BuildRequires: python-devel >= 1:2.7 |
5d86414d | 25 | BuildRequires: python-setuptools >= 7.0 |
7dfde63c JB |
26 | BuildRequires: python-setuptools_scm |
27 | %if %{with tests} | |
28 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) | |
29 | BuildRequires: glibc-localedb-all | |
30 | %endif | |
31 | BuildRequires: python-pytest >= 2.9.0 | |
32 | %endif | |
ca45e258 JB |
33 | %endif |
34 | %if %{with python3} | |
7dfde63c JB |
35 | BuildRequires: python3-devel >= 1:3.4 |
36 | BuildRequires: python3-modules >= 1:3.4 | |
5d86414d | 37 | BuildRequires: python3-setuptools >= 7.0 |
7dfde63c JB |
38 | BuildRequires: python3-setuptools_scm |
39 | %if %{with tests} | |
40 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) | |
41 | BuildRequires: glibc-localedb-all | |
42 | %endif | |
43 | BuildRequires: python3-pytest >= 2.9.0 | |
44 | %endif | |
ca45e258 | 45 | %endif |
4b858531 | 46 | BuildRequires: rpm-pythonprov |
2e3dd66c | 47 | BuildRequires: rpmbuild(macros) >= 1.710 |
628c8e46 | 48 | %{?with_doc:BuildRequires: sphinx-pdg >= 1.0} |
87d7dbd0 | 49 | %{?with_doc:BuildRequires: python-devel-tools} |
2f514ebb | 50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
51 | ||
52 | %description | |
628c8e46 JB |
53 | The py lib is a Python development support library featuring the |
54 | following tools and modules: | |
8e9dea4c ER |
55 | - py.path: uniform local and svn path objects |
56 | - py.apipkg: explicit API control and lazy-importing | |
57 | - py.iniconfig: easy parsing of .ini files | |
628c8e46 | 58 | - py.code: dynamic code generation and introspection |
2f514ebb | 59 | |
4b858531 | 60 | %description -l pl.UTF-8 |
628c8e46 JB |
61 | Biblioteka py to biblioteka wpierająca tworzenie oprogramowania w |
62 | Pythonie. Zawiera następujące narzędzia i moduły: | |
63 | - py.path - jednolite obiekty ścieżek lokalnych i svn | |
64 | - py.apipkg - bezpośrednia kontrola API i leniwego importowania | |
65 | - py.iniconfig - łatwa analiza plików .ini | |
66 | - py.code - dynamiczne generowanie kodu i introspekcji | |
4b858531 | 67 | |
8e9dea4c ER |
68 | %package -n python3-py |
69 | Summary: Library with cross-python path, ini-parsing, io, code, log facilities | |
e50d971d | 70 | Summary(pl.UTF-8): Biblioteka wspierająca obsługę ścieżek, ini, we/wy, kodowania i logowania w wielu Pythonach |
8e9dea4c | 71 | Group: Development/Languages/Python |
8e9dea4c ER |
72 | |
73 | %description -n python3-py | |
74 | The py lib is a Python development support library featuring the | |
75 | following tools and modules: | |
76 | - py.path: uniform local and svn path objects | |
77 | - py.apipkg: explicit API control and lazy-importing | |
78 | - py.iniconfig: easy parsing of .ini files | |
79 | - py.code: dynamic code generation and introspection | |
e50d971d JB |
80 | |
81 | %description -n python3-py -l pl.UTF-8 | |
82 | Biblioteka py to biblioteka wpierająca tworzenie oprogramowania w | |
83 | Pythonie. Zawiera następujące narzędzia i moduły: | |
84 | - py.path - jednolite obiekty ścieżek lokalnych i svn | |
85 | - py.apipkg - bezpośrednia kontrola API i leniwego importowania | |
86 | - py.iniconfig - łatwa analiza plików .ini | |
87 | - py.code - dynamiczne generowanie kodu i introspekcji | |
8e9dea4c | 88 | |
5edc3003 JB |
89 | %package apidocs |
90 | Summary: Documentation for Python py library | |
91 | Summary(pl.UTF-8): Dokumentacja do biblioteki Pythona py | |
92 | Group: Documentation | |
93 | ||
94 | %description apidocs | |
95 | Documentation for Python py library. | |
96 | ||
97 | %description apidocs -l pl.UTF-8 | |
98 | Dokumentacja do biblioteki Pythona py. | |
99 | ||
2f514ebb | 100 | %prep |
101 | %setup -q -n %{module}-%{version} | |
628c8e46 JB |
102 | %patch0 -p1 |
103 | ||
104 | cp -p %{SOURCE1} doc | |
2f514ebb | 105 | |
106 | %build | |
ca45e258 | 107 | %if %{with python2} |
16339572 | 108 | %py_build |
7dfde63c JB |
109 | |
110 | %if %{with tests} | |
111 | LC_ALL=C.UTF-8 \ | |
112 | %{__python} -m pytest testing | |
113 | %endif | |
ca45e258 | 114 | %endif |
2f514ebb | 115 | |
8e9dea4c | 116 | %if %{with python3} |
16339572 | 117 | %py3_build |
7dfde63c JB |
118 | |
119 | %if %{with tests} | |
120 | LC_ALL=C.UTF-8 \ | |
121 | %{__python3} -m pytest testing | |
122 | %endif | |
8e9dea4c ER |
123 | %endif |
124 | ||
628c8e46 JB |
125 | %if %{with doc} |
126 | PYTHONPATH=$(pwd) \ | |
127 | %{__make} -C doc html | |
128 | %endif | |
129 | ||
2f514ebb | 130 | %install |
131 | rm -rf $RPM_BUILD_ROOT | |
ca45e258 JB |
132 | |
133 | %if %{with python2} | |
438626b1 | 134 | %py_install |
2f514ebb | 135 | |
136 | %py_postclean | |
ca45e258 | 137 | %endif |
2f514ebb | 138 | |
8e9dea4c | 139 | %if %{with python3} |
16339572 | 140 | %py3_install |
8e9dea4c ER |
141 | %endif |
142 | ||
2f514ebb | 143 | %clean |
144 | rm -rf $RPM_BUILD_ROOT | |
145 | ||
ca45e258 | 146 | %if %{with python2} |
2f514ebb | 147 | %files |
148 | %defattr(644,root,root,755) | |
5edc3003 | 149 | %doc AUTHORS CHANGELOG LICENSE README.rst |
8e9dea4c ER |
150 | %{py_sitescriptdir}/%{module} |
151 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
ca45e258 | 152 | %endif |
8e9dea4c ER |
153 | |
154 | %if %{with python3} | |
155 | %files -n python3-py | |
156 | %defattr(644,root,root,755) | |
5edc3003 | 157 | %doc AUTHORS CHANGELOG LICENSE README.rst |
8e9dea4c ER |
158 | %{py3_sitescriptdir}/%{module} |
159 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
160 | %endif | |
5edc3003 JB |
161 | |
162 | %if %{with doc} | |
163 | %files apidocs | |
164 | %defattr(644,root,root,755) | |
165 | %doc doc/_build/html/{_modules,_static,announce,*.html,*.js} | |
166 | %endif |