[packages/python-pyperclip] - fixed tests, pl, cleanup

qboosh qboosh at pld-linux.org
Sun Jan 14 13:14:55 CET 2024


commit f7fd9b4b01042aae8b9e04f63553f9833d15081d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Jan 14 12:19:45 2024 +0100

    - fixed tests, pl, cleanup

 python-pyperclip.spec | 45 +++++++++++++++++++++++++++++++++++----------
 1 file changed, 35 insertions(+), 10 deletions(-)
---
diff --git a/python-pyperclip.spec b/python-pyperclip.spec
index 88bc2b4..d997fa2 100644
--- a/python-pyperclip.spec
+++ b/python-pyperclip.spec
@@ -1,10 +1,12 @@
+#
 # Conditional build:
-%bcond_without	doc	# don't build doc
-%bcond_with	tests	# do perform "make test" (broken)
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# unit tests
 %bcond_without	python2 # CPython 2.x module
 %bcond_without	python3 # CPython 3.x module
 
 Summary:	A cross-platform clipboard module for Python
+Summary(pl.UTF-8):	Wieloplatformowy moduł schowka dla Pythona
 Name:		python-pyperclip
 Version:	1.8.2
 Release:	1
@@ -12,10 +14,9 @@ License:	BSD
 Group:		Libraries/Python
 Source0:	https://files.pythonhosted.org/packages/source/p/pyperclip/pyperclip-%{version}.tar.gz
 # Source0-md5:	853603b2e8fa1b13622fdbe72d1fb201
-URL:		https://pypi.python.org/project/pyperclip
+URL:		https://pypi.org/project/pyperclip/
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
-%{?with_doc:BuildRequires:	sphinx-pdg}
 %if %{with python2}
 BuildRequires:	python >= 1:2.6
 BuildRequires:	python-modules >= 1:2.6
@@ -26,6 +27,9 @@ BuildRequires:	python3 >= 1:3.1
 BuildRequires:	python3-modules >= 1:3.1
 BuildRequires:	python3-setuptools
 %endif
+%if %{with doc}
+BuildRequires:	sphinx-pdg-3
+%endif
 Requires:	python-modules >= 1:2.6
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -34,8 +38,13 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 A cross-platform clipboard module for Python. (only handles plain text
 for now)
 
+%description -l pl.UTF-8
+Wieloplatformowy moduł schowka dla Pythona (obecnie obsługuje tylko
+czysty tekst).
+
 %package -n python3-pyperclip
 Summary:	A cross-platform clipboard module for Python
+Summary(pl.UTF-8):	Wieloplatformowy moduł schowka dla Pythona
 Group:		Libraries/Python
 Requires:	python3-modules >= 1:3.1
 
@@ -43,6 +52,10 @@ Requires:	python3-modules >= 1:3.1
 A cross-platform clipboard module for Python. (only handles plain text
 for now)
 
+%description -n python3-pyperclip -l pl.UTF-8
+Wieloplatformowy moduł schowka dla Pythona (obecnie obsługuje tylko
+czysty tekst).
+
 %package apidocs
 Summary:	API documentation for Python pyperclip module
 Summary(pl.UTF-8):	Dokumentacja API modułu Pythona pyperclip
@@ -59,17 +72,26 @@ Dokumentacja API modułu Pythona pyperclip.
 
 %build
 %if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+%if %{with tests}
+PYTHONPATH=$(pwd)/src \
+%{__python} tests/test_pyperclip.py
+%endif
 %endif
 
 %if %{with python3}
-%py3_build %{?with_tests:test}
+%py3_build
+
+%if %{with tests}
+PYTHONPATH=$(pwd)/src \
+%{__python3} tests/test_pyperclip.py
+%endif
 %endif
 
 %if %{with doc}
-cd docs
-%{__make} -j1 html
-rm -rf _build/html/_sources
+%{__make} -C docs -j1 html \
+	SPHINXBUILD=sphinx-build-3
 %endif
 
 %install
@@ -91,6 +113,7 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 %files
 %defattr(644,root,root,755)
+%doc AUTHORS.txt CHANGES.txt LICENSE.txt README.md
 %{py_sitescriptdir}/pyperclip
 %{py_sitescriptdir}/pyperclip-%{version}-py*.egg-info
 %endif
@@ -98,11 +121,13 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python3}
 %files -n python3-pyperclip
 %defattr(644,root,root,755)
+%doc AUTHORS.txt CHANGES.txt LICENSE.txt README.md
 %{py3_sitescriptdir}/pyperclip
 %{py3_sitescriptdir}/pyperclip-%{version}-py*.egg-info
 %endif
 
 %if %{with doc}
 %files apidocs
-%doc docs/_build/html/*
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_static,*.html,*.js}
 %endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pyperclip.git/commitdiff/f7fd9b4b01042aae8b9e04f63553f9833d15081d



More information about the pld-cvs-commit mailing list