RPM packaging (was: Last set of changes for 1.1.3)

Frank Cusack fcusack at fcusack.com
Wed Aug 30 20:11:18 CEST 2006

On August 30, 2006 12:15:52 PM +0200 Nicolas Baradakis <nbk at sitadelle.com> wrote:
> Sandworm wrote:
>> The RPM build process does use the Makefile. It does a complete
>> build and install, but does the install in the environment of
>> the "build root", which has a usr, etc, bin, and so on. The built
>> directory is then used to construct the packaged binary RPM
>> (and source RPM, if requested). However, it needs to distinguish
>> between different types of files. This is why files are tagged as
>> "%doc", because these need to be located in what is designated as
>> the documentation directory.
>> So, regardless of the original directory that the Makefile
>> installed them in, they get moved into the documentation
>> directory, sort of relative to the way they are specified in
>> the %doc directives.

All that is slightly incorrect.

rpm doesn't "need" to distinguish between doc files and others, it
only does so so that you can install rpms and leave out the documentation
to save disk space.  You can specify any file as a doc file.

The %doc directive tags files as documentation, and if the file is not
an absolute path, copies it from the *build* dir into the install dir.
It's useful for installing files that aren't installed by the Makefile
(e.g. NEWS).

>> If you're interested, see "The %doc Directive" at
>> http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html
> Thanks for the pointer. I'm reading this document, and it looks like
> the %docdir directive is exactly what we need. What do you think?
> %docdir /usr/share/doc/freeradius-1.1.3

This is already implicit, you don't need to specify %docdir.

However, if the Makefile installs into /usr/share/doc/freeradius-1.1.3,
AND you specify %doc directives that use relative [to build dir] paths,
the Makefile-installed docs will be removed.  This is a quirk of rpm
%doc behavior.  In order to preserve the Makefile-installed docs, you'd
have to install docs in the %install section rather than use %doc in the
%files section.  I hope that makes sense.

So if the Makefile installs into /usr/share/doc/freeradius-1.1.3, and
you have


all the Makefile-installed docs will be removed and you will be left
with only the single file COPYRIGHT.


More information about the Freeradius-Devel mailing list