From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: Problem building a version update of rng-tools Date: Wed, 03 May 2023 18:16:16 +0100 Message-ID: In-Reply-To: <37f6b9b1-8bba-eef1-870d-69ce554ad16d@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1062689137386415883==" List-Id: --===============1062689137386415883== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey, That is probably a good idea :) -Michael > On 3 May 2023, at 17:09, Adolf Belka wrote: >=20 > Hi Michael, >=20 > On 03/05/2023 17:57, Adolf Belka wrote: >> Hi Michael, >>=20 >> On 03/05/2023 17:39, Michael Tremer wrote: >>> Hello Adolf, >>>=20 >>>> On 3 May 2023, at 14:23, Adolf Belka wrote: >>>>=20 >>>> Hi Michael, >>>>=20 >>>> On 03/05/2023 14:58, Adolf Belka wrote: >>>>>=20 >>>>> On 03/05/2023 14:35, Adolf Belka wrote: >>>>>> Hi Michael, >>>>>>=20 >>>>>> On 03/05/2023 14:07, Michael Tremer wrote: >>>>>>> Hello Adolf, >>>>>>>=20 >>>>>>> Normally you should not need to add anything extra for this to work. = The compiler should know where to search for libraries. >>>>>>>=20 >>>>>>> If pkg-config is being used, this might be a little bit different. >>>>>> Just before the various packages are checked to exist the configure al= so checks that pkg-config is existing. >>>>>>>=20 >>>>>>>> On 3 May 2023, at 13:02, Adolf Belka wrot= e: >>>>>>>>=20 >>>>>>>> Hi All, >>>>>>>>=20 >>>>>>>>=20 >>>>>>>> There is a new version for rng-tools so I thought I would do an upda= te but it kept stopping saying that it required libcap and could not find it. >>>>>>>>=20 >>>>>>>> I noted that the libcap libs are in /lib and not in /usr/lib as the = other packages that rng-tools looks for have their libs. (openssl, libxml2, c= url, jansson) >>>>>>>>=20 >>>>>>>> The new version has a flag for the ./configure called libcap_LIBS wh= ich can be used to override pkg-config. >>>>>>>>=20 >>>>>>>> I tried that in various ways such as libcap_LIBS=3D"/lib" or libcap_= LIBS=3D"/lib/libcap.so.2.67" and others, but none of them worked. The ./confi= gure still ended up with the message >>>>>>>>=20 >>>>>>>> checking for libcap... no >>>>>>>> configure: error: libcap is required >>>>>>>>=20 >>>>>>>> I then noticed that libcap.pc is in /lib/pkgconfig/ while all the ot= her packages being searched for are in /usr/lib/pkgconfig/ >>>>>>>=20 >>>>>>> This should indeed be installed to /usr/lib/pkgconfig. >>>>>>>=20 >>>>>>> I don=E2=80=99t have a problem with simply changing =E2=80=94-prefix= =3D/ to =E2=80=94-prefix=3D/usr for libcap, because we don=E2=80=99t support = a split /usr directory anyways. That should make it easier. >>>>> Looking through the libcap README and Makefile then the .pc files shoul= d be getting placed in /usr/lib/pkgconfig but they aren't. Also as $(prefix) = is not defined then the prefix should be /usr but again it is not. >>>>=20 >>>> I think I must have misread what the Makefile etc were intending to do. >>>>=20 >>>> I just tried a quick build of libcap with adding prefix=3D/usr to the ma= ke and make install lines and the lib files and the .pc files are now in /usr= /lib/ and /usr/lib/pkgconfig/ >>>>=20 >>>> The only remaining question I have is if anything else in IPFire would b= e expecting to see the lib files for libcap in /lib/ instead of /usr/lib/ bec= ause then the symlinking of the lib from /lib/ to /usr/lib/ won't be needed a= ny more. >>>=20 >>> No, pkg-config should never search in /lib. >> Okay, that is good to know. >>>=20 >>>> What is libcap used for so I can test out the built iso on a vm machine? >>>=20 >>> It is quite widely used to manage capabilities of a running program. I ca= n give some privileges away and limit itself so that any remote code executin= g could not cause too much damage for example. >>>=20 >>> /usr/bin/ping is for example linked against libcap. If you can execute it= , everything is fine. >> That is a nice easy test then. >>=20 >> The build of libcap with prefix=3D/usr successfully built but it also plac= ed the capsh, getcap, getpcaps and setcap binaries from /sbin to /usr/sbin so= the change was not as easy as I thought. Maybe I should only have the prefix= =3D/usr in the make line and not in the make install line. >>=20 >> Will have another look in the makefile and see how the location for capsh = etc are defined. >>=20 > Discovered that I also had to define exec_prefix as blank, then those execu= table files were placed in /sbin again. >=20 >=20 > Regards, >=20 > Adolf. >=20 >> Regards, >> Adolf. >>>=20 >>>> Regards, >>>>=20 >>>> Adolf. >>>>=20 >>>>>> libcap currently keeps the library files in /lib/ but makes a symlink = to one of them in /usr/lib/. Libcap doesn't have a configure line. There is a= sed command on the Makefile to stop it building static libs and then it goes= straight to make and then make install >>>>>>>=20 >>>>>>>> I then manually did a copy of libcap.pc to /usr/lib/pkgconfig/ and t= hen re ran just the rng-tools build and it then successfully found libcap and= completed the build. So the problem is definitely to do withy the unusual lo= cation for the library files of libcap. >>>>>>>=20 >>>>>>> Do we have any other packages that install .pc files into funny place= s? >>>>>> The other .pc files that are in /lib/pkgconfig/ are libkeyutils, libpr= oc-2, libpsx and libsysfs >>>>>>>=20 >>>>> The libpsx.pc file is also from libcap. >>>>>>>> So the question I have is what is the best way to deal with this. >>>>>>>>=20 >>>>>>>> Should I add into the libcap lfs a line that copies the libcap.pc to= /usr/lib/pkgconfig/ or >>>>>>>>=20 >>>>>>>> is can someone tell me what I am doing wrong with the libcap_LIBS fl= ag for ./configure >>>>>>>>=20 >>>>> I think that rather than trying to adjust libcap to work the way it say= s it should be anyway, I will add a copy line into the lfs to move the libcap= .pc file to /usr/lib/pkgconfig/ >>>>>=20 >>>>>=20 >>>>> Regards, >>>>>=20 >>>>> Adolf. >>>>>=20 >>>>>>>>=20 >>>>>>>> Regards, >>>>>>>>=20 >>>>>>>> Adolf. >>>>>>>>=20 >>>>>>>=20 >>>>>>> -Michael --===============1062689137386415883==--