From 9966be79c3f24876d5f628730fc0e0e2330eb2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= Date: Mon, 1 Jun 2020 01:07:13 +0100 Subject: Add support for zstd-compressed manual pages * configure.ac: Check for zstd. * include/comp_src.h.in (comp_list): Add zstd. * include/manconfig.h.in: Define UNZSTD. * NEWS: Document this. --- NEWS | 3 +++ configure.ac | 6 ++++++ include/comp_src.h.in | 6 ++++++ include/manconfig.h.in | 1 + 4 files changed, 16 insertions(+) diff --git a/NEWS b/NEWS index 0f7c3d3f..9078e68c 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,9 @@ Major changes since man-db 2.9.1: * Add a bug tracker link to man-db's own manual pages. + * Add support for zstd-compressed manual pages, thanks to Bernhard + Rosenkränzer. + man-db 2.9.1 (25 February 2020) =============================== diff --git a/configure.ac b/configure.ac index 3406c5e6..5aefa5c5 100644 --- a/configure.ac +++ b/configure.ac @@ -327,6 +327,11 @@ if test -n "$lzip" then unlzip="$lzip -dc" fi +MAN_CHECK_PROGS([zstd], [ZSTD], [use ZSTD as zstd compression utility], [zstd]) +if test -n "$zstd" +then + unzstd="$zstd -dc" +fi if test -n "$compressor" then AC_DEFINE([COMP_CAT], [1], [Define if you have compressors and want to support compressed cat files.]) @@ -339,6 +344,7 @@ AC_SUBST([bunzip2]) AC_SUBST([unlzma]) AC_SUBST([unxz]) AC_SUBST([unlzip]) +AC_SUBST([unzstd]) MAN_COMPRESS_LIB([z], [gzopen]) dnl To add more decompressors just follow the scheme above. diff --git a/include/comp_src.h.in b/include/comp_src.h.in index d3ef8901..bc5d6016 100644 --- a/include/comp_src.h.in +++ b/include/comp_src.h.in @@ -77,6 +77,12 @@ struct compression comp_list[] = { {UNLZIP, "lz", NULL}, #endif /* HAVE_LZIP */ +/* If we have zstd, incorporate the following */ +#ifdef HAVE_ZSTD + {UNZSTD, "zst", NULL}, + {UNZSTD, "zstd", NULL}, +#endif /* HAVE_ZSTD */ + /*------------------------------------------------------*/ /* Add your decompressor(s) and extension(s) below here */ /*------------------------------------------------------*/ diff --git a/include/manconfig.h.in b/include/manconfig.h.in index 859970f3..6992d979 100644 --- a/include/manconfig.h.in +++ b/include/manconfig.h.in @@ -225,6 +225,7 @@ #define UNLZMA "@unlzma@" #define UNXZ "@unxz@" #define UNLZIP "@unlzip@" +#define UNZSTD "@unzstd@" /*-----------------------------------------------------------------------*/ /* The things below here shouldn't really be changed unless you really */ -- cgit v1.2.3