2010-07-02 14:37:40 +00:00
|
|
|
#
|
2011-09-20 14:49:49 +00:00
|
|
|
# spec file for package python-mechanize
|
2010-07-02 14:37:40 +00:00
|
|
|
#
|
2022-01-24 00:58:29 +00:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2010-07-02 14:37:40 +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.
|
|
|
|
|
|
2019-01-18 10:41:40 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-07-02 14:37:40 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
2018-06-14 17:22:43 +00:00
|
|
|
%define modname mechanize
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2019-04-05 12:29:27 +00:00
|
|
|
Name: python-mechanize
|
2022-07-24 09:10:15 +00:00
|
|
|
Version: 0.4.8
|
2011-09-20 14:49:49 +00:00
|
|
|
Release: 0
|
|
|
|
|
Summary: Stateful programmatic web browsing
|
2022-01-24 00:58:29 +00:00
|
|
|
License: BSD-3-Clause AND (BSD-3-Clause OR ZPL-2.1)
|
2018-06-14 17:22:43 +00:00
|
|
|
URL: https://github.com/python-mechanize/mechanize
|
2018-08-29 10:46:29 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/m/mechanize/%{modname}-%{version}.tar.gz
|
2019-09-11 12:38:04 +00:00
|
|
|
BuildRequires: %{python_module Twisted}
|
2018-06-14 17:22:43 +00:00
|
|
|
BuildRequires: %{python_module html5lib}
|
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-01-18 10:41:40 +00:00
|
|
|
BuildRequires: %{python_module zope.interface}
|
2018-06-14 17:22:43 +00:00
|
|
|
BuildRequires: fdupes
|
2018-08-29 10:46:29 +00:00
|
|
|
BuildRequires: python
|
2018-06-14 17:22:43 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2019-11-12 16:51:27 +00:00
|
|
|
Requires: python-Twisted
|
|
|
|
|
Requires: python-html5lib
|
|
|
|
|
Requires: python-zope.interface
|
2010-07-06 08:00:27 +00:00
|
|
|
BuildArch: noarch
|
2018-06-14 17:22:43 +00:00
|
|
|
%python_subpackages
|
2010-07-02 14:37:40 +00:00
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Stateful programmatic web browsing, after Andy Lester's Perl module
|
|
|
|
|
WWW::Mechanize.
|
|
|
|
|
|
|
|
|
|
The library is layered: mechanize.Browser (stateful web browser),
|
|
|
|
|
mechanize.UserAgent (configurable URL opener), plus urllib2 handlers.
|
|
|
|
|
|
|
|
|
|
Features include: ftp:, http: and file: URL schemes, browser history,
|
|
|
|
|
high-level hyperlink and HTML form support, HTTP cookies, HTTP-EQUIV and
|
|
|
|
|
Refresh, Referer [sic] header, robots.txt, redirections, proxies, and Basic and
|
|
|
|
|
Digest HTTP authentication. mechanize's response objects are (lazily-)
|
|
|
|
|
.seek()able and still work after .close().
|
|
|
|
|
|
|
|
|
|
Much of the code originally derived from Perl code by Gisle Aas (libwww-perl),
|
|
|
|
|
Johnny Lee (MSIE Cookie support) and last but not least Andy Lester
|
|
|
|
|
(WWW::Mechanize). urllib2 was written by Jeremy Hylton.
|
|
|
|
|
|
|
|
|
|
%prep
|
2018-06-14 17:22:43 +00:00
|
|
|
%setup -q -n %{modname}-%{version}
|
|
|
|
|
sed -i -e '/^#!\/usr\/bin\/env python/d' %{modname}/_{entities,equiv,form_controls}.py
|
|
|
|
|
sed -i "1d" examples/forms/{echo.cgi,example.py,simple.py} # Fix doc-file-dependency
|
2010-07-02 14:37:40 +00:00
|
|
|
|
|
|
|
|
%build
|
2018-06-14 17:22:43 +00:00
|
|
|
%python_build
|
2010-07-02 14:37:40 +00:00
|
|
|
|
|
|
|
|
%install
|
2018-06-14 17:22:43 +00:00
|
|
|
%python_install
|
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
|
|
%check
|
2019-01-18 10:41:40 +00:00
|
|
|
%python_expand $python ./run_tests.py -v
|
2010-07-02 14:37:40 +00:00
|
|
|
|
2018-06-14 17:22:43 +00:00
|
|
|
%files %{python_files}
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%doc examples README.rst
|
|
|
|
|
%{python_sitelib}/%{modname}*
|
2010-07-02 14:37:40 +00:00
|
|
|
|
|
|
|
|
%changelog
|