Files
haikuports/dev-python/mechanize/mechanize-0.4.8.recipe
2025-08-04 08:16:52 +00:00

88 lines
2.0 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
SUMMARY="Stateful programmatic web browsing in Python"
DESCRIPTION="Stateful programmatic web browsing in Python, after Andy \
Lesters 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="2"
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_VERSIONS=(3.10)
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
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 pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
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 pythonVersion in ${PYTHON_VERSIONS[@]}; do
python=python$pythonVersion
$python run_tests.py
done
}