rt_makedist - create/update source files specified in an RPM spec.
rt_makedist [OPTIONS] rt_makedist [OPTIONS] PROJECT.spec rt_makedist [OPTIONS] PROJECT.spec.in rt_makedist [OPTIONS] PROJECT.bootstrap
rt_makedist creates or updates sources, patches and icons specified in an RPM spec file. It's intended to be used with projects that maintain their spec files within their source trees; it expects to find the actual source files in the same directory as PROJECT.spec.
For example if your project's spec file contains something like this:
... Name: foo Version: 1.0 Source: %name-%version.tar.gz ...
this script will try to create the file foo-1.0.tar.gz, as described below.
Upon startup, if no filenames are provided rt_makedist
searches "." and
".." for the files *.bootstrap, *.spec.in and *.spec in that order
and exits with an error message if eiher directory contains more than one
file of each kind, or if neither directory contains any matching files.
After that, if the -x option was specified, it calls rt_bootstrap(1) in order to create/update the project's build scripts (the spec file, make files, etc.).
Next, it tries to create/update all source files, patches and icons mentioned in the spec file:
rt_makedist
tries to use these tools to
generate the source files by calling make dist
or perl Build.PL dist
.Source*
directives in the spec. If there's more than one,
or if it specifies an unsupported file type, it exits with an error message
(supported file types are: .zip, .tar, .tar.{Z,gz,bz2}, .cpio
and .cpio.{Z,gz,bz2}).If the spec file contains no Source:
directives, rt_makedist exits
with status 0.
Otherwise it looks for a file named PROJECT.distsubdir, which should specify the subdirectory prefix under which all the contained files should be added to the archive. That file may refer to any RPM macros defined in the spec or in the user's or system-wide RPM macro files. If that file doesn't exist the subdirectory prefix defaults to the main archive file's base name minus any suffixes.
Next it calles rt_archive(1)/rt_distfiles(1) with appropriate arguments to create the archive.
At this point all sources, patches and icons must exist in the project's
top-level directory, otherwise rt_makedist
exits with an error message.
Finally, it copies all source files, patches and icons from the project's top-level directory to the rpmbuild's source directory (%_sourcedir).
The following example shows how rt_makedist parses a simple spec file and creates a .tar.gz archive required to build it.
% ls -1 Makefile foo.c foo.spec % egrep 'Name|Version|Source' foo.spec Name: foo Version: 1.0 Source: %name-%version.tar.gz % rt_makedist ... rt_makedist: created foo-1.0.tar.gz
Print a short help message and exit.
Print out version information and exit.
Print out debug logs on STDERR; this option may be repeated to increase the log level.
Save/load the results of the spec file processing to/from a cache file.
Save temporary files in this directory.
Define an RPM macro when parsing the spec file.
Set RPM target while processing the spec file.
Use these alternative RPM startup files when processing the spec file.
Call rt_bootstrap(1) first.
A script that should create any missing Source
and Patch
files
descibed in the spec file.
autoconf(8), Module::Build, ExtUtils::MakeMaker, rt_bootstrap(1), rt_archive(1), rt_distfiles(1)
Davlet Panech - dpanech at users dot sourceforge dot net
Copyright 2010 Davlet Panech.
Rpmtoolbox is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Rpmtoolbox is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with rpmtoolbox. If not, see <www.gnu.org>.