2017-10-26 10:36:39 +00:00
#
# spec file for package python-wptools
#
2024-03-05 04:05:53 +00:00
# Copyright (c) 2024 SUSE LLC
2017-10-26 10:36:39 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2018-12-04 14:14:37 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2017-10-26 10:36:39 +00:00
#
%define pyname wptools
Name : python-wptools
2018-10-22 19:17:06 +00:00
Version : 0.4.17
2017-10-26 10:36:39 +00:00
Release : 0
Summary : Wikipedia tools (for Humans)
License : MIT
2018-12-04 17:26:02 +00:00
URL : https://github.com/siznax/wptools/
2017-10-26 10:36:39 +00:00
Source : https://files.pythonhosted.org/packages/source/w/wptools/%{pyname} -%{version} .tar.gz
# PATCH-FIX-UPSTREAM python-wptools-avoid-reading-readme.patch badshah400@gmail.com -- README.rst contains numerous spurious characters that are not readable in ascii. Skip reading this file in setup.py and manually insert a long description text instead
Patch0 : python-wptools-avoid-reading-readme.patch
2024-03-05 04:05:53 +00:00
BuildRequires : %{python_module pip}
2017-10-26 10:36:39 +00:00
BuildRequires : %{python_module setuptools}
2024-03-05 04:05:53 +00:00
BuildRequires : %{python_module wheel}
2017-10-26 10:36:39 +00:00
BuildRequires : fdupes
BuildRequires : python-rpm-macros
Requires : python-certifi >= 2017.7.27.1
Requires : python-html2text >= 2016.9.19
Requires : python-lxml >= 3.8.0
Requires : python-pycurl >= 7.43.0
2020-05-18 08:12:29 +00:00
Requires(post) : update-alternatives
Requires(postun) : update-alternatives
2017-10-26 10:36:39 +00:00
BuildArch : noarch
%python_subpackages
%description
Python and command-line MediaWiki access for Humans.
Features:
* get an HTML or plain text " e x t r a c t " (lead or summary)
* get a representative image (pageimage, thumb, etc.)
* get an Infobox as a python dictionary
* get any/all Wikidata by title
* get info in any language
* get random info
%prep
2024-03-05 04:05:53 +00:00
%autosetup -p1 -n wptools-%{version}
2018-05-26 19:39:17 +00:00
sed -E -i " 1 { / ^ # ! \ / u s r \ / b i n . * p y t h o n / d } " scripts/wptool.py
2017-10-26 10:36:39 +00:00
%build
2024-03-05 04:05:53 +00:00
%pyproject_wheel
2017-10-26 10:36:39 +00:00
%install
2024-03-05 04:05:53 +00:00
%pyproject_install
2020-05-18 08:12:29 +00:00
%python_clone -a %{buildroot} %{_bindir} /wptool
2019-10-14 14:50:23 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}
2017-10-26 10:36:39 +00:00
2020-05-18 08:12:29 +00:00
%post
%python_install_alternative wptool
%postun
%python_uninstall_alternative wptool
2017-10-26 10:36:39 +00:00
%files %{python_files}
2018-12-04 17:26:02 +00:00
%license LICENSE
%doc HISTORY.rst README.rst
2020-05-18 08:12:29 +00:00
%python_alternative %{_bindir} /wptool
2024-03-05 04:05:53 +00:00
%{python_sitelib} /scripts
%{python_sitelib} /wptools
%{python_sitelib} /wptools-%{version} .dist-info
2017-10-26 10:36:39 +00:00
%changelog