buildsystem: Adapt 'newpackage' script to hierarchical package structure.