58 lines
1.4 KiB
Bash
58 lines
1.4 KiB
Bash
# Template file for 'python-sqlparse'
|
|
pkgname=python-sqlparse
|
|
version=0.1.14
|
|
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=e561e31853ab9f3634a1a2bd53035f9e47dfb203d56b33cc6569047ba087daf0
|
|
|
|
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
|
|
}
|
|
}
|