Bug 1673139

Summary: opensc library name not correct with respect to pkg-config file
Product: [Fedora] Fedora Reporter: Neil Horman <nhorman>
Component: openscAssignee: Jakub Jelen <jjelen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: crypto-team, gmazyland, jjelen, nmavrogi, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: opensc-0.19.0-6.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-10 02:47:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Neil Horman 2019-02-06 18:28:20 UTC
Description of problem:
pkg-config --libs opensc-pkcs11 returns "-lopensc-pkcs11".  However, the opensc package includes the file /usr/lib64/opensc-pkcs11.so, not /usr/lib64/libopensc-pkcs11.so, and so the library search fails.

Version-Release number of selected component (if applicable):
opensc-0.19.0-3.fc29

How reproducible:
100%

Steps to Reproduce:
1.Add PKG_CHECK_MODULES(...,[opensc-pkcs11],...) to a configure.ac script
2.Add ${opensc_LIBS} to the corresponding makefile.am
3.Configure and build that application

Actual results:
the resultant makefile will include -lopensc-pkcs11 on the link line, but the library will not be found, as the package only includes a version of the library without the "lib" prefix, which gcc is looking for.

Expected results:
successful link

Additional info:
The proper fix is likely to have upstream change their build scripts to rename the library libopensc-pkcs11.so, but a quick fix would just be to install a %post script in the spec file to symlink it to ensure backwards compatibility

Comment 1 Jakub Jelen 2019-02-07 08:33:39 UTC
The OpenSC does provides a library you SHOULD NOT link directly against. The mentioned library is a PKCS#11 module, which is supposed to be dynamically loaded. We should probably drop the .pc files from the package so it is not confusing.

The packaging guidelines for PKCS#11 modules [1] are quite new and not very extensive so far, but if it is confusing, we should work on fixing them.

[1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Pkcs11Support/

Comment 2 Jakub Jelen 2019-02-07 08:47:21 UTC
I will apply the following patch with the next update:

https://src.fedoraproject.org/rpms/opensc/c/38a21309

Comment 3 Jakub Jelen 2019-02-07 09:26:36 UTC
This is my proposal for the amendment of the packaging guidelines:

https://pagure.io/packaging-committee/pull-request/856

Comment 4 Fedora Update System 2019-03-27 14:45:40 UTC
opensc-0.19.0-6.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-958a542bfe

Comment 5 Fedora Update System 2019-03-27 18:18:32 UTC
opensc-0.19.0-6.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-958a542bfe

Comment 6 Fedora Update System 2019-04-10 02:47:59 UTC
opensc-0.19.0-6.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.