[PLUG] 'install' utility; how do I...

Paul Heinlein heinlein at madboa.com
Thu Jan 12 09:31:18 PST 2006


On Thu, 12 Jan 2006, David Fleck wrote:

> I'm trying to do a recursive copy of a set of files from point A to 
> point B.  This is part of an rpm spec file, and I'm trying to use 
> the 'install' binary (from coreutils) to do it.

As others have mentioned, install has no ability to do recursive 
copies. The reason, I suspect, is that the -m switch allows it to set 
permission modes -- but mode setting is typically incompatible with 
the mixed files/directories content implied by recursive copying.

Others have suggested rsync and "cp -a"; the first isn't a tool I'd 
use in a rpm build setting, the second will work only on systems with 
GNU cp (since the -a switch is non-standard).

If cross-platform work is important -- and, admittedly, it may not be 
-- I'd suggest tar:

   tar cf - html | (cd %{buildroot}/usr/local/share/doc/ntp && tar xf -)

If you're assured of the presence of GNU tar, it's even easier

   tar c html | tar xC %{buildroot}/usr/local/share/doc/ntp

(Of course, if you have GNU tar, you probably also have GNU cp, in 
which case 'cp -a' will work just as well...)

-- 
Paul Heinlein <> heinlein at madboa.com <> www.madboa.com



More information about the PLUG mailing list