Tony Earnshaw wrote: > tor, 30.06.2005 kl. 17.40 skrev Bob Proulx: > > The %install script is run with /bin/sh by default. You should not be > > using pushd and popd there. Those are not standard commands and would > > fail if /bin/sh were a different shell than bash. And you don't need > > them here anyway. > > First off: If you don't get to the bottom - Thanks! > Secondly, this is meant for Red Hat, so bash is standard (sh *is* bash). It is still better not to depend upon that! > > ln -s libdb-4.2.so %{buildroot}/usr/local/BerkeleyDB.4.2/lib/libdb.so > > This *works*. But I can't see how. How does rpmbuild know where to find > libdb-4.2.so? Symlinks are name translations. So when you ask for libdb.so it will be translated by name to libdb-4.2.so. Both files are in the same directory so a relative path from one to the other in the same directory is all that is needed. For this particular part rpmbuild does not need to find libdb-4.2.so. It is finding libdb.so, a symlink with a *value* of libdb-4.2.so. The rpmbuild command will find libdb.so listed in %files. It finds libdb-4.2.so independently based upon whether it is listed in %files too or not. As far as rpmbuild is concerned these two files are completely separate and unrelated files. But we happen to know that one is symlink with a value that points it to the other one. But only because we are cognizant of the relationship while rpmbuild is not. > > Uhm, your %files section is completely empty. You need to list > > something there in order to have your symlinks in the package. This > > can't be your actual spec file. > > No, of course it isn't. I tried to attach the spec file, but it was 4.9 > kB and it appears the list doesn't accept anything over 4 kB. I was burned by that very same mailing list problem myself just recently. Grrr... > So you got what was relevant to my question; my actual %fies section > (which works, everything works) is: Everything is working for you? As I read it there was a problem with symlinks not being packaged. But if that is resolved then good. > %files > %defattr(-,root,root) > /usr/local/BerkeleyDB.4.2/bin/* > /usr/local/BerkeleyDB.4.2/lib/* > /usr/local/BerkeleyDB.4.2/include/* > /usr/local/BerkeleyDB.4.2/docs/* That all looks fine. One bug in at least some older version of rpm (I don't know if it is fixed, probably) is that dangling symlinks were not expanded by the file glob '*' in the %files section. I should verify that it is fixed now but don't have time at the moment. But as long as both the symlink and the target were available in the buildroot then the above should work fine on any version of rpm. > > Since you are trying to package the Berkeley DB which has been > > packaged many times before, you might try to find another version of > > the package and look at the techniques used by the other packager. > > Using http://www.rpmfind.net to find another package might be helpful. > > Good call. That's how I got the pushd/popd stuff (I'm still learning ;) Ah, yes, well then shame on the original Berkeley DB packagers for using that construct! :-) > Really the idea was, that what Sleepycat packaged for rpm building was > so utterly useless, that even though I got it to work in the end (by all > sorts of sleight of hand), I thought I could build my own from the > beginning. And I did. That is the beauty of free software! Glad things are working for you. Bob