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 πŸ“

  • %_builddir DIRECTORY β€” the directory where the per-package build directories get placed when building. your lil construction zone πŸ—οΈ
  • %_fileattrsdir DIRECTORY β€” the directory where the file classifier configuration lives.
  • %_rpmdir DIRECTORY β€” the directory where freshly-built binary packages get written. ✨
  • %_rpmfilename TEMPLATE β€” the output binary package filename query format used when building binary packages, exactly as described by rpm-queryformat(7). heads up: the filename is considered relative to %_rpmdir. 🫢
  • %_sourcedir DIRECTORY β€” the directory where sources and patches are found when building.
  • %_srcrpmdir DIRECTORY β€” the directory where newly built source packages get written. 🌈
  • %_topdir DIRECTORY β€” 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. πŸ™Œ

  • %bugurl URL β€” configurable bug URL, same as the BugURL: 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.
  • %distribution STRING β€” configurable distribution information, same as the Distribution: tag in a specfile.
  • %disturl URL β€” configurable distribution URL, same as the DistURL: tag in a specfile.
  • %disttag STRING β€” configurable distribution tag, same as the DistTag: tag in a specfile.
  • %modularitylabel STRING β€” configurable modularity label, same as ModularityLabel: in a specfile. Obsolete. πŸ’€
  • %packager STRING β€” configurable packager information, same as Packager: in a specfile.
  • %translationurl URL β€” configurable translation URL, same as TranslationURL: in a specfile.
  • %upstreamreleases URL β€” configurable URL for checking for newer upstream releases, same as UpstreamReleases: in a specfile.
  • %vendor STRING β€” configurable vendor information, same as Vendor: 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_pkgcheck EXECUTABLE β€” a program to call for each successfully built and written binary package, like rpmlint. the path to the package gets passed to the program as a command-line argument.
  • %_build_pkgcheck_set EXECUTABLE β€” a program to call for the whole binary package set after a successful build, like rpmlint. the paths to the package set get passed to the program as command-line arguments.
  • %_build_pkgcheck_srpm EXECUTABLE β€” a program to call for each successfully built and written source package, like rpmlint. the path to the package gets passed to the program as a command-line argument.
  • %_default_patch_flags STRING β€” the set of default options on all %patch applications.
  • %_default_patch_fuzz NUMBER β€” default fuzz level for patch application in the spec file. see patch(1) for the details.
  • %_smp_ncpus_max NUMBER β€” a hard limit for the maximum number of CPU's to use in parallel during a package build. Zero means unlimited.
  • %_smp_nthreads_max NUMBER β€” a hard limit for the maximum number of threads to use in parallel during a package build. Zero means unlimited.
  • %_smp_tasksize_proc NUMBER β€” assumed task size of build processes (during compilation). used for tuning the amount of parallelism based on available memory.
  • %_smp_tasksize_thread NUMBER β€” 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_policy POLICY β€” 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 the SOURCE_DATE_EPOCH environment variable.
  • %clamp_mtime_to_source_date_epoch BOOLEAN β€” alias for %build_mtime_policy clamp_to_source_date_epoch. Do not use. Deprecated and scheduled for removal. πŸ’€
  • %source_date_epoch_from_changelog BOOLEAN β€” whether to set the SOURCE_DATE_EPOCH environment variable from the timestamp of the topmost %changelog entry.
  • %use_source_date_epoch_as_buildtime BOOLEAN β€” whether to use the SOURCE_DATE_EPOCH environment variable value as the buildtime of packages.
  • %_binary_filedigest_algorithm HASHALGO β€” the algorithm to use for generating per-file checksums (aka digests) of binary packages. see rpm-config(5) for the supported values.
  • %_binary_payload IOFLAGS β€” the IO method and compression to use for generating the payload of binary packages. see rpm-payloadflags(7).
  • %_buildhost HOSTNAME β€” use HOSTNAME as the package buildhost instead of acquiring the value from gethostname(2).
  • %_buildtime TIMESTAMP β€” use TIMESTAMP as the package buildtime instead of acquiring the value from time(2).
  • %_changelog_trimage TIMESTAMP β€” 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_trimtime TIMESTAMP β€” 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_fmt TEMPLATE β€” a template for the per-package documentation directory name, ie. the files packaged with %doc.
  • %__docdir_path PATH β€” a colon separated list of directories whose contents should always be considered as documentation.
  • %_openpgp_autosign_id KEYID β€” the OpenPGP key id or fingerprint to use for automatically signing packages after a successful build. see also rpmsign(1). πŸ”
  • %_rpmformat VERSION β€” the RPM package format to produce. supported values are:
    • 4: RPM v4 format
    • 6: RPM v6 format
  • %_source_filedigest_algorithm HASHALGO β€” the algorithm to use for generating per-file checksums (aka digests) of source packages. see rpm-config(5) for the supported values.
  • %_source_payload β€” the IO method and compression to use for generating the payload of source packages. see rpm-payloadflags(7).
  • %__gpg_reserved_space NUMBER β€” 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_links MODE β€” 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 -debuginfo package.
    • separate: generate build_id links in binary packages.
    • compat: same as separate but with a compatibility link(s) in the -debuginfo packages.
  • %_debuginfo_subpackages BOOLEAN β€” whether rpm should create separate debuginfo packages for each subpackage.
  • %_debugsource_packages BOOLEAN β€” whether rpm should put debug source files into their own subpackage.
  • %_enable_debug_packages BOOLEAN β€” whether rpm should generate debuginfo subpackages.
  • %_include_gdb_index BOOLEAN β€” include a .gdb_index section in the .debug files. requires %_enable_debug_packages to be enabled and gdb-add-index(1) to be installed.
  • %_include_minidebuginfo BOOLEAN β€” include minimal debug information in build binaries. requires %_enable_debug_packages to be enabled.
  • %_no_recompute_build_ids BOOLEAN β€” disable recomputation of build-ids. Cannot be used with %_unique_build_ids.
  • %_unique_build_ids BOOLEAN β€” whether build-ids should be made unique between package version/releases when generating debuginfo packages.
  • %_unique_debug_names BOOLEAN β€” whether .debug files should be made unique between package version, release and architecture. requires %_unique_build_ids to be enabled.
  • %_unique_debug_srcs BOOLEAN β€” whether the /usr/debug/src/<package> directories should be unique between package version, release and architecture.
  • %__find_debuginfo EXECUTABLE β€” 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_build BOOLEAN β€” whether ELF binaries in noarch packages should terminate a build.
  • %_duplicate_files_terminate_build BOOLEAN β€” whether duplicate files in the %files section should terminate a build.
  • %_empty_manifest_terminate_build BOOLEAN β€” whether an empty %files manifest file should terminate a build.
  • %_invalid_encoding_terminates_build BOOLEAN β€” whether a non-UTF8 encoding in package data should terminate a build.
  • %__find_provides EXECUTABLE β€” the executable to use for rpm 3.x style provides generation. Do not use. Deprecated and scheduled for removal. πŸ’€
  • %__find_requires EXECUTABLE β€” the executable to use for rpm 3.x style requires generation. Do not use. Deprecated and scheduled for removal. πŸ’€
  • %_missing_build_ids_terminate_build BOOLEAN β€” whether ELF files without build-ids should terminate a build. for historical reasons, this is only applicable if %_enable_debug_packages is also enabled.
  • %_missing_doc_files_terminate_build BOOLEAN β€” whether missing %doc files 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 and user() and group() requires get diluted down into recommends πŸ«—. Super handy when you're transitioning to rpm-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:


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