feat: Update man build
This commit is contained in:
		
							
								
								
									
										28
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								Makefile
									
									
									
									
									
								
							@@ -6,21 +6,25 @@ docs_build_dir := ./build/docs
 | 
			
		||||
 | 
			
		||||
.PHONY: help tests docs
 | 
			
		||||
 | 
			
		||||
all: man
 | 
			
		||||
 | 
			
		||||
help:
 | 
			
		||||
	@echo Usage: make TARGET
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo Available targets:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo 'help	print this help message'
 | 
			
		||||
	@echo 'tests	run tests from $(tests_dir)'
 | 
			
		||||
	@echo 'test	run tests from $(tests_dir)'
 | 
			
		||||
	@echo 'lint	run shellcheck'
 | 
			
		||||
	@echo 'docs	build documentation from $(docs_dir)'
 | 
			
		||||
	@echo 'man	build manual pages from $(docs_dir)'
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo See README.md for more info.
 | 
			
		||||
 | 
			
		||||
tests:
 | 
			
		||||
test:
 | 
			
		||||
	# See bats(1), https://bats-core.readthedocs.io/en/latest/index.html
 | 
			
		||||
	for test in $(tests_dir)/*.bats; do bats --verbose-run --print-output-on-failure "$$test"; done
 | 
			
		||||
	for test in $(tests_dir)/*.bats; do \
 | 
			
		||||
		bats --verbose-run --print-output-on-failure "$$test"; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
lint:
 | 
			
		||||
	shellcheck $(src_dir)/boring-backup
 | 
			
		||||
@@ -28,11 +32,17 @@ lint:
 | 
			
		||||
	shellcheck $(src_dir)/lib/handlers/sources/*.sh
 | 
			
		||||
	shellcheck $(src_dir)/lib/handlers/targets/*.sh
 | 
			
		||||
 | 
			
		||||
docs: builddir
 | 
			
		||||
	# See rst2man(1), rst2html(1), https://docutils.sourceforge.io/docs/index.html
 | 
			
		||||
	rst2man $(docs_dir)/boring-backup.1.rst | gzip -9 > $(docs_build_dir)/boring-backup.1.gz
 | 
			
		||||
	rst2html $(docs_dir)/boring-backup.1.rst > $(docs_build_dir)/boring-backup.1.html
 | 
			
		||||
man: build_dir
 | 
			
		||||
	# See rst2man(1), rst2html(1),
 | 
			
		||||
	# https://docutils.sourceforge.io/docs/index.html
 | 
			
		||||
	rst2man $(docs_dir)/boring-backup.ru.1.rst \
 | 
			
		||||
		> $(docs_build_dir)/boring-backup.ru.1
 | 
			
		||||
	sed -e 's/.SH NAME/.SH ИМЯ/' \
 | 
			
		||||
		-e 's/.SH AUTHOR/.SH АВТОРЫ/' \
 | 
			
		||||
		-e 's/.SH COPYRIGHT/.SH АВТОРСКИЕ ПРАВА/' \
 | 
			
		||||
		-i $(docs_build_dir)/boring-backup.ru.1
 | 
			
		||||
	gzip -9 $(docs_build_dir)/boring-backup.ru.1
 | 
			
		||||
 | 
			
		||||
builddir:
 | 
			
		||||
build_dir:
 | 
			
		||||
	mkdir -p $(build_dir)
 | 
			
		||||
	mkdir -p $(docs_build_dir)
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ Add some Bats extensions:
 | 
			
		||||
 | 
			
		||||
Run tests:
 | 
			
		||||
 | 
			
		||||
    make tests
 | 
			
		||||
    make test
 | 
			
		||||
 | 
			
		||||
# Linting
 | 
			
		||||
 | 
			
		||||
@@ -28,6 +28,6 @@ Run shellcheck:
 | 
			
		||||
 | 
			
		||||
# Building
 | 
			
		||||
 | 
			
		||||
Build docs (manpage and HTML):
 | 
			
		||||
Build manpages:
 | 
			
		||||
 | 
			
		||||
    make docs
 | 
			
		||||
    make man
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user