]> git.pld-linux.org Git - SPECS.git/blob - python-distro.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python-distro.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # unit tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define         module  distro
9 Summary:        An OS platform information API
10 Summary(pl.UTF-8):      API do intermacji o platformie systemu operacyjnego
11 Name:           python-%{module}
12 Version:        1.5.0
13 Release:        2
14 License:        Apache v2.0
15 Group:          Libraries/Python
16 Source0:        https://github.com/nir0s/distro/archive/v%{version}/%{module}-%{version}.tar.gz
17 # Source0-md5:  da1cab49e8aad7bd6ae5c9f66657bd2e
18 Patch0:         %{name}-docs.patch
19 URL:            https://github.com/nir0s/distro
20 %if %{with python2}
21 BuildRequires:  python-modules >= 1:2.7
22 BuildRequires:  python-setuptools
23 %if %{with tests}
24 BuildRequires:  python-pytest
25 %endif
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-modules >= 1:3.4
29 BuildRequires:  python3-setuptools
30 %if %{with tests}
31 BuildRequires:  python3-pytest
32 %endif
33 %endif
34 BuildRequires:  rpm-pythonprov
35 BuildRequires:  rpmbuild(macros) >= 1.714
36 %if %{with doc}
37 BuildRequires:  sphinx-pdg >= 1.1
38 %endif
39 Requires:       python-modules >= 1:2.7
40 BuildArch:      noarch
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 distro provides information about the OS distribution it runs on, such
45 as a reliable machine-readable ID, or version information.
46
47 %description -l pl.UTF-8
48 distro udostępnia informacje o dystrybucji systemu operacyjnego, na
49 jakim działa, takie jak wiarygodny, czytelny dla maszyny identyfikator
50 albo informację o wersji.
51
52 %package -n python3-%{module}
53 Summary:        An OS platform information API
54 Summary(pl.UTF-8):      API do intermacji o platformie systemu operacyjnego
55 Group:          Libraries/Python
56 Requires:       python3-modules >= 1:3.4
57
58 %description -n python3-%{module}
59 distro provides information about the OS distribution it runs on, such
60 as a reliable machine-readable ID, or version information.
61
62 It is the recommended replacement for Python's original
63 platform.linux_distribution function removed in Python 3.8.
64
65 %description -n python3-%{module} -l pl.UTF-8
66 distro udostępnia informacje o dystrybucji systemu operacyjnego, na
67 jakim działa, takie jak wiarygodny, czytelny dla maszyny identyfikator
68 albo informację o wersji.
69
70 Jest to zalecany zamiennik oryginalnej pythonowej funkcji
71 platform.linux_distribution, usuniętej w Pythonie 3.8.
72
73 %package apidocs
74 Summary:        API documentation for Python distro module
75 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona distro
76 Group:          Documentation
77
78 %description apidocs
79 API documentation for Python distro module.
80
81 %description apidocs -l pl.UTF-8
82 Dokumentacja API modułu Pythona distro.
83
84 %prep
85 %setup -q -n %{module}-%{version}
86 %patch0 -p1
87
88 %build
89 %if %{with python2}
90 %py_build
91
92 %if %{with tests}
93 %{__python} -m pytest tests
94 %endif
95 %endif
96
97 %if %{with python3}
98 %py3_build
99
100 %if %{with tests}
101 %{__python3} -m pytest tests
102 %endif
103 %endif
104
105 %if %{with doc}
106 sphinx-build -b html docs docs/_build/html
107 %endif
108
109 %install
110 rm -rf $RPM_BUILD_ROOT
111
112 %if %{with python2}
113 %py_install
114
115 %py_postclean
116 %endif
117
118 %if %{with python3}
119 %py3_install
120 %endif
121
122 %clean
123 rm -rf $RPM_BUILD_ROOT
124
125 %files
126 %defattr(644,root,root,755)
127 %doc CHANGELOG.md CONTRIBUTORS.md LICENSE README.md
128 %{py_sitescriptdir}/distro.py[co]
129 %{py_sitescriptdir}/distro-%{version}-py*.egg-info
130
131 %if %{with python3}
132 %files -n python3-%{module}
133 %defattr(644,root,root,755)
134 %attr(755,root,root) %{_bindir}/distro
135 %doc CHANGELOG.md CONTRIBUTORS.md LICENSE README.md
136 %{py3_sitescriptdir}/distro.py
137 %{py3_sitescriptdir}/__pycache__/distro.cpython-*.py[co]
138 %{py3_sitescriptdir}/distro-%{version}-py*.egg-info
139 %endif
140
141 %if %{with doc}
142 %files apidocs
143 %defattr(644,root,root,755)
144 %doc docs/_build/html/{_modules,_static,*.html,*.js}
145 %endif
This page took 0.405584 seconds and 3 git commands to generate.