]> git.pld-linux.org Git - packages/python-py.git/blob - python-py.spec
0240a1a5eaf82e285ab1b56dd39f1598a22847cb
[packages/python-py.git] / python-py.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # HTML documentation build
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6 %bcond_with     tests   # unit tests [fail with pytest 3.0?]
7
8 %define         module  py
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
11 Name:           python-%{module}
12 Version:        1.7.0
13 Release:        2
14 License:        MIT
15 Group:          Development/Languages/Python
16 #Source0Download: https://pypi.org/simple/py/
17 Source0:        https://files.pythonhosted.org/packages/source/p/py/py-%{version}.tar.gz
18 # Source0-md5:  e53ac12db4286737837ef3ccb4158301
19 Source1:        http://docs.python.org/objects.inv?/python-objects.inv
20 # Source1-md5:  3d3c0b594b2e91d559418c107d973633
21 Patch0:         %{name}-offline.patch
22 URL:            https://pypi.org/project/py/
23 %if %{with python2}
24 BuildRequires:  python-devel >= 1:2.7
25 BuildRequires:  python-setuptools >= 7.0
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
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-devel >= 1:3.4
36 BuildRequires:  python3-modules >= 1:3.4
37 BuildRequires:  python3-setuptools >= 7.0
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
45 %endif
46 BuildRequires:  rpm-pythonprov
47 BuildRequires:  rpmbuild(macros) >= 1.710
48 %{?with_doc:BuildRequires:      sphinx-pdg >= 1.0}
49 %{?with_doc:BuildRequires:      python-devel-tools}
50 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
52 %description
53 The py lib is a Python development support library featuring the
54 following tools and modules:
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
58  - py.code: dynamic code generation and introspection
59
60 %description -l pl.UTF-8
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
67
68 %package -n python3-py
69 Summary:        Library with cross-python path, ini-parsing, io, code, log facilities
70 Summary(pl.UTF-8):      Biblioteka wspierająca obsługę ścieżek, ini, we/wy, kodowania i logowania w wielu Pythonach
71 Group:          Development/Languages/Python
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
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
88
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
100 %prep
101 %setup -q -n %{module}-%{version}
102 %patch0 -p1
103
104 cp -p %{SOURCE1} doc
105
106 %build
107 %if %{with python2}
108 %py_build
109
110 %if %{with tests}
111 LC_ALL=C.UTF-8 \
112 %{__python} -m pytest testing
113 %endif
114 %endif
115
116 %if %{with python3}
117 %py3_build
118
119 %if %{with tests}
120 LC_ALL=C.UTF-8 \
121 %{__python3} -m pytest testing
122 %endif
123 %endif
124
125 %if %{with doc}
126 PYTHONPATH=$(pwd) \
127 %{__make} -C doc html
128 %endif
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132
133 %if %{with python2}
134 %py_install
135
136 %py_postclean
137 %endif
138
139 %if %{with python3}
140 %py3_install
141 %endif
142
143 %clean
144 rm -rf $RPM_BUILD_ROOT
145
146 %if %{with python2}
147 %files
148 %defattr(644,root,root,755)
149 %doc AUTHORS CHANGELOG LICENSE README.rst
150 %{py_sitescriptdir}/%{module}
151 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
152 %endif
153
154 %if %{with python3}
155 %files -n python3-py
156 %defattr(644,root,root,755)
157 %doc AUTHORS CHANGELOG LICENSE README.rst
158 %{py3_sitescriptdir}/%{module}
159 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
160 %endif
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
This page took 0.095849 seconds and 2 git commands to generate.