rpmrebuild_plugins(1)

πŸ“¦
version 2.21 Β· 3 versions
, in epel 9, fedora 43, fedora 44

πŸ’– rpmrebuild_plugins β€” the engine that makes rpmrebuild go brrr πŸ’–

okay bestie, sit down, hydrate, because this is the plugin manual for rpmrebuild(1) β€” the part where you stop just copying an rpm and start changing it. it's giving mad scientist energy fr fr 🧚✨


✨ SYNOPSIS ✨

rpmrebuild [non-plugins-option] [plugins-option] <packagename>

🌸 DESCRIPTION 🌸

so rpmrebuild on its own is doing its absolute best to reconstruct an rpm package as close to the original as it possibly can. it's a perfectionist. it's a Virgo. it's trying so hard 😭

and then the plugins come in and do the opposite β€” they're here to somehow change the rebuilded rpm. plot twist. character development. we love to see it πŸ’…


πŸŽ€ RPMREBUILD WITHOUT PLUGINS πŸŽ€

no plugins, no drama. the rebuilding process literally looks like this:

  • query β€” query the rpm to be rebuilded for the different pieces of information.
  • concatenate β€” create the specfile from these pieces.
  • build β€” use the specfile to build the rpm.

clean. simple. unproblematic. we stan a low-maintenance workflow 🌈


πŸ¦‹ RPMREBUILD WITH PLUGINS πŸ¦‹

now with plugins the process gets a glow-up and looks like this:

  • query β€” query the rpm to be rebuilded for the different pieces of information.
  • change parts β€” change parts of the spec created by query.
  • concatenate β€” create specfile from the pieces.
  • change whole β€” change the concatenated specfile.
  • build β€” use the specfile to build the rpm.

see how it snuck two whole extra steps in there? main character energy. obsessed πŸ‘‘


πŸ“ SPECFILE PIECES πŸ“

the Query step goes and asks for the following information, piece by piece:

  • preamble
  • conflicts
  • obsoletes
  • provides
  • requires
  • description
  • files
  • filetriggers
  • transfiletriggers
  • triggers
  • pre
  • post
  • preun
  • postun
  • verifyscript
  • changelog

that's the whole shopping list, no substitutions πŸ™ˆ


πŸ’œ SPECFILE CONCATENATION πŸ’œ

then Concatenate takes all those pieces and builds the 'full' specfile out of them. it does the following:

  • add AutoReq / AutoProv tags
  • add BuildRoot tag
  • add some defines to adjust rpm's behaviour.
  • double all '%' β€” it'll prevent rpm from attempting expand %something as macro.
  • add '%description' before description
  • add '%files' before files
  • add '%changelog' before changelog

it's basically assembling the lego set. respect the process 🧱✨


πŸ”₯ PLUGINS TYPES πŸ”₯

the rpm building (or rebuilding) process has two inputs: the specfile and the package's files under the buildroot directory. so obviously, there are two plugins types:

  • for specfile modification (exemple : demo.plug).
  • for files (under buildroot) modification (exemple : demofiles.plug).

pick your fighter πŸ’€


πŸ’… PLUGIN'S INTERFACE πŸ’…

Plugins are executed AFTER rpm package is queried and BEFORE new package is rebuilded, in the order specified on the command line. yes, order matters, bestie, don't play with it.

🌟 Exit status 🌟

Any plugin should exit with status 0 on success, and any other value on failure. A Failed plugin will immediately terminate whole rpmrebuild. no second chances, no redemption arc, it's over 😭

🌟 Environment variables 🌟

all plugins get the following environment variables:

  • RPMREBUILD_TMPDIR β€” directory for plugin's temporaries files. plugin no need remove this directory β€” rpmrebuild will care. (it's the mom friend of directories 🫢)
  • RPMREBUILD_PLUGINS_DIR β€” directory with plugins.
  • RPMREBUILD_COMMENT_MISSING β€” if 'yes' missing files commented in the 'files' part of specfile
  • RPMREBUILD_PUG_FROM_FS β€” if 'yes' permission owner and group in the part file were taken from filesystem, otherwise β€” from rpm's database.
  • RPMREBUILD_WARNING β€” if 'yes' rpmrebuild will produce warning for filenames with glob characters.
  • PATH β€” This variable is set to $RPMREBUILD_PLUGINS_DIR:$PATH
  • LONG_OPTION β€” Contains long option (without --) which was used to invoke plugin.
  • RPM_BUILD_ROOT β€” For plugins modifying files under buildroot set to buildroot. For other plugins β€” empty.

(yes, it really is RPMREBUILD_PUG_FROM_FS and not PLUG. no cap. we don't know either. it's iconic, leave it alone πŸ’€)

🌟 stdin and stdout 🌟

Plugins for specfile modification (i.e., invoked with --spec-got) "source" spec file from stdin and have to write the resulting spec file to stdout.

so it's a little conveyor belt of spec text. slay πŸŽ€


🌈 PLUGIN'S EXAMPLES 🌈

Some plugins are given as examples :

  • compat_digest.plug (change-spec-preamble) : add configuration for compatibility digest
  • demofiles.plug (change-files) : a "dummy" plugin to show what can be done with a file plugin
  • demo.plug (change-spec-*) : a "dummy" plugin to show how spec plugins work
  • empty_section.plug (change-spec-*) : empy a full spec section
  • exclude_file.plug (change-spec-files) : exclude files from rpm list
  • file2pacDep.plug (change-spec-requires) : a "real" plugin to convert file dependencies to package dependencies
  • nodoc.plug (change-spec-files): a "real" plugin to remove documentation from a package
  • replacefile.plug (change-files) : change a file content
  • set_tag.plug (change-spec-preamble) : a "real" plugin to change a tag in spec file
  • unset_tag.plug (change-spec-preamble) : a "real" plugin to comment a tag in spec file
  • uniq.plug (change-spec) : a very simple "real" plugin to sort and clean duplicate spec lines
  • un_prelink.plug (change-files) : undo prelink

a whole little ensemble cast. the dummy ones are the comic relief, the "real" ones carry the plot πŸ”₯


🧚 PLUGINS' MANPAGES FILENAME CONVENTION 🧚

If you are going to write a plugin (and a manpage for it) it's strongly recommended than manpage's file looks like name.1rrp β€” this way the command 'man -k rrp' will provide a list of all rpmrebuild's plugins installed.

⚠️ Please note, that makewhatis should be run before newly installed manpages will be available for 'man -k rrp'

naming convention is the vibe check. pass it or your manpage is invisible to the group chat πŸ™ˆ


πŸ‘‘ AUTHORS πŸ‘‘

  • Eric Gerbier <eric.gerbier@tutanota.com>
  • Valery Reznic <valery_reznic@users.sourceforge.net>

See <URL:http://rpmrebuild.sourceforge.net/>.


πŸ’– SEE ALSO πŸ’–


and that's the whole page bestie!! this one's version 2.21, credited to Valery Reznic, from the rpm tools manual set β€” go forth and plugin, you absolute icon πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from