Move build control in package generation script