public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: Problem building a version update of rng-tools
Date: Wed, 03 May 2023 16:39:09 +0100	[thread overview]
Message-ID: <5D27C6F6-2B45-4C26-98DC-3210B0B1BFCA@ipfire.org> (raw)
In-Reply-To: <4e013951-d847-8d59-9682-0a4a023081b9@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 4438 bytes --]

Hello Adolf,

> On 3 May 2023, at 14:23, Adolf Belka <adolf.belka(a)ipfire.org> wrote:
> 
> Hi Michael,
> 
> On 03/05/2023 14:58, Adolf Belka wrote:
>> 
>> On 03/05/2023 14:35, Adolf Belka wrote:
>>> Hi Michael,
>>> 
>>> On 03/05/2023 14:07, Michael Tremer wrote:
>>>> Hello Adolf,
>>>> 
>>>> Normally you should not need to add anything extra for this to work. The compiler should know where to search for libraries.
>>>> 
>>>> If pkg-config is being used, this might be a little bit different.
>>> Just before the various packages are checked to exist the configure also checks that pkg-config is existing.
>>>> 
>>>>> On 3 May 2023, at 13:02, Adolf Belka <adolf.belka(a)ipfire.org> wrote:
>>>>> 
>>>>> Hi All,
>>>>> 
>>>>> 
>>>>> There is a new version for rng-tools so I thought I would do an update but it kept stopping saying that it required libcap and could not find it.
>>>>> 
>>>>> 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, curl, jansson)
>>>>> 
>>>>> The new version has a flag for the ./configure called libcap_LIBS which can be used to override pkg-config.
>>>>> 
>>>>> I tried that in various ways such as libcap_LIBS="/lib" or libcap_LIBS="/lib/libcap.so.2.67" and others, but none of them worked. The ./configure still ended up with the message
>>>>> 
>>>>> checking for libcap... no
>>>>> configure: error: libcap is required
>>>>> 
>>>>> I then noticed that libcap.pc is in /lib/pkgconfig/ while all the other packages being searched for are in /usr/lib/pkgconfig/
>>>> 
>>>> This should indeed be installed to /usr/lib/pkgconfig.
>>>> 
>>>> I don’t have a problem with simply changing —-prefix=/ to —-prefix=/usr for libcap, because we don’t support a split /usr directory anyways. That should make it easier.
>> Looking through the libcap README and Makefile then the .pc files should 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.
> 
> I think I must have misread what the Makefile etc were intending to do.
> 
> I just tried a quick build of libcap with adding prefix=/usr to the make and make install lines and the lib files and the .pc files are now in /usr/lib/ and /usr/lib/pkgconfig/
> 
> The only remaining question I have is if anything else in IPFire would be expecting to see the lib files for libcap in /lib/ instead of /usr/lib/ because then the symlinking of the lib from /lib/ to /usr/lib/ won't be needed any more.

No, pkg-config should never search in /lib.

> What is libcap used for so I can test out the built iso on a vm machine?

It is quite widely used to manage capabilities of a running program. I can give some privileges away and limit itself so that any remote code executing could not cause too much damage for example.

/usr/bin/ping is for example linked against libcap. If you can execute it, everything is fine.

> Regards,
> 
> Adolf.
> 
>>> 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
>>>> 
>>>>> I then manually did a copy of libcap.pc to /usr/lib/pkgconfig/ and then 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 location for the library files of libcap.
>>>> 
>>>> Do we have any other packages that install .pc files into funny places?
>>> The other .pc files that are in /lib/pkgconfig/ are libkeyutils, libproc-2, libpsx and libsysfs
>>>> 
>> The libpsx.pc file is also from libcap.
>>>>> So the question I have is what is the best way to deal with this.
>>>>> 
>>>>> Should I add into the libcap lfs a line that copies the libcap.pc to /usr/lib/pkgconfig/ or
>>>>> 
>>>>> is can someone tell me what I am doing wrong with the libcap_LIBS flag for ./configure
>>>>> 
>> I think that rather than trying to adjust libcap to work the way it says it should be anyway, I will add a copy line into the lfs to move the libcap.pc file to /usr/lib/pkgconfig/
>> 
>> 
>> Regards,
>> 
>> Adolf.
>> 
>>>>> 
>>>>> Regards,
>>>>> 
>>>>> Adolf.
>>>>> 
>>>> 
>>>> -Michael



  reply	other threads:[~2023-05-03 15:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 12:02 Adolf Belka
2023-05-03 12:07 ` Michael Tremer
2023-05-03 12:35   ` Adolf Belka
2023-05-03 12:58     ` Adolf Belka
2023-05-03 13:23       ` Adolf Belka
2023-05-03 15:39         ` Michael Tremer [this message]
2023-05-03 15:57           ` Adolf Belka
2023-05-03 16:09             ` Adolf Belka
2023-05-03 17:16               ` Michael Tremer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5D27C6F6-2B45-4C26-98DC-3210B0B1BFCA@ipfire.org \
    --to=michael.tremer@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox