Skip to content

Commit 77374e8

Browse files
committed
Makefile: FHS conformant manpage installation pathes
FHS mandates manpages should go to /usr/share/man (or /usr/local/share/man, for site local installations) -- /usr/man was an fallout of some ancient Unices that haven't been fully FHS conformant and usually just a symlink to /usr/share/man, if existing at all. Distros sometimes need to override this (eg. MVCC installs), therefore go the 30+ years common practise way and introduce MANDIR environment variable. Since it's a subdir under the prefix for general constant and machine architecture independ data -- which in turn also sometimes wants to be overridden by distros, it shall be derived from DATADIR variable. Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
1 parent 2076dc6 commit 77374e8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ ROOTDIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
2424
# The files will be installed under `$(DESTDIR)/$(PREFIX)`.
2525
# The convention of `DESTDIR` was changed in containerd v1.6.
2626
PREFIX ?= /usr/local
27+
DATADIR ?= $(PREFIX)/share
28+
MANDIR ?= $(DATADIR)/man
2729

2830
TEST_IMAGE_LIST ?=
2931

@@ -253,8 +255,8 @@ man/%: docs/man/%.md FORCE
253255
go-md2man -in "$<" -out "$@"
254256

255257
define installmanpage
256-
$(INSTALL) -d $(DESTDIR)/$(PREFIX)/man/man$(2);
257-
gzip -c $(1) >$(DESTDIR)/$(PREFIX)/man/man$(2)/$(3).gz;
258+
$(INSTALL) -d $(DESTDIR)/$(MANDIR)/man$(2);
259+
gzip -c $(1) >$(DESTDIR)/$(MANDIR)/man$(2)/$(3).gz;
258260
endef
259261

260262
install-man: man

0 commit comments

Comments
 (0)