Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 336973

Summary: net-analyzer/nagios-plugins has automagic dependency on ldap
Product: Gentoo Linux Reporter: Markos Chandras (RETIRED) <hwoarang>
Component: New packagesAssignee: Markos Chandras (RETIRED) <hwoarang>
Status: RESOLVED FIXED    
Severity: QA CC: netmon, qa
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to add/remove support for openldap
updated patch

Description Markos Chandras (RETIRED) gentoo-dev 2010-09-12 19:00:16 UTC
Hi

You use 'ldap' USE flag on nagios-plugins but this flag has no effect on the build system. So the ldap plugin gets activated when it finds ldap headers on the host system.


./configure --help|grep ldap -> returns nothing


and 


root@Eternity ~ # grep -r ldap /home/hwoarang/development/gentoo-cvs/gentoo-x86/net-analyzer/nagios-plugins/nagios-plugins-1.4.15.ebuild 
IUSE="+ssl samba mysql postgres ldap snmp nagios-dns nagios-ntp nagios-ping nagios-ssh nagios-game ups ipv6 radius +suid jabber"
DEPEND="ldap? ( >=net-nds/openldap-2.0.25 )

So this flag seems pretty much useless. Either drop this flag and make openldap mandatory ( not recommended ) or create a patch for build system to enable/disable openldap support
Comment 1 Markos Chandras (RETIRED) gentoo-dev 2010-09-12 19:43:48 UTC
Created attachment 247054 [details, diff]
patch to add/remove support for openldap

Initial patch which add --with/--without-ldap switch to enable/disable check_ldap plugin

@QA

Please review the patch since I am not that experienced with autotools

Thanks
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-09-12 21:05:07 UTC
You have to change the AC_CHECK_LIB call, see
http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
Comment 3 Markos Chandras (RETIRED) gentoo-dev 2010-09-12 21:46:24 UTC
(In reply to comment #2)
> You have to change the AC_CHECK_LIB call, see
> http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
> 

Ok let me think about this aloud. This is bad because the libldap  will be added to LIBS and this has ugly effects to other plugins because they will list libldap to the linking libraries. Fair enough. However I am not sure I understand the solution. Apparently you do not need libldap on LIBS but only when you build the ldap plugin. So if you override the default behavior of ACTION-IF-FOUND should be fine right?

So AC_CHECK_LIB(ldap,main,[],,-llber) should be ok right?
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-09-12 22:10:10 UTC
You ought to use [:], as [] is just "nothing".
Comment 5 Markos Chandras (RETIRED) gentoo-dev 2010-10-13 08:28:14 UTC
Created attachment 250429 [details, diff]
updated patch

What about this one?
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2011-02-22 23:27:33 UTC
Fixed
Comment 7 Frieder Bürzele 2011-04-19 21:36:13 UTC
this fix actual is no fix, it messes up the ldap plugin. 
it actually compiles fine but I figured out that the linker misses -lldap

config.log:
configure:13682: checking for ldap_init
configure:13682: x86_64-pc-linux-gnu-gcc -o conftest -g -O2   -L. conftest.c  >&5
/tmp/cc0s6THd.o: In function `main':
/var/tmp/portage/net-analyzer/some/conftest.c:66: undefined reference to `ldap_init'
collect2: ld returned 1 exit status


changing the patch back to:

-+	AC_CHECK_LIB(ldap,main,[:],,-llber)
++	AC_CHECK_LIB(ldap,main,,,-llber)

works fine
Comment 8 Markos Chandras (RETIRED) gentoo-dev 2011-04-29 21:00:39 UTC
Fixed. Thank you