From 57b87f2c6744d4f3bf67ea67909cf680925b0ea9 Mon Sep 17 00:00:00 2001 From: Veraellyunjie <75799052+Veraellyunjie@users.noreply.github.com> Date: Sun, 3 Mar 2024 22:53:07 +0200 Subject: [PATCH 1/3] adjust MANDIR for OpenBSD remove `share` from `MANDIR` - on OpenBSD the man should end up at `/usr/local/man/man1/rdrview.1` --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1e4570f..b523511 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,11 @@ endif PREFIX = /usr/local BINDIR = $(DESTDIR)$(PREFIX)/bin -MANDIR = $(DESTDIR)$(PREFIX)/share/man/man1 +ifeq ($(SYSTEM), OpenBSD) + MANDIR = $(DESTDIR)$(PREFIX)/man/man1 +else + MANDIR = $(DESTDIR)$(PREFIX)/share/man/man1 +endif SRCS = $(wildcard src/*.c) OBJS = $(SRCS:.c=.o) From 21a078e2d644ff240768f12bb56bef2f19d04fb8 Mon Sep 17 00:00:00 2001 From: Veraellyunjie <75799052+Veraellyunjie@users.noreply.github.com> Date: Sun, 3 Mar 2024 23:02:00 +0200 Subject: [PATCH 2/3] add makewhatis for OpenBSD `makewhatis` is run via cron weekly on OpenBSD, until then invoking `man rdrview` works but produces: `man: outdated mandoc.db lacks rdrview(1) entry, run makewhatis /usr/local/man` Downsides of this commit: * makewhatis takes a lot of time * `uname -s` is run again, `$(SYSTEM)` not used * I am not sure wheter other platforms need makewhatis or not * I am not sure it is good practice to put makewhatis into `install` and `uninstall` --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index b523511..cc4c09f 100644 --- a/Makefile +++ b/Makefile @@ -48,13 +48,22 @@ COMMIT: clean: rm -f $(OBJS) rdrview src/version.h + install: mkdir -p $(BINDIR) cp -f rdrview $(BINDIR) mkdir -p $(MANDIR) cp -f rdrview.1 $(MANDIR) chmod 0644 $(MANDIR)/rdrview.1 + @ case $$(uname -s) in (OpenBSD) \ + printf 'makewhatis %s/man\n' $(PREFIX); \ + makewhatis $(PREFIX)/man; \ + esac uninstall: cd $(BINDIR) && rm rdrview cd $(MANDIR) && rm rdrview.1 + @ case $$(uname -s) in (OpenBSD) \ + printf 'makewhatis %s/man\n' $(PREFIX); \ + makewhatis $(PREFIX)/man; \ + esac From a6a1aca1044614b340f9e1a1d4d225948cf3708f Mon Sep 17 00:00:00 2001 From: Veraellyunjie <75799052+Veraellyunjie@users.noreply.github.com> Date: Sun, 3 Mar 2024 23:05:32 +0200 Subject: [PATCH 3/3] typo spaces -> tab --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index cc4c09f..7326059 100644 --- a/Makefile +++ b/Makefile @@ -23,9 +23,9 @@ endif PREFIX = /usr/local BINDIR = $(DESTDIR)$(PREFIX)/bin ifeq ($(SYSTEM), OpenBSD) - MANDIR = $(DESTDIR)$(PREFIX)/man/man1 + MANDIR = $(DESTDIR)$(PREFIX)/man/man1 else - MANDIR = $(DESTDIR)$(PREFIX)/share/man/man1 + MANDIR = $(DESTDIR)$(PREFIX)/share/man/man1 endif SRCS = $(wildcard src/*.c)