gbp-buildpackage-rpm

Name

gbp-buildpackage-rpm -- Build RPM packages from a Git repository

Synopsis

gbp buildpackage-rpm [--git-[no-]ignore-new] [--git-[no-]ignore-untracked] [--git-tag] [--git-verbose] [--git-color=[auto|on|off]] [--git-color-scheme=COLOR_SCHEME] [--git-notify=[auto|on|off]] [--git-tmp-dir=DIRECTORY] [--git-vendor=VENDOR] [--git-native=[auto|on|off]] [--git-upstream-branch=TREEISH] [--git-packaging-branch=BRANCH_NAME] [--git-pq-branch=BRANCH_NAME] [--git-ignore-branch] [--git-[no-]submodules] [--git-builder=BUILD_CMD] [--git-cleaner=CLEAN_CMD] [--git-[no-]sign-tags] [--git-keyid=GPG-KEYID] [--git-posttag=COMMAND] [--git-postbuild=COMMAND] [--git-postexport=COMMAND] [--git-prebuild=COMMAND] [--git-[no-]build] [--git-[no-]hooks] [--git-packaging-tag=TAG-FORMAT] [--git-upstream-tag=TAG-FORMAT] [--git-force-create] [--git-no-create-orig] [--git-upstream-tree=[TAG|BRANCH|TREEISH]] [--git-tarball-dir=DIRECTORY] [--git-compression-level=LEVEL] [--git-export-dir=DIRECTORY] [--git-export=TREEISH] [--git-packaging-dir=DIRECTORY] [--git-spec-file=FILEPATH] [--git-orig-prefix=PREFIX] [--git-export-sourcedir=DIRECTORY] [--git-export-specdir=DIRECTORY] [--git-[no-]pristine-tar] [--git-[no-]pristine-tar-commit] [--git-tag-only] [--git-retag] [--git-mock] [--git-dist=DISTRIBUTION] [--git-arch=ARCHITECTURE] [--git-mock-options=OPTIONS] [--git-mock-root=ROOT] [--git-[no-]patch-export] [--git-patch-export-rev=TREEISH] [--git-[no-]patch-numbers] [--git-patch-compress=THRESHOLD] [--git-patch-ignore-path=REGEX] [--git-patch-squash=COMMITISH] [--git-spec-vcs-tag=TAG_FORMAT]

DESCRIPTION

gbp buildpackage-rpm is used to build RPM packages from a Git repository. It is an RPM counterpart for the gbp buildpackage tool that is designed for building Debian packages.

gbp buildpackage-rpm will, in order:

OPTIONS

--git-[no-]ignore-new

Don't abort if there are uncommitted changes in the source tree or the current branch doesn't match the PACKAGING-BRANCH.

--git-[no-]ignore-untracked

Don't abort if there are untracked files in the source tree.

--git-tag

Add a git tag after a successful build.

--git-builder=BUILD_CMD

Use BUILD_CMD instead of rpmbuild -ba.

--git-cleaner=CLEAN_CMD

Use CLEAN_CMD.

--git-verbose

Verbose execution

--git-color=[auto|on|off]

Whether to use colored output.

--git-color-scheme=COLOR_SCHEME

Colors to use in output (when color is enabled). The format for COLOR_SCHEME is '<debug>:<info>:<warning>:<error>'. Numerical values and color names are accepted, empty fields imply the default color. For example --git-color-scheme='cyan:34::' would show debug messages in cyan, info messages in blue and other messages in default (i.e. warning and error messages in red).

--git-notify=[auto|on|off]

Whether to send a desktop notification after the build.

--git-tmp-dir=DIRECTORY

Base directory under which temporary directories are created.

--git-vendor=VENDOR

Distribution vendor name.

--git-native=[auto|on|off]

Define the 'nativity' of a package. The default value auto makes gbp buildpackage-rpm to guess. Guessing is based on the existence of upstream branch.

--git-upstream-branch=BRANCH_NAME

Branch to build the orig tarball from if --git-upstream-tree is set to BRANCH. Default is upstream.

--git-packaging-branch=BRANCH_NAME

If you're not on this branch when invoking gbp buildpackage-rpm it will fail. Default is master. This is done to make sure you don't accidentally release from a topic branch. Not being on this branch will be ignored when using --git-ignore-new.

--git-pq-branch=BRANCH_NAME

Name (format string) of the patch-queue/development branch. This makes building easier when working with separate packaging and development branches.

If --git-patch-export is enabled and gbp buildpackage-rpm detects that the current branch has a patch-queue/development branch it exports the patches from there instead of the tip of the current branch (unless --git-patch-export-rev is defined, of course). Similarly, if the current branch is a patch-queue/development branch gbp buildpackage-rpm will automatically enable patch-export and export packaging files from the packaging branch instead of the current branch (unless --git-export) is defined.

--git-ignore-branch

Don't check if the current branch matches PACKAGING-BRANCH.

--git-[no-]submodules

Include git submodules in the orig tarball.

--git-[no-]sign-tags

GPG sign all created tags.

--git-keyid=GPG-KEYID

Use this keyid for gpg signing tags.

--git-posttag=COMMAND

Excecute COMMAND after tagging a new version.

Exported environment variables are: GBP_TAG (the name of the generated tag), GBP_BRANCH (the branch the package was build from) and GBP_SHA1 (the sha1 of the commit the tag was created at).

--git-postbuild=COMMAND

Execute COMMAND after successful build.

Exported environment variables are: GBP_CHANGES_FILE (the name of the generated changes file), GBP_BUILD_DIR (the build dir).

--git-postexport=COMMAND

Execute COMMAND after exporting the source tree.

Exported environment variables are: GBP_GIT_DIR (the repository the package is being built from), GBP_TMP_DIR (the temporary directory where the sources have been initially exported).

--git-prebuild=COMMAND

Execute COMMAND from the build directory before calling rpmbuild or the application specified via --git-builder.

Exported environment variables are: GBP_GIT_DIR (the repository the package is being built from), GBP_BUILD_DIR (the build dir).

--git-[no-]build

Enable builder. Note: --git-no-build causes the postbuild hook to be disabled, too.

--git-[no-]hooks

Enable running all (cleaner, postexport, prebuild, postbuild, and posttag) hooks. Note: the --git-builder command is not affected by this option.

--git-packaging-tag=TAG-FORMAT

Use this tag format when tagging released versions of the package.

--git-upstream-tag=TAG-FORMAT

Use this tag format when looking for tags of upstream versions, default is upstream/%(version)s.

--git-force-create

Force creation of an orig tarball (overwriting a pre-existing one if present).

--git-no-create-orig

Don't try to create any orig tarball.

--git-export-dir=DIRECTORY

Export the packaging files from the current branch head (or the treeish object given via --git-export to DIRECTORY before building.

--git-export-sourcedir=DIRECTORY, --git-export-specdir=DIRECTORY

Subdirectories under export directory where packaging files are exported. The default build options of rpmbuild builder are also adjusted accordingly.

--git-export=TREEISH

Instead of exporting the current branch head, export the treeish object TREEISH. The special name INDEX exports the current index, WC.TRACKED exports all files tracked by Git in the current working copy as is, WC.UNTRACKED exports all untracked files too whereas WC (or WC.IGNORED) exports all files in the current working directory, even ignored files.

--git-packaging-dir=DIRECTORY

Subdirectory that contains the RPM packaging files.

--git-spec-file=FILEPATH

Relative path to the spec file to use. Special value auto causes gbp buildpackage-rpm to search and guess. Other values cause the --git-packaging-dir option to be ignored: the directory of the spec file is used, instead.

--git-upstream-tree=[TAG|BRANCH|TREEISH]

How to find the upstream sources used to generate the tarball. TAG looks at a tag corresponding to the version in the changelog. BRANCH looks at the upstream branch given via the --git-upstream-branch option. Other values are interpreted as treeishs.

This doesn't have any effect if --git-pristine-tar is being used.

--git-tarball-dir=DIRECTORY

Search for original tarballs in DIRECTORY instead of generating them.

--git-compression-level=LEVEL

Specifies the upstream tarball compression level if an upstream tarball needs to be built.

--git-orig-prefix=PREFIX

Prefix (directory) to be used when generating tarballs. Special value auto causes gbp buildpackage-rpm to guess the prefix.

--git-tag-only

Don't build, only tag and run post-tag hooks.

--git-retag

Don't fail tag operations if a tag with the same version already exists, but, overwrite the existing tag, instead.

--git-pristine-tar

Use pristine-tar when generating the upstream tarball if it doesn't exist.

--git-pristine-tar-commit

Commit the pristine-tar delta to the pristine-tar branch if a new tarball was generated and the pristine-tar data isn't already there.

--git-mock

Use mock to build the rpms by invoking gbp-builder-mock.

--git-dist

Build for this distribution when using mock (e.g.: epel-6).

--git-arch

Build for this architecture when using mock, default is to build for the current host architecture.

--git-mock-root

The mock root to use. Defaults to DIST-ARCH from above.

--git-mock-options

Additional options to pass to mock. Default is to pass no additional options.

--git-[no-]patch-export

Create patches from the commits between the upstream version and export-treeish. That is, after exporting packaging files (from the pacakging directory) gbp buildpackage-rpm creates one patch per commit (similar to git-format-patch) and updates the spec file in the export dir. You use --git-patch-export-rev to specify the tip commit of the patch series.

--git-patch-export-rev=TREEISH

Use TREEISH as the tip commit of the patch series instead of the default - i.e. treeish from which the packaging files are exported (which is defined with --git-export.

--git-[no-]patch-numbers

Whether the patch files should start with a number or not.

--git-patch-compress=THRESHOLD

Compress (auto-generated) patches larger than given THRESHOLD bytes. Special value 0 disabled patch compression.

--git-patch-ignore-path=REGEX

Exclude changes to path(s) matching REGEX in patch generation.

--git-patch-squash=COMMITISH

Squash commits up to the given COMMITISH into one monolitic diff. Could be used if one wants to squash commits from an upstream release up to a stable update into a single diff (commits on top of the stable would generate one patch per commit as usual). The format is '<commit_ish>[:<filename_base>]', i.e. commitish optionally followed by a colon and the desired filename base for the diff (suffix '.diff' is automatically added by gbp buildpackage-rpm). Magic word 'HEAD' translates to the patch-export-treeish when given as the squash-point. This allows one to configure gbp to always squash all commits into one monolithic diff.

--git-spec-vcs-tag=TAG_FORMAT

gbp buildpackage-rpm always automatically sets/updates the 'VCS:' tag in the spec file after exporting. This option defines the format string for the 'VCS:' tag. An empty value causes no 'VCS:' tag to be inserted and possible old 'VCS:' tag to be removed. Otherwise, the old 'VCS:' tag is updated or a new 'VCS:' tag is added if one does not exist. In the format string '%(tagname)s' expands to the long tag name (from git-describe) and '%(commit)s' expans to the sha1 of the exported commit.

EXAMPLES

Only build a source RPM with rpmbuild

      gbp buildpackage-rpm -bs
    

Build an RPM package with rpmbuild on a custom branch with the uncommitted changes included.

      gbp buildpackage-rpm --git-ignore-branch --git-export=WC.UNTRACKED
    

CONFIGURATION FILES

Several gbp.conf files are parsed to set defaults for the above command-line arguments. See the gbp.conf(5)> manpage for details.

All options in the config files are specified without the 'git-' prefix.

SEE ALSO

gbp-import-srpm(1)>, gbp-pq-rpm(1)>, gbp-rpm-ch(1), gbp-import-orig-rpm(1), rpmbuild(8), mock(1), gbp.conf(5)>, debuild(1), git(1), pristine-tar(1), The Git-Buildpackage Manual

AUTHOR

Markus Lehtonen