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

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



James Olin Oden wrote:
On Thu, 14 Aug 2003, Dhananjay D. Makwana wrote:


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


RPM installs the files based on the path listed in %files. So everything should work correctly, but sometimes software builds try to hard code things they should not. This is when you start making a patch for the softwares make files, and including that as part of your source rpm (-:

...and feed it to the upstream maintainer as well. ;)


Eli
--------------------. "If it ain't broke now,
Eli Carter           \                  it will be soon." -- crypto-gram
eli.carter(a)inet.com `-------------------------------------------------




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