From 346de71cd5320e8e3c7c1a852c2c061cb8c3ced7 Mon Sep 17 00:00:00 2001
From: brutzzl3r <s3b.gr0ss@gmail.com>
Date: Thu, 11 Aug 2022 20:03:52 +0200
Subject: [PATCH 1/2] man-page: Fix logfile short option

man synopsis states [-n -logfile] option. Later on in avrdude.1 as well as in
main.c -l is used.
Also '-logfile' is no option alternative but a parameter.
This is a minor issue but still confusing when one uses / to search
through man pages.

-- Always leave the code cleaner than you found it --

Signed-off-by: brutzzl3r <s3b.gr0ss@gmail.com>
---
 src/avrdude.1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/avrdude.1 b/src/avrdude.1
index 05d656fa..1920b583 100644
--- a/src/avrdude.1
+++ b/src/avrdude.1
@@ -39,7 +39,7 @@
 .Oc
 .Op Fl F
 .Op Fl i Ar delay
-.Op Fl n logfile
+.Op Fl l Ar logfile
 .Op Fl n
 .Op Fl O
 .Op Fl P Ar port

From 266eb23207faa66e5ab6f2a6717716e93e52ab59 Mon Sep 17 00:00:00 2001
From: brutzzl3r <s3b.gr0ss@gmail.com>
Date: Fri, 12 Aug 2022 19:26:50 +0200
Subject: [PATCH 2/2] man-page: Fix install dir

`avrdude.1` is installed into `man` dir instead of its proper section
location.
This is due to the definition of `TYPE MAN` which points to
`<DATAROOT>/man` according to cmake docs.

Use `DESTINATION` and add proper section subdir.

This allows for `man -M <YOUR INSTALL dir>/share/man -w 1 avrdude` to succeed
instead of throwing `No manual entry for avrdude in section 1`

Signed-off-by: brutzzl3r <s3b.gr0ss@gmail.com>
---
 src/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f3eedcd8..804468c1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -273,4 +273,6 @@ install(TARGETS libavrdude
     PUBLIC_HEADER DESTINATION include COMPONENT dev
     )
 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/avrdude.conf" TYPE SYSCONF)
-install(FILES avrdude.1 TYPE MAN)
+install(FILES "avrdude.1"
+	DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
+	)