Building FreeRadius with custom LDAP libraries
Hello, I am trying to use http://www.packetfence.org/downloads/PacketFence/freeradius/freeradius-2.2.0... to create custom FreeRadius RPMs for RHEL/CentOS 6. The main aim is to add --with-dhcp compile option which is not included in the standard build. The secondary aim is to build using custom ldap libraries, because we are using LTB OpenLDAP RPM packages (http://ltb-project.org/wiki/download#openldap). The libraries as installed by these RPM packages are in /usr/local/openldap/lib64/ and /usr/local/openldap/include/ In the src.rpm I see: BuildRequires: openldap-devel which I can change to: BuildRequires: openldap-ltb-debuginfo but how can I define custom LDAP libraries? Can I use something like: export CPPFLAGS="${CPPFLAGS} -I/usr/local/openldap/include" export LDFLAGS="${LDFLAGS} -L/usr/local/openldap/lib64" ...as we do for building Dovecot, or CXXFLAGS="${CXXFLAGS} -I/usr/local/openldap/include"; export CXXFLAGS LDFLAGS="${LDFLAGS} -L/usr/local/openldap/lib64 -lldap -llber -R/usr/local/openldap/lib64"; export LDFLAGS ...as we do for building PowerDNS? ( We have found the above for other software after significant effort. I hope it'll be easier with FreeRadius! :-) ) Please advise! Thanks, Nick
--with-rlm-ldap-lib-dir= --with-rlm-ldap-include-dir= Top level configure.
Thanks, Nick
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 12/9/2013 11:47 πμ, Arran Cudbard-Bell wrote:
--with-rlm-ldap-lib-dir= --with-rlm-ldap-include-dir=
Top level configure.
Thanks Arran, It worked! I have built and installed the new RPMs and things are working OK. Interestingly, trying to build with the default system libs was failing: During RPMbuild: ... checking for ldap_init in -lldap_r... no checking for ldap.h... yes configure: WARNING: silently not building rlm_ldap. configure: WARNING: FAILURE: rlm_ldap requires: libldap_r. ... and then (later): error: File not found: /home/fradius1/rpmbuild/BUILDROOT/freeradius-2.2.0-3.el6.x86_64/usr/lib64/freeradius/rlm_ldap.so error: File not found: /home/fradius1/rpmbuild/BUILDROOT/freeradius-2.2.0-3.el6.x86_64/usr/lib64/freeradius/rlm_ldap-2.2.0.so But I have also installed the standard openldap and openldap-devel packages (openldap 2.4.23, as available by default repos) and: $ ls -la /usr/lib64/*ldap* lrwxrwxrwx. 1 root root 10 Sep 21 2012 /usr/lib64/libldap-2.4.so.2 -> libldap.so -rw-r--r-- 1 root root 781914 Mar 20 15:57 /usr/lib64/libldapbackend.a -rwxr-xr-x 1 root root 1151 Mar 20 15:57 /usr/lib64/libldapbackend.la -rwxr-xr-x 1 root root 379419 Mar 20 15:57 /usr/lib64/libldapbackend.so lrwxrwxrwx. 1 root root 12 Sep 21 2012 /usr/lib64/libldap_r-2.4.so.2 -> libldap_r.so lrwxrwxrwx 1 root root 29 Jun 4 19:30 /usr/lib64/libldap_r.so -> /lib64/libldap_r-2.4.so.2.5.6 lrwxrwxrwx 1 root root 27 Jun 4 19:30 /usr/lib64/libldap.so -> /lib64/libldap-2.4.so.2.5.6 -rwxr-xr-x 1 root root 40320 Feb 22 2013 /usr/lib64/libsmbldap.so.0 ...which is the default lib dir. Solely for my comprehension, what could have been the reason for that failure? Shouldn't it work when looking for libs in the default libs dir? Thanks again, Nick
On 12 Sep 2013, at 11:02, Nikolaos Milas <nmilas@noa.gr> wrote:
On 12/9/2013 11:47 πμ, Arran Cudbard-Bell wrote:
--with-rlm-ldap-lib-dir= --with-rlm-ldap-include-dir=
Top level configure.
Thanks Arran,
It worked! I have built and installed the new RPMs and things are working OK.
Your linker's search path doesn't include the directory the libraries are in. rlm_ldap ./configure opted not to build the module because it's dependencies were un met. The module wasn't built, and so the rlm_ldap.so files didn't exist when building the RPM. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
On 12/9/2013 2:46 μμ, Arran Cudbard-Bell wrote:
Your linker's search path doesn't include the directory the libraries are in.
Hmm, it seems the path is included but the ldap libs therein are not used because there is an "override" in /etc/ld.so.conf: # ldconfig -v | grep -v ^$'\t' /usr/lib64/atlas: /usr/lib64/mysql: /usr/lib64/qt-3.3/lib: /usr/lib64/xulrunner: /usr/local/berkeleydb/lib64: /usr/local/openldap/lib64: /lib: /lib64: /usr/lib: /usr/lib64: /lib64/tls: (hwcap: 0x8000000000000000) /usr/lib64/sse2: (hwcap: 0x0000000004000000) /usr/lib64/tls: (hwcap: 0x8000000000000000) ldconfig -v output does not list any *ldap* libraries in /usr/lib64 although they exist (while it lists *ldap* libs in /usr/local/openldap/lib64), obviously because: # cat /etc/ld.so.conf include ld.so.conf.d/*.conf /usr/local/berkeleydb/lib64 /usr/local/openldap/lib64 Regards, Nick
Nikolaos Milas wrote:
ldconfig -v output does not list any *ldap* libraries in /usr/lib64 although they exist (while it lists *ldap* libs in /usr/local/openldap/lib64), obviously because:
Well... this is a local OS issue. You'll need to consult your OS documentation to figure out what's going on. We're just RADIUS people. We come close, but we don't know *everything*. :) Alan DeKok.
On Thu, Sep 12, 2013 at 3:25 PM, Nikolaos Milas <nmilas@noa.gr> wrote:
Hello,
I am trying to use http://www.packetfence.org/**downloads/PacketFence/** freeradius/freeradius-2.2.0-2.**el6.src.rpm<http://www.packetfence.org/downloads/PacketFence/freeradius/freeradius-2.2.0-2.el6.src.rpm>to create custom FreeRadius RPMs for RHEL/CentOS 6.
The main aim is to add --with-dhcp compile option which is not included in the standard build.
For the record, 2.2.0 already builds dhcp support by default, so you should not need to add --with-dhcp. See http://freeradius.org/ -- Fajar
participants (4)
-
Alan DeKok -
Arran Cudbard-Bell -
Fajar A. Nugraha -
Nikolaos Milas