]>
Commit | Line | Data |
---|---|---|
174bd39f JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
174bd39f JB |
5 | |
6 | Summary: Non-validating SQL parser | |
7 | Summary(pl.UTF-8): Parser SQL bez kontroli poprawności | |
9ef95864 JB |
8 | Name: python3-sqlparse |
9 | Version: 0.4.1 | |
9819b163 | 10 | Release: 4 |
174bd39f JB |
11 | License: BSD |
12 | Group: Libraries/Python | |
13 | #Source0Download: https://pypi.org/simple/sqlparse/ | |
14 | Source0: https://files.pythonhosted.org/packages/source/s/sqlparse/sqlparse-%{version}.tar.gz | |
9ef95864 | 15 | # Source0-md5: eebbc6b5f1033054873033e54b0c1266 |
174bd39f | 16 | URL: https://pypi.org/project/sqlparse/ |
9ef95864 | 17 | BuildRequires: python3-modules >= 1:3.5 |
174bd39f JB |
18 | BuildRequires: python3-setuptools |
19 | %if %{with tests} | |
20 | BuildRequires: python3-pytest | |
21 | %endif | |
174bd39f JB |
22 | BuildRequires: rpm-pythonprov |
23 | BuildRequires: rpmbuild(macros) >= 1.714 | |
24 | %if %{with doc} | |
25 | BuildRequires: sphinx-pdg | |
26 | %endif | |
9ef95864 | 27 | Requires: python3-modules >= 1:3.5 |
174bd39f JB |
28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | sqlparse is a non-validating SQL parser for Python. It provides | |
33 | support for parsing, splitting and formatting SQL statements. | |
34 | ||
35 | %description -l pl.UTF-8 | |
36 | sqlparse to parser SQL dla Pythona nie sprawdzający poprawnosci. | |
37 | Obsługuje analizę, podział i formatowanie zapytań SQL. | |
38 | ||
174bd39f JB |
39 | %package apidocs |
40 | Summary: API documentation for Python sqlparse module | |
41 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona sqlparse | |
42 | Group: Documentation | |
43 | ||
44 | %description apidocs | |
45 | API documentation for Python sqlparse module. | |
46 | ||
47 | %description apidocs -l pl.UTF-8 | |
48 | Dokumentacja API modułu Pythona sqlparse. | |
49 | ||
50 | %prep | |
51 | %setup -q -n sqlparse-%{version} | |
52 | ||
53 | %build | |
174bd39f JB |
54 | %py3_build |
55 | ||
56 | %if %{with tests} | |
57 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
58 | %{__python3} -m pytest tests | |
59 | %endif | |
174bd39f JB |
60 | |
61 | %if %{with doc} | |
62 | %{__make} -C docs html | |
63 | %endif | |
64 | ||
65 | %install | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | ||
174bd39f JB |
68 | %py3_install |
69 | ||
70 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{sqlformat,sqlformat-3} | |
71 | ln -s sqlformat-3 $RPM_BUILD_ROOT%{_bindir}/sqlformat | |
72 | install -Dp docs/sqlformat.1 $RPM_BUILD_ROOT%{_mandir}/man1/sqlformat-3.1 | |
73 | echo '.so sqlformat-3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/sqlformat.1 | |
174bd39f JB |
74 | |
75 | %clean | |
76 | rm -rf $RPM_BUILD_ROOT | |
77 | ||
174bd39f JB |
78 | %files |
79 | %defattr(644,root,root,755) | |
80 | %doc AUTHORS CHANGELOG LICENSE README.rst TODO | |
174bd39f JB |
81 | %attr(755,root,root) %{_bindir}/sqlformat |
82 | %attr(755,root,root) %{_bindir}/sqlformat-3 | |
83 | %{py3_sitescriptdir}/sqlparse | |
84 | %{py3_sitescriptdir}/sqlparse-%{version}-py*.egg-info | |
85 | %{_mandir}/man1/sqlformat.1* | |
86 | %{_mandir}/man1/sqlformat-3.1* | |
174bd39f JB |
87 | |
88 | %if %{with doc} | |
89 | %files apidocs | |
90 | %defattr(644,root,root,755) | |
91 | %doc docs/build/html/{_static,*.html,*.js} | |
92 | %endif |