build: Moving packaging function into 'packages' file

packaging functions will be numerous, don't make common too big, let's
move to packages.