diff options
author | NextHendrix | 2018-03-27 15:44:13 +0100 |
---|---|---|
committer | NextHendrix | 2018-03-27 15:44:13 +0100 |
commit | 3c4ad950f9b717f352a2204166fe5555db79c062 (patch) | |
tree | b4e8722873242795a136d54f69994afe4e0a1d46 | |
download | aur-3c4ad950f9b717f352a2204166fe5555db79c062.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | LICENSE | 21 | ||||
-rw-r--r-- | PKGBUILD | 90 |
3 files changed, 129 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..86ae1ea96e82 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = python-asteval + pkgdesc = Safe, minimalistic evaluator of python expression using ast module + pkgver = 0.9.12 + pkgrel = 0 + url = http://github.com/newville/asteval + arch = any + license = BSD + makedepends = python-pip + depends = python + depends = python-numpy + depends = python-six + source = https://pypi.python.org/packages/6f/6b/63b958aef9e2b155450d3059756e68d54ead0898b67a793a7ab79ccbbabd/asteval-0.9.12.tar.gz + source = LICENSE + md5sums = 1db193c2c20f4ab41a2ea325940e7712 + md5sums = d45ae5800909759cbaf63b457165e330 + +pkgname = python-asteval + diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..ae6eccd69a85 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2017 Matthew Newville, The University of Chicago + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..d926f8a16ef2 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,90 @@ +# Maintainer: NextHendrix <chris.jones.492@gmail.com> + +pkgname=python-asteval +pkgver=0.9.12 +pkgrel=0 +pkgdesc='Safe, minimalistic evaluator of python expression using ast module' +arch=(any) +url=http://github.com/newville/asteval +license=(BSD) +depends=(python python-numpy python-six) +## EXTRA_DEPENDS ## +makedepends=(python-pip) +checkdepends=() +provides=() +conflicts=(${provides%=*}) # No quotes, to avoid an empty entry. +source=(https://pypi.python.org/packages/6f/6b/63b958aef9e2b155450d3059756e68d54ead0898b67a793a7ab79ccbbabd/asteval-0.9.12.tar.gz) +md5sums=(1db193c2c20f4ab41a2ea325940e7712) +source+=(LICENSE) +md5sums+=(d45ae5800909759cbaf63b457165e330) +if [[ ${source[0]} =~ ^git+ ]]; then + provides+=("${pkgname%-git}") + conflicts+=("${pkgname%-git}") +fi + +export PIP_CONFIG_FILE=/dev/null +export PIP_DISABLE_PIP_VERSION_CHECK=true + +_first_source() { + echo " ${source_i686[@]} ${source_x86_64[@]} ${source[@]}" | + tr -s ' ' | tail -c+2 | cut -d' ' -f1 +} + +_is_wheel() { + [[ $(_first_source) =~ \.whl$ ]] +} + +_dist_name() { + basename "$(_first_source)" | + sed 's/\(\.tar\.gz\|\.tgz\|\.tar\.bz2\|\.zip\|\.git\)$//' +} + +if [[ $(_first_source) =~ ^git+ ]]; then + pkgver() { + ( set -o pipefail + cd "$srcdir/$(_dist_name)" + git describe --long --tags 2>/dev/null | + sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' || + printf "r%s.%s" \ + "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + ) + } +fi + +build() { + if _is_wheel; then return; fi + cd "$srcdir/$(_dist_name)" + # See Arch Wiki/PKGBUILD/license. + # Get the first filename that matches. + local test_name + if [[ ${license[0]} =~ ^(BSD|MIT|ZLIB|Python)$ ]]; then + for test_name in LICENSE LICENSE.txt license.txt COPYING.md COPYING.rst COPYING.txt COPYRIGHT; do + if cp "$srcdir/$(_dist_name)/$test_name" "$srcdir/LICENSE" 2>/dev/null; then + break + fi + done + fi + # Build the wheel (which can fail) only after fetching the license. + pip wheel -v --no-deps --wheel-dir="$srcdir" \ + --global-option=build --global-option=-j"$(nproc)" . || + true +} + +check() { + # Remove the first line line to run tests. + # You may need to call `python setup.py build_ext -i` first. + return 0 + if _is_wheel; then return; fi + cd "$srcdir/$(_dist_name)" + python setup.py -q test +} + +package() { + cd "$srcdir" + # pypa/pip#3063: pip always checks for a globally installed version. + pip --quiet install --root="$pkgdir" --no-deps --ignore-installed \ + "$(ls ./*.whl 2>/dev/null || echo ./"$(_dist_name)")" + if [[ -f LICENSE ]]; then + install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + fi +} |