Skip to content

Commit c7ae870

Browse files
author
Sam Kleinman
committed
build: adding support for compressed man pages in the make file
1 parent 1dafbf4 commit c7ae870

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

makefile

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ else
2020
BUILDDIR = $(root-build)
2121
endif
2222

23+
# Helpers to compress the man pages
24+
UNCOMPRESSED_MAN := $(shell find $(BUILDDIR)/man/ -name "*.1")
25+
COMPRESSED_MAN := $(subst .1,.1.gz,$(UNCOMPRESSED_MAN))
26+
2327
# Internal variables.
2428
PAPEROPT_a4 = -D latex_paper_size=a4
2529
PAPEROPT_letter = -D latex_paper_size=letter
@@ -75,19 +79,27 @@ deploy:
7579
sed -i -r 's@(<dt><a href=").*html#@\1./#@' $(publication-output)/$(current-branch)/single/genindex.html
7680
@echo "Running the publication routine..."
7781
git rev-parse --verify HEAD >|$(publication-output)/$(current-branch)/release.txt
78-
# $(publication-script)
79-
@echo "Publication succeessfully deployed."
82+
@echo "Publication succeessfully deployed to '$(publication-output)'."
8083
endif
8184

8285

8386
disabled-builds:
8487
@echo make MODE='publish' epub
8588
@echo make MODE='publish' latexpdf
86-
@echo cp -R $(BUILDDIR)/epub/MongoDB.epub $(publication-output)/$(current-branch)/MongoDB-manual-$(current-branch).epub
87-
@echo cp -R $(BUILDDIR)/latex/MongoDB.pdf $(publication-output)/$(current-branch)/MongoDB-manual-$(current-branch).pdf
89+
@echo cp -R $(BUILDDIR)/epub/MongoDB.epub $(publication-output)/$(current-branch)/MongoDB-Manual-$(current-branch).epub
90+
@echo cp -R $(BUILDDIR)/latex/MongoDB.pdf $(publication-output)/$(current-branch)/MongoDB-Manual-$(current-branch).pdf
8891
@echo
8992
@echo This target did nothing, eventually these procedures will generate epub and latex builds.
9093

94+
#
95+
# Helpers to build compressed man pages.
96+
#
97+
98+
build-man: man $(COMPRESSED_MAN)
99+
100+
$(BUILDDIR)/man/%.1.gz:$(BUILDDIR)/man/%.1
101+
gzip $< -c > $@
102+
91103
#
92104
# Clean up/removal targets
93105
#
@@ -125,10 +137,11 @@ epub:
125137
@echo
126138
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
127139

128-
man:
140+
build-man:
129141
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
130142
@echo
131143
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
144+
@echo
132145

133146
changes:
134147
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes

0 commit comments

Comments
 (0)