]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
LDAP configure.ac fix; Optionally omit LDAP from RPM builds; CI build for recent...
authorTerry Burton <tez@terryburton.co.uk>
Tue, 8 Dec 2020 20:30:17 +0000 (20:30 +0000)
committerGitHub <noreply@github.com>
Tue, 8 Dec 2020 20:30:17 +0000 (13:30 -0700)
* ldap configure.ac: Match character mangling performed by user options parser

* RPM: Allow libfreeradius-ldap be omitted from build

... using rpmbuild ... --without ldap

Mostly for CI package testing with Fedora with does not have LTB
packages.

* CI: Enable package build with recent Fedora

Aim is to use Fedora Rawhide rolling release but it currently has a glibc bug
that means that CI throws permissions errors.

.github/workflows/ci-rpm.yml
redhat/freeradius.spec
src/lib/ldap/configure
src/lib/ldap/configure.ac

index eb5fdc9186a7bc55469e49635f0c5a131559e691..456bc45105399def8471b72d99049cdb50f52020 100644 (file)
@@ -10,11 +10,17 @@ on:
 jobs:
   rpm-build:
 
+    # Really we want to build on rolling Fedora Rawhide, however it is
+    # currently affected by a permission issue due to a glibc/systemd bug:
+    #
+    #   https://bugzilla.redhat.com/show_bug.cgi?id=1869030
+    #
     strategy:
       matrix:
         env:
-          - { NAME: "centos-7", OS: "centos:7" }
-          - { NAME: "centos-8", OS: "centos:8" }
+          - { NAME: "centos-7",  OS: "centos:7" }
+          - { NAME: "centos-8",  OS: "centos:8" }
+          - { NAME: "fedora-33", OS: "fedora:33" }
       fail-fast: false
 
     runs-on: ubuntu-latest
@@ -86,7 +92,17 @@ jobs:
     - name: Enable PowerTools on CentOS 8
       if: ${{ matrix.env.NAME == 'centos-8' }}
       run: |
-        yum config-manager --enable PowerTools
+        yum config-manager --enable PowerTools || :
+        yum config-manager --enable powertools || :
+
+    #
+    #  We just patch the SPEC file for Fedora since we want to use the standard
+    #  make rpm target which wants to build with LDAP.
+    #
+    - name: Disable rlm_ldap on Fedora (no LTB packages)
+      if: ${{ startsWith(matrix.env.NAME, 'fedora-') }}
+      run: |
+        sed -ie 's/%bcond_without ldap/%global _without_ldap: 1/' freeradius/redhat/freeradius.spec
 
     - name: Install build dependencies
       run: |
@@ -120,6 +136,7 @@ jobs:
         env:
           - { NAME: "centos-7", OS: "centos:7" }
           - { NAME: "centos-8", OS: "centos:8" }
+          - { NAME: "fedora-33", OS: "fedora:33" }
       fail-fast: false
 
     runs-on: ubuntu-latest
@@ -131,7 +148,8 @@ jobs:
 
     steps:
 
-    - name: Extra repos
+    - name: Extra repos for CentOS
+      if: ${{ startsWith(matrix.env.NAME, 'centos-') }}
       run: |
         echo '[ltb-project]' >> /etc/yum.repos.d/ltb-project.repo
         echo 'name=LTB project packages' >> /etc/yum.repos.d/ltb-project.repo
@@ -140,12 +158,14 @@ jobs:
         echo 'gpgcheck=1' >> /etc/yum.repos.d/ltb-project.repo
         echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project' >> /etc/yum.repos.d/ltb-project.repo
         rpm --import https://ltb-project.org/lib/RPM-GPG-KEY-LTB-project
-        yum install -y epel-release yum-utils
+        yum install -y epel-release
 
     - name: Enable PowerTools on CentOS 8
       if: ${{ matrix.env.NAME == 'centos-8' }}
       run: |
-        yum config-manager --enable PowerTools
+        yum install -y yum-utils
+        yum config-manager --enable PowerTools || :
+        yum config-manager --enable powertools || :
 
     - name: Load RPMs
       uses: actions/download-artifact@v2
index 535d33bbc2600c279369f5def54d20a7f2cea87f..23bb65806399f92bf6427f376302a866fb5a03a9 100644 (file)
@@ -2,6 +2,7 @@
 %bcond_with experimental_modules
 %bcond_with rlm_sigtran
 %bcond_with wbclient
+%bcond_without ldap
 
 # Many distributions have extremely old versions of OpenSSL
 # if you'd like to build with the FreeRADIUS openssl packages
@@ -15,6 +16,7 @@
 %{!?_with_rlm_eap_tnc: %global _without_rlm_eap_tnc --without-rlm_eap_tnc}
 %{!?_with_rlm_yubikey: %global _without_rlm_yubikey --without-rlm_yubikey}
 %{!?_with_rlm_sigtran: %global _without_rlm_sigtran --without-rlm_sigtran}
+%{?_without_ldap: %global _without_libfreeradius_ldap --without-libfreeradius-ldap}
 
 # experimental modules
 %bcond_with rlm_idn
@@ -197,6 +199,7 @@ BuildRequires: krb5-devel
 %description krb5
 This plugin provides Kerberos 5 support for the FreeRADIUS server project.
 
+%if %{!?_without_ldap:1}%{?_without_ldap:0}
 %package ldap
 Summary: LDAP support for FreeRADIUS
 Group: System Environment/Daemons
@@ -206,6 +209,7 @@ BuildRequires: openldap-ltb
 
 %description ldap
 This plugin provides LDAP support for the FreeRADIUS server project.
+%endif
 
 %package libfreeradius-curl
 Summary: curl wrapper library for FreeRADIUS
@@ -479,8 +483,10 @@ export RADIUSD_VERSION_RELEASE="%{release}"
         --with-threads \
         --with-thread-pool \
         --with-docdir=%{docdir} \
-       --with-libfreeradius-ldap-include-dir=/usr/local/openldap/include \
-       --with-libfreeradius-ldap-lib-dir=/usr/local/openldap/lib64 \
+%if %{!?_without_ldap:1}%{?_without_ldap:0}
+        --with-libfreeradius-ldap-include-dir=/usr/local/openldap/include \
+        --with-libfreeradius-ldap-lib-dir=/usr/local/openldap/lib64 \
+%endif
         --with-rlm-sql_postgresql-include-dir=/usr/include/pgsql \
         --with-rlm-sql-postgresql-lib-dir=%{_libdir} \
         --with-rlm-sql_mysql-include-dir=/usr/include/mysql \
@@ -526,6 +532,7 @@ export RADIUSD_VERSION_RELEASE="%{release}"
         %{?_without_rlm_mruby} \
         %{?_with_rlm_cache_memcached} \
         %{?_without_rlm_cache_memcached} \
+        %{?_without_libfreeradius_ldap} \
 #        --with-modules="rlm_wimax" \
 
 make %{?_smp_mflags}
@@ -921,9 +928,11 @@ fi
 %defattr(-,root,root)
 %{_libdir}/freeradius/rlm_sql_sqlite.so
 
+%if %{!?_without_ldap:1}%{?_without_ldap:0}
 %files ldap
 %defattr(-,root,root)
 %{_libdir}/freeradius/rlm_ldap.so
+%endif
 
 %files unixODBC
 %defattr(-,root,root)
index b5c944bbb08494fb6160dc27b2c6919d44229d86..1f2b06c617aa5c1343b4a564ba0459ee07c28422 100755 (executable)
@@ -1901,7 +1901,7 @@ fail=
 SMART_LIBS=
 SMART_CLFAGS=
 SASL=
-if test x$with_libfreeradius-ldap != xno; then
+if test x$with_libfreeradius_ldap != xno; then
 
                                ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
index eeb29ff383be0cc00a00672d91e755a68a7c0f38..5d7176a798ac646e462c3523a6cb6bd355206485 100644 (file)
@@ -2,12 +2,13 @@ AC_PREREQ([2.53])
 AC_INIT(base.c)
 AC_REVISION($Revision$)
 AC_DEFUN(modname,[libfreeradius-ldap])
+AC_DEFUN(modname_useropt,[libfreeradius_ldap])
 
 fail=
 SMART_LIBS=
 SMART_CLFAGS=
 SASL=
-if test x$with_[]modname != xno; then
+if test x$with_[]modname_useropt != xno; then
 
        dnl ############################################################
        dnl # Check for compiler