I'm not all that familiar with it but this is what etotheipi used to build 0.92 at least.
That script also requires some extra attention if you want to create an offline bundle. This link (WARNING: Massive amounts of techno-babble) and some follow-up posts roughly describe the process for building offline bundles.