dev-python/cryptography-vectors: new recipe.

This commit is contained in:
fbrosson
2018-10-31 12:25:59 +00:00
parent 1f5b4eff70
commit 8036e56781

View File

@@ -0,0 +1,102 @@
SUMMARY="Test vectors for the cryptography package"
DESCRIPTION="cryptography-vectors is a special Python module which is actually \
just a collection of data files. Its only purpose is to provide packagers the \
data files required to test the \"cryptography\" Python module. \
Normal users will therefore never need to install this one."
HOMEPAGE="https://pypi.org/project/cryptography-vectors/
https://github.com/pyca/cryptography"
COPYRIGHT="2013-2018 The cryptography developers"
LICENSE="Apache v2
BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://pypi.io/packages/source/c/cryptography-vectors/cryptography_vectors-$portVersion.tar.gz"
CHECKSUM_SHA256="bf4d9b61dce69c49e830950aa36fad194706463b0b6dfe81425b9e0bc6644d46"
ARCHITECTURES="any"
PROVIDES="
cryptography_vectors = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
setuptools_python
setuptools_python3
"
BUILD_PREREQUIRES="
cmd:python
cmd:python3
"
PYTHON_PACKAGES=(python python3)
PYTHON_VERSIONS=(2.7 3.6)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
\""
eval "REQUIRES_$pythonPackage=\"
haiku
cmd:python$pythonVersion
\""
done
BUILD()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
rm -rf "$sourceDir"-$pythonPackage
cp -a "$sourceDir" "$sourceDir"-$pythonPackage
cd "$sourceDir"-$pythonPackage
python=python$pythonVersion
$python setup.py build
done
}
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
cd "$sourceDir"-$pythonPackage
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH="$installLocation"
mkdir -p "$installLocation"
$python setup.py install \
--root=/ --prefix="$prefix"
install -m 755 -d "$dataDir"/licenses/packages/cryptography_vectors
install -m 644 -t "$dataDir"/licenses/packages/cryptography_vectors LICENSE*
rm "$dataDir"/licenses/packages/cryptography_vectors/LICENSE.APACHE
ln -s "`finddir B_SYSTEM_DATA_DIRECTORY`/licenses/Apache v2" \
"$dataDir"/licenses/packages/cryptography_vectors/LICENSE.APACHE
packageEntries $pythonPackage \
"$dataDir" \
"$prefix"/lib/$python
done
}
TEST()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
cd "$sourceDir"-$pythonPackage
python=python$pythonVersion
$python setup.py test
done
}