From 1fe392c7723d58fc97ed48b84a541dd79f455c42 Mon Sep 17 00:00:00 2001 From: Erik Auerswald Date: Sun, 14 May 2023 17:37:48 +0200 Subject: [PATCH] use latest release date as man page date The latest release date is extracted from the NEWS file, i.e., it depends only on the sources, not the build date. This is intended to help in creating reproducible builds by avoiding timestamps. It is also closer to the date of the contents of the man page than using just the latest copyright year. I do not have a perfect solution that works for both a git clone and a downloaded tar ball. This solution works well for released tar balls of the ssocr sources. --- INSTALL | 2 +- Makefile | 6 +++--- NEWS | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/INSTALL b/INSTALL index 13bd706..ec2dbee 100644 --- a/INSTALL +++ b/INSTALL @@ -24,7 +24,7 @@ build a .deb package by typing: Prerequisites ------------- - A system sufficiently compatible to POSIX and GNU. -- POSIX utilities: chmod, printf, sh, sed (or compatible) +- POSIX utilities: chmod, head, printf, sh, sed (or compatible) - GNU utilities: date, gzip, install, tar (or compatible) - Other utilities: bzip2 - Imlib2 shared library and development headers. On a Debian or Ubuntu system diff --git a/Makefile b/Makefile index 35cef7c..5b33d83 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ DOCDIR := $(PREFIX)/share/doc/ssocr DOCS := AUTHORS COPYING INSTALL README THANKS NEWS VERSION := $(shell sed -n 's/^.*VERSION.*"\(.*\)".*/\1/p' defines.h) CRYEARS := $(shell sed -n 's/^.*fprintf.*Copyright.*\(2004-2[0-9][0-9][0-9]\).*Erik.*Auerswald.*$$/\1/p' help.c) -MANYEAR := $(shell sed -n 's/^.*fprintf.*Copyright.*2004-\(2[0-9][0-9][0-9]\).*Erik.*Auerswald.*$$/\1/p' help.c) +RELDATE := $(shell sed -n 's/^Version [.0-9]* .\([-0-9]*\).*$$/\1/p' NEWS | head -n1) all: ssocr ssocr.1 @@ -21,9 +21,9 @@ imgproc.o: imgproc.c defines.h imgproc.h help.h Makefile help.o: help.c defines.h imgproc.h help.h Makefile charset.o: charset.c charset.h defines.h help.h Makefile -ssocr.1: ssocr.1.in Makefile defines.h help.c +ssocr.1: ssocr.1.in Makefile defines.h help.c NEWS sed -e 's/@VERSION@/$(VERSION)/' \ - -e 's/@DATE@/$(MANYEAR)/' \ + -e 's/@DATE@/$(RELDATE)/' \ -e 's/@CRYEARS@/$(CRYEARS)/' <$< >$@ ssocr-manpage.html: ssocr.1 diff --git a/NEWS b/NEWS index 259a51f..cb233ea 100644 --- a/NEWS +++ b/NEWS @@ -3,8 +3,8 @@ Noteworthy Changes in ssocr Releases Upcoming Version ?.??.? (????-??-??): ------------------------------------- - * The man page uses the year of the last ssocr update as its date instead - of the build day of the man page, to help reproducible builds + * The man page uses the latest ssocr release date as its date (to help + in creating reproducible builds) * Documentation improvements Version 2.23.0 (2023-05-01):