aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2020-08-06 16:13:54 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2020-08-06 16:13:54 +0000
commitd0327929abfbf1d42ab522d969d23ebb9845d179 (patch)
treedabf793d13c47901484d9eb9ae05756f9fa449b0 /Makefile.inc1
parent1931aa942f90a34dbb4518f9f97f0a17ab880735 (diff)
downloadsrc-d0327929abfbf1d42ab522d969d23ebb9845d179.tar.gz
src-d0327929abfbf1d42ab522d969d23ebb9845d179.zip
pkgbase: Add a new variable PKG_TIMESTAMP
libarchive uses the SOURCE_DATE_EPOCH env variable to set the date of file in an archive, this is useful for reproducibility. Add a variable name PKG_TIMESTAMP that take a epoch time and set SOURCE_DATE_EPOCH to this. By default it is the current time so no changes here.
Notes
Notes: svn path=/head/; revision=363964
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc19
1 files changed, 9 insertions, 0 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 94fd5ef5c515..e0992e2acb4f 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -545,6 +545,13 @@ PKG_VERSION= ${_REVISION}${EXTRA_REVISION}
.endif
.endif # !defined(PKG_VERSION)
+.if !defined(PKG_TIMESTAMP)
+TIMEEPOCHNOW= %s
+SOURCE_DATE_EPOCH= ${TIMEEPOCHNOW:gmtime}
+.else
+SOURCE_DATE_EPOCH= ${PKG_TIMESTAMP}
+.endif
+
.if !defined(_MKSHOWCONFIG)
_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \
-m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE
@@ -1831,6 +1838,7 @@ create-packages-kernel: _pkgbootstrap _repodir .PHONY
${MAKE} -f Makefile.inc1 \
DESTDIR=${KSTAGEDIR} \
PKG_VERSION=${PKG_VERSION} DISTDIR=kernel \
+ SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
create-kernel-packages
create-packages: .PHONY create-packages-world create-packages-kernel
@@ -1847,6 +1855,7 @@ create-world-packages: _pkgbootstrap .PHONY
done > ${WSTAGEDIR}/packages.mk
${_+_}@cd ${.CURDIR}; \
${MAKE} -f Makefile.inc1 create-world-packages-jobs \
+ SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
.MAKE.JOB.PREFIX=
.if make(create-world-packages-jobs)