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 the PACKAGING-BRANCH. living dangerously, love that for you πŸ’…
  • --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. 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 for COLOR_SCHEME is '<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 value auto makes gbp buildpackage-rpm guess. 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-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 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 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 β€” execute COMMAND after 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 β€” execute COMMAND after 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 β€” execute COMMAND before 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 β€” execute COMMAND after 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 β€” execute COMMAND from the build directory before calling rpmbuild or 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-build causes 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-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). 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) to DIRECTORY before 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 object TREEISH. the special name INDEX exports 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 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-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 β€” 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-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 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 (from git-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 the git- prefix. Drop the git-, bestie. That's the rule.

πŸ‘€ SEE ALSO πŸ‘€

Your girl does not work alone, here's the whole friend group:


✨ 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