aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-10-14 12:05:45 +0200
committerMattias Andrée <maandree@kth.se>2017-10-14 12:05:45 +0200
commit67692fc2056a95ad5f673742fd4e73fb99ba43e9 (patch)
tree17336d992f97fbd6ee186ed738e44e1c884edc5e
parentChange license, change style, and remove crap (diff)
downloadsha3sum-67692fc2056a95ad5f673742fd4e73fb99ba43e9.tar.gz
sha3sum-67692fc2056a95ad5f673742fd4e73fb99ba43e9.tar.bz2
sha3sum-67692fc2056a95ad5f673742fd4e73fb99ba43e9.tar.xz
Do not use texman
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--.gitignore3
-rw-r--r--Makefile63
-rw-r--r--xsum.188
-rw-r--r--xsum.texman80
4 files changed, 117 insertions, 117 deletions
diff --git a/.gitignore b/.gitignore
index 6bbe7bc..46c1b9f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,4 +8,5 @@ bin/
*.a
*.su
*.gch
-
+*.1
+!/xsum.1
diff --git a/Makefile b/Makefile
index e34673c..5590bd0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+.NONPOSIX:
+
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share
@@ -8,7 +10,6 @@ LICENSEDIR = $(DATADIR)/licenses
PKGNAME = sha3sum
-
WARN = -Wall -Wextra -pedantic -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include-dirs \
-Wtrampolines -Wfloat-equal -Wshadow -Wmissing-prototypes -Wmissing-declarations \
-Wredundant-decls -Wnested-externs -Winline -Wno-variadic-macros -Wswitch-default \
@@ -46,9 +47,25 @@ shake256sum = SHAKE256
shake512sum = SHAKE512
+MAN1 =\
+ keccaksum.1\
+ keccak-224sum.1\
+ keccak-256sum.1\
+ keccak-384sum.1\
+ keccak-512sum.1\
+ sha3-224sum.1\
+ sha3-256sum.1\
+ sha3-384sum.1\
+ sha3-512sum.1\
+ rawshake256sum.1\
+ rawshake512sum.1\
+ shake256sum.1\
+ shake512sum.1
+
+
.PHONY: all
-all: command man
+all: command $(MAN1)
.PHONY: command
@@ -63,18 +80,12 @@ obj/%.o: src/%.c src/*.h
$(CC) $(FLAGS) $(COPTIMISE) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
-
-.PHONY: man
-man: $(foreach C,$(CMDS),bin/$(C).1)
-
-bin/%.1: xsum.texman
- @mkdir -p bin
- cat $< | sed -e 's/xsum/$*/g' -e 's/XSUM/$($*)/g' | texman > $@
+%.1: xsum.1
+ u=$$(printf '%s\n' $* | tr a-z A-Z); sed -e 's/xsum/$*/g' -e 's/XSUM/'"$$u"'/g' -e 's/Xsum/$($*)/g' < xsum.1 > $@
.PHONY: install
-install: install-command install-copyright install-man
-
+install: install-command install-license install-man
.PHONY: install-command
install-command: install-keccak install-sha3 install-rawshake install-shake
@@ -96,35 +107,15 @@ install-%sum: bin/%sum
install -dm755 -- "$(DESTDIR)$(BINDIR)"
install -m755 -- $< "$(DESTDIR)$(BINDIR)/$*sum"
-
-.PHONY: install-copyright
-install-copyright: install-license
-
.PHONY: install-license
install-license:
install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
install -m644 -- LICENSE "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
-
.PHONY: install-man
-install-man: install-keccak-man install-sha3-man install-rawshake-man install-shake-man
-
-.PHONY: install-keccak-man
-install-keccak-man: $(foreach C,$(KECCAK_CMDS),install-$(C)-man)
-
-.PHONY: install-sha3-man
-install-sha3-man: $(foreach C,$(SHA3_CMDS),install-$(C)-man)
-
-.PHONY: install-rawshake-man
-install-rawshake-man: $(foreach C,$(RAWSHAKE_CMDS),install-$(C)-man)
-
-.PHONY: install-shake-man
-install-shake-man: $(foreach C,$(SHAKE_CMDS),install-$(C)-man)
-
-.PHONY: install-%sum-man
-install-%sum-man: bin/%sum.1
- install -dm755 -- "$(DESTDIR)$(MANDIR)/man1"
- install -m644 -- $< "$(DESTDIR)$(MANDIR)/man1/$*sum.1"
+install-man: $(MAN1)
+ mkdir -p -- "$(DESTDIR)$(MANDIR)/man1"
+ cp -- $(MAN1) "$(DESTDIR)$(MANDIR)/man1/"
@@ -133,9 +124,9 @@ uninstall:
-rm -- $(foreach C,$(CMDS),"$(DESTDIR)$(BINDIR)/$(C)")
-rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
-rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
- -rm -- $(foreach C,$(CMDS),"$(DESTDIR)$(MANDIR)/man1/$(C).1")
+ -cd -- "$(DESTDIR)$(MANDIR)/man1" && rm -- $(MAN1)
.PHONY: clean
clean:
- -rm -r bin obj
+ -rm -r -- bin obj $(MAN1)
diff --git a/xsum.1 b/xsum.1
new file mode 100644
index 0000000..1d29964
--- /dev/null
+++ b/xsum.1
@@ -0,0 +1,88 @@
+.TH XSUM 1 sha3sum
+.SH NAME
+xsum - Compute and check Xsum message digests
+.SH SYNOPSIS
+.B xsum
+[-u | -l | -b | -c]
+[-R
+.IR rate ]
+[-C
+.IR capacity ]
+[(-N | -O)
+.IR output-size ]
+[(-S | -B)
+.IR state-size ]
+[-W
+.IR word-size ]
+[-Z
+.IR squeeze-count ]
+[-vx]
+.RI [ file \ ...]
+.SH DESCRIPTION
+Print or check Xsum checksums. If no file
+or when the file is -, read standard input.
+.TP
+.B -u
+Output checksums in upper-case hexadecimal representation. (default)
+.TP
+.B -l
+Output checksums in lower-case hexadecimal representation.
+.TP
+.B -b
+Output checksums in binary representation. This suppresses
+the filenames and checksum delimiters. Only the checksums
+are printed.
+.TP
+.B -c
+Read Xsum sums from the file and check them against
+the files on your systems. The input files files
+should be formated as the output of this program, or
+similarly. This is not going to work if any of the
+filenames in the input files starts with a regular
+blank space or horizontal tab space, or if they
+contain a line feed, carriage return or form feed.
+.TP
+.B -x
+Convert input files from hexadecimal for to binary form
+before calculating the checksums.
+.TP
+.B -v
+Print the hashing parameters.
+.P
+The following options change the hashing parameters:
+.TP
+.BI -R\ rate
+Change the rate.
+.TP
+.BI -C\ capacity
+Change the capacity.
+.TP
+.BR -N ,\ -O \ \fIoutput-size\fP
+Change the output size.
+.TP
+.BR -S ,\ -B \ \fIstate-size\fP
+Change the state size.
+.TP
+.BI -W\ word-size
+Change the word size.
+.TP
+.BI -Z\ squeeze-count
+Change the number of squeezes that is performed.
+.SH AUTHORS
+Mattias Andrée
+.RI < maandree@kth.se >
+.SH NOTES
+All commands in the sha3sum package allow changing
+the hashing parameters. However it is only intended
+to be used with
+.BR keccaksum (1),
+or if you know what you are doing; apart from
+.B -N
+which is intended to
+.I always
+be used with
+.BR shake256sum (1),
+.BR shake512sum (1),
+.BR rawshake256sum (1),
+and
+.BR rawshake512sum (1).
diff --git a/xsum.texman b/xsum.texman
deleted file mode 100644
index 216b758..0000000
--- a/xsum.texman
+++ /dev/null
@@ -1,80 +0,0 @@
-@c -*- texinfo -*-
-@texman{xsum}{1}{November 14 2014}
-
-@section Name
-xsum - compute and check XSUM message digests
-
-@section Synopsis
-@b{xsum} [option...] [--] [file...]
-
-@section Description
-Print or check XSUM checksums. If no file
-or when the file is -, read standard input.
-
-@item @b{-h}, @b{--help}
-Display option summary.
-
-@item @b{-u}, @b{--upper}, @b{--uppercase}, @b{--upper-case}
-Output checksums in upper-case hexadecimal representation. (default)
-
-@item @b{-l}, @b{--lower}, @b{--lowercase}, @b{--lower-case}
-Output checksums in lower-case hexadecimal representation.
-
-@item @b{-b}, @b{--binary}
-Output checksums in binary representation. This suppresses
-the filenames and checksum delimiters. Only the checksums
-are printed.
-
-@item @b{-x}, @b{--hex}, @b{--hex-input}
-Convert input files from hexadecimal for to binary form
-before calculating the checksums.
-
-@item @b{-c}, @b{--check}
-Read XSUM sums from the file and check them against
-the files on your systems. The input files files
-should be formated as the output of this program, or
-similarly. This is not going to work if any of the
-filenames in the input files starts with a regular
-blank space or horizontal tab space, or if they
-contain a line feed, carriage return or form feed.
-
-@item @b{-v}, @b{--verbose}
-Print the hashing parameters.
-
-@item The following options change the hashing parameters:
-
-@item @b{-R}, @b{--bitrate}, @b{--rate} RATE
-Change the rate.
-
-@item @b{-C}, @b{--capacity} CAPACITY
-Change the capacity.
-
-@item @b{-N}, @b{-O}, @b{--output-size}, @b{--output} SIZE
-Change the output size.
-
-@item @b{-S}, @b{-B}, @b{--state-size}, @b{--state} SIZE
-Change the state size.
-
-@item @b{-W}, @b{--word-size}, @b{--word} SIZE
-Change the word size.
-
-@item @b{-Z}, @b{--squeezes} COUNT
-Change the number of squeezes that is performed.
-
-
-@section Author
-
-Written by Mattias Andrée.
-
-
-@section Note
-
-All commands in the sha3sum package allow changing
-the hashing parameters. However it is only intended
-to be used with @b{keccaksum}, or if you know what you
-are doing; apart from @b{--output} which is intended
-to @emph{always} be used with @b{shake256sum},
-@b{shake512sum}, @b{rawshake256sum} and @b{rawshake512sum}.
-
-@bye
-