]> git.pld-linux.org Git - SPECS.git/blob - python-rst.linker.spec
SPECS updated Sat 31 Jul 20:26:02 CEST 2021
[SPECS.git] / python-rst.linker.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # documentation (uses python2, needs repository metadata)
4 %bcond_without  tests   # py.test tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %if %{without python2}
9 %undefine       with_doc
10 %endif
11 Summary:        rst.linker - Python 2 Sphinx plugin to add links to the changelog
12 Summary(pl.UTF-8):      rst.linker - wtyczka Sphinksa dla Pythona 2 do dodawania odnośników do changeloga
13 Name:           python-rst.linker
14 Version:        1.11
15 Release:        2
16 License:        MIT
17 Group:          Libraries/Python
18 #Source0Download: https://pypi.org/simple/rst.linker/
19 Source0:        https://files.pythonhosted.org/packages/source/r/rst.linker/rst.linker-%{version}.tar.gz
20 # Source0-md5:  9541a7debee1c5b4ac54350696082664
21 URL:            https://github.com/jaraco/rst.linker
22 %if %{with python2}
23 BuildRequires:  python-devel >= 1:2.7
24 BuildRequires:  python-modules >= 1:2.7
25 BuildRequires:  python-setuptools >= 1:31.0.1
26 BuildRequires:  python-setuptools_scm >= 1.15.0
27 %if %{with tests}
28 BuildRequires:  python-dateutil
29 BuildRequires:  python-importlib_metadata
30 BuildRequires:  python-path
31 BuildRequires:  python-pytest >= 3.5
32 BuildRequires:  python-pytest-black-multipy
33 BuildRequires:  python-pytest-flake8
34 BuildRequires:  python-six
35 %endif
36 %if %{with doc}
37 BuildRequires:  python-Sphinx
38 BuildRequires:  python-jaraco.packaging >= 3.2
39 # needs to be already installed
40 BuildRequires:  python-rst.linker >= 1.9
41 %endif
42 %endif
43 %if %{with python3}
44 BuildRequires:  python3-devel >= 1:3.2
45 BuildRequires:  python3-modules >= 1:3.2
46 BuildRequires:  python3-setuptools >= 1:31.0.1
47 BuildRequires:  python3-setuptools_scm >= 1.15.0
48 %if %{with tests}
49 BuildRequires:  python3-dateutil
50 %if "%{py3_ver}" < "3.8"
51 BuildRequires:  python3-importlib_metadata
52 %endif
53 BuildRequires:  python3-path
54 BuildRequires:  python3-pytest >= 3.5
55 BuildRequires:  python3-pytest-black-multipy
56 BuildRequires:  python3-pytest-flake8
57 BuildRequires:  python3-six
58 %endif
59 %endif
60 BuildRequires:  rpm-pythonprov
61 BuildRequires:  rpmbuild(macros) >= 1.714
62 Requires:       python-Sphinx
63 BuildArch:      noarch
64 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65
66 %description
67 rst.linker is a Sphinx plugin to add links to the changelog.
68
69 %description -l pl.UTF-8
70 rst.linker to wtyczka Sphinksa służąca do dodawania odnośników do
71 changeloga.
72
73 %package -n python3-rst.linker
74 Summary:        rst.linker - Python 3 Sphinx plugin to add links to the changelog
75 Summary(pl.UTF-8):      rst.linker - wtyczka Sphinksa dla Pythona 3 do dodawania odnośników do changeloga
76 Group:          Libraries/Python
77 Requires:       python3-Sphinx
78
79 %description -n python3-rst.linker
80 rst.linker is a Sphinx plugin to add links to the changelog.
81
82 %description -n python3-rst.linker -l pl.UTF-8
83 rst.linker to wtyczka Sphinksa służąca do dodawania odnośników do
84 changeloga.
85
86 %package apidocs
87 Summary:        Documentation for rst.linker module
88 Summary(pl.UTF-8):      Dokumentacja do modułu rst.linker
89 Group:          Documentation
90
91 %description apidocs
92 Documentation for rst.linker module.
93
94 %description apidocs -l pl.UTF-8
95 Dokumentacja do modułu rst.linker.
96
97 %prep
98 %setup -q -n rst.linker-%{version}
99
100 %build
101 %if %{with python2}
102 %py_build %{?with_doc:build_sphinx}
103
104 %if %{with tests}
105 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
106 PYTEST_PLUGINS="pytest_black_multipy,pytest_flake8" \
107 %{__python} -m pytest test_all.py
108 %endif
109 %endif
110
111 %if %{with python3}
112 %py3_build
113
114 %if %{with tests}
115 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
116 PYTEST_PLUGINS="pytest_black,pytest_black_multipy,pytest_flake8" \
117 %{__python3} -m pytest test_all.py
118 %endif
119 %endif
120
121 %install
122 rm -rf $RPM_BUILD_ROOT
123
124 %if %{with python2}
125 %py_install
126
127 %py_postclean
128 %endif
129
130 %if %{with python3}
131 %py3_install
132 %endif
133
134 %clean
135 rm -rf $RPM_BUILD_ROOT
136
137 %if %{with python2}
138 %files
139 %defattr(644,root,root,755)
140 %doc CHANGES.rst LICENSE README.rst
141 %dir %{py_sitescriptdir}/rst
142 %{py_sitescriptdir}/rst/__init__.py[co]
143 %{py_sitescriptdir}/rst/linker.py[co]
144 %{py_sitescriptdir}/rst.linker-%{version}-py*.egg-info
145 %endif
146
147 %if %{with python3}
148 %files -n python3-rst.linker
149 %defattr(644,root,root,755)
150 %doc CHANGES.rst LICENSE README.rst
151 %dir %{py3_sitescriptdir}/rst
152 %{py3_sitescriptdir}/rst/__init__.py
153 %{py3_sitescriptdir}/rst/linker.py
154 %dir %{py3_sitescriptdir}/rst/__pycache__
155 %{py3_sitescriptdir}/rst/__pycache__/__init__.cpython-*.py[co]
156 %{py3_sitescriptdir}/rst/__pycache__/linker.cpython-*.py[co]
157 %{py3_sitescriptdir}/rst.linker-%{version}-py*.egg-info
158 %endif
159
160 %if %{with doc}
161 %files apidocs
162 %defattr(644,root,root,755)
163 %doc build-2/sphinx/html/{_static,*.html,*.js}
164 %endif
This page took 0.039614 seconds and 3 git commands to generate.