gbp-buildpackage-rpm(1)
π NAME π
gbp-buildpackage-rpm β build RPM packages straight outta a Git repository π
(and yes bestie, this is the git-buildpackage Manual page, so you know it's legit π )
β¨ SYNOPSIS β¨
gbp buildpackage-rpm [--git-[no-]ignore-new] [--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-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-preexport= 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-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-spec-vcs-tag= TAG_FORMAT]
π DESCRIPTION π
so gbp buildpackage-rpm is THE girl for building RPM packages out of a Git repository. it's literally the RPM counterpart of the gbp buildpackage tool, except that one is the Debian-packages girlie π
. same energy, different distro, iykyk.
here's the run of show, in order, no skipping:
- β Verify that it is being executed from the proper location.
- β Verify that the repository doesn't contain any uncommitted source changes.
- β Verify that it is being executed from the correct branch.
- π¦ Export packaging files to a separate build area.
- π¦ Create an orig source tarball if it doesn't exist.
- π¨ Call
rpmbuild(1)(or the application specified via--git-builder), passing along all command line arguments that don't start with--git-. - π·οΈ (Optionally) tag the tree after a successful build.
- πͺ (Optionally) call a post build hook β e.g. to run
rpmlint. - πͺ (Optionally) call a post tag hook β e.g. to push the results to a remote repository after creating the tag.
π OPTIONS π
okay here comes the menu. every single flag, no crumbs left behind β¨
--git-[no-]ignore-newβ don't abort if there are uncommitted changes in the source tree, or if the current branch doesn't match thePACKAGING-BRANCH. living dangerously, love that for you π--git-tagβ add a git tag after a successful build π·οΈβ¨--git-builder=BUILD_CMDβ useBUILD_CMDinstead ofrpmbuild -ba.--git-cleaner=CLEAN_CMDβ useCLEAN_CMD.--git-verboseβ verbose execution. it tells you everything, and honestly? we love a yapper π£οΈ--git-color=[auto|on|off]β whether to use colored output π--git-color-scheme=COLOR_SCHEMEβ the colors to use in output (only when color is enabled, obvi). the format forCOLOR_SCHEMEis'<debug>:<info>:<warning>:<error>'. numerical values AND color names are accepted, and 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). aesthetic AND functional π--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]β defines the 'nativity' of a package. the default valueautomakesgbp buildpackage-rpmguess. the guessing is based on the existence of the upstream branch.--git-upstream-branch=BRANCH_NAMEβ the branch to build the orig tarball from, if--git-upstream-treeis set toBRANCH. default isupstream.--git-packaging-branch=BRANCH_NAMEβ if you're not on this branch when invokinggbp buildpackage-rpm, it will fail. default ismaster. this exists so you don't accidentally release from a topic branch π. not being on this branch gets ignored when you're using--git-ignore-new.--git-ignore-branchβ don't check if the current branch matchesPACKAGING-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β executeCOMMANDafter tagging a new version.
the exported environment variables are: GBP_TAG (the name of the generated tag), GBP_BRANCH (the branch the package was built from) and GBP_SHA1 (the sha1 of the commit the tag was created at).
--git-postbuild=COMMANDβ executeCOMMANDafter a successful build.
the exported environment variables are: GBP_CHANGES_FILE (the name of the generated changes file), GBP_BUILD_DIR (the build dir).
--git-preexport=COMMANDβ executeCOMMANDbefore exporting the source tree.
the 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-postexport=COMMANDβ executeCOMMANDafter exporting the source tree.
the 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β executeCOMMANDfrom the build directory before callingrpmbuildor the application specified via--git-builder.
the 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-buildcauses the postbuild hook to be disabled, too.--git-[no-]hooksβ enable running all the hooks (cleaner, preexport, postexport, prebuild, postbuild, and posttag). β οΈ note: the--git-buildercommand 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 isupstream/%(version)s.--git-force-createβ force creation of an orig tarball (overwriting a pre-existing one if present). no takesies backsies π--git-no-create-origβ don't try to create any orig tarball at all.--git-export-dir=DIRECTORYβ export the packaging files from the current branch head (or the treeish object given via--git-export) toDIRECTORYbefore building.--git-export-sourcedir=DIRECTORY , --git-export-specdir=DIRECTORYβ subdirectories under the export directory where packaging files are exported. the default build options of the rpmbuild builder are also adjusted accordingly.--git-export=TREEISHβ instead of exporting the current branch head, export the treeish objectTREEISH. the special nameINDEXexports the current index,WC)exports all files in the current working directory.--git-packaging-dir=DIRECTORYβ subdirectory that contains the RPM packaging files.--git-spec-file=FILEPATHβ relative path to the spec file to use. the special valueautocausesgbp buildpackage-rpmto search and guess. other values cause the--git-packaging-diroption 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.TAGlooks at a tag corresponding to the version in the changelog.BRANCHlooks at the upstream branch given via the--git-upstream-branchoption. 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 inDIRECTORYinstead of generating them.--git-compression-level=LEVELβ specifies the upstream tarball compression level, if an upstream tarball needs to be built.--git-tag-onlyβ don't build, only tag and run the post-tag hooks.--git-retagβ don't fail tag operations if a tag with the same version already exists; overwrite the existing tag, instead.--git-pristine-tarβ usepristine-tarwhen 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β usemockto build the rpms by invokinggbp-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 toDIST-ARCHfrom above.--git-mock-optionsβ additional options to pass to mock. default is to pass no additional options.--git-spec-vcs-tag=TAG_FORMATβgbp buildpackage-rpmalways 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 a 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 (fromgit-describe) and'%(commit)s'expans to the sha1 of the exported commit.
okay bestie that's the vibe so farβ¦ and there's literally more coming, so don't go anywhere β¨
π EXAMPLES π
Okay bestie, here's where it gets juicy β actual things you can type. π
Only build a source RPM with rpmbuild
gbp buildpackage-rpm -bs
That's it. That's the whole vibe. Source RPM, no binary drama. π¦
Build an RPM package with rpmbuild on a custom branch with the uncommitted changes included.
gbp buildpackage-rpm --git-ignore-branch --git-export=WC
The way this one just grabs your working-copy changes and rolls with it β --git-ignore-branch so it stops being picky about which branch you're on, --git-export=WC so it takes the working copy as-is. Chaotic? A little. Iconic? Absolutely. π₯
π CONFIGURATION FILES π
So like, several gbp.conf files get parsed to set the defaults for all those command-line arguments up above, okay? The deets live in the gbp.conf(5) manpage β go read it, I'll wait. π«Ά
β οΈ Important detail, no cap: all options in the config files are specified without thegit-prefix. Drop thegit-, bestie. That's the rule.
π SEE ALSO π
Your girl does not work alone, here's the whole friend group:
gbp-import-srpm(1)gbp-pq-rpm(1)gbp-rpm-ch(1)rpmbuild(8)mock(1)gbp.conf(5)debuild(1)git(1)pristine-tar(1)- The Git-Buildpackage Manual β¨
file:///usr/share/doc/git-buildpackage/manual-html/index.htmlβ©
β¨ AUTHOR β¨
Markus Lehtonen <markus.lehtonen@linux.intel.com> β thank you for your service, king/queen/monarch π
And that's a wrap on gbp-buildpackage-rpm(1), bestie! π This page was dated 26 May 2026, so jot that down, and you can find the whole thing filed under gbp-buildpackage-rpm(1) in your friendly neighbourhood man pages. Go build something gorgeous. πΈπ¦π
π¦ where this page comes from
- ubuntu stonking: git-buildpackage-rpm 0.9.43 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms