RPMBUILD-CONFIG(5)
π rpmbuild-config(5) π
okay bestie, welcome to rpmbuild-config(5) β the page that explains how you bend rpmbuild to your will through macros. it's long, it's iconic, and we're doing it together. grab a snack π
πΈ NAME πΈ
rpmbuild-config β rpmbuild macro configuration β¨
π SYNOPSIS π
NAME VALUE
π¦ DESCRIPTION π¦
The primary way rpmbuild gets configured is rpm-macros(7). For the whole general mechanism, go read rpm-config(5) β this manual is only about the configurables that touch rpmbuild's operation. no cap. π
π CONFIGURATION π
Here's everything supported for the rpm build operation, which you'd typically invoke through the rpmbuild command. periodt. π
π Locations and filenames π
%_builddirDIRECTORY β the directory where the per-package build directories get placed when building. your lil construction zone ποΈ%_fileattrsdirDIRECTORY β the directory where the file classifier configuration lives.%_rpmdirDIRECTORY β the directory where freshly-built binary packages get written. β¨%_rpmfilenameTEMPLATE β the output binary package filename query format used when building binary packages, exactly as described byrpm-queryformat(7). heads up: the filename is considered relative to%_rpmdir. π«Ά%_sourcedirDIRECTORY β the directory where sources and patches are found when building.%_srcrpmdirDIRECTORY β the directory where newly built source packages get written. π%_topdirDIRECTORY β the toplevel directory under which the package build directories reside by default. the mothership π
π·οΈ Informational tags π·οΈ
These are a special little group of macros: if they're defined, they behave as if the corresponding tag had been used in a specfile. which slays, because it means you can change values without touching thousands of specfiles. π
%bugurlURL β configurable bug URL, same as theBugURL:tag in a specfile. if you set it, it should point to a website for searching existing issues and filing new ones for this package.%distributionSTRING β configurable distribution information, same as theDistribution:tag in a specfile.%disturlURL β configurable distribution URL, same as theDistURL:tag in a specfile.%disttagSTRING β configurable distribution tag, same as theDistTag:tag in a specfile.%modularitylabelSTRING β configurable modularity label, same asModularityLabel:in a specfile. Obsolete. π%packagerSTRING β configurable packager information, same asPackager:in a specfile.%translationurlURL β configurable translation URL, same asTranslationURL:in a specfile.%upstreamreleasesURL β configurable URL for checking for newer upstream releases, same asUpstreamReleases:in a specfile.%vendorSTRING β configurable vendor information, same asVendor:in a specfile.
π¨ Build operation π¨
These settings affect all sorts of aspects of the build and they can genuinely make a build fail or succeed β but they have no direct impact on the packages that get produced. so like, vibe-affecting, not output-affecting. π
%_build_pkgcheckEXECUTABLE β a program to call for each successfully built and written binary package, likerpmlint. the path to the package gets passed to the program as a command-line argument.%_build_pkgcheck_setEXECUTABLE β a program to call for the whole binary package set after a successful build, likerpmlint. the paths to the package set get passed to the program as command-line arguments.%_build_pkgcheck_srpmEXECUTABLE β a program to call for each successfully built and written source package, likerpmlint. the path to the package gets passed to the program as a command-line argument.%_default_patch_flagsSTRING β the set of default options on all%patchapplications.%_default_patch_fuzzNUMBER β default fuzz level for patch application in the spec file. seepatch(1)for the details.%_smp_ncpus_maxNUMBER β a hard limit for the maximum number of CPU's to use in parallel during a package build. Zero means unlimited.%_smp_nthreads_maxNUMBER β a hard limit for the maximum number of threads to use in parallel during a package build. Zero means unlimited.%_smp_tasksize_procNUMBER β assumed task size of build processes (during compilation). used for tuning the amount of parallelism based on available memory.%_smp_tasksize_threadNUMBER β assumed task size of threads (during package generation). used for tuning the amount of parallelism based on available memory.
π¦ Package generation π¦
These settings affect various aspects of the produced binary and source packages. this is the part where the actual goods get their glow-up. β¨
%build_mtime_policyPOLICY β defines how file timestamps are handled in built packages. Clamping means ensuring the value does not exceed the threshold value.clamp_to_buildtime: clamp file timestamps to package buildtime.clamp_to_source_date_epoch: clamp file timestamps to theSOURCE_DATE_EPOCHenvironment variable.
%clamp_mtime_to_source_date_epochBOOLEAN β alias for%build_mtime_policy clamp_to_source_date_epoch. Do not use. Deprecated and scheduled for removal. π%source_date_epoch_from_changelogBOOLEAN β whether to set theSOURCE_DATE_EPOCHenvironment variable from the timestamp of the topmost%changelogentry.%use_source_date_epoch_as_buildtimeBOOLEAN β whether to use theSOURCE_DATE_EPOCHenvironment variable value as the buildtime of packages.%_binary_filedigest_algorithmHASHALGO β the algorithm to use for generating per-file checksums (aka digests) of binary packages. seerpm-config(5)for the supported values.%_binary_payloadIOFLAGS β the IO method and compression to use for generating the payload of binary packages. seerpm-payloadflags(7).%_buildhostHOSTNAME β use HOSTNAME as the package buildhost instead of acquiring the value fromgethostname(2).%_buildtimeTIMESTAMP β use TIMESTAMP as the package buildtime instead of acquiring the value fromtime(2).%_changelog_trimageTIMESTAMP β maximum age of preserved changelog entries in binary packages, relative to the newest existing entry. Unix timestamp format. the value of zero disables trimming by age.%_changelog_trimtimeTIMESTAMP β an alternative strategy for changelog trimming: trim all changelog entries older than the specified timestamp. Unix timestamp format. the value of zero disables trimming by time.%_docdir_fmtTEMPLATE β a template for the per-package documentation directory name, ie. the files packaged with%doc.%__docdir_pathPATH β a colon separated list of directories whose contents should always be considered as documentation.%_openpgp_autosign_idKEYID β the OpenPGP key id or fingerprint to use for automatically signing packages after a successful build. see alsorpmsign(1). π%_rpmformatVERSION β the RPM package format to produce. supported values are:4: RPM v4 format6: RPM v6 format
%_source_filedigest_algorithmHASHALGO β the algorithm to use for generating per-file checksums (aka digests) of source packages. seerpm-config(5)for the supported values.%_source_payloadβ the IO method and compression to use for generating the payload of source packages. seerpm-payloadflags(7).%__gpg_reserved_spaceNUMBER β the number of bytes to reserve for signatures in the signature header. this reserve helps speed up package signing significantly. β‘
π Debuginfo generation π
Debuginfo sub-packages contain information necessary to debug otherwise release-specification builds with a debugger. these settings determine whether debuginfo packages get generated at all, plus various aspects of the generated debugging information. π§
%_build_id_linksMODE β defines how and if build_id links are generated for ELF files. the following settings are supported:none: no build_id links are generated.alldebug: generate rpm < 4.14 style build_id links, ie everything in the-debuginfopackage.separate: generate build_id links in binary packages.compat: same asseparatebut with a compatibility link(s) in the-debuginfopackages.
%_debuginfo_subpackagesBOOLEAN β whether rpm should create separate debuginfo packages for each subpackage.%_debugsource_packagesBOOLEAN β whether rpm should put debug source files into their own subpackage.%_enable_debug_packagesBOOLEAN β whether rpm should generate debuginfo subpackages.%_include_gdb_indexBOOLEAN β include a.gdb_indexsection in the.debugfiles. requires%_enable_debug_packagesto be enabled andgdb-add-index(1)to be installed.%_include_minidebuginfoBOOLEAN β include minimal debug information in build binaries. requires%_enable_debug_packagesto be enabled.%_no_recompute_build_idsBOOLEAN β disable recomputation of build-ids. Cannot be used with%_unique_build_ids.%_unique_build_idsBOOLEAN β whether build-ids should be made unique between package version/releases when generating debuginfo packages.%_unique_debug_namesBOOLEAN β whether.debugfiles should be made unique between package version, release and architecture. requires%_unique_build_idsto be enabled.%_unique_debug_srcsBOOLEAN β whether the/usr/debug/src/<package>directories should be unique between package version, release and architecture.%__find_debuginfoEXECUTABLE β the location of the debuginfo helper executable.
π¦ Legacy compatibility π¦
These settings deal with several decades of backwards compatibility. most of them determine whether a particular issue is considered an error or just a warning. sometimes they're also useful for temporarily working around issues while packaging. iykyk. π
%_binaries_in_noarch_packages_terminate_buildBOOLEAN β whether ELF binaries in noarch packages should terminate a build.%_duplicate_files_terminate_buildBOOLEAN β whether duplicate files in the%filessection should terminate a build.%_empty_manifest_terminate_buildBOOLEAN β whether an empty%filesmanifest file should terminate a build.%_invalid_encoding_terminates_buildBOOLEAN β whether a non-UTF8 encoding in package data should terminate a build.%__find_providesEXECUTABLE β the executable to use for rpm 3.x style provides generation. Do not use. Deprecated and scheduled for removal. π%__find_requiresEXECUTABLE β the executable to use for rpm 3.x style requires generation. Do not use. Deprecated and scheduled for removal. π%_missing_build_ids_terminate_buildBOOLEAN β whether ELF files without build-ids should terminate a build. for historical reasons, this is only applicable if%_enable_debug_packagesis also enabled.%_missing_doc_files_terminate_buildBOOLEAN β whether missing%docfiles in the build directory should terminate a build.
part 1 done bestie, don't go anywhere β more of this page is coming and it's only getting better π«Ά
%_unpackaged_files_terminate_build BOOLEANβ bestie, this one decides whether stray files just chilling in the build root, all unpackaged and unaccounted for, are allowed to β¨end the whole buildβ¨. Flip it on and an unpackaged file literally terminates the build. No cap.%_nonzero_exit_pkgcheck_terminate_build BOOLEANβ should the build of packages fail when the package checker (if one is even defined) hands back an error? That's the whole question π . Peep the%_build_pkgcheck_*macros for the receipts.%_use_internal_dependency_generator BOOLEANβ if enabled, you get rpm 3.x style dependency generation. Do not use. It's deprecated and scheduled for removal, bestie, it's giving ghost of rpm past π». Leave it alone fr fr.%_use_weak_usergroup_deps BOOLEANβ turn this on anduser()andgroup()requires get diluted down into recommends π«. Super handy when you're transitioning torpm-sysusers(7)based user/group management. Lowkey iconic.%_wrong_version_format_terminate_build BOOLEANβ whether an invalid version format showing up in dependencies etc. should terminate a build. So like, a malformed version is a whole vibe check failure and the build just stops π.
π SEE ALSO π
Go read these, they're all part of the lore, iykyk:
rpmbuild(1)rpm-common(8)rpm-macrofile(5)rpm-rpmrc(5)rpm-config(5)rpm-payloadflags(7)rpm-macros(7)
And that's a wrap on RPMBUILD-CONFIG(5) π this page ate and left no crumbs. It came to you from RPM 6.1.0, dated 2026-08-20, and honestly? Slay. Now go forth and build something cute β¨ππ¦
π¦ where this page comes from
- ubuntu stonking: rpm 6.1.0-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms