Skip to content

Commit

Permalink
Compress the manpage
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Neyman <stilor@att.net>
  • Loading branch information
stilor committed Apr 7, 2018
1 parent b670aaf commit 20e8402
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile.am
Expand Up @@ -19,6 +19,9 @@ man1_MANS = docs/ct-ng.1
# paths.sh generated by configure
nobase_dist_pkgdata_DATA = $(verbatim_data) paths.sh

# ct-ng, as renamed by the installation
ctng_progname = `echo ct-ng | sed '$(transform)'`

USER_MANUAL_FILES = \
docs/manual/1_Introduction.md \
docs/manual/2_Installation.md \
Expand All @@ -44,7 +47,7 @@ do_subst = ( @SED@ \
-e 's,[@]docdir[@],$(docdir),g' \
-e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
-e 's,[@]pkglibexecdir[@],$(pkglibexecdir),g' \
-e 's,[@]progname[@],'`echo ct-ng | sed '$(transform)'`',g' \
-e 's,[@]progname[@],'$(ctng_progname)',g' \
| $(SHELL) config.status --file=- )

ct-ng: ct-ng.in Makefile
Expand All @@ -56,5 +59,12 @@ docs/ct-ng.1: docs/ct-ng.1.in Makefile
bash-completion/ct-ng: bash-completion/ct-ng.in Makefile
$(AM_V_GEN)$(MKDIR_P) bash-completion && $(do_subst) < $< >$@-t && mv -f $@-t $@

# automake doesn't offer an option to compress manpages, do it after installation
install-data-hook:
gzip -9 $(DESTDIR)$(man1dir)/$(ctng_progname).1

uninstall-hook:
rm -f $(DESTDIR)$(man1dir)/$(ctng_progname).1.gz

dist-hook: maintainer/download-docs.sh
$< $(top_distdir) $(USER_MANUAL_FILES)

0 comments on commit 20e8402

Please sign in to comment.