gbs export subcommand to export a Git tree to a tarball and spec file.
For command usage details, enter:
gbs export --help
Export source code to a default packaging directory:
$ gbs export info: Generating patches from git (upstream/4.1.5..HEAD) info: Didn't find any old 'Patch' tags, adding new patches after the last 'Source' tag. info: Didn't find any old '%patch' macros, adding new patches after the last '%setup' macro pristine-tar: successfully generated /var/tmp/.gbs_export_UJn0nS/sed-4.1.5.tar.gz info: package files have been exported to: /home/test/sed/packaging/sed-4.1.5-1 $ diff packaging/sed.spec packaging/sed-4.1.5-1/sed.spec 11a12,13 > # Patches auto-generated by git-buildpackage: > Patch0: 0001-hello.patch > 25a28,29 > # 0001-hello.patch > %patch0 -p1
From the log, you can see that a patch has been generated, and a tarball is created from the pristine-tar branch. The
--no-patch-exportoption can be used to disable this feature and generate a tarball from the current branch directly.
-ooption to generate packaging files to a specified path:
$ gbs export -o ~/
--source-rpmoption to generate a source RPM package:
gbs export -o ~/ --source-rpm
--specoption, if there are multiple spec files:
$ gbs export --spec=dlog.spec
--specoption only accepts a file name and must not contain any path info. GBS prefixes the packaging directory automatically.
--fallback-to-nativeoption to force the export process to perform packaging for non-native packages in the native packaging mode, ignoring the upstream branch and creating a tarball from HEAD (by default) or specified commit without generating any patch. Adding the
--fallback-to-nativeoption when issuing the
gbs exportcommand is equivalent to adding the
fallback_to_native = trueproperty to the
[general]section of the GBS configuration file.
This option serves as a work-around solution for solving export failures of some non-native packages caused by a tricky engineering problem. For Tizen native packages, the
gbs exportcommand always performs packaging in the native packaging mode.
$ gbs export --fallback-to-native