void-packages/srcpkgs/python-sqlparse/template

58 lines
1.4 KiB
Plaintext

# Template file for 'python-sqlparse'
pkgname=python-sqlparse
version=0.1.13
revision=1
noarch=yes
wrksrc="sqlparse-${version}"
python_versions="2.7 3.4"
hostmakedepends="python-setuptools python3.4-setuptools"
depends="python"
pycompile_module="sqlparse"
short_desc="Non-validating SQL parser for Python2"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="https://github.com/andialbrecht/sqlparse"
license="BSD"
distfiles="${PYPI_SITE}/s/sqlparse/sqlparse-${version}.tar.gz"
checksum=9f3953add43be4f342a272cc2bbb8998aa450f87948aa1d72599ba1447ed3e15
post_extract() {
cp -a ${wrksrc} /tmp/python2.7-build
cp -a ${wrksrc} /tmp/python3.4-build
mv /tmp/python{2.7,3.4}-build ${wrksrc}
}
pre_build() {
cd ${wrksrc}/python3.4-build
mv bin/sqlformat{,3}
sed -i 's,#!/usr/bin/env python,&3.4,' bin/sqlformat3
sed -i "s,'bin/sqlformat','bin/sqlformat3'," setup.py
}
do_build() {
cd ${wrksrc}/python2.7-build
python setup.py build
cd ${wrksrc}/python3.4-build
python3.4 setup.py build
}
do_install() {
cd ${wrksrc}/python2.7-build
python setup.py install --root=${DESTDIR}
cd ${wrksrc}/python3.4-build
python3.4 setup.py install --root=${DESTDIR}
}
python3.4-sqlparse_package() {
noarch=yes
depends="python3.4"
pycompile_version="3.4"
pycompile_module="sqlparse"
short_desc="${short_desc/Python2/Python3.4}"
pkg_install() {
vmove usr/bin/sqlformat3
vmove usr/lib/python3.4
}
}