Browse Source

lsof: reproducible build

- clear build host and user info
- clear compiler flags
- set date to SOURCE_DATE_EPOCH

Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
lilik-openwrt-22.03
Maxim Storchak 7 years ago
parent
commit
137ace7522
2 changed files with 29 additions and 1 deletions
  1. +5
    -1
      utils/lsof/Makefile
  2. +24
    -0
      utils/lsof/patches/005-reproducable-build.patch

+ 5
- 1
utils/lsof/Makefile View File

@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=lsof PKG_NAME:=lsof
PKG_VERSION:=4.89 PKG_VERSION:=4.89
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.bz2 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 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 endef
define Build/Compile define Build/Compile
LSOF_HOST="none" \
LSOF_LOGNAME="none" \
LSOF_SYSINFO="none" \
LSOF_USER="none" \
$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE) -C $(PKG_BUILD_DIR)
endef endef


+ 24
- 0
utils/lsof/patches/005-reproducable-build.patch View File

@ -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 \

Loading…
Cancel
Save