summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorTruocolo2024-02-21 17:18:03 +0100
committerTruocolo2024-02-21 17:18:03 +0100
commit2c4237bba60e67b59c322058c5e2ecd77363f15a (patch)
treeae6ccf31800b6200e960d15603d0e6067920bf6a /PKGBUILD
parentbf5ec65b42e16193c4d481f4e45f686d11d3dd45 (diff)
downloadaur-python2-chardet.tar.gz
add license; fix indentation, modularize
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD85
1 files changed, 61 insertions, 24 deletions
diff --git a/PKGBUILD b/PKGBUILD
index bad630d25a6f..98ba174120ce 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,45 +1,82 @@
+# SPDX-License-Identifier: AGPL-3.0
+#
+# Maintainer: Pellegrino Prevete <cGVsbGVncmlub3ByZXZldGVAZ21haWwuY29tCg== | base -d>
+# Maintainer: Truocolo <truocolo@aol.com>
# Contributor: Marcell Meszaros < marcell.meszaros AT runbox.eu >
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: William Rea <sillywilly@gmail.com>
-pkgname='python2-chardet'
-_name="${pkgname#python2-}"
+_py="python2"
+_pkg='chardet'
+pkgname="${_py}-${_pkg}"
+_name="${_pkg}"
pkgver=4.0.0
pkgrel=3
pkgdesc='Python 2 module for character encoding auto-detection'
-arch=('any')
-url="https://pypi.org/project/${_name}/"
-license=('LGPL')
-depends=('python2')
-makedepends=('python2-setuptools')
-checkdepends=('python2-pytest')
-_tarname="${_name}-${pkgver}"
-source=("https://pypi.python.org/packages/source/${_name::1}/${_name}/${_tarname}.tar.gz")
-b2sums=('6a4c49441a9f21215a752fad970820f623f406695ad30518ac2acd423ed1e467cedbcf743fe63e54ce384d426f62aa2f6b0013b086c3efaba28d8d8f976befc9')
+arch=(
+ 'any'
+)
+url="https://pypi.org/project/${_pkg}"
+license=(
+ 'LGPL'
+)
+depends=(
+ "${_py}"
+)
+makedepends=(
+ "${_py}-setuptools"
+)
+checkdepends=(
+ "${_py}-pytest"
+)
+_tarname="${_pkg}-${pkgver}"
+_pypi="https://pypi.python.org/packages/source"
+source=(
+ "${_pypi}/${_pkg::1}/${_pkg}/${_tarname}.tar.gz")
+b2sums=(
+ '6a4c49441a9f21215a752fad970820f623f406695ad30518ac2acd423ed1e467cedbcf743fe63e54ce384d426f62aa2f6b0013b086c3efaba28d8d8f976befc9'
+)
prepare() {
- cd "${_tarname}"
- sed -e 's|#![ ]*/usr/bin/python$|#!/usr/bin/python2|' \
- -e 's|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|' \
- -e 's|#![ ]*/bin/env python$|#!/usr/bin/env python2|' \
- -i $(find . -name '*.py')
+ cd \
+ "${_tarname}"
+ sed \
+ -e 's|#![ ]*/usr/bin/python$|#!/usr/bin/python2|' \
+ -e 's|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|' \
+ -e 's|#![ ]*/bin/env python$|#!/usr/bin/env python2|' \
+ -i $(find . -name '*.py')
}
build() {
- cd "${_tarname}"
- python2 setup.py build
+ cd \
+ "${_tarname}"
+ "${_py}" \
+ setup.py \
+ build
}
check() {
- cd "${_tarname}"
- python2 -m pytest
+ cd \
+ "${_tarname}"
+ "${_py}" -m pytest
}
package() {
- cd "${_tarname}"
- python2 setup.py install --root="${pkgdir}" --optimize=1
+ cd \
+ "${_tarname}"
+ "${_py}" \
+ setup.py \
+ install \
+ --root="${pkgdir}" \
+ --optimize=1
- # To avoid file conflict with the python3 version
- mv "${pkgdir}/usr/bin/chardetect"{,-py2}
+ # To avoid file conflict
+ # with the python3 version
+ cp \
+ "${pkgdir}/usr/bin/${_pkg}ect"{,2}
+ mv \
+ "${pkgdir}/usr/bin/${_pkg}ect"{,-py2}
}
+
+# vim:set sw=2 sts=-1 et: