Scroll to navigation

rpmrebuild(1) rpm tools rpmrebuild(1)

NAME

rpmrebuild - a tool to build an rpm package from an installed package

SYNOPSIS

rpmrebuild [option] <packagename>

DESCRIPTION

rpmrebuild is a tool to build easily rpm package. it can be used to build an rpm file from an installed package (lost rpm) or to quickly make change to a package: just have your change on installed files and call rpmrebuild.

OPTIONS

-5 --md5-compat-digest
use rpm 4.4 compatible digest (md5)
pass additional flags to rpmbuild
work in batch mode (no interactive query if files change)
set files posix capabilities as saved in rpm database
set files posix capabilities as installed files (do not force to original capabilities, saved in rpm database)
comment out in the specfile missing files. Default: no.
defines to be passed to rpmbuild.
rpm package result will be written in directory.
alias to --edit-whole.
alias for --change-spec-whole
output help information about all, but plugins option and exit.
output help information about plugins options and exit.
read more options from the file 'file'.
install the created package. you need to run rpmrebuild as root user.
alias to --pug-from-fs
list installed plugins
alias to --change-files
do not test install at end of rpm building
use package file, not installed rpm (this option is like rpm's -p option)
set files permission, uid and gid as saved in rpm database
keep installed files permission, uid and gid (do not force to original files permission, uid and gid saved in rpm database)
use rpm scripts to compute provides
use rpm scripts to compute requires
specify a release
do not rebuild package, only generate specfile. Can't be used with --change-files.
verbose output
for debugging purposes : do not remove temporary files at end of work. also force verbose mode
output version information and exit.
display some warnings if it detects a potential problem (for example, spec file which contains filename with globbing char).
Turn on/off package verifying before processing. Default: yes. Can be turn off to get better performance.

PLUGINS OPTION

rpmrebuild use may be extended with plugins. Plugins are searched in /usr/lib/rpmrebuild/plugins and then in $PATH

Invoke plugin which change package's files. Note, that these files are copied before to the temporary location, so installed package's files not changed.
Can't be used with --spec-only

--change-spec-whole=<command>
--edit-whole

Invoke plugin or editor to change specfile.

--change-spec-preamble=<command>
--edit-preamble

--change-spec-conflicts=<command>
--edit-conflicts

--change-spec-obsoletes=<command>
--edit-obsoletes

--change-spec-provides=<command>
--edit-provides

--change-spec-requires=<command>
--edit-requires

--change-spec-suggests=<command>
--edit-suggests

--change-spec-enhances=<command>
--edit-enhances

--change-spec-recommends=<command>
--edit-recommends

--change-spec-supplements=<command>
--edit-supplements

--change-spec-description=<command>
--edit-description

--change-spec-files=<command>
--edit-files

--change-spec-triggers=<command>
--edit-triggers

--change-spec-pre=<command>
--edit-pre

--change-spec-post=<command>
--edit-post

--change-spec-preun=<command>
--edit-preun

--change-spec-postun=<command>
--edit-postun

--change-spec-pretrans=<command>
--edit-pretrans

--change-spec-postrans=<command>
--edit-postrans

--change-spec-verifyscript=<command>
--edit-verifyscript

--change-spec-changelog=<command>
--edit-changelog

Invoke plugin or editor to change preamble, conflicts, obsoletes, provides, requires, description, files, triggers, preinstall, postinstall, preuninstall, postuninstall, verifyscript or changelog.
None of these options can be specified after --change-spec-whole or --edit-whole.

INCLUDE FILES

Any of the rpmrebuild's LONG option can be specified on the command line or in the include file (file specified with -i/--include option).

Include files are also searched in the /usr/lib/rpmrebuild/plugins directory.

Include file has following syntax.

Any line begin with '#' or some number of whitespace and '#'.
empty line are ignored.
option line is very similar to the option written on the command line. the limitation of the option line in the file are:
should be used ONLY long options WITHOUT leading --.
option's argument should not be quoted.
option's argument should be separated from option by spaces or tabs, not by equal ('=') sign.
package name (non-optional argument) shouldn't be specified in the include file.

For example, if command line looks like:

rpmrebuild --change-files="pgm1 a b c" --change-spec-pre="pgm2 bb" pkg

Then include file should be written like:

change-files pgm1 a b c
change-spec-pre pgm2 bb

FILES

~/.rpmmacros
is used by rpm when building packages (macros)
$RPMREBUILD_TMPDIR/work
directory where rpmrebuild put temporary files.

ENVIRONMENT

Directory for temporal files. If not set ~/.tmp/rpmrebuild.$$ is used.
This is another way to pass options to rpmrebuild (to use with care). It allows to change the default options on a host. For example to activate the un_prelink plugin, just set RPMREBUILD_OPTS="--include un_prelink.plug"
used to specify an editor for specfile. if not set EDITOR variable examined.
used to specify an editor for specfile. if not set vi used.

EXAMPLES

Build an rpm package as closed as possible to original one:

rpmrebuild --batch package

Build a modified package:

rpmrebuild --keep-perm package

Build a rpm from another rpm file:

rpmrebuild --package --filter filter /usr/src/redhat/i386/package-i386.rpm

rebuild and sign the bash package

rpmrebuild --additional "--sign" bash

Rebuild rpm as legacy (rpm[23]) package:

rpmrebuild --additional "--nodirtokens" bash

Specify generated rpm name:

rpmrebuild --define "_rpmfilename %%{NAME}.rpm" bash

Change package interactive

rpmrebuild --package --change-files "/bin/bash" /some/place/bash.rpm

Change package non-interactive

rpmrebuild --package --change-files "a.sh && b.sh" /some/place/bash.rpm

if you have problem with rpm building, and if you know specfile syntax, you can also edit it:

rpmrebuild --edit-whole package

batch change of version tag

rpmrebuild --change-spec-preamble='sed -e "s/^Version:.*/Version: YourVersion/"' YourPackage

AUTHORS

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

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

NOTES


- md5 checksum will not match original ones.
- gpg or pgp signatures are lost

COPYRIGHT

rpmrebuild is copyright (C) 2002 by Eric Gerbier.
this program is distributed under GNU General Public License
It is provided "as is", without any express or implied warranties.
See the file COPYING for details.

SEE ALSO

rpm(8), rpmbuild(8), rpmrebuild_plugins(1), 'man -k rrp' for plugins specific manpages.

2.18 Eric Gerbier