rpm package building as non-root (was: Re: src.rpm standards)

Dennis Gregorovic dgregor at redhat.com
Thu Jan 29 15:58:17 UTC 2004


On Thu, Jan 29, 2004 at 02:11:05AM -0500, Mike A. Harris wrote:
> I've got a tarball with stuff in it for people to get started 
> building rpms with this approach, with a similar config to mine, 
> located at:
> 
>       ftp://people.redhat.com/mharris/hacks   rpmbuild-nonroot*

The bottom of your .rpmmacos file contains the following lines:
     # The following will try to create any missing directories
     # required above (Not implemented yet)

My solution is to add the following to the top of the file:
     # a macro to create a directory if it doesn't exist and then
     # echo the name of the directory.
     %dir() %( [ -d %1 ] || mkdir %1; echo %1 )

You can then change
   %_topdir	%(echo $HOME)/rpmbuild
to
  %_topdir	%dir $HOME/rpmbuild

same for %_sourcedir, %_specdir, etc.

Cheers
-- Dennis






More information about the fedora-devel-list mailing list