From 20e8402779db3d47856b45b31e5f3d76c8554a55 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 4 Apr 2018 23:37:54 -0700 Subject: Compress the manpage Signed-off-by: Alexey Neyman diff --git a/Makefile.am b/Makefile.am index 88ac882..cfe5210 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ @@ -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 @@ -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) -- cgit v0.10.2-6-g49f6