rpmrebuild_plugins(1)
π 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:
preambleconflictsobsoletesprovidesrequiresdescriptionfilesfiletriggerstransfiletriggerstriggersprepostpreunpostunverifyscriptchangelog
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%somethingas 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 specfileRPMREBUILD_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:$PATHLONG_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 digestdemofiles.plug(change-files) : a "dummy" plugin to show what can be done with a file plugindemo.plug(change-spec-*) : a "dummy" plugin to show how spec plugins workempty_section.plug(change-spec-*) : empy a full spec sectionexclude_file.plug(change-spec-files) : exclude files from rpm listfile2pacDep.plug(change-spec-requires) : a "real" plugin to convert file dependencies to package dependenciesnodoc.plug(change-spec-files): a "real" plugin to remove documentation from a packagereplacefile.plug(change-files) : change a file contentset_tag.plug(change-spec-preamble) : a "real" plugin to change a tag in spec fileunset_tag.plug(change-spec-preamble) : a "real" plugin to comment a tag in spec fileuniq.plug(change-spec) : a very simple "real" plugin to sort and clean duplicate spec linesun_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, thatmakewhatisshould 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 π
rpm(8),rpmbuild(8),rpmrebuild(1),compat_digest.plug(1)demofiles.plug(1)demo.plug(1)exclude_file.plug(1)empty_section.plug(1)file2pacDep.plug(1)nodoc.plug(1)replacefile.plug(1)set_tag.plug(1)uniq.plug(1)un_prelink.plug(1)unset_tag.plug(1)'man -k rrp'for plugins specific manpages
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
- epel 9: rpmrebuild 2.21-1.el9 Β· GPL-2.0-or-later
- fedora 43: rpmrebuild 2.21-1.fc43 Β· GPL-2.0-or-later
- fedora 44: rpmrebuild 2.21-2.fc44 Β· 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