Blame SOURCES/freeradius-no-buildtime-cert-gen.patch

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