]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add configure switch for radlast
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 29 Jan 2025 14:16:25 +0000 (14:16 +0000)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 29 Jan 2025 19:45:56 +0000 (19:45 +0000)
/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

Make.inc.in
Makefile
configure
configure.ac
debian/freeradius-utils.install
debian/rules
doc/ChangeLog
redhat/freeradius.spec
src/main/.gitignore
src/main/radlast.mk.in [moved from src/main/radlast.mk with 82% similarity]

index fefb022a268626190ccc781068efaa16f7072131..6d5cc1c343ce49e3bd2694a889ca238c0fdad1b7 100644 (file)
@@ -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
index 31ce505bb4c6ef89889c4a9ef23b24d130e6af46..888e74e14f0c371788f74309093b0c2d9e12bf34 100644 (file)
--- 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))
 
index 5041ca264f4d3ef91410bc78e5516857f1332826..f1dfa97c44f600ef564fedd2cac9697c639d1ae6 100755 (executable)
--- 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" ;;
index a24a8061f62ba434a92675ad55fb33af9b1dc5b9..6f292066466458fda3ec898b16d2d44e324741fb 100644 (file)
@@ -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 \
index b2f3e34120d0298b8295e7ed126552b93ec7c2d0..9be3ff5b00c195f2d00ba0b0274f184c2cc092f9 100644 (file)
@@ -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
index 17bf68c842ea199bb799c0a7854201df6cb1b8a5..3b468dcb2284c4d79b867590ac749f85ba5573a8 100755 (executable)
@@ -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
index f255972e88d82c2e0ea773c4dc34fbd4b094ea76..e45e142397021531e544aaa6b317829a0ed1d18f 100644 (file)
@@ -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
index 40610a8794ab6c73446b429b836adfb186ab8a94..c7a0ab33977cb660e172196dd1e9f2f5a1a05f87 100644 (file)
@@ -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
index cc538fe8cef9d23c7cb67eda725d916a6eb892bb..f7bd771a61ee6bdf8dfc2a44000ce7458375f4d1 100644 (file)
@@ -1,5 +1,6 @@
 Makefile
 radsniff.mk
+radlast.mk
 checkrad
 radclient
 radiusd
similarity index 82%
rename from src/main/radlast.mk
rename to src/main/radlast.mk.in
index 766ce1feb75bca67951e750e7c82134e9a9058e9..1689cd76cb1a3a6b1ba8b134b1aeb6cf3839982e 100644 (file)
@@ -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