void-packages/srcpkgs/python-sqlalchemy-migrate/template

58 lines
1.7 KiB
Bash

# Template file for 'python-sqlalchemy-migrate'
pkgname=python-sqlalchemy-migrate
version=0.9.5
revision=1
noarch=yes
wrksrc="${pkgname#*-}-${version}"
python_versions="2.7 3.4"
hostmakedepends="python-setuptools python3.4-setuptools python-pbr python3.4-pbr"
depends="python-pbr python-SQLAlchemy python-decorator python-six python-sqlparse python-tempita"
pycompile_module="migrate"
short_desc="Database schema migration for SQLAlchemy (Python2)"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="https://github.com/stackforge/sqlalchemy-migrate"
license="MIT"
distfiles="${PYPI_SITE}/s/sqlalchemy-migrate/sqlalchemy-migrate-${version}.tar.gz"
checksum=d36ae0879b418c4a7011c081a7b05aa9eaf2f2bc38402cdad4ad64369de31d9c
pre_build() {
cp -a ${wrksrc} /tmp/migrate-2.7
cp -a ${wrksrc} /tmp/migrate-3.4
mv /tmp/migrate-{2.7,3.4} ${wrksrc}
cd ${wrksrc}/migrate-3.4
sed -i 's,\(migrate\) =,\13 =,;s,\(migrate-repository\) =,\13 =,' setup.cfg
find . -type f -name '*.py' -exec sed -i '/^#!/s,python$,&3.4,' {} +
}
do_build() {
cd ${wrksrc}/migrate-2.7
python setup.py build
cd ${wrksrc}/migrate-3.4
python3.4 setup.py build
}
do_install() {
cd ${wrksrc}/migrate-2.7
python setup.py install --root=${DESTDIR}
vlicense COPYING LICENSE
cd ${wrksrc}/migrate-3.4
python3.4 setup.py install --root=${DESTDIR}
}
python3.4-sqlalchemy-migrate_package() {
noarch=yes
depends="python3.4-pbr python3.4-SQLAlchemy python3.4-decorator python3.4-six
python3.4-sqlparse python3.4-tempita"
pycompile_version="3.4"
pycompile_module="migrate"
short_desc="${short_desc/Python2/Python3.4}"
pkg_install() {
vmove usr/bin/migrate*3
vmove usr/lib/python3.4
vlicense ${wrksrc}/COPYING LICENSE
}
}