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