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

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



--- "Dhananjay D. Makwana" <makwana@semandex.net>
wrote:
> 
> Quoting James Olin Oden
> <joden@malachi.lee.k12.nc.us>:
> 
> > 
> > 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
> 

Jay,

What I ended up doing was setting buildroot in
~/.rpmmacros :

%_topdir        /home/gjackson/rpmbuilds
%_buildroot     %{_topdir}/ROOT

Then in my specfile put

BuildRoot: %{_buildroot}

somewhere after the Group: line. Then in the %install
and %filelist section of the specfile put:

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

%files
%defattr(-,root,root)
/usr/kerberos

rpm knows what $RPM_BUILD_ROOT is from my setting the
previous vars and the DESTDIR on the make install
works only because the version of kerberos I'm using
supports this in the source.

After running rpmbuild -ba <filename>.spec the
user-owned build_root dir was created and all binaries
were put in there. However, the rpm that was created
in RPMS/i386 has the correct absolute pathnames for
root running rpm -i on another machine they are put in
the proper places. Do an rpm -q -l -p <package>.rpm to
see. This works because the %files section said put
them there and since the binaries have the paths
hard-coded from the configure and make (before the
make install), nothing breaks. At least I think that's
the reason why :)

Thanks,
George


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com




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