Using .deb style subdirectories with rpm?

Paul Johnson pauljohn32 at
Mon Oct 5 06:38:06 UTC 2009

On Sun, Oct 4, 2009 at 6:41 PM, Ignacio Valdes <ivaldes at> wrote:
> I re-read my post and see it is turgid so I'll try and clarify. The
> .deb that I am working from has for example in the un-built deb
> layout:
> %{debbuildroot}/etc/init.d/
> %{debbuildroot}/etc/apache2/sites-enabled/mysite.conf
> %{debbuildroot}/opt/myapplication/env
> Deb seems to copy these into their respective sub-directories with no
> extra code.  For example: /etc/init.d/ gets created
> with dpkg -i thedeb.deb with no specific code doing this in any of the
> deb control files.
> I've built rpm's before so this seems to be more of a manual process
> with rpm, hence my attempt at cp -Rf $whereRwe/etc /etc

The files directive in the spec file is not actually installing the
files. It is just declaring which files are put into which package.
If you do not want to list all of the individual files, you don't have
to.  You can just grab all of the installed files with one line.

You need to focus on how the files actually get installed into their
positions.  This is usually controlled by the source code itself,
usually in the configure statement and the Makefile setup.

In the Debian package system, there is no vigorously enforced concept
of "pristine source code" similar to the RPM framework.  If someone
builds an RPM and has no special adjustments in the make install
portion, then he is accepting the program author's decision on where
to put the files.  If that is changed, it will show up in the spec
file with "cp" or thins like the "make PREFIX=?? install"  or whatever
(depending on the generation of automake you have).  If you want to
make an rpm drop files in the same locations as a Debian install, I'd
suggest you run the RPM build without making any adjustments and then
you can see where things get dropped within the buildroot.  If that
doesn't match what you want, you can either
1) hack the source code to create a patch so the files go where you
want (that's probably what the Debian person did--that's what I've
seen them do, anyway), or
2) put in some clever cp's in the install part of the rpm spec file.
However, you should be cautious about that because you may break your
program. If some components go looking for settings or data in a
certain spot, and you have moved it, then you are sunk.

Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas

More information about the Rpm-list mailing list