Skip to contentSkip to conversation

Simplify the generation of man pages

PATCH Superseded Leonidas Spyropoulos 1 participant 1 message Mar 1, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Simplify the generation of man pages

Use sed to simplify the man pages generation. Keep the .in files intact during make and generate the actual man pages with sed. Additionally package tools already gz the man pages during install so it doesn't really need to do that during make and it breaks reproducibility of the package due to timestamps on files.

Motivation: https://reproducible-builds.org

---
 Makefile               |  20 +-
 makedumpfile.8.in      | 692 +++++++++++++++++++++++++++++++++++++++++
 makedumpfile.conf.5.in | 419 +++++++++++++++++++++++++
 3 files changed, 1120 insertions(+), 11 deletions(-)
 create mode 100644 makedumpfile.8.in
 create mode 100644 makedumpfile.conf.5.in
Makefile +9 -11
index 9f9fd22..f118b31 100644
@@ -112,26 +112,24 @@ $(OBJ_ARCH): $(SRC_ARCH)
 
 makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH)
 	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@ $< $(LIBS)
-	echo .TH MAKEDUMPFILE 8 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.8
-	grep -v "^.TH MAKEDUMPFILE 8" $(VPATH)makedumpfile.8 >> temp.8
-	mv temp.8 makedumpfile.8
-	gzip -c ./makedumpfile.8 > ./makedumpfile.8.gz
-	echo .TH MAKEDUMPFILE.CONF 5 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.5
-	grep -v "^.TH MAKEDUMPFILE.CONF 5" $(VPATH)makedumpfile.conf.5 >> temp.5
-	mv temp.5 makedumpfile.conf.5
-	gzip -c ./makedumpfile.conf.5 > ./makedumpfile.conf.5.gz
+	@sed -e "s/@DATE@/$(DATE)/" \
+	     -e "s/@VERSION@/$(VERSION)/" \
+	     $(VPATH)makedumpfile.8.in > $(VPATH)makedumpfile.8
+	@sed -e "s/@DATE@/$(DATE)/" \
+	     -e "s/@VERSION@/$(VERSION)/" \
+	     $(VPATH)makedumpfile.conf.5.in > $(VPATH)makedumpfile.conf.5
 
 eppic_makedumpfile.so: extension_eppic.c
 	$(CC) $(CFLAGS) $(LDFLAGS) -shared -rdynamic -o $@ extension_eppic.c -fPIC -leppic -ltinfo
 
 clean:
-	rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8.gz makedumpfile.conf.5.gz
+	rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8 makedumpfile.conf.5
 
 install:
 	install -m 755 -d ${DESTDIR}/usr/sbin ${DESTDIR}/usr/share/man/man5 ${DESTDIR}/usr/share/man/man8 ${DESTDIR}/etc
 	install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile $(VPATH)makedumpfile-R.pl
-	install -m 644 -t ${DESTDIR}/usr/share/man/man8 makedumpfile.8.gz
-	install -m 644 -t ${DESTDIR}/usr/share/man/man5 makedumpfile.conf.5.gz
+	install -m 644 -t ${DESTDIR}/usr/share/man/man8 makedumpfile.8
+	install -m 644 -t ${DESTDIR}/usr/share/man/man5 makedumpfile.conf.5
 	install -m 644 -D $(VPATH)makedumpfile.conf ${DESTDIR}/etc/makedumpfile.conf.sample
 	mkdir -p ${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts
 	install -m 644 -t ${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts/ $(VPATH)eppic_scripts/*
makedumpfile.8.in new file +692 -0

692 lines not on this page · raw message

makedumpfile.conf.5.in new file +419 -0

419 lines not on this page · raw message

Signature · 1 line
2.35.1