rt_distfiles - list files making up an RPM project's main archive
rt_distfiles [OPTIONS] rt_distfiles [OPTIONS] PROJECT.spec rt_distfiles [OPTIONS] PROJECT.spec.in rt_distfiles [OPTIONS] PROJECT.bootstrap
rt_distfiles prints the file names making up an RPM's project main archive (source) file, using various heuristics and auxilliary files (which you may have to create). 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 spec file contains:
... Name: foo Version: 1.0 Source: %name-%version.tar.gz ...
this script will try to print out the names of files that should be included in foo-1.0.tar.gz, as described below.
First, If no filenames are provided rt_distfiles will search "." and ".." for the files *.bootstrap, *.spec.in and *.spec in that order and exit with an error message if eiher directory contains more than one file of each kind, or if neither directory contains any files matching the above patterns.
Next, it tries to compile the list of files for inclusion in the source
archive from three sets of glob patterns stored in auxilliary files in the
directory containing the spec file. These files may refer to any RPM macros
(e.g., %{name}
) defined in the spec file or in the user and system RPM
macro files ($HOME/.rpmmacros, etc.). All three files are optional and use
reasonable defaults; they should contain one pattern per line:
This file should contain glob patterns of files to be included in the archive, relative to the project's top-level directory. If this file doesn't exist all files below the project's top-level directory will be included. If it's empty or the patterns/filenames contained within it don't match any files, rt_distfiles exits without printing anything with status 0.
This file should contain glob patterns to be excluded, relative to the project's top-level directory. If this file is empty or doesn't exist, no files will be excluded.
This file should contain glob patterns of base names to be excluded from the list. If this file is empty no files will be excluded; if it doesn't exist, the default /etc/rpmtoolbox/distfiles.xfilter will be used. Unlike the patterns from PROJECT.distfiles.skip, these patterns are matched against the base name of each file under consideration.
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.
Here's a hypothetical example that shows how rt_distfiles ignores the files that are likely not needed in a distribution. It ignores ".svn" (filtered out by /etc/rpmtoolbox/distfiles.xfilter) and "private" (filtered out by foo.distfiles.skip).
% ls -a -1 . .. .svn foo.c foo.distfiles.skip foo.spec Makefile private/ % cat foo.distfiles.skip private % rt_distfiles foo.c foo.distfiles.skip foo.spec Makefile
File names or patterns of source files to be included and excluded from distribution, relative to the project's top-level directory.
Names or patterns to be excluded from distribution; these are matched against base names of files under consideration.
Default xfilter list.
rt_archive(1), rt_makedist(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>.