Improve packaging scripts
Merge branch 'master' into v1.6