From: Terry Burton Date: Tue, 8 Dec 2020 20:30:17 +0000 (+0000) Subject: LDAP configure.ac fix; Optionally omit LDAP from RPM builds; CI build for recent... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09ca6ab2d21d139e47beaf46137fcfc09109ba82;p=thirdparty%2Ffreeradius-server.git LDAP configure.ac fix; Optionally omit LDAP from RPM builds; CI build for recent Fedora (#3787) * 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. --- diff --git a/.github/workflows/ci-rpm.yml b/.github/workflows/ci-rpm.yml index eb5fdc9186a..456bc451053 100644 --- a/.github/workflows/ci-rpm.yml +++ b/.github/workflows/ci-rpm.yml @@ -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 diff --git a/redhat/freeradius.spec b/redhat/freeradius.spec index 535d33bbc26..23bb6580639 100644 --- a/redhat/freeradius.spec +++ b/redhat/freeradius.spec @@ -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) diff --git a/src/lib/ldap/configure b/src/lib/ldap/configure index b5c944bbb08..1f2b06c617a 100755 --- a/src/lib/ldap/configure +++ b/src/lib/ldap/configure @@ -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' diff --git a/src/lib/ldap/configure.ac b/src/lib/ldap/configure.ac index eeb29ff383b..5d7176a798a 100644 --- a/src/lib/ldap/configure.ac +++ b/src/lib/ldap/configure.ac @@ -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