diff options
author | Chris Severance | 2015-09-08 05:54:03 -0400 |
---|---|---|
committer | Chris Severance | 2015-09-08 05:54:03 -0400 |
commit | fdda0852c8bab6e8a37d3156e24ced00d3acf090 (patch) | |
tree | 46f278ba82e9b40c2b68196a4b74363e106f0642 | |
download | aur-fdda0852c8bab6e8a37d3156e24ced00d3acf090.tar.gz |
made python2 package
-rw-r--r-- | .SRCINFO | 34 | ||||
-rw-r--r-- | PKGBUILD | 129 |
2 files changed, 163 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..1c063614275f --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,34 @@ +pkgbase = python2-aws-eb-cli + pkgdesc = The API and CLI tools that provide access to Amazon Elastic Beanstalk awsebcli + pkgver = 3.5.2 + pkgrel = 1 + url = http://aws.amazon.com/code/6752709412171743 + arch = any + license = Apache + makedepends = python2 + makedepends = python2-distribute + source = https://pypi.python.org/packages/source/a/awsebcli/awsebcli-3.5.2.tar.gz + sha256sums = a753dbff9a9888b50ba13b221e6e8126e4697a1d61ba871e37c4ac782686da5f + +pkgname = python2-aws-eb-cli + depends = python2 + depends = python2-pyyaml>=3.11 + depends = python2-botocore>=1.0.1 + depends = python2-cement=2.4.0 + depends = python2-colorama=0.3.3 + depends = python2-pathspec=0.3.3 + depends = python2-docopt>=0.6.1 + depends = python2-docopt<0.7 + depends = python2-requests>=2.6.1 + depends = python2-requests<2.7 + depends = python2-texttable>=0.8.1 + depends = python2-texttable<0.9 + depends = python2-websocket-client>=0.11.0 + depends = python2-websocket-client<1.0 + depends = python2-docker-py>=1.1.0 + depends = python2-docker-py<1.2 + depends = python2-dockerpty>=0.3.2 + depends = python2-dockerpty<0.4 + depends = python2-blessed=1.9.5 + conflicts = python- + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b66be4566b2f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,129 @@ +# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com +# Contributor: Douglas Creager (dcreager AT dcreager DOT NET) +# Contributor: Josh David Miller (josh AT joshdavidmiller DOT COM) +# Contributor: David Pretty (david DOT pretty AT gmail DOT COM) +# Contributor: Johannes Zellner (johannes AT nebulon DOT DE) + +# Unlike aws-cli which allows >= versions, this package checks and crashes +# if the exact == and < versions aren't installed. +# To build these, download the packages from the AUR or ABS and change the version. + +set -u +_pyver="python2" +_pybase='aws-eb-cli' +if [ "${_pyver}" = 'python' ]; then +pkgname="${_pybase}" +_pyverother='python2' +else +pkgname="${_pyver}-${_pybase}" +_pyverother='python' +fi +_pybase="${_pybase//-/}" +pkgver='3.5.2' +pkgrel='1' +pkgdesc='The API and CLI tools that provide access to Amazon Elastic Beanstalk awsebcli' +arch=('any') +url='http://aws.amazon.com/code/6752709412171743' +license=('Apache') # Apache License 2.0 +makedepends=("${_pyver}" "${_pyver}-distribute") # same as python-setuptools +_srcdir="${_pybase}-${pkgver}" +#_verwatch=("https://pypi.python.org/simple/${_pybase}/" "${_pybase}-\([0-9\.]\+\)\.tar\.gz" 't') +source=("https://pypi.python.org/packages/source/${_pybase: 0:1}/${_pybase}/${_pybase}-${pkgver}.tar.gz") +sha256sums=('a753dbff9a9888b50ba13b221e6e8126e4697a1d61ba871e37c4ac782686da5f') + +# Convert python requires to PKGBUILD depends +# $1: prefix python- or python2- +# $2: space separated list of packages to drop < or <=: 'foo bar' +# (because our packages are often too new) +# $3: what to convert == to: '>=' or '=' +# returns array _pydepends=() +_fn_pydepends() { + # Paste in from setup.py. This function does NOT work in zsh. +local _requires=" +requires = ['pyyaml>=3.11', + 'botocore>=1.0.1', + 'cement==2.4', + 'colorama==0.3.3', + 'pathspec==0.3.3', + ## For docker-compose + 'docopt >= 0.6.1, < 0.7', + 'requests >= 2.6.1, < 2.7', + 'texttable >= 0.8.1, < 0.9', + 'websocket-client >= 0.11.0, < 1.0', + 'docker-py >= 1.1.0, < 1.2', + 'dockerpty >= 0.3.2, < 0.4', + #found further down in setup.py + 'blessed==1.9.5', + ] +" + # Convert requires=[] to local _requires=() + _requires="${_requires//requires = \[/local _requires=(}" + _requires="${_requires//\]/)}" + eval "${_requires}" + _requires=("${_requires[@]// /}") # embedded spaces + _requires=("${_requires[@]%,}") # trailing commas + _requires=("${_requires[@]//==/$3}") # translate == + local _pynoless=" $2 " # we can search for ' foo ' + _pydepends=() + local _pyst1 + for _pyst1 in "${_requires[@]}"; do # foo>=0.0,<=0.0 + local _pyname="${_pyst1%%[<=>]*}" # foo + _pyst1="${_pyst1#${_pyname}}" # >=0.0,<=0.0 + local IFS=',' + local _pyst2=(${_pyst1}) # (>=0.0 <=0.0) + _pyst2=("${_pyst2[@]/#/$1${_pyname}}") # (foo>=0.0 foo<=0.0) + local _pystn + for _pystn in "${!_pyst2[@]}"; do + if [[ "${_pyst2[${_pystn}]}" == *\<* ]] && [ "${_pynoless// ${_pyname} /}" != "${_pynoless}" ]; then + unset _pyst2[${_pystn}] + fi + done + _pydepends+=("${_pyst2[@]}") + done +} +_fn_pydepends "${_pyver}-" '' '=' +# vercmp doesn't consider 2.4 and 2.4.0 equal +_pydepends=("${_pydepends[@]//-cement=2.4/-cement=2.4.0}") +unset -f _fn_pydepends + +build() { + set -u + cd "${_srcdir}" + ${_pyver} setup.py build + # Fix the location of the dev tools + #sed -i 's/LinuxClimbUpDepth\s=.*$/LinuxClimbUpDepth = 0/g' \ + # ${srcdir}/AWS-ElasticBeanstalk-CLI-${pkgver}/eb/linux/python3/scli/constants.py + #sed -i 's/LinuxRepoScript\s=.*$/LinuxRepoScript = \x27AWSDevTools\/AWSDevTools-RepositorySetup.sh\x27/g' \ + # ${srcdir}/AWS-ElasticBeanstalk-CLI-${pkgver}/eb/linux/python3/scli/constants.py + set +u +} + +check() { + set -u + cd "${_srcdir}" + # If pip is installed, some package tests download missing packages. We can't allow that. + #${_pyver} setup.py test --verbose + set +u +} + +package() { + set -u + depends=("${_pyver}" "${_pydepends[@]}") + conflicts=("${_pyverother}-${pkgbase}") + cd "${_srcdir}" + ${_pyver} 'setup.py' install --root "${pkgdir}" + install -Dpm644 'LICENSE.txt' "${pkgdir}/usr/share/licenses/${pkgname%-git}/LICENSE" + + # Install the files into /opt since they depend on a non-standard directory + # structure. + #mkdir -p ${pkgdir}/opt + #cp -r ${srcdir}/AWS-ElasticBeanstalk-CLI-${pkgver}/eb/linux/python3 ${pkgdir}/opt/aws-eb-cli + #cp -r ${srcdir}/AWS-ElasticBeanstalk-CLI-${pkgver}/AWSDevTools/Linux ${pkgdir}/opt/aws-eb-cli/AWSDevTools + + # Link the CLI program into /usr/bin + #mkdir -p ${pkgdir}/usr/bin + #ln -s ../../opt/aws-eb-cli/eb ${pkgdir}/usr/bin + set +u +} +set +u +# vim:set ts=2 sw=2 et: |