aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-11-19 19:43:44 +0100
committerJakub Jirutka <jakub@jirutka.cz>2016-11-19 20:23:01 +0100
commit2b8264d60c195bd95430f6b00dfb8199bbfcbf83 (patch)
treeb41a1c5c61505d868a3de10727dee8fbd74d76bf /community
parentdbee2cf6f3a33a163e7279836e9abdd3af5494f8 (diff)
community/py-sqlparse: fix conflict in /usr/bin between py2 and py3
Diffstat (limited to 'community')
-rw-r--r--community/py-sqlparse/APKBUILD10
1 files changed, 9 insertions, 1 deletions
diff --git a/community/py-sqlparse/APKBUILD b/community/py-sqlparse/APKBUILD
index 89df52c5373..f8fe598d919 100644
--- a/community/py-sqlparse/APKBUILD
+++ b/community/py-sqlparse/APKBUILD
@@ -8,6 +8,7 @@ pkgdesc="A non-validating SQL parser module for Python"
url="https://sqlparse.readthedocs.io"
arch="noarch"
license="BSD"
+depends="py3-${pkgname#py-}"
makedepends="python2-dev py-setuptools python3-dev"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
@@ -20,7 +21,8 @@ build() {
}
package() {
- mkdir -p "$pkgdir"
+ mkdir -p "$pkgdir"/usr/bin
+ ln -s sqlformat-3 "$pkgdir"/usr/bin/sqlformat
}
_py2() {
@@ -34,12 +36,18 @@ _py3() {
_py() {
local python="$1"
+ local pyver="${1:6:1}"
pkgdesc="$pkgdesc (for $python)"
depends="$depends $python"
install_if="$pkgname=$pkgver-r$pkgrel $python"
cd "$builddir"
$python setup.py install --prefix=/usr --root="$subpkgdir"
+
+ # Add version suffix to executable files.
+ local path; for path in "$subpkgdir"/usr/bin/*; do
+ mv "$path" "$path-$pyver" || return 1
+ done
}
md5sums="ec1bab3438f358b6be72fc1912bbd648 sqlparse-0.2.2.tar.gz"