#49177 Broken CFLAGS provided by the dirsrv pkgconfig file
Closed: wontfix Opened by firstyear.

Ticket was cloned from Red Hat Bugzilla (product Fedora): 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

Metadata Update from @firstyear:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1433992

Metadata Update from @firstyear:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1433992

Metadata Update from @firstyear:
- Issue assigned to firstyear

I0> cat /usr/lib64/pkgconfig/dirsrv.pc                                       
ldaplib=openldap
Name: dirsrv
Description: 389 Directory Server
Version: 1.3.6.2
Libs: -L${libdir}//dirsrv -lslapd
Cflags: -DUSE_OPENLDAP -I${includedir}//dirsrv

Metadata Update from @firstyear:
- Custom field reviewstatus adjusted to new
- Custom field type adjusted to defect

Metadata Update from @firstyear:
- Custom field reviewstatus adjusted to review (was: new)

It is a small progress but pkgconfig files does not work properly if they are installed to non-standard PKG_CONFIG_PATH e.g. /usr/lib/pkgconfig/ on 64 bit machine. In another words, ./configure was not called without any --*dir parameter. BTW Fedora add them all in specfile after expansion of rpm macro "%configure"

sh# cat /usr/lib/pkgconfig/dirsrv.pc 
ldaplib=openldap
Name: dirsrv
Description: 389 Directory Server
Version: 1.3.6.2.20170321git7d1a2ee
Libs: -L${libdir}//dirsrv -lslapd
Cflags: -DUSE_OPENLDAP -I${includedir}//dirsrv
sh# pkg-config --libs dirsrv
Package dirsrv was not found in the pkg-config search path.
Perhaps you should add the directory containing `dirsrv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dirsrv' found
sh# PKG_CONFIG_PATH=/usr/lib/pkgconfig/ pkg-config --libs dirsrv
Variable 'libdir' not defined in '/usr/lib/pkgconfig/dirsrv.pc'
sh# PKG_CONFIG_PATH=/usr/lib/pkgconfig/ pkg-config --cflags dirsrv
Variable 'libdir' not defined in '/usr/lib/pkgconfig/dirsrv.pc'

ack.

I will update the upstream specfile to use %configure

Metadata Update from @mreynolds:
- Custom field reviewstatus adjusted to ack (was: review)

commit 4fb30a0006518135774c89fca182e79986509f3f
To ssh://git@pagure.io/389-ds-base.git
6ce24c1..4fb30a0 master -> master

Metadata Update from @firstyear:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

commit 4fb30a0 is sufficient enough for fedora but pkgconfig files still need to be fixed.

I don't understand your comment here: What issue still is outstanding you are referring to?

I don't understand your comment here: What issue still is outstanding you are referring to?

@firstyear Check attached patch

Thanks Lukas, I pushed your patch:

25e5b78..b672e63  master -> master
commit b672e63e60d85629e161dbe8c167567dbc08fe22
Author: Lukas Slebodnik <lslebodn@redhat.com>
Date:   Wed Mar 22 16:29:50 2017 +0000

Ahhhh I see, thanks @lslebodn

Patch to fix double slash in pc file

0001-Issue-49177-Fix-pkg-config-file.patch

Metadata Update from @mreynolds:
- Custom field reviewstatus adjusted to review (was: ack)
- Issue status updated to: Open (was: Closed)

Metadata Update from @nhosoi:
- Custom field reviewstatus adjusted to ack (was: review)

Ack, though I think we should be careful as a change to our configure.ac may break this.

The same bug is also in other pkg-config files.
I would prefer to fix configure script so @serverincdir@ and @serverdir@ will not contain leading '/'

Or another solution is that @serverincdir@ would be full path (including $prefix). But this patch will work as well.

I just wan to give some ideas for improvement :-)

Or another solution is that @serverincdir@ would be full path (including $prefix). But this patch will work as well.
I just wan to give some ideas for improvement :-)

@lslebodn these variables are used in many places in the code so I don't want to meddle with them too much, but I think you'll like this patch. Can you review it please?

0001-Issue-49177-Fix-pkg-config-file.patch

Metadata Update from @mreynolds:
- Custom field reviewstatus adjusted to review (was: ack)

@lslebodn these variables are used in many places in the code so I don't want to meddle with them too much, but I think you'll like this patch. Can you review it please?

Sure. You know code much better :-)

All pkgconfig are generated without double slash.

e.g.

prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib
includedir=${prefix}/include
ldaplib=openldap
Name: dirsrv
Description: 389 Directory Server
Version: 1.3.6.3.20170331git0621e82
Libs: -L${libdir}/dirsrv -lslapd
Cflags: -DUSE_OPENLDAP -I${includedir}/dirsrv

ACK

BTW it is interesting that rpm debuginfo extractor has an issue with '//'. I didn't consider it as any problem in previous reviews.

BTW it is interesting that rpm debuginfo extractor has an issue with '//'. I didn't consider it as any problem in previous reviews.

Yeah I was also surprised to see the double slash cause problems. Oh well, it's fixed now. Thanks for the review!

84ec261..fa5e2d0 master -> master

Metadata Update from @mreynolds:
- Custom field reviewstatus adjusted to ack (was: review)
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata Update from @mreynolds:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1433992 https://bugzilla.redhat.com/show_bug.cgi?id=1436994 (was: https://bugzilla.redhat.com/show_bug.cgi?id=1433992)

Metadata Update from @mreynolds:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1433992, https://bugzilla.redhat.com/show_bug.cgi?id=1436994 (was: https://bugzilla.redhat.com/show_bug.cgi?id=1433992 https://bugzilla.redhat.com/show_bug.cgi?id=1436994)

Metadata Update from @vashirov:
- Custom field origin adjusted to None
- Issue set to the milestone: None (was: 0.0 NEEDS_TRIAGE)

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/2236

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

Metadata