]> git.pld-linux.org Git - SPECS.git/blob - python-hyperlink.spec
SPECS updated Sun 1 Aug 20:28:02 CEST 2021
[SPECS.git] / python-hyperlink.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 Summary:        A featureful, immutable, and correct URL for Python 2
9 Summary(pl.UTF-8):      Funkcjonalne, niezmienne i poprawne URL-e dla Pythona 2
10 Name:           python-hyperlink
11 Version:        19.0.0
12 Release:        2
13 License:        MIT
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/hyperlink/
16 Source0:        https://files.pythonhosted.org/packages/source/h/hyperlink/hyperlink-%{version}.tar.gz
17 # Source0-md5:  4772fb4d87c26a1ab22a6161424e3cba
18 URL:            https://pypi.org/project/hyperlink/
19 %if %{with python2}
20 BuildRequires:  python-modules >= 1:2.6
21 BuildRequires:  python-setuptools
22 %if %{with tests}
23 BuildRequires:  python-idna >= 2.5
24 BuildRequires:  python-pytest >= 2.9.2
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-idna >= 2.5
32 BuildRequires:  python3-pytest >= 2.9.2
33 %endif
34 %endif
35 BuildRequires:  rpm-pythonprov
36 BuildRequires:  rpmbuild(macros) >= 1.714
37 %if %{with doc}
38 BuildRequires:  python3-sphinx_rtd_theme
39 BuildRequires:  sphinx-pdg-3 >= 1.3
40 %endif
41 Requires:       python-modules >= 1:2.6
42 BuildArch:      noarch
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %description
46 Hyperlink provides a pure-Python implementation of immutable URLs.
47 Based on RFC 3986 and 3987, the Hyperlink URL makes working with both
48 URIs and IRIs easy.
49
50 %description -l pl.UTF-8
51 Hyperlink zawiera czysto pythonową implementację niezmiennych URL-i.
52 Jest oparta na RFC 3986 i 3987, pozwala na łatwą pracę z URI oraz IRI.
53
54 %package -n python3-hyperlink
55 Summary:        A featureful, immutable, and correct URL for Python 3
56 Summary(pl.UTF-8):      Funkcjonalne, niezmienne i poprawne URL-e dla Pythona 3
57 Group:          Libraries/Python
58 Requires:       python3-modules >= 1:3.4
59
60 %description -n python3-hyperlink
61 Hyperlink provides a pure-Python implementation of immutable URLs.
62 Based on RFC 3986 and 3987, the Hyperlink URL makes working with both
63 URIs and IRIs easy.
64
65 %description -n python3-hyperlink -l pl.UTF-8
66 Hyperlink zawiera czysto pythonową implementację niezmiennych URL-i.
67 Jest oparta na RFC 3986 i 3987, pozwala na łatwą pracę z URI oraz IRI.
68
69 %package apidocs
70 Summary:        API documentation for Python hyperlink module
71 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona hyperlink
72 Group:          Documentation
73
74 %description apidocs
75 API documentation for Python hyperlink module.
76
77 %description apidocs -l pl.UTF-8
78 Dokumentacja API modułu Pythona hyperlink.
79
80 %prep
81 %setup -q -n hyperlink-%{version}
82
83 %build
84 %if %{with python2}
85 %py_build
86 # deprecated target, but sometimes still used: %{?with_tests:test}
87
88 %if %{with tests}
89 %{__python} -m pytest hyperlink/test
90 %endif
91 %endif
92
93 %if %{with python3}
94 %py3_build
95 # deprecated target, but sometimes still used: %{?with_tests:test}
96
97 %if %{with tests}
98 %{__python3} -m pytest hyperlink/test
99 %endif
100 %endif
101
102 %if %{with doc}
103 %{__make} -C docs html \
104         SPHINXBUILD=sphinx-build-3
105 %endif
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109
110 %if %{with python2}
111 %py_install
112
113 %py_postclean
114 %endif
115
116 %if %{with python3}
117 %py3_install
118 %endif
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %if %{with python2}
124 %files
125 %defattr(644,root,root,755)
126 %doc CHANGELOG.md LICENSE README.md
127 %{py_sitescriptdir}/hyperlink
128 %{py_sitescriptdir}/hyperlink-%{version}-py*.egg-info
129 %endif
130
131 %if %{with python3}
132 %files -n python3-hyperlink
133 %defattr(644,root,root,755)
134 %doc CHANGELOG.md LICENSE README.md
135 %{py3_sitescriptdir}/hyperlink
136 %{py3_sitescriptdir}/hyperlink-%{version}-py*.egg-info
137 %endif
138
139 %if %{with doc}
140 %files apidocs
141 %defattr(644,root,root,755)
142 %doc docs/_build/html/{_modules,_static,*.html,*.js}
143 %endif
This page took 0.408553 seconds and 3 git commands to generate.