[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: catch-22 running rpmbuild as root/non-root?



Quoting James Olin Oden <joden@malachi.lee.k12.nc.us>:

> On Thu, 14 Aug 2003, George Jackson wrote:
> 
> > I've read lots of documentation on building rpms as a
> > non-root user and in fact have been successful in
> > building a package in a dir other than the default
> > /usr/src/redhat. The package can then be installed and
> > used but only in a user-owned directory tree.
> > 
> > I've also read a lot of docs and posts that say, and
> > rightfully so, not to build rpms as root. I was a
> > little confused, however, why most of the Maximum RPM
> > book (I know it's a little dated) and other references
> > had showed building rpms as root but I fully
> > understand why you should never do this.
> > 
> > My problem is: As a builder of an rpm for a
> > site-specific kerberos package (I don't have root
> > privs), I want to build the rpm as a non-root user so
> > that a root user (the sysadmin who gave me this task)
> > can take the rpm and install in all the normal,
> > root-owned places. However, while running rpmbuild as
> > non-root, the %install (just runs make install) macro
> > fails since I can't write to the system dirs. But if I
> > want to get an rpm I have to be able to run the
> > %install macro to create the filelist of binaries that
> > go into the rpm (right? otherwise, rpmbuild fails). 
> > 
> > If I'm unclear on any of the above let me know but is
> > there any way to do this?
> >
> 
> Your preamble needs:
> 
> 	BuildRoot: /path/some/where/you/can/write
> 
> And in %install you need to make all your directories and place
> all your files offset $RPM_BUILD_ROOT.

what happens when you install that generated rpm ? Where will the files go ? I
am a newbie to rpms. For example if i want to install a file as
/usr/local/lib/libfoo.so and for %install i have offset the path with
$RPM_BUILD_ROOT. Now what happens on the machine where I am installing this rpm. 

Thanks in advance,
-Jay

> 
> Cheers...james 
> 
> p.s. www.freshrpms.org has an excelent archive of spec files that do this 
> (I think he uses the equivalant rpm macro instead of RPM_BUILD_ROOT, but
> that is a matter of taste).
> 
> > Thanks!
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site design software
> > http://sitebuilder.yahoo.com
> > 
> > 
> > _______________________________________________
> > Rpm-list mailing list
> > Rpm-list@redhat.com
> > https://www.redhat.com/mailman/listinfo/rpm-list
> > 
> 
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@redhat.com
> https://www.redhat.com/mailman/listinfo/rpm-list
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []