'\" -*- coding: UTF-8 -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH gbp-buildpackage-rpm 1 "31 May 2023" "" "git-buildpackage Manual" .SH NAME gbp-buildpackage-rpm \- Build RPM packages from a Git repository .SH SYNOPSIS 'nh .fi .ad l \fBgbp\ buildpackage-rpm\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu [\fB--git-[no-]ignore-new\fR] [\fB--git-tag\fR] [\fB--git-verbose\fR] [\fB--git-color=\fR[auto|on|off]] [\fB--git-color-scheme=\fR \fICOLOR_SCHEME\fR] [\fB--git-notify=\fR[auto|on|off]] [\fB--git-tmp-dir\fR= \fIDIRECTORY\fR] [\fB--git-vendor\fR= \fIVENDOR\fR] [\fB--git-native\fR[auto|on|off]] [\fB--git-upstream-branch=\fR \fITREEISH\fR] [\fB--git-packaging-branch=\fR \fIBRANCH_NAME\fR] [\fB--git-ignore-branch\fR] [\fB--git-[no-]submodules\fR] [\fB--git-builder=\fR \fIBUILD_CMD\fR] [\fB--git-cleaner=\fR \fICLEAN_CMD\fR] [\fB--git-[no-]sign-tags\fR] [\fB--git-keyid=\fR \fIGPG-KEYID\fR] [\fB--git-posttag=\fR \fICOMMAND\fR] [\fB--git-postbuild=\fR \fICOMMAND\fR] [\fB--git-postexport=\fR \fICOMMAND\fR] [\fB--git-prebuild=\fR \fICOMMAND\fR] [\fB--git-preexport=\fR \fICOMMAND\fR] [\fB--git-[no-]build\fR] [\fB--git-[no-]hooks\fR] [\fB--git-packaging-tag=\fR \fITAG-FORMAT\fR] [\fB--git-upstream-tag=\fR \fITAG-FORMAT\fR] [\fB--git-force-create\fR] [\fB--git-no-create-orig\fR] [\fB--git-upstream-tree=\fR \fI[TAG|BRANCH|TREEISH]\fR] [\fB--git-tarball-dir=\fR \fIDIRECTORY\fR] [\fB--git-compression-level=\fR \fILEVEL\fR] [\fB--git-export-dir=\fR \fIDIRECTORY\fR] [\fB--git-export=\fR \fITREEISH\fR] [\fB--git-packaging-dir=\fR \fIDIRECTORY\fR] [\fB--git-spec-file=\fR \fIFILEPATH\fR] [\fB--git-export-sourcedir\fR= \fIDIRECTORY\fR] [\fB--git-export-specdir\fR= \fIDIRECTORY\fR] [\fB--git-[no-]pristine-tar\fR] [\fB--git-[no-]pristine-tar-commit\fR] [\fB--git-tag-only\fR] [\fB--git-retag\fR] [\fB--git-mock\fR] [\fB--git-dist\fR= \fIDISTRIBUTION\fR] [\fB--git-arch\fR= \fIARCHITECTURE\fR] [\fB--git-mock-options\fR= \fIOPTIONS\fR] [\fB--git-mock-root\fR= \fIROOT\fR] [\fB--git-spec-vcs-tag\fR= \fITAG_FORMAT\fR] 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBgbp\ buildpackage-rpm\fR is used to build RPM packages from a Git repository. It is an RPM counterpart for the \fBgbp\ buildpackage\fR tool that is designed for building Debian packages. .PP \fBgbp\ buildpackage-rpm\fR will, in order: .TP 0.2i \(bu Verify that it is being executed from the proper location. .TP 0.2i \(bu Verify that the repository doesn't contain any uncommitted source changes. .TP 0.2i \(bu Verify that it is being executed from the correct branch. .TP 0.2i \(bu Export packaging files to a separate build area. .TP 0.2i \(bu Create an orig source tarball if it doesn't exist. .TP 0.2i \(bu Call rpmbuild(1) (or the application specified via \*(T<\fB\-\-git\-builder\fR\*(T>), passing along all command line arguments that don't start with --git-. .TP 0.2i \(bu (Optionally) tag the tree after a successful build. .TP 0.2i \(bu (Optionally) call a post build hook - e.g. to run rpmlint. .TP 0.2i \(bu (Optionally) call a post tag hook - e.g. to push the results to a remote repository after creating the tag. .SH OPTIONS .TP \*(T<\fB\-\-git\-[no\-]ignore\-new\fR\*(T> Don't abort if there are uncommitted changes in the source tree or the current branch doesn't match the \fIPACKAGING-BRANCH\fR. .TP \*(T<\fB\-\-git\-tag\fR\*(T> Add a git tag after a successful build. .TP \*(T<\fB\-\-git\-builder=\fR\*(T>\fIBUILD_CMD\fR Use \fIBUILD_CMD\fR instead of \fBrpmbuild -ba\fR. .TP \*(T<\fB\-\-git\-cleaner=\fR\*(T>\fICLEAN_CMD\fR Use \fICLEAN_CMD\fR. .TP \*(T<\fB\-\-git\-verbose\fR\*(T> Verbose execution .TP \*(T<\fB\-\-git\-color=\fR\*(T>[auto|on|off] Whether to use colored output. .TP \*(T<\fB\-\-git\-color\-scheme=\fR\*(T>\fICOLOR_SCHEME\fR Colors to use in output (when color is enabled). The format for COLOR_SCHEME is \&':::'. 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). .TP \*(T<\fB\-\-git\-notify=\fR\*(T>[auto|on|off] Whether to send a desktop notification after the build. .TP \*(T<\fB\-\-git\-tmp\-dir\fR\*(T>=\fIDIRECTORY\fR Base directory under which temporary directories are created. .TP \*(T<\fB\-\-git\-vendor\fR\*(T>=\fIVENDOR\fR Distribution vendor name. .TP \*(T<\fB\-\-git\-native=\fR\*(T>[auto|on|off] Define the 'nativity' of a package. The default value \fIauto\fR makes \fBgbp\ buildpackage-rpm\fR to guess. Guessing is based on the existence of upstream branch. .TP \*(T<\fB\-\-git\-upstream\-branch\fR\*(T>=\fIBRANCH_NAME\fR Branch to build the orig tarball from if \*(T<\fB\-\-git\-upstream\-tree\fR\*(T> is set to \fIBRANCH\fR. Default is \fIupstream\fR. .TP \*(T<\fB\-\-git\-packaging\-branch\fR\*(T>=\fIBRANCH_NAME\fR If you're not on this branch when invoking \fBgbp\ buildpackage-rpm\fR it will fail. Default is \fImaster\fR. 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 \*(T<\fB\-\-git\-ignore\-new\fR\*(T>. .TP \*(T<\fB\-\-git\-ignore\-branch\fR\*(T> Don't check if the current branch matches \fIPACKAGING-BRANCH\fR. .TP \*(T<\fB\-\-git\-[no\-]submodules\fR\*(T> Include git submodules in the orig tarball. .TP \*(T<\fB\-\-git\-[no\-]sign\-tags\fR\*(T> GPG sign all created tags. .TP \*(T<\fB\-\-git\-keyid=\fR\*(T>\fIGPG-KEYID\fR Use this keyid for gpg signing tags. .TP \*(T<\fB\-\-git\-posttag=\fR\*(T>\fICOMMAND\fR Execute \fICOMMAND\fR after tagging a new version. Exported environment variables are: \fBGBP_TAG\fR (the name of the generated tag), \fBGBP_BRANCH\fR (the branch the package was built from) and \fBGBP_SHA1\fR (the sha1 of the commit the tag was created at). .TP \*(T<\fB\-\-git\-postbuild=\fR\*(T>\fICOMMAND\fR Execute \fICOMMAND\fR after successful build. Exported environment variables are: \fBGBP_CHANGES_FILE\fR (the name of the generated changes file), \fBGBP_BUILD_DIR\fR (the build dir). .TP \*(T<\fB\-\-git\-preexport=\fR\*(T>\fICOMMAND\fR Execute \fICOMMAND\fR before exporting the source tree. Exported environment variables are: \fBGBP_GIT_DIR\fR (the repository the package is being built from), \fBGBP_TMP_DIR\fR (the temporary directory where the sources have been initially exported). .TP \*(T<\fB\-\-git\-postexport=\fR\*(T>\fICOMMAND\fR Execute \fICOMMAND\fR after exporting the source tree. Exported environment variables are: \fBGBP_GIT_DIR\fR (the repository the package is being built from), \fBGBP_TMP_DIR\fR (the temporary directory where the sources have been initially exported). .TP \*(T<\fB\-\-git\-prebuild=\fR\*(T>\fICOMMAND\fR Execute \fICOMMAND\fR from the build directory before calling rpmbuild or the application specified via \*(T<\fB\-\-git\-builder\fR\*(T>. Exported environment variables are: \fBGBP_GIT_DIR\fR (the repository the package is being built from), \fBGBP_BUILD_DIR\fR (the build dir). .TP \*(T<\fB\-\-git\-[no\-]build\fR\*(T> Enable builder. Note: \*(T<\fB\-\-git\-no\-build\fR\*(T> causes the postbuild hook to be disabled, too. .TP \*(T<\fB\-\-git\-[no\-]hooks\fR\*(T> Enable running all (cleaner, preexport, postexport, prebuild, postbuild, and posttag) hooks. Note: the \*(T<\fB\-\-git\-builder\fR\*(T> command is not affected by this option. .TP \*(T<\fB\-\-git\-packaging\-tag=\fR\*(T>\fITAG-FORMAT\fR Use this tag format when tagging released versions of the package. .TP \*(T<\fB\-\-git\-upstream\-tag=\fR\*(T>\fITAG-FORMAT\fR Use this tag format when looking for tags of upstream versions, default is \fIupstream/%(version)s\fR. .TP \*(T<\fB\-\-git\-force\-create\fR\*(T> Force creation of an orig tarball (overwriting a pre-existing one if present). .TP \*(T<\fB\-\-git\-no\-create\-orig\fR\*(T> Don't try to create any orig tarball. .TP \*(T<\fB\-\-git\-export\-dir=\fR\*(T>\fIDIRECTORY\fR Export the packaging files from the current branch head (or the treeish object given via \*(T<\fB\-\-git\-export\fR\*(T> to \fIDIRECTORY\fR before building. .TP \*(T<\fB\-\-git\-export\-sourcedir\fR\*(T>=\fIDIRECTORY\fR , \*(T<\fB\-\-git\-export\-specdir\fR\*(T>=\fIDIRECTORY\fR Subdirectories under export directory where packaging files are exported. The default build options of rpmbuild builder are also adjusted accordingly. .TP \*(T<\fB\-\-git\-export=\fR\*(T>\fITREEISH\fR Instead of exporting the current branch head, export the treeish object \fITREEISH\fR. The special name \fIINDEX\fR exports the current index, \fIWC\fR) exports all files in the current working directory. .TP \*(T<\fB\-\-git\-packaging\-dir=\fR\*(T>\fIDIRECTORY\fR Subdirectory that contains the RPM packaging files. .TP \*(T<\fB\-\-git\-spec\-file=\fR\*(T>\fIFILEPATH\fR Relative path to the spec file to use. Special value \fIauto\fR causes \fBgbp\ buildpackage-rpm\fR to search and guess. Other values cause the \*(T<\fB\-\-git\-packaging\-dir\fR\*(T> option to be ignored: the directory of the spec file is used, instead. .TP \*(T<\fB\-\-git\-upstream\-tree=\fR\*(T>\fI[TAG|BRANCH|TREEISH]\fR How to find the upstream sources used to generate the tarball. \fITAG\fR looks at a tag corresponding to the version in the changelog. \fIBRANCH\fR looks at the upstream branch given via the \*(T<\fB\-\-git\-upstream\-branch\fR\*(T> option. Other values are interpreted as treeishs. This doesn't have any effect if \*(T<\fB\-\-git\-pristine\-tar\fR\*(T> is being used. .TP \*(T<\fB\-\-git\-tarball\-dir=\fR\*(T>\fIDIRECTORY\fR Search for original tarballs in \fIDIRECTORY\fR instead of generating them. .TP \*(T<\fB\-\-git\-compression\-level=\fR\*(T>\fILEVEL\fR Specifies the upstream tarball compression level if an upstream tarball needs to be built. .TP \*(T<\fB\-\-git\-tag\-only\fR\*(T> Don't build, only tag and run post-tag hooks. .TP \*(T<\fB\-\-git\-retag\fR\*(T> Don't fail tag operations if a tag with the same version already exists, but, overwrite the existing tag, instead. .TP \*(T<\fB\-\-git\-pristine\-tar\fR\*(T> Use pristine-tar when generating the upstream tarball if it doesn't exist. .TP \*(T<\fB\-\-git\-pristine\-tar\-commit\fR\*(T> 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. .TP \*(T<\fB\-\-git\-mock\fR\*(T> Use mock to build the rpms by invoking \fBgbp-builder-mock\fR. .TP \*(T<\fB\-\-git\-dist\fR\*(T> Build for this distribution when using mock (e.g.: epel-6). .TP \*(T<\fB\-\-git\-arch\fR\*(T> Build for this architecture when using mock, default is to build for the current host architecture. .TP \*(T<\fB\-\-git\-mock\-root\fR\*(T> The mock root to use. Defaults to \fIDIST\fR-\fIARCH\fR from above. .TP \*(T<\fB\-\-git\-mock\-options\fR\*(T> Additional options to pass to mock. Default is to pass no additional options. .TP \*(T<\fB\-\-git\-spec\-vcs\-tag\fR\*(T>=\fITAG_FORMAT\fR \fBgbp\ buildpackage-rpm\fR 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. .SH EXAMPLES Only build a source RPM with \fBrpmbuild\fR .PP .nf \*(T< \fBgbp\ buildpackage\-rpm\fR \-bs \*(T> .fi .PP Build an RPM package with \fBrpmbuild\fR on a custom branch with the uncommitted changes included. .PP .nf \*(T< \fBgbp\ buildpackage\-rpm\fR \-\-git\-ignore\-branch \-\-git\-export=WC \*(T> .fi .SH "CONFIGURATION FILES" Several \*(T<\fIgbp.conf\fR\*(T> files are parsed to set defaults for the above command-line arguments. See the \fBgbp.conf\fR(5) manpage for details. .PP All options in the config files are specified without the 'git-' prefix. .SH "SEE ALSO" \fBgbp-import-srpm\fR(1), \fBgbp-pq-rpm\fR(1), \fBgbp-rpm-ch\fR(1), \fBrpmbuild\fR(8), \fBmock\fR(1), \fBgbp.conf\fR(5), \fBdebuild\fR(1), \fBgit\fR(1), \fBpristine-tar\fR(1), .URL file:///usr/share/doc/git-buildpackage/manual-html/index.html " The Git-Buildpackage Manual" .SH AUTHOR Markus Lehtonen <\*(T>