Blame SOURCES/1-fix-man-page-installation.patch

6bb98d
From 836f4e735cf368542f14005e41d2f84ec29dfd60 Mon Sep 17 00:00:00 2001
6bb98d
From: Yann Collet <yann.collet.73@gmail.com>
6bb98d
Date: Sat, 4 Dec 2021 10:29:49 -0800
6bb98d
Subject: [PATCH] fix man page installation
6bb98d
6bb98d
for variant redirectors (`xxh32sum`, `xxh64sum` and `xxh128sum`).
6bb98d
fix #647, reported by @jpalus.
6bb98d
6bb98d
Also : slightly updated man page text, for clarity and accuracy.
6bb98d
---
6bb98d
 Makefile        | 14 ++++++++------
6bb98d
 cli/xxhsum.1    |  8 ++++----
6bb98d
 cli/xxhsum.1.md |  8 +++++---
6bb98d
 3 files changed, 17 insertions(+), 13 deletions(-)
6bb98d
6bb98d
diff --git a/Makefile b/Makefile
6bb98d
index 2fbefbc..63273e1 100644
6bb98d
--- a/Makefile
6bb98d
+++ b/Makefile
6bb98d
@@ -457,6 +457,7 @@ endif
6bb98d
 
6bb98d
 INSTALL_PROGRAM ?= $(INSTALL)
6bb98d
 INSTALL_DATA    ?= $(INSTALL) -m 644
6bb98d
+INSTALL_DIR     ?= $(INSTALL) -d -m 755
6bb98d
 
6bb98d
 
6bb98d
 # Escape special symbols by putting each character into its separate class
6bb98d
@@ -496,7 +497,7 @@ libxxhash.pc: libxxhash.pc.in
6bb98d
 .PHONY: install
6bb98d
 install: lib libxxhash.pc xxhsum  ## install libraries, CLI, links and man page
6bb98d
 	@echo Installing libxxhash
6bb98d
-	$(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)
6bb98d
+	$(Q)$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
6bb98d
 	$(Q)$(INSTALL_DATA) libxxhash.a $(DESTDIR)$(LIBDIR)
6bb98d
 	$(Q)$(INSTALL_PROGRAM) $(LIBXXH) $(DESTDIR)$(LIBDIR)
6bb98d
 	$(Q)ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR)
6bb98d
@@ -508,19 +509,20 @@ ifeq ($(DISPATCH),1)
6bb98d
 	$(Q)$(INSTALL_DATA) xxh_x86dispatch.h $(DESTDIR)$(INCLUDEDIR)
6bb98d
 endif
6bb98d
 	@echo Installing pkgconfig
6bb98d
-	$(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/
6bb98d
+	$(Q)$(INSTALL_DIR) $(DESTDIR)$(PKGCONFIGDIR)/
6bb98d
 	$(Q)$(INSTALL_DATA) libxxhash.pc $(DESTDIR)$(PKGCONFIGDIR)/
6bb98d
 	@echo Installing xxhsum
6bb98d
-	$(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/
6bb98d
+	$(Q)$(INSTALL_DIR) $(DESTDIR)$(BINDIR)/
6bb98d
 	$(Q)$(INSTALL_PROGRAM) xxhsum $(DESTDIR)$(BINDIR)/xxhsum
6bb98d
 	$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh32sum
6bb98d
 	$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh64sum
6bb98d
 	$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh128sum
6bb98d
 	@echo Installing man pages
6bb98d
+	$(Q)$(INSTALL_DIR) $(DESTDIR)$(MANDIR)/
6bb98d
 	$(Q)$(INSTALL_DATA) $(MAN) $(DESTDIR)$(MANDIR)/xxhsum.1
6bb98d
-	$(Q)ln -sf $(MAN) $(DESTDIR)$(MANDIR)/xxh32sum.1
6bb98d
-	$(Q)ln -sf $(MAN) $(DESTDIR)$(MANDIR)/xxh64sum.1
6bb98d
-	$(Q)ln -sf $(MAN) $(DESTDIR)$(MANDIR)/xxh128sum.1
6bb98d
+	$(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh32sum.1
6bb98d
+	$(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh64sum.1
6bb98d
+	$(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh128sum.1
6bb98d
 	@echo xxhash installation completed
6bb98d
 
6bb98d
 .PHONY: uninstall
6bb98d
diff --git a/cli/xxhsum.1 b/cli/xxhsum.1
6bb98d
index 27e6808..715fc4b 100644
6bb98d
--- a/cli/xxhsum.1
6bb98d
+++ b/cli/xxhsum.1
6bb98d
@@ -1,14 +1,14 @@
6bb98d
-.TH "XXHSUM" "1" "November 2021" "xxhsum 0.8.1" "User Commands"
6bb98d
+.TH "XXHSUM" "1" "December 2021" "xxhsum 0.8.1" "User Commands"
6bb98d
 .SH "NAME"
6bb98d
 \fBxxhsum\fR \- print or check xxHash non\-cryptographic checksums
6bb98d
 .SH "SYNOPSIS"
6bb98d
 \fBxxhsum [<OPTION>] \|\.\|\.\|\. [<FILE>] \|\.\|\.\|\.\fR \fBxxhsum \-b [<OPTION>] \|\.\|\.\|\.\fR
6bb98d
 .P
6bb98d
-\fBxxh32sum\fR is equivalent to \fBxxhsum \-H0\fR \fBxxh64sum\fR is equivalent to \fBxxhsum \-H1\fR \fBxxh128sum\fR is equivalent to \fBxxhsum \-H2\fR
6bb98d
+\fBxxh32sum\fR is equivalent to \fBxxhsum \-H0\fR, \fBxxh64sum\fR is equivalent to \fBxxhsum \-H1\fR, \fBxxh128sum\fR is equivalent to \fBxxhsum \-H2\fR
6bb98d
 .SH "DESCRIPTION"
6bb98d
 Print or check xxHash (32, 64 or 128 bits) checksums\. When no \fIFILE\fR, read standard input, except if it\'s the console\. When \fIFILE\fR is \fB\-\fR, read standard input even if it\'s the console\.
6bb98d
 .P
6bb98d
-\fBxxhsum\fR supports a command line syntax similar but not identical to md5sum(1)\. Differences are: \fBxxhsum\fR doesn\'t have text/binary mode switch (\fB\-b\fR, \fB\-t\fR); \fBxxhsum\fR always treats files as binary file; \fBxxhsum\fR has a hash bit width switch (\fB\-H\fR);
6bb98d
+\fBxxhsum\fR supports a command line syntax similar but not identical to md5sum(1)\. Differences are: \fBxxhsum\fR doesn\'t have text/binary mode switch (\fB\-b\fR, \fB\-t\fR); \fBxxhsum\fR always treats files as binary file; \fBxxhsum\fR has a hash selection switch (\fB\-H\fR);
6bb98d
 .P
6bb98d
 As xxHash is a fast non\-cryptographic checksum algorithm, \fBxxhsum\fR should not be used for security related purposes\.
6bb98d
 .P
6bb98d
@@ -19,7 +19,7 @@ As xxHash is a fast non\-cryptographic checksum algorithm, \fBxxhsum\fR should n
6bb98d
 Displays xxhsum version and exits
6bb98d
 .TP
6bb98d
 \fB\-H\fR\fIHASHTYPE\fR
6bb98d
-Hash selection\. \fIHASHTYPE\fR means \fB0\fR=XXH32, \fB1\fR=XXH64, \fB2\fR=XXH128, \fB3\fR=XXH3\. Alternatively, \fIHASHTYPE\fR \fB32\fR=XXH32, \fB64\fR=XXH64, \fB128\fR=XXH128\. Default value is \fB1\fR (64bits)
6bb98d
+Hash selection\. \fIHASHTYPE\fR means \fB0\fR=XXH32, \fB1\fR=XXH64, \fB2\fR=XXH128, \fB3\fR=XXH3\. Note that \fB\-H3\fR triggers \fB\-\-tag\fR, which can\'t be skipped (this is to reduce risks of confusion with \fB\-H2\fR (\fBXXH64\fR))\. Alternatively, \fIHASHTYPE\fR \fB32\fR=XXH32, \fB64\fR=XXH64, \fB128\fR=XXH128\. Default value is \fB1\fR (64bits)
6bb98d
 .TP
6bb98d
 \fB\-\-tag\fR
6bb98d
 Output in the BSD style\.
6bb98d
diff --git a/cli/xxhsum.1.md b/cli/xxhsum.1.md
6bb98d
index 777d1ca..df2cb91 100644
6bb98d
--- a/cli/xxhsum.1.md
6bb98d
+++ b/cli/xxhsum.1.md
6bb98d
@@ -7,8 +7,8 @@ SYNOPSIS
6bb98d
 `xxhsum [<OPTION>] ... [<FILE>] ...`
6bb98d
 `xxhsum -b [<OPTION>] ...`
6bb98d
 
6bb98d
-`xxh32sum` is equivalent to `xxhsum -H0`
6bb98d
-`xxh64sum` is equivalent to `xxhsum -H1`
6bb98d
+`xxh32sum` is equivalent to `xxhsum -H0`,
6bb98d
+`xxh64sum` is equivalent to `xxhsum -H1`,
6bb98d
 `xxh128sum` is equivalent to `xxhsum -H2`
6bb98d
 
6bb98d
 
6bb98d
@@ -23,7 +23,7 @@ When <FILE> is `-`, read standard input even if it's the console.
6bb98d
 Differences are:
6bb98d
 `xxhsum` doesn't have text/binary mode switch (`-b`, `-t`);
6bb98d
 `xxhsum` always treats files as binary file;
6bb98d
-`xxhsum` has a hash bit width switch (`-H`);
6bb98d
+`xxhsum` has a hash selection switch (`-H`);
6bb98d
 
6bb98d
 As xxHash is a fast non-cryptographic checksum algorithm,
6bb98d
 `xxhsum` should not be used for security related purposes.
6bb98d
@@ -38,6 +38,8 @@ OPTIONS
6bb98d
 
6bb98d
 * `-H`<HASHTYPE>:
6bb98d
   Hash selection. <HASHTYPE> means `0`=XXH32, `1`=XXH64, `2`=XXH128, `3`=XXH3.
6bb98d
+  Note that `-H3` triggers `--tag`, which can't be skipped
6bb98d
+  (this is to reduce risks of confusion with `-H2` (`XXH64`)).
6bb98d
   Alternatively, <HASHTYPE> `32`=XXH32, `64`=XXH64, `128`=XXH128.
6bb98d
   Default value is `1` (64bits)
6bb98d
 
6bb98d
-- 
6bb98d
2.36.1
6bb98d