Bug #88789 rpm-oel.spec.in incorrectly marks openldap-devel as commercial-only dependency
Submitted: 6 Dec 2017 14:37 Modified: 7 Mar 2018 18:33
Reporter: Alexey Kopytov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S3 (Non-critical)
Version:5.7, 8.0 OS:Any
Assigned to: Terje Røsten CPU Architecture:Any

[6 Dec 2017 14:37] Alexey Kopytov
Description:
The openldap-devel package is a build requirement on RHEL-based
distributions for both the client-side and the server-side LDAP
authentication plugins. The client-side plugin is available in community
builds, while the server-side one is enterprise only.

However, rpm-oel.spec.in lists openldap-devel as a build requirement
only for enterprise builds:

%if 0%{?commercial}
BuildRequires:  openldap-devel
%endif

Which results in build failures when building community RPMs on
RHEL/CentOS systems without openldap-devel installed.

How to repeat:
Try building a community RPM on RHEL/CentOS without openldap-devel
installed.
[7 Dec 2017 10:48] Terje Røsten
Hi!

Thanks for report, indeed openldap-devel is required in all variants.
[14 Dec 2017 11:54] Alexey Kopytov
The same problem applies to Debian/Ubuntu packaging in a
way. 'Build-Depends:' in packaging/deb-in/control.in does not list
OpenLDAP development package as a list dependency. So the client
OpenLDAP authentication plugin is not built.

However, /mysql-packagesource-server.install.in lists
'usr/lib/mysql/plugin/authentication_ldap_sasl_client.so' as a library
to install and package.

Adding 'libldap2-dev' as a build dependency in control.in fixes it.
[14 Dec 2017 12:45] Alexey Kopytov
Actually, libsasl2-dev should also be present in build dependencies on Debian/Ubuntu machines to build the client LDAP auth plugin. Not sure if that should be reported as a separate bug?
[14 Dec 2017 14:39] Alexey Kopytov
In fact, the following code in packaging/deb-in/CMakeLists.txt is
redundant, because it was written in assumption that only commercial
binaries require libldap2-dev and libsasl2-dev to build:

# Commercial or community
IF (DEB_PRODUCT STREQUAL "commercial")
...
  SET (DEB_CONTROL_BDEPS_EXTRA ",libldap2-dev, libsasl2-dev")
...
ENDIF()

Since both commercial and community binaries have those build
requirements, they can just be listed in 'control.in' and that code can
be removed.
[24 Jan 2018 3:58] MySQL Verification Team
Bug #89365 marked as duplicate of this one
[9 Mar 2018 15:02] Paul DuBois
Fixed in 5.7.22.

RPM and Debian packages listed openldap-devel as a dependency for the
LDAP authentication plugins, but only for Enterprise distributions.
They now list the dependency for Community distributions as well.