601982
From e6f7c9d4c2af1cda7760ca8155166bb5d4d541d0 Mon Sep 17 00:00:00 2001
601982
From: Alexander Scheel <ascheel@redhat.com>
601982
Date: Wed, 8 May 2019 12:58:02 -0400
601982
Subject: [PATCH] Don't generate certificates in reproducible builds
601982
601982
Signed-off-by: Alexander Scheel <ascheel@redhat.com>
601982
---
601982
 Make.inc.in  | 5 +++++
601982
 configure    | 4 ++++
601982
 configure.ac | 3 +++
601982
 raddb/all.mk | 4 ++++
601982
 4 files changed, 16 insertions(+)
601982
601982
diff --git a/Make.inc.in b/Make.inc.in
601982
index 0b2cd74de8..8c623cf95c 100644
601982
--- a/Make.inc.in
601982
+++ b/Make.inc.in
601982
@@ -173,3 +173,8 @@ else
601982
 	TESTBINDIR = ./$(BUILD_DIR)/bin
601982
 	TESTBIN    = ./$(BUILD_DIR)/bin
601982
 endif
601982
+
601982
+#
601982
+#  With reproducible builds, do not generate certificates during installation
601982
+#
601982
+ENABLE_REPRODUCIBLE_BUILDS = @ENABLE_REPRODUCIBLE_BUILDS@
601982
diff --git a/configure b/configure
601982
index c2c599c92b..3d4403a844 100755
601982
--- a/configure
601982
+++ b/configure
601982
@@ -655,6 +655,7 @@ RUSERS
601982
 SNMPWALK
601982
 SNMPGET
601982
 PERL
601982
+ENABLE_REPRODUCIBLE_BUILDS
601982
 openssl_version_check_config
601982
 WITH_DHCP
601982
 modconfdir
601982
@@ -5586,6 +5587,7 @@ else
601982
 fi
601982
 
601982
 
601982
+ENABLE_REPRODUCIBLE_BUILDS=yes
601982
 # Check whether --enable-reproducible-builds was given.
601982
 if test "${enable_reproducible_builds+set}" = set; then :
601982
   enableval=$enable_reproducible_builds;  case "$enableval" in
601982
@@ -5597,6 +5599,7 @@ $as_echo "#define ENABLE_REPRODUCIBLE_BUILDS 1" >>confdefs.h
601982
     ;;
601982
   *)
601982
     reproducible_builds=no
601982
+    ENABLE_REPRODUCIBLE_BUILDS=no
601982
   esac
601982
 
601982
 fi
601982
@@ -5604,6 +5607,7 @@ fi
601982
 
601982
 
601982
 
601982
+
601982
 CHECKRAD=checkrad
601982
 # Extract the first word of "perl", so it can be a program name with args.
601982
 set dummy perl; ac_word=$2
601982
diff --git a/configure.ac b/configure.ac
601982
index a7abf0025a..35b013f4af 100644
601982
--- a/configure.ac
601982
+++ b/configure.ac
601982
@@ -619,6 +619,7 @@ AC_SUBST([openssl_version_check_config])
601982
 dnl #
601982
 dnl #  extra argument: --enable-reproducible-builds
601982
 dnl #
601982
+ENABLE_REPRODUCIBLE_BUILDS=yes
601982
 AC_ARG_ENABLE(reproducible-builds,
601982
 [AS_HELP_STRING([--enable-reproducible-builds],
601982
                 [ensure the build does not change each time])],
601982
@@ -630,8 +631,10 @@ AC_ARG_ENABLE(reproducible-builds,
601982
     ;;
601982
   *)
601982
     reproducible_builds=no
601982
+    ENABLE_REPRODUCIBLE_BUILDS=no
601982
   esac ]
601982
 )
601982
+AC_SUBST(ENABLE_REPRODUCIBLE_BUILDS)
601982
 
601982
 
601982
 dnl #############################################################
601982
diff --git a/raddb/all.mk b/raddb/all.mk
601982
index c966edd657..c8e976a499 100644
601982
--- a/raddb/all.mk
601982
+++ b/raddb/all.mk
601982
@@ -124,7 +124,11 @@ $(R)$(raddbdir)/users: $(R)$(modconfdir)/files/authorize
601982
 ifneq "$(LOCAL_CERT_PRODUCTS)" ""
601982
 $(LOCAL_CERT_PRODUCTS):
601982
 	@echo BOOTSTRAP raddb/certs/
601982
+ifeq "$(ENABLE_REPRODUCIBLE_BUILDS)" "yes"
601982
+	@$(MAKE) -C $(R)$(raddbdir)/certs/ passwords.mk
601982
+else
601982
 	@$(MAKE) -C $(R)$(raddbdir)/certs/
601982
+endif
601982
 
601982
 # Bootstrap is special
601982
 $(R)$(raddbdir)/certs/bootstrap: | raddb/certs/bootstrap $(LOCAL_CERT_PRODUCTS)
601982
-- 
601982
2.21.0
601982