From 137ace7522e7600b23ce873f391d5a62fa4e0507 Mon Sep 17 00:00:00 2001 From: Maxim Storchak Date: Fri, 15 Dec 2017 15:33:03 +0200 Subject: [PATCH] lsof: reproducible build - clear build host and user info - clear compiler flags - set date to SOURCE_DATE_EPOCH Signed-off-by: Maxim Storchak --- utils/lsof/Makefile | 6 ++++- .../lsof/patches/005-reproducable-build.patch | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 utils/lsof/patches/005-reproducable-build.patch diff --git a/utils/lsof/Makefile b/utils/lsof/Makefile index d8d5d2762b..65df6f3ddb 100644 --- a/utils/lsof/Makefile +++ b/utils/lsof/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=lsof PKG_VERSION:=4.89 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://sunsite.ualberta.ca/pub/Mirror/lsof/ ftp://ftp.fu-berlin.de/pub/unix/tools/lsof @@ -57,6 +57,10 @@ define Build/Configure endef define Build/Compile + LSOF_HOST="none" \ + LSOF_LOGNAME="none" \ + LSOF_SYSINFO="none" \ + LSOF_USER="none" \ $(MAKE) -C $(PKG_BUILD_DIR) endef diff --git a/utils/lsof/patches/005-reproducable-build.patch b/utils/lsof/patches/005-reproducable-build.patch new file mode 100644 index 0000000000..1e4ab15491 --- /dev/null +++ b/utils/lsof/patches/005-reproducable-build.patch @@ -0,0 +1,24 @@ +diff --git a/dialects/linux/Makefile b/dialects/linux/Makefile +index 2bea108..ed8382e 100644 +--- a/dialects/linux/Makefile ++++ b/dialects/linux/Makefile +@@ -78,8 +78,8 @@ version.h: FRC + @echo '#define LSOF_BLDCMT "${LSOF_BLDCMT}"' > version.h; + @echo '#define LSOF_CC "${CC}"' >> version.h + @echo '#define LSOF_CCV "${CCV}"' >> version.h +- @echo '#define LSOF_CCDATE "'`date`'"' >> version.h +- @echo '#define LSOF_CCFLAGS "'`echo ${CFLAGS} | sed 's/\\\\(/\\(/g' | sed 's/\\\\)/\\)/g' | sed 's/"/\\\\"/g'`'"' >> version.h ++ @echo '#define LSOF_CCDATE "'`date -d @${SOURCE_DATE_EPOCH}`'"' >> version.h ++ @echo '#define LSOF_CCFLAGS ""' >> version.h + @echo '#define LSOF_CINFO "${CINFO}"' >> version.h + @if [ "X${LSOF_HOST}" = "X" ]; then \ + echo '#define LSOF_HOST "'`uname -n`'"' >> version.h; \ +@@ -90,7 +90,7 @@ version.h: FRC + echo '#define LSOF_HOST "${LSOF_HOST}"' >> version.h; \ + fi \ + fi +- @echo '#define LSOF_LDFLAGS "${CFGL}"' >> version.h ++ @echo '#define LSOF_LDFLAGS ""' >> version.h + @if [ "X${LSOF_LOGNAME}" = "X" ]; then \ + echo '#define LSOF_LOGNAME "${LOGNAME}"' >> version.h; \ + else \