summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMarcell Meszaros2022-04-06 18:29:44 +0200
committerMarcell Meszaros2022-04-06 20:06:13 +0200
commit4b7aeae80150a8cd2a2ae6fdf134da361a74f94d (patch)
tree41e11d1c2b01d1b9d91558e08c17ab7267d2663a /PKGBUILD
parent2b14a3829d560e31daf3aee86a36df52f9414861 (diff)
downloadaur-4b7aeae80150a8cd2a2ae6fdf134da361a74f94d.tar.gz
edit description; cleanup and lint build script code
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD36
1 files changed, 18 insertions, 18 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 13ffe27c86a4..fd9df710c5f4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,65 +1,65 @@
# Maintainer: Marcell Meszaros < marcell.meszaros AT runbox.eu >
# Contributor: jyantis <yantis@yantis.net>
-pkgname=python2-colorama-git
+_gitname='colorama'
+pkgname="python2-${_gitname}-git"
pkgver=0.4.4.r50.gaff7fb2
pkgrel=1
epoch=1
-pkgdesc='Simple cross-plaform colored terminal text in Python 2'
+pkgdesc='Python API for cross-platform colored terminal text (packaged for Python 2)'
arch=('any')
-url='https://github.com/tartley/colorama'
+url="https://github.com/tartley/${_gitname}"
license=('BSD')
depends=('python2')
makedepends=('git' 'python2-setuptools')
-source=('git+https://github.com/tartley/colorama.git')
+source=("git+${url}.git")
sha256sums=('SKIP')
-provides=('python2-colorama')
-conflicts=('python2-colorama')
+provides=("${pkgname%-*}")
+conflicts=("${pkgname%-*}")
prepare() {
- cd colorama
+ cd "${_gitname}"
# Patch any #!/usr/bin/python to #!/usr/bin/python2
- for file in $(find . -name '*.py' -print); do
- sed -r -i 's_^#!.*/usr/bin/python(\s|$)_#!/usr/bin/python2_' $file
- sed -r -i 's_^#!.*/usr/bin/env(\s)*python(\s|$)_#!/usr/bin/env python2_' $file
+ find . -name '*.py' -print | while read file; do
+ sed -r -i 's_^#!.*/usr/bin/python(\s|$)_#!/usr/bin/python2_' "${file}"
+ sed -r -i 's_^#!.*/usr/bin/env(\s)*python(\s|$)_#!/usr/bin/env python2_' "${file}"
done
}
pkgver() {
- cd colorama
+ cd "${_gitname}"
# Generate git tag based version. Count only proper (v)#.#* [#=number] tags.
local _gitversion=$(git describe --long --tags --match '[v0-9][0-9.][0-9.]*' | sed -e 's|^v||')
# Generate Python-compatible SCM version from git version
- local _py_project_scm_version=$(echo $_gitversion | sed \
+ local _py_project_scm_version=$(echo "${_gitversion}" | sed \
-e 's|\-\([0-9]\+\)-\(g[0-9a-f]\+\)|.dev\1+\2|'
)
# Replace project version with generated Python-compatible SCM version
- sed -i -e "s|^__version__.\+\$|__version__ = '${_py_project_scm_version}'|" './colorama/__init__.py'
+ sed -i -e "s|^__version__.\+\$|__version__ = '${_py_project_scm_version}'|" "./${_gitname}/__init__.py"
# Format git-based version for pkgver
- echo $_gitversion | sed \
+ echo "${_gitversion}" | sed \
-e 's|^\([0-9][0-9.]*\)-\([a-zA-Z]\+\)|\1\2|' \
-e 's|\([0-9]\+-g\)|r\1|' \
-e 's|-|.|g'
}
build() {
- cd colorama
+ cd "${_gitname}"
python2 setup.py build
}
check() {
- cd colorama
+ cd "${_gitname}"
python2 setup.py test --verbose
}
package() {
- cd colorama
-
+ cd "${_gitname}"
python2 setup.py install --root="${pkgdir}" --optimize=1
# Install License