--- man-db-2.5.7.orig/configure.ac
+++ man-db-2.5.7/configure.ac
@@ -321,6 +321,11 @@ if test -n "$bzip2"
 then
 	bunzip2="$bzip2 -dc"
 fi
+MAN_CHECK_PROGS([xz], [XZ], [use XZ as Lempel-Ziv-Markov chain-Algorithm compression utility], [xz])
+if test -n "$xz"
+then
+	unxz="$xz -dc"
+fi
 MAN_CHECK_PROGS([lzma], [LZMA], [use LZMA as Lempel-Ziv-Markov chain-Algorithm compression utility], [lzma])
 if test -n "$lzma"
 then
@@ -337,6 +342,7 @@ AC_SUBST(gunzip)
 AC_SUBST(uncompress)
 AC_SUBST(bunzip2)
 AC_SUBST(unlzma)
+AC_SUBST(unxz)
 MAN_COMPRESS_LIB([z], [gzopen])
 dnl To add more decompressors just follow the scheme above.
 
--- man-db-2.5.7.orig/config.h.in
+++ man-db-2.5.7/config.h.in
@@ -941,6 +941,9 @@
 /* Define to 1 if you have the <ws2tcpip.h> header file. */
 #undef HAVE_WS2TCPIP_H
 
+/* Define if you have xz. */
+#undef HAVE_XZ
+
 /* Define to 1 if the system has the type `_Bool'. */
 #undef HAVE__BOOL
 
--- man-db-2.5.7.orig/include/comp_src.h.in
+++ man-db-2.5.7/include/comp_src.h.in
@@ -67,6 +67,11 @@ struct compression comp_list[] = {
 	{UNLZMA, "lzma", NULL},
 #endif /* HAVE_LZMA */
 
+/* If we have xz, incorporate the following */
+#ifdef HAVE_XZ
+	{UNXZ, "xz", NULL},
+#endif /* HAVE_XZ */
+
 /*------------------------------------------------------*/
 /* Add your decompressor(s) and extension(s) below here */
 /*------------------------------------------------------*/
--- man-db-2.5.7.orig/include/manconfig.h.in
+++ man-db-2.5.7/include/manconfig.h.in
@@ -220,6 +220,7 @@
 #  define UNCOMPRESS "@uncompress@"
 #  define BUNZIP2 "@bunzip2@"
 #  define UNLZMA "@unlzma@"
+#  define UNXZ "@unxz@"
 #endif /* COMP_SRC */
 
 /*-----------------------------------------------------------------------*/
