Add basic manpages for ctr, containerd, containerd-config
Adds initial manpages for ctr, containerd, and containerd config commands, as well as the config.toml configuration file. Adds targets to Makefile for generating and installing manpages. Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
This commit is contained in:
15
Makefile
15
Makefile
@@ -57,7 +57,7 @@ TEST_REQUIRES_ROOT_PACKAGES=$(filter \
|
||||
|
||||
# Project binaries.
|
||||
COMMANDS=ctr containerd containerd-stress containerd-release
|
||||
MANPAGES=ctr.1 containerd.1 config.toml.5 containerd-config.1 containerd-publish.1
|
||||
MANPAGES=ctr.1 containerd.1 config.toml.5 containerd-config.1
|
||||
|
||||
GO_TAGS=$(if $(BUILDTAGS),-tags "$(BUILDTAGS)",)
|
||||
GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PKG) $(EXTRA_LDFLAGS)'
|
||||
@@ -83,7 +83,7 @@ BINARIES=$(addprefix bin/,$(COMMANDS))
|
||||
TESTFLAGS ?= -v $(TESTFLAGS_RACE)
|
||||
TESTFLAGS_PARALLEL ?= 8
|
||||
|
||||
.PHONY: clean all AUTHORS build binaries test integration generate protos checkprotos coverage ci check help install uninstall vendor release
|
||||
.PHONY: clean all AUTHORS build binaries test integration generate protos checkprotos coverage ci check help install uninstall vendor release mandir install-man
|
||||
.DEFAULT: default
|
||||
|
||||
all: binaries
|
||||
@@ -158,7 +158,7 @@ bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a sta
|
||||
binaries: $(BINARIES) ## build binaries
|
||||
@echo "$(WHALE) $@"
|
||||
|
||||
manpages: mandir $(addprefix man/,$(MANPAGES))
|
||||
man: mandir $(addprefix man/,$(MANPAGES))
|
||||
@echo "$(WHALE) $@"
|
||||
|
||||
mandir:
|
||||
@@ -168,6 +168,15 @@ man/%: docs/man/%.md FORCE
|
||||
@echo "$(WHALE) $<"
|
||||
go-md2man -in "$<" -out "$@"
|
||||
|
||||
define installmanpage
|
||||
mkdir -p $(DESTDIR)/man/man$(2);
|
||||
gzip -c $(1) >$(DESTDIR)/man/man$(2)/$(3).gz;
|
||||
endef
|
||||
|
||||
install-man:
|
||||
@echo "$(WHALE) $@"
|
||||
$(foreach manpage,$(addprefix man/,$(MANPAGES)), $(call installmanpage,$(manpage),$(subst .,,$(suffix $(manpage))),$(notdir $(manpage))))
|
||||
|
||||
release: $(BINARIES)
|
||||
@echo "$(WHALE) $@"
|
||||
@rm -rf releases/$(RELEASE) releases/$(RELEASE).tar.gz
|
||||
|
||||
Reference in New Issue
Block a user