From 1f5eb29ad59e7302e0407855333fbf1377f6f127 Mon Sep 17 00:00:00 2001
From: Jonas Witschel <diabonas@archlinux.org>
Date: Sat, 11 Jul 2020 17:02:59 +0200
Subject: [PATCH] Make man page reproducible

Respect SOURCE_DATE_EPOCH and remove the embedded timestamp from the gzipped
man page.
---
 Makefile | 2 +-
 help2man | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 04fdecd..d2f6230 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ man: lsb_release.1.gz
 
 lsb_release.1.gz: lsb_release
 	@./help2man -N --include ./lsb_release.examples --alt_version_key=program_version ./lsb_release >lsb_release.1
-	@gzip -9f lsb_release.1
+	@gzip -9f -n lsb_release.1
 
 install: all
 	install -D -m 644 lsb_release.1.gz ${mandir}/man1/lsb_release.1.gz
diff --git a/help2man b/help2man
index 13015c2..d448342 100755
--- a/help2man
+++ b/help2man
@@ -173,7 +173,7 @@ my ($help_text, $version_text) = map {
 	or die "$this_program: can't get `--$_' info from $ARGV[0]\n"
 } qw(help), $opt_version_key;
 
-my $date = strftime "%B %Y", localtime;
+my $date = strftime "%B %Y", gmtime($ENV{SOURCE_DATE_EPOCH} || time);
 (my $program = $ARGV[0]) =~ s!.*/!!;
 my $package = $program;
 my $version;
-- 
2.27.0

