14
0

Accepting request 992065 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/992065
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-mechanize?expand=0&rev=28
This commit is contained in:
2022-08-01 19:33:06 +00:00
committed by Git OBS Bridge
3 changed files with 57 additions and 19 deletions

View File

@@ -0,0 +1,30 @@
From a14ecec7abcd8da9b55d28a6d9ebfd89ce635615 Mon Sep 17 00:00:00 2001
From: Li-Wen Hsu <lwhsu@lwhsu.org>
Date: Mon, 25 Apr 2022 22:03:01 +0800
Subject: [PATCH] setup.cfg: Move packages def to options section
Fix packaging with older setuptools.
---
setup.cfg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: mechanize-0.4.8/setup.cfg
===================================================================
--- mechanize-0.4.8.orig/setup.cfg
+++ mechanize-0.4.8/setup.cfg
@@ -8,7 +8,6 @@ license = BSD
description = Stateful, programmatic web browsing
long_description = file: README.rst
url = https://github.com/python-mechanize/mechanize
-packages = mechanize
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
@@ -37,6 +36,7 @@ classifiers =
Topic :: Text Processing :: Markup :: XML
[options]
+packages = mechanize
zip_safe = True
install_requires = html5lib>=0.999999999

View File

@@ -1,3 +1,19 @@
-------------------------------------------------------------------
Mon Aug 1 14:36:49 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Reference upstream patch in specfile for future updates
- Remove catchall in files section that would have found the
mistake
- Update shebang fix commands
- Fix requirements
- Update description
-------------------------------------------------------------------
Sun Jul 31 21:25:20 UTC 2022 - ecsos <ecsos@opensuse.org>
- Add python-mechanize-setup.cfg.patch to fix mechanize not
found during build. (boo#1202003)
-------------------------------------------------------------------
Sun Jul 24 09:09:01 UTC 2022 - Dirk Müller <dmueller@suse.com>

View File

@@ -25,6 +25,8 @@ Summary: Stateful programmatic web browsing
License: BSD-3-Clause AND (BSD-3-Clause OR ZPL-2.1)
URL: https://github.com/python-mechanize/mechanize
Source: https://files.pythonhosted.org/packages/source/m/mechanize/%{modname}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM python-mechanize-setup.cfg.patch gh#python-mechanize/mechanize#73 -- setup.cfg: Move packages def to options section
Patch1: %{name}-setup.cfg.patch
BuildRequires: %{python_module Twisted}
BuildRequires: %{python_module html5lib}
BuildRequires: %{python_module setuptools}
@@ -32,33 +34,22 @@ BuildRequires: %{python_module zope.interface}
BuildRequires: fdupes
BuildRequires: python
BuildRequires: python-rpm-macros
Requires: python-Twisted
Requires: python-html5lib
Requires: python-zope.interface
BuildArch: noarch
%python_subpackages
%description
Stateful programmatic web browsing, after Andy Lester's Perl module
WWW::Mechanize.
Stateful programmatic web browsing in Python. Browse pages
programmatically with HTML form filling and clicking
of links.
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
%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
%patch1 -p1
sed -i -e '1{/^#!\/usr\/bin\/env python/d}' %{modname}/{_entities,_equiv,_form_controls,polyglot}.py
sed -i -e '1{/^#!/d}' examples/forms/{echo.cgi,example.py,simple.py}
chmod -x examples/forms/{echo.cgi,example.py,simple.py}
%build
%python_build
@@ -73,6 +64,7 @@ sed -i "1d" examples/forms/{echo.cgi,example.py,simple.py} # Fix doc-file-depend
%files %{python_files}
%license LICENSE
%doc examples README.rst
%{python_sitelib}/%{modname}*
%{python_sitelib}/%{modname}
%{python_sitelib}/%{modname}-%{version}*-info
%changelog