Hi Nigel, Nigel Metheringham wrote: >On Fri, 2006-05-05 at 10:48 +1000, John Pye wrote: > > >>The first problem is that according to 'Maximum RPM' >> >> > >Maximum RPM is really rather dated now. > > I checked the 'snapshot' Max RPM as well. Also not updated, I guess. > > >>I found that the only way to build RPMs off-root was to use the >>suggested .rpmmacros to replace %_topdir with something else. There was >>a nice little download script on the RPM webpage that looked after all >>that. But it seems that the manual needs to be updated to explain if/why >>the .rpmrc approach isn't working, and whether or not that's a >>Fedora-only issue, or what. >> >> > >Best thing is probably to get the Fedora RPM Development Tools - see > http://fedoraproject.org/wiki/fedora-rpmdevtools > >fedora-buildrpmtree sets things up for you. An alternative is >(strangely) the cpan2rpm command/package - > cpan2rpm --mk-rpm-dirs >sets things up for you > > > >>Next, my off-root RPM build fails due to 'install -o root -g root' >>commands. What is the suggested why to have RPMs built for correct root >>installation if you're not able to use the 'install -o' command during >>the build? Is that where the %defattr stuff comes into play? Should I >>not use 'install -o' in RPMs? >> >> > >Don't set the owner in the %install phase, but instead use a combination >of %defattr for the overall attributes setting, and %attr for specific >file/directory attribute setting. > > Ok, that was the right move. > > >>Finally, my trickiest problem. I have an RPM spec file as shown below >>that results in a dependency on '/usr/bin/perl5'. I don't have this on >>my system, so I want to trace back where the dependency is coming from. >>I suspect that the 'update-mime-database' command in my %pre and %post >>could be responsible -- how can I check that? >> >> > >Just do a > find /my/source/dir -type f -print | xargs fgrep /usr/bin/perl5 > >and see what you get. > >The thing like that that catches me out sometimes is examples in the >package documentation that get swept up and including in the %doc file >set. If any of those are executable they will be included in the deps >checking - so an executable perl script which starts > #!/usr/bin/perl5 > >will cause that dep. Solution is to chmod the file to 444. > > There was a perl file lurking which I hadn't seen. Thanks for that. >Reading the stuff on the Fedora Extras wiki is worth doing - even if you >never intend to submit packages to Extras or even use Fedora. Start at > http://fedoraproject.org/wiki/Packaging/Guidelines > >If you are packaging stuff that is going to be put on any other machine >I would strongly recommend using a proper build environment, which makes >sure that things aren't just building because you happen to have a file >in a particular place on your box... it makes things reproducible. > >The Fedora Extras favoured one appears to be Mock:- > http://fedoraproject.org/wiki/Extras/MockTricks > http://fedoraproject.org/wiki/Projects/Mock > >Personally I use mach - which I find more efficient since it does not >rebuild the build environment every time. [However I do wonder if we >should get something with a happy medium - saves the clean build >environment as a archive, and reinstates that each time] > >Mach is at > http://thomas.apestaart.org/projects/mach/ >and is also packaged within Fedora Extras and some other environments. > > I'll take a look at those things. Thanks heaps for those tips. Cheers JP _______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/rpm-list