Description: Include kdf binaries into the build
 Modify Makefile to fit Debian's needs.
 Add altered location of binaries to PATH within the tomb script.
 Remove note on binaries to be compiled from manpage as they are part of the
 package now.
Forwarded: not-needed
Author: Sven Geuer <sge@debian.org>
Last-Update: 2024-07-19 
--- a/doc/tomb.1
+++ b/doc/tomb.1
@@ -49,8 +49,7 @@
 to protect the key is AES256, a custom one can be specified using the \fI-o\fR
 option, for a list of supported ciphers use \fI-v\fR. For additional protection
 against dictionary attacks on keys, the \fI--kdf\fR option can be used when
-forging a key, making sure that the binaries in \fIextras/kdf\fR were compiled
-and installed on the system.
+forging a key.
 
 .B
 .IP "lock"
--- a/extras/kdf-keys/Makefile
+++ b/extras/kdf-keys/Makefile
@@ -1,11 +1,11 @@
 
 PREFIX ?= /usr/local
+BINDIR = /libexec/tomb
 
 all:
-	$(CC) -O2 $(CFLAGS) -o tomb-kdb-pbkdf2 pbkdf2.c -lgcrypt
-	$(CC) -O2 $(CFLAGS) -o tomb-kdb-pbkdf2-getiter benchmark.c -lgcrypt
-	$(CC) -O2 $(CFLAGS) -o tomb-kdb-pbkdf2-gensalt gen_salt.c -lgcrypt
-	$(CC) -O2 $(CFLAGS) -o tomb-kdb-hexencode hexencode.c
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o tomb-kdb-pbkdf2 pbkdf2.c -lgcrypt
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o tomb-kdb-pbkdf2-getiter benchmark.c -lgcrypt
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o tomb-kdb-pbkdf2-gensalt gen_salt.c -lgcrypt
 
 test:
 	@echo "Running Tomb-kdb tests"
@@ -15,8 +15,7 @@
 	rm -f tomb-kdb-pbkdf2 tomb-kdb-pbkdf2-getiter tomb-kdb-pbkdf2-gensalt tomb-kdb-hexencode
 
 install:
-	install -Dm755 tomb-kdb-pbkdf2 ${DESTDIR}${PREFIX}/bin/tomb-kdb-pbkdf2
-	install -Dm755 tomb-kdb-pbkdf2-getiter ${DESTDIR}${PREFIX}/bin/tomb-kdb-pbkdf2-getiter
-	install -Dm755 tomb-kdb-pbkdf2-gensalt ${DESTDIR}${PREFIX}/bin/tomb-kdb-pbkdf2-gensalt
-	install -Dm755 tomb-kdb-hexencode ${DESTDIR}${PREFIX}/bin/tomb-kdb-hexencode
-	@echo "Tomb-kdb auxiliary binaries installed in ${DESTDIR}${PREFIX}/bin"
+	install -Dm755 tomb-kdb-pbkdf2 ${DESTDIR}${PREFIX}${BINDIR}/tomb-kdb-pbkdf2
+	install -Dm755 tomb-kdb-pbkdf2-getiter ${DESTDIR}${PREFIX}${BINDIR}/tomb-kdb-pbkdf2-getiter
+	install -Dm755 tomb-kdb-pbkdf2-gensalt ${DESTDIR}${PREFIX}${BINDIR}/tomb-kdb-pbkdf2-gensalt
+	@echo "Tomb-kdb auxiliary binaries installed in ${DESTDIR}${PREFIX}${BINDIR}"
--- a/tomb
+++ b/tomb
@@ -101,6 +101,8 @@
 
 # Make sure sbin is in PATH (man zshparam)
 path+=( /sbin /usr/sbin )
+# Make sure location of kdb-pbkdf2 binaries is in PATH
+path+=( /usr/libexec/tomb )
 
 # For gettext
 export TEXTDOMAIN=tomb
