From 2e9a3da4cd5b8bb559ed480fd0e7eaa1951b9846 Mon Sep 17 00:00:00 2001 From: Crestwave <35413013+Crestwave@users.noreply.github.com> Date: Sat, 13 Oct 2018 11:15:17 +0000 Subject: [PATCH] speedtest-cli: new recipe (#3212) --- .../speedtest-cli/speedtest_cli-2.0.2.recipe | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 net-analyzer/speedtest-cli/speedtest_cli-2.0.2.recipe diff --git a/net-analyzer/speedtest-cli/speedtest_cli-2.0.2.recipe b/net-analyzer/speedtest-cli/speedtest_cli-2.0.2.recipe new file mode 100644 index 000000000..a563ad484 --- /dev/null +++ b/net-analyzer/speedtest-cli/speedtest_cli-2.0.2.recipe @@ -0,0 +1,72 @@ +SUMMARY="A CLI for testing internet bandwidth using speedtest.net" +DESCRIPTION="speedtest-cli is a command-line interface for testing internet \ +bandwidth using speedtest.net. Note that latency reported by this tool should \ +not be relied on as a value indicative of ICMP style latency; rather, it is a \ +relative value used for determining the lowest latency server for performing \ +the actual speed test against. +Also note that its results may also be inconsistent with speedtest.net due to \ +the website's migration to using pure socket tests instead of HTTP based ones, \ +the application being written in Python, \ +differing performance between Python versions, \ +and CPU and Memory capacity and speed." +HOMEPAGE="https://github.com/sivel/speedtest-cli" +COPYRIGHT="2012-2018 Matt Martz" +LICENSE="Apache v2" +REVISION="1" +SOURCE_URI="$HOMEPAGE/archive/v$portVersion.tar.gz" +CHECKSUM_SHA256="5e22f2dcce1c9020f33faf559b22727483f022008a2912b85d573e578374b6a0" +SOURCE_FILENAME="speedtest-cli-$portVersion.tar.gz" +SOURCE_DIR="speedtest-cli-$portVersion" + +ARCHITECTURES="any" + +PROVIDES=" + $portName = $portVersion + " +REQUIRES=" + haiku + " +BUILD_REQUIRES=" + haiku_devel + " + +PYTHON_PACKAGES=(python python3) +PYTHON_VERSIONS=(2.7 3.6) +for i in "${!PYTHON_PACKAGES[@]}"; do +pythonPackage=${PYTHON_PACKAGES[i]} +pythonVersions=${PYTHON_VERSIONS[$i]} +eval "PROVIDES_${pythonPackage}=\"\ + ${portName}_$pythonPackage = $portVersion\n\ + cmd:speedtest_cli_$pythonPackage + \"; \ +REQUIRES_$pythonPackage=\"\ + haiku\n\ + cmd:python$pythonVersion\ + \"" +BUILD_REQUIRES="$BUILD_REQUIRES + 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 + + rm -rf $binDir/speedtest + mv $binDir/speedtest-cli $binDir/speedtest-cli-$pythonPackage + packageEntries $pythonPackage \ + $prefix/lib/python* \ + $binDir + done +}