#!/bin/sh -ex

test -f setup.py
test ! -e debian
rm -rf deb_dist
python3 setup.py --command-packages=stdeb.command debianize --suite smurf --maintainer "Matthias Urlichs <matthias@urlichs.de>" "$@"

cat >debian/.gitignore <<_
/files
/*.log
/*.debhelper
/*.debhelper-build-stamp
/*.substvars
/debhelper-build-stamp
_
sed -ne 's#^Package: #/#p' <debian/control >>debian/.gitignore

fgrep -qs .pybuild .gitignore || echo '/.pybuild/' >>.gitignore	
git add debian .gitignore
git commit -m "Debianized."
echo DONE
