Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1434967

Summary: Broken CFLAGS provided by the dirsrv pkgconfig file
Product: Red Hat Enterprise Linux 7 Reporter: mreynolds
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: Viktor Ashirov <vashirov>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.4CC: edewata, extras-qa, lslebodn, mreynolds, nhosoi, nkinder, rmeggins, spichugi, wibrown
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.6.1-4.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1433992 Environment:
Last Closed: 2017-08-01 21:16:38 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:
Bug Depends On: 1433992    
Bug Blocks:    

Description mreynolds 2017-03-22 18:56:02 UTC
+++ This bug was initially created as a clone of Bug #1433992 +++

Description of problem:
It is not possible to rebuild freeIPA in koji due to broken
CFLAGS provided by dirsrv(389-ds-base-devel)


Version-Release number of selected component (if applicable):
sh$ rpm -q 389-ds-base-devel
389-ds-base-devel-1.3.6.2-2.fc26

How reproducible:
Deterministic

Steps to Reproduce:
1. dnf install --best -y 'pkgconfig(dirsrv)'
2. pkg-config --cflags dirsrv

Actual results:
//invalid string in CFLAGS
@ldaplib_defs@ -I/dirsrv

Expected results:
//output from fedora25
-DUSE_OPENLDAP -I/usr/include/dirsrv

Additional info:
There are more unexpaded values in pkgconfig file.

sh$ cat /usr/lib64/pkgconfig/dirsrv.pc 
ldaplib=@ldaplib@

Name: dirsrv
Description: 389 Directory Server
Version: 1.3.6.2
Libs: -L${libdir}//dirsrv -lslapd
Cflags: @ldaplib_defs@ -I${includedir}//dirsrv

--- Additional comment from  on 2017-03-20 10:23:30 EDT ---

Assigning to William since he added the pkgconfig files.

--- Additional comment from wibrown on 2017-03-21 02:49:25 EDT ---

Upstream ticket:
https://pagure.io/389-ds-base/issue/49177

--- Additional comment from  on 2017-03-21 22:07:44 EDT ---

Does this build address the issues with pkgcfg?

https://koji.fedoraproject.org/koji/taskinfo?taskID=18512577

--- Additional comment from wibrown on 2017-03-22 00:38:05 EDT ---

It looks like it:

wget https://kojipkgs.fedoraproject.org//work/tasks/2578/18512578/389-ds-base-devel-1.3.6.3-2.fc26.x86_64.rpm
rpm2cpio ./389-ds-base-devel-1.3.6.3-2.fc26.x86_64.rpm| cpio -idv

cat ./usr/lib64/pkgconfig/dirsrv.pc

ldaplib=openldap

Name: dirsrv
Description: 389 Directory Server
Version: 1.3.6.3
Libs: -L${libdir}//dirsrv -lslapd
Cflags: -DUSE_OPENLDAP -I${includedir}//dirsrv

--- Additional comment from  on 2017-03-22 12:13:57 EDT ---

(In reply to wibrown from comment #4)
> It looks like it:
> 
> wget
> https://kojipkgs.fedoraproject.org//work/tasks/2578/18512578/389-ds-base-
> devel-1.3.6.3-2.fc26.x86_64.rpm
> rpm2cpio ./389-ds-base-devel-1.3.6.3-2.fc26.x86_64.rpm| cpio -idv
> 
> cat ./usr/lib64/pkgconfig/dirsrv.pc
> 
> ldaplib=openldap
> 
> Name: dirsrv
> Description: 389 Directory Server
> Version: 1.3.6.3
> Libs: -L${libdir}//dirsrv -lslapd
> Cflags: -DUSE_OPENLDAP -I${includedir}//dirsrv

Aren't the %{ var } supposed to be filled in?

--- Additional comment from Lukas Slebodnik on 2017-03-22 12:25:46 EDT ---

(In reply to mreynolds from comment #5)
> (In reply to wibrown from comment #4)
> > It looks like it:
> > 
> > wget
> > https://kojipkgs.fedoraproject.org//work/tasks/2578/18512578/389-ds-base-
> > devel-1.3.6.3-2.fc26.x86_64.rpm
> > rpm2cpio ./389-ds-base-devel-1.3.6.3-2.fc26.x86_64.rpm| cpio -idv
> > 
> > cat ./usr/lib64/pkgconfig/dirsrv.pc
> > 
> > ldaplib=openldap
> > 
> > Name: dirsrv
> > Description: 389 Directory Server
> > Version: 1.3.6.3
> > Libs: -L${libdir}//dirsrv -lslapd
> > Cflags: -DUSE_OPENLDAP -I${includedir}//dirsrv
> 
> Aren't the %{ var } supposed to be filled in?

No,
because pkgconfig  can expand them.
However they are not defined in dirsrv.pc

e.g.
  prefix=/usr/local
  exec_prefix=${prefix}
  libdir=${exec_prefix}/lib
  includedir=${prefix}/include

  Name: ipa_hbac
  Description: FreeIPA HBAC Evaluator library
  Version: 1.15.3
  Libs: -L${libdir} -lipa_hbac
  Cflags: I${includedir}/ipa_hbac
  URL: https://pagure.io/SSSD/sssd/

So there is missing in dirsrv.pc.in (and probably others as well)
  prefix=@prefix@
  exec_prefix=@exec_prefix@
  libdir=@libdir@
  includedir=@includedir@

My fault; I didn't explain it properly in upstream ticket
https://pagure.io/389-ds-base/issue/49177#comment-432430

--- Additional comment from Lukas Slebodnik on 2017-03-22 12:37:25 EDT ---

https://pagure.io/389-ds-base/issue/raw/files/82b80363857846caeeff342fca4c34dd532c218159720ce31f1216bdce912a45-0001-Ticket-49177-rpm-would-not-create-valid-pkgconfig-fi.patch

--- Additional comment from  on 2017-03-22 14:44:14 EDT ---

Fixed in upstream 389-ds-base-1.3.6.3-4

Comment 3 Simon Pichugin 2017-05-05 12:58:55 UTC
Build tested:
389-ds-base-1.3.6.1-9.el7.x86_64
389-ds-base-devel-1.3.6.1-9.el7.x86_64

Verification steps:
1. Check pkg-config cflags output for errors:
[root@qeos-130 pkgconfig]# pkg-config --cflags dirsrv
-DUSE_OPENLDAP -I/usr/include/dirsrv

2. Check dirsrv.pc for weird output:
[root@qeos-130 pkgconfig]# cat /usr/lib64/pkgconfig/dirsrv.pc
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include
ldaplib=openldap

Name: dirsrv
Description: 389 Directory Server
Version: 1.3.6.1
Libs: -L${libdir}/dirsrv -lslapd
Cflags: -DUSE_OPENLDAP -I${includedir}/dirsrv

Everything is in expected state.

Comment 4 errata-xmlrpc 2017-08-01 21:16:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2086