build package scripts prepared
fixed some bugs in build scripts