diff options
author | Jonathan Yantis | 2015-06-11 09:07:09 -0700 |
---|---|---|
committer | Jonathan Yantis | 2015-06-11 09:07:09 -0700 |
commit | 5b481b21739f4a15b6d01bc2c6565e7788139fc1 (patch) | |
tree | cfb22a45b87e2d5947f9cb3539608324d4e6517b /PKGBUILD | |
download | aur-python-sh-git.tar.gz |
Initial import
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..aa91cfe4db1e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,52 @@ +# Maintainer: jyantis <yantis@yantis.net> +pkgname=python-sh-git +pkgver=1.11.r708.7a4e296 +pkgrel=2 +pkgdesc='A full-fledged subprocess interface for Python 3 that allows you to call any program as if it were a function' +arch=('any') +url='https://github.com/amoffat/sh' +license=('MIT') +depends=('python') +source=("git+https://github.com/amoffat/sh") +sha256sums=('SKIP') +makedepends=('git' 'python-setuptools') +provides=('python-sh') +conflicts=('python-sh') + +pkgver() { + cd sh + printf "%s.r%s.%s" "${_version}" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} +pkgver() { + cd sh + set -o pipefail + _gitversion=$( git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" ) + + if [ -f "sh.py" ]; then + printf "%s.%s" "$(grep -R "__version__ =" sh.py | awk -F\" '{print $2}')" $_gitversion | sed 's/-/./g' + else + printf "%s" $_gitversion + fi +} +build() { + cd sh + python setup.py build +} + +package() { + cd sh + + # We don't need anything related to git in the package + rm -rf .git* + + python setup.py install --root="${pkgdir}" --optimize=1 + + # Install License + install -D -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + + # Install Documentation + install -D -m644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md" +} + +# vim:set ts=2 sw=2 et: |