From: Matthew Newton Date: Wed, 29 Jan 2025 14:16:25 +0000 (+0000) Subject: add configure switch for radlast X-Git-Tag: release_3_2_7~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fece06e2f4984a1f4c227ba9ef3edf4a8ad5e2ee;p=thirdparty%2Ffreeradius-server.git add configure switch for radlast /usr/bin/last is unavailable on some systems due to 32bit utmp, which is what radlast uses, so give the option to simply not include it when building --- diff --git a/Make.inc.in b/Make.inc.in index fefb022a26..6d5cc1c343 100644 --- a/Make.inc.in +++ b/Make.inc.in @@ -65,6 +65,7 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} INSTALLSTRIP = @INSTALLSTRIP@ +MANSKIP = @MANSKIP@ # # Linker arguments for libraries searched for by the main diff --git a/Makefile b/Makefile index 31ce505bb4..888e74e14f 100644 --- a/Makefile +++ b/Makefile @@ -142,7 +142,7 @@ $(R)$(dictdir)/%: share/% @echo INSTALL $(notdir $<) ${Q}$(INSTALL) -m 644 $< $@ -MANFILES := $(wildcard man/man*/*.?) +MANFILES := $(filter-out $(MANSKIP),$(wildcard man/man*/*.?)) MANDIR := $(wildcard man/man*) install.man: $(subst man/,$(R)$(mandir)/,$(MANFILES)) diff --git a/configure b/configure index 5041ca264f..f1dfa97c44 100755 --- a/configure +++ b/configure @@ -652,6 +652,7 @@ ac_header_c_list= enable_option_checking=no ac_subst_vars='LTLIBOBJS LIBOBJS +MANSKIP STATIC_MODULES USE_STATIC_LIBS USE_SHARED_LIBS @@ -677,10 +678,12 @@ DIRNAME AUTOHEADER AUTOCONF ACLOCAL +LAST RUSERS SNMPWALK SNMPGET openssl_version_check_config +WITH_RADLAST WITH_DHCP modconfdir dictdir @@ -785,6 +788,7 @@ with_threads with_tcp with_vmps with_dhcp +with_radlast with_static_modules with_shared_libs with_modules @@ -1490,6 +1494,7 @@ Optional Packages: --with-tcp compile in TCP support. (default=yes) --with-vmps compile in VMPS support. (default=yes) --with-dhcp compile in DHCP support. (default=yes) + --with-radlast install radlast --with-static-modules=QUOTED-MODULE-LIST --with-shared-libs build dynamic libraries and link against them. (default=yes) @@ -6796,6 +6801,26 @@ printf "%s\n" "#define WITH_DHCP 1" >>confdefs.h fi + +MANSKIP= +WITH_RADLAST= + +# Check whether --with-radlast was given. +if test ${with_radlast+y} +then : + withval=$with_radlast; case "$withval" in + yes) + WITH_RADLAST=yes + ;; + *) + WITH_RADLAST=no + esac + +fi + + + + STATIC_MODULES= # Check whether --with-static_modules was given. @@ -7261,6 +7286,58 @@ fi + +if test "x$WITH_RADLAST" = "x"; then + # Extract the first word of "last", so it can be a program name with args. +set dummy last; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LAST+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$LAST"; then + ac_cv_prog_LAST="$LAST" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_LAST="yes" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_LAST" && ac_cv_prog_LAST="no" +fi +fi +LAST=$ac_cv_prog_LAST +if test -n "$LAST"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LAST" >&5 +printf "%s\n" "$LAST" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + WITH_RADLAST="$LAST" +fi +if test "x$WITH_RADLAST" != "xyes"; then + MANSKIP="$MANSKIP man/man1/radlast.1" +fi + + missing_dir=`cd $ac_aux_dir && pwd` # Expand $ac_aux_dir to an absolute path. @@ -14670,7 +14747,8 @@ USE_STATIC_LIBS="yes" -ac_config_files="$ac_config_files ./Make.inc ./src/include/build-radpaths-h ./src/main/radsniff.mk ./src/main/checkrad ./src/main/radlast ./src/main/radtest ./scripts/rc.radiusd ./scripts/cron/radiusd.cron.daily ./scripts/cron/radiusd.cron.monthly ./scripts/cryptpasswd ./raddb/radrelay.conf ./raddb/radiusd.conf" + +ac_config_files="$ac_config_files ./Make.inc ./src/include/build-radpaths-h ./src/main/radsniff.mk ./src/main/radlast.mk ./src/main/checkrad ./src/main/radlast ./src/main/radtest ./scripts/rc.radiusd ./scripts/cron/radiusd.cron.daily ./scripts/cron/radiusd.cron.monthly ./scripts/cryptpasswd ./raddb/radrelay.conf ./raddb/radiusd.conf" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -15370,6 +15448,7 @@ do "./Make.inc") CONFIG_FILES="$CONFIG_FILES ./Make.inc" ;; "./src/include/build-radpaths-h") CONFIG_FILES="$CONFIG_FILES ./src/include/build-radpaths-h" ;; "./src/main/radsniff.mk") CONFIG_FILES="$CONFIG_FILES ./src/main/radsniff.mk" ;; + "./src/main/radlast.mk") CONFIG_FILES="$CONFIG_FILES ./src/main/radlast.mk" ;; "./src/main/checkrad") CONFIG_FILES="$CONFIG_FILES ./src/main/checkrad" ;; "./src/main/radlast") CONFIG_FILES="$CONFIG_FILES ./src/main/radlast" ;; "./src/main/radtest") CONFIG_FILES="$CONFIG_FILES ./src/main/radtest" ;; diff --git a/configure.ac b/configure.ac index a24a8061f6..6f29206646 100644 --- a/configure.ac +++ b/configure.ac @@ -567,6 +567,25 @@ if test "x$WITH_DHCP" = "xyes"; then fi AC_SUBST(WITH_DHCP) + +dnl # +dnl # extra argument: --with-radlast +dnl # +MANSKIP= +WITH_RADLAST= +AC_ARG_WITH(radlast, +[ --with-radlast install radlast], +[ case "$withval" in + yes) + WITH_RADLAST=yes + ;; + *) + WITH_RADLAST=no + esac ] +) +AC_SUBST(WITH_RADLAST) + + dnl # dnl # Allow the user to specify a list of modules to be linked dnl # statically to the server. @@ -858,6 +877,19 @@ fi AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers) + +dnl # +dnl # radlast depends on last +dnl # +if test "x$WITH_RADLAST" = "x"; then + AC_CHECK_PROG(LAST, last, yes, no) + WITH_RADLAST="$LAST" +fi +if test "x$WITH_RADLAST" != "xyes"; then + MANSKIP="$MANSKIP man/man1/radlast.1" +fi + + dnl # dnl # FIXME This is truly gross. dnl # @@ -2625,11 +2657,13 @@ AC_SUBST(USE_SHARED_LIBS) USE_STATIC_LIBS="yes" AC_SUBST(USE_STATIC_LIBS) AC_SUBST(STATIC_MODULES) +AC_SUBST(MANSKIP) AC_CONFIG_FILES([\ ./Make.inc \ ./src/include/build-radpaths-h \ ./src/main/radsniff.mk \ + ./src/main/radlast.mk \ ./src/main/checkrad \ ./src/main/radlast \ ./src/main/radtest \ diff --git a/debian/freeradius-utils.install b/debian/freeradius-utils.install index b2f3e34120..9be3ff5b00 100644 --- a/debian/freeradius-utils.install +++ b/debian/freeradius-utils.install @@ -5,7 +5,6 @@ usr/bin/radeapclient usr/bin/radwho usr/bin/radsecret usr/bin/radsniff -usr/bin/radlast usr/bin/radtest usr/bin/radzap usr/bin/radsqlrelay diff --git a/debian/rules b/debian/rules index 17bf68c842..3b468dcb22 100755 --- a/debian/rules +++ b/debian/rules @@ -204,6 +204,8 @@ install-arch: build-arch-stamp rm -f $(freeradius_dir)/usr/lib/freeradius/rlm_cache_memcached.so dh_install --sourcedir=$(freeradius_dir) -p freeradius-utils + [ ! -e $(freeradius_dir)/usr/bin/radlast ] || \ + install -m 0755 $(freeradius_dir)/usr/bin/radlast $(CURDIR)/debian/freeradius-utils/usr/bin/radlast dh_install --sourcedir=$(freeradius_dir) -p freeradius dh_strip -a --dbg-package=freeradius-dbg diff --git a/doc/ChangeLog b/doc/ChangeLog index f255972e88..e45e142397 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -57,6 +57,7 @@ FreeRADIUS 3.2.7 Sat 24 Aug 2024 12:00:00 UTC urgency=low * Better handler single-character expansions. Fixes #2216. * Correct calculation of EAP length in pre-proxy. Fixes #5486. * Don't segfault when using detail listeners. Fixes #5485 + * radlast is no longer installed if "last" is not present. FreeRADIUS 3.2.6 Sat 24 Aug 2024 12:00:00 UTC urgency=low Configuration changes diff --git a/redhat/freeradius.spec b/redhat/freeradius.spec index 40610a8794..c7a0ab3397 100644 --- a/redhat/freeradius.spec +++ b/redhat/freeradius.spec @@ -1,11 +1,13 @@ %bcond_with rlm_yubikey %bcond_without ldap +%bcond_with radlast # %%bcond_with experimental_modules %{!?_with_rlm_cache_memcached: %global _without_rlm_cache_memcached --without-rlm_cache_memcached} %{!?_with_rlm_eap_pwd: %global _without_rlm_eap_pwd --without-rlm_eap_pwd} %{!?_with_rlm_eap_tnc: %global _without_rlm_eap_tnc --without-rlm_eap_tnc} %{!?_with_rlm_yubikey: %global _without_rlm_yubikey --without-rlm_yubikey} +%{!?_with_radlast: %global _without_radlast --without-radlast} %{?_without_ldap: %global _without_libfreeradius_ldap --without-libfreeradius-ldap} %{?el7: %global _without_rlm_eap_teap --without-rlm_eap_teap} @@ -428,6 +430,8 @@ export LDFLAGS="-Wl,--build-id" %{?_without_rlm_cache_memcached} \ %{?_without_libwbclient} \ %{?_without_libfreeradius_ldap} \ + %{?_with_radlast} \ + %{?_without_radlast} \ # --with-modules="rlm_wimax" \ make %_smp_mflags @@ -844,7 +848,9 @@ fi /usr/bin/radclient /usr/bin/radcrypt /usr/bin/radeapclient +%if %{?_with_radlast:1}%{!?_with_radlast:0} /usr/bin/radlast +%endif /usr/bin/radtest /usr/bin/radsecret /usr/bin/radsniff @@ -859,7 +865,9 @@ fi %doc %{_mandir}/man1/rad_counter.1.gz %doc %{_mandir}/man1/radclient.1.gz %doc %{_mandir}/man1/radeapclient.1.gz +%if %{?_with_radlast:1}%{!?_with_radlast:0} %doc %{_mandir}/man1/radlast.1.gz +%endif %doc %{_mandir}/man8/radsqlrelay.8.gz %doc %{_mandir}/man1/radtest.1.gz %doc %{_mandir}/man1/radwho.1.gz diff --git a/src/main/.gitignore b/src/main/.gitignore index cc538fe8ce..f7bd771a61 100644 --- a/src/main/.gitignore +++ b/src/main/.gitignore @@ -1,5 +1,6 @@ Makefile radsniff.mk +radlast.mk checkrad radclient radiusd diff --git a/src/main/radlast.mk b/src/main/radlast.mk.in similarity index 82% rename from src/main/radlast.mk rename to src/main/radlast.mk.in index 766ce1feb7..1689cd76cb 100644 --- a/src/main/radlast.mk +++ b/src/main/radlast.mk.in @@ -1,5 +1,7 @@ +ifeq (@WITH_RADLAST@,yes) install: $(R)$(bindir)/radlast $(R)$(bindir)/radlast: src/main/radlast | $(R)$(bindir) @echo INSTALL $(notdir $<) @$(INSTALL) -m 755 $< $(R)$(bindir) +endif