Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The good old rpm while building package in steps simply kept the content of the BuildRoot -- it was very useful for me, because if some piece of software was difficult to create, I could check BuildRoot if everything is OK.

Now, with all "improved" rpm -- the content of BuildRoot is deleted automatically, so I cannot really dive into it (installing step is not that long).

One hack I know of would be adding some kind of sleep at the end of install stage to rpm spec. But this is ugly.

So -- QUESTION -- how to keep the content of BuildRoot in nice way -- in other words, how to disable auto delete once and for good?

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

Have you tried using rpmbuild -bi in testing, so that the you get everything built up through the %install phase? That should show you what's going on without automatically cleaning afterwards.

Then when you're satisfied, build as normal.

share|improve this answer
    
Thank you. This is the least intrusive approach and it works. –  greenoldman Apr 2 '11 at 14:58
add comment

Try adding a dummy %clean to the spec file. Something like:

%clean
echo NOOP
share|improve this answer
add comment

This is annoying, I agree. If you don't mind modifying your rpm, I suggest going into the rpm source and finding out where the BuildRoot is deleted, disable that line (it is probably only one line), and recompile. The other thing I would suggest is filing a wishlist bug to restore the old behaviour, which I believe was configurable.

Question: in what version of rpm did this behavior change?

share|improve this answer
    
I don't know about the version, but change in official rpm would be tough: lists.rpm.org/pipermail/rpm-list/2008-December/000040.html The explanation indicates that idelogy play a huge role. Patching rpm would be possible though, thank you for the hint. Maybe I would manage revert automatic BuildRoot creating too. –  greenoldman Apr 1 '11 at 10:11
    
@macias: I looked at the rpm sources on Debian (4.9.0-2), but didn't find out anything useful. However, even if the developers are not willing to change it, I expect they are willing to tell you how to do it for yourself. –  Faheem Mitha Apr 1 '11 at 10:35
    
luckily the -bi switch works for this case, so I skip patching if I can -- the software list with regressions are getting longer anyway. –  greenoldman Apr 2 '11 at 14:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.