Portable version of the gen-version script