mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-10 05:40:07 +02:00
mechanize: update to version 0.4.8, support Python 3.10. (#9477)
Minor clean ups.
This commit is contained in:
@@ -1,91 +0,0 @@
|
||||
SUMMARY="Stateful programmatic web browsing in Python"
|
||||
DESCRIPTION="Stateful programmatic web browsing in Python, after Andy \
|
||||
Lester’s Perl module WWW::Mechanize.
|
||||
|
||||
- mechanize.Browser and mechanize.UserAgentBase implement \
|
||||
the interface of urllib2.OpenerDirector, so any URL can be opened, not \
|
||||
just http.
|
||||
- mechanize.UserAgentBase offers easy dynamic configuration \
|
||||
of user-agent features like protocol, cookie, redirection and \
|
||||
robots.txt handling, without having to make a new OpenerDirector \
|
||||
each time, e.g. by calling build_opener().
|
||||
- Easy HTML form filling.
|
||||
- Convenient link parsing and following.
|
||||
- Browser history (.back() and .reload() methods).
|
||||
- The Referer HTTP header is added properly (optional).
|
||||
- Automatic observance of robots.txt.
|
||||
- Automatic handling of HTTP-Equiv and Refresh."
|
||||
HOMEPAGE="https://github.com/python-mechanize/mechanize
|
||||
http://pypi.python.org/pypi/mechanize"
|
||||
COPYRIGHT="2002-2010 John J. Lee
|
||||
1997-1999 Gisle Aas
|
||||
1997-1999 Johnny Lee
|
||||
2003 Andy Lester"
|
||||
LICENSE="BSD (3-clause)"
|
||||
REVISION="3"
|
||||
SOURCE_URI="https://github.com/python-mechanize/mechanize/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="08515f36d315566b256888bbe50e3587293397028c45b5289f3e38fede3c574f"
|
||||
|
||||
ARCHITECTURES="any"
|
||||
|
||||
PROVIDES="
|
||||
$portName = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python39)
|
||||
PYTHON_VERSIONS=(3.9)
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
eval "PROVIDES_${pythonPackage}=\"\
|
||||
${portName}_$pythonPackage = $portVersion\
|
||||
\"; \
|
||||
REQUIRES_$pythonPackage=\"\
|
||||
haiku\n\
|
||||
html5lib_$pythonPackage\n\
|
||||
cmd:python$pythonVersion\
|
||||
\""
|
||||
BUILD_REQUIRES="$BUILD_REQUIRES
|
||||
html5lib_$pythonPackage
|
||||
setuptools_$pythonPackage
|
||||
"
|
||||
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
|
||||
cmd:python$pythonVersion"
|
||||
done
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
python=python$pythonVersion
|
||||
installLocation=$prefix/lib/$python/vendor-packages/
|
||||
export PYTHONPATH=$installLocation:$PYTHONPATH
|
||||
mkdir -p $installLocation
|
||||
rm -rf build
|
||||
$python setup.py build install \
|
||||
--root=/ --prefix=$prefix
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
$prefix/lib/python*
|
||||
done
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
python=python$pythonVersion
|
||||
$python run_tests.py
|
||||
done
|
||||
}
|
||||
88
dev-python/mechanize/mechanize-0.4.8.recipe
Normal file
88
dev-python/mechanize/mechanize-0.4.8.recipe
Normal file
@@ -0,0 +1,88 @@
|
||||
SUMMARY="Stateful programmatic web browsing in Python"
|
||||
DESCRIPTION="Stateful programmatic web browsing in Python, after Andy \
|
||||
Lester’s Perl module WWW::Mechanize.
|
||||
|
||||
- The browser class mechanize.Browser implements the interface of \
|
||||
urllib2.OpenerDirector, so any URL can be opened, not just http.
|
||||
- Easy HTML form filling.
|
||||
- Convenient link parsing and following.
|
||||
- Browser history (.back() and .reload() methods).
|
||||
- The Referer HTTP header is added properly (optional).
|
||||
- Automatic observance of robots.txt.
|
||||
- Automatic handling of HTTP-Equiv and Refresh."
|
||||
HOMEPAGE="https://github.com/python-mechanize/mechanize
|
||||
http://pypi.python.org/pypi/mechanize"
|
||||
COPYRIGHT="2017 Kovid Goyal, John J Lee, Gisle Aas, Johnny Lee, Andy Lester"
|
||||
LICENSE="BSD (3-clause)"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://pypi.python.org/packages/source/${portName:0:1}/$portName/$portName-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="5e86ac0777357e006eb04cd28f7ed9f811d48dffa603d3891ac6d2b92280dc91"
|
||||
|
||||
ARCHITECTURES="any"
|
||||
|
||||
PROVIDES="
|
||||
$portName = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python39 python310)
|
||||
PYTHON_VERSIONS=(3.9 3.10)
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
eval "PROVIDES_${pythonPackage}=\"
|
||||
${portName}_$pythonPackage = $portVersion
|
||||
\""
|
||||
eval "REQUIRES_$pythonPackage=\"
|
||||
haiku
|
||||
html5lib_$pythonPackage
|
||||
cmd:python$pythonVersion
|
||||
\""
|
||||
BUILD_REQUIRES+="
|
||||
setuptools_$pythonPackage
|
||||
"
|
||||
BUILD_PREREQUIRES+="
|
||||
cmd:python$pythonVersion
|
||||
"
|
||||
TEST_REQUIRES+="
|
||||
html5lib_$pythonPackage
|
||||
cmd:python$pythonVersion
|
||||
"
|
||||
done
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
python=python$pythonVersion
|
||||
installLocation=$prefix/lib/$python/vendor-packages/
|
||||
export PYTHONPATH=$installLocation:$PYTHONPATH
|
||||
|
||||
mkdir -p $installLocation
|
||||
rm -rf build
|
||||
|
||||
$python setup.py build install \
|
||||
--root=/ --prefix=$prefix
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
$prefix/lib/python*
|
||||
done
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
for i in "${!PYTHON_VERSIONS[@]}"; do
|
||||
python=python${PYTHON_VERSIONS[$i]}
|
||||
|
||||
$python run_tests.py
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user