you should use some eclass, probably distutils-r1