0004-configure.ac-allow-disabling-registry-downloads.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. From be11d948f89b10be094e28d8a0a5e8fb532c7b60 Mon Sep 17 00:00:00 2001
  2. From: Vincent Fazio <vfazio@gmail.com>
  3. Date: Wed, 11 Jan 2023 22:55:51 -0600
  4. Subject: [PATCH] configure.ac: allow disabling registry downloads
  5. Some environments require reproducible builds. Since the IANA PEN
  6. registry is constantly updating and there is no snapshot available,
  7. installing ipmitool via `make install` is not reproducible.
  8. Provide a configure mechanism to disable the registry download/install..
  9. [vfazio: backport from upstream be11d948f89b10be094e28d8a0a5e8fb532c7b60]
  10. Signed-off-by: Vincent Fazio <vfazio@gmail.com>
  11. ---
  12. configure.ac | 30 ++++++++++++++++++++----------
  13. 1 file changed, 20 insertions(+), 10 deletions(-)
  14. diff --git a/configure.ac b/configure.ac
  15. index 4ee1be8..1dd2742 100644
  16. --- a/configure.ac
  17. +++ b/configure.ac
  18. @@ -18,8 +18,6 @@ AC_PROG_LN_S
  19. AC_PROG_MAKE_SET
  20. AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
  21. AC_CHECK_PROG([SED], [sed], [sed])
  22. -AC_CHECK_PROG([WGET], [wget], [wget])
  23. -AC_CHECK_PROG([CURL], [curl], [curl])
  24. AC_HEADER_STDC
  25. AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h])
  26. @@ -56,21 +54,33 @@ if test "x$exec_prefix" = "xNONE"; then
  27. exec_prefix="$prefix"
  28. fi
  29. -if test "x$WGET" = "x"; then
  30. - if test "x$CURL" = "x"; then
  31. +dnl allow enabling/disabling the fetching of the IANA PEN registry
  32. +AC_ARG_ENABLE([registry-download],
  33. + [AC_HELP_STRING([--enable-registry-download],
  34. + [download/install the IANA PEN registry [default=yes]])],
  35. + [xenable_registry_download=$enableval],
  36. + [xenable_registry_download=yes])
  37. +
  38. +AM_CONDITIONAL([DOWNLOAD], [false])
  39. +
  40. +if test "x$xenable_registry_download" = "xyes"; then
  41. + AC_CHECK_PROG([WGET], [wget], [wget])
  42. + AC_CHECK_PROG([CURL], [curl], [curl])
  43. +
  44. + if test "x$WGET" = "x" && test "x$CURL" = "x"; then
  45. AC_MSG_WARN([** Neither wget nor curl could be found.])
  46. AC_MSG_WARN([** IANA PEN database will not be installed by `make install` !])
  47. else
  48. - DOWNLOAD="$CURL --location --progress-bar"
  49. AM_CONDITIONAL([DOWNLOAD], [true])
  50. + if test "x$WGET" != "x"; then
  51. + DOWNLOAD="$WGET -c -nd -O -"
  52. + else
  53. + DOWNLOAD="$CURL --location --progress-bar"
  54. + fi
  55. fi
  56. -else
  57. - DOWNLOAD="$WGET -c -nd -O -"
  58. - AM_CONDITIONAL([DOWNLOAD], [true])
  59. fi
  60. -AC_MSG_WARN([** Download is:])
  61. -AC_MSG_WARN($DOWNLOAD)
  62. +AC_MSG_WARN([** Download is: $DOWNLOAD])
  63. AC_SUBST(DOWNLOAD, $DOWNLOAD)
  64. dnl
  65. --
  66. 2.25.1