Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 kbtin (1.0.17-1) unstable; urgency=medium
 .
   * New upstream release.
   * Split out ansi2html, ansi2txt, ttyrec2ansi, (new) pipetty to a new
     package "colorized-logs".
Author: Adam Borowski <kilobyte@angband.pl>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2016-08-29

--- kbtin-1.0.17.orig/pipetty.1
+++ kbtin-1.0.17/pipetty.1
@@ -20,8 +20,7 @@ can't cope with ANSI codes.  Use
 when you do want colors, like when you're going to feed that output to
 .B ansi2html
 or
-.B less -R
-.R .
+.BR "less -R" .
 .SH CAVEATS
 Certain programs, such as
 .BR bash ,
--- kbtin-1.0.17.orig/ac_arg_lib.m4
+++ kbtin-1.0.17/ac_arg_lib.m4
@@ -5,24 +5,26 @@ AC_ARG_ENABLE([$1], [])
 if [[ "X$enable_$1" != "Xno" ]]
   then
     # Missing pkg-config is ok.
+    $3_CFLAGS="$(pkg-config 2>/dev/null --cflags $2)"
+    $3_LIBS="$(pkg-config 2>/dev/null --libs $2)"
     ac_save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS $(pkg-config 2>/dev/null --cflags $2)"
     ac_save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $(pkg-config 2>/dev/null --libs $2)"
+    CFLAGS="$CFLAGS ${$3_CFLAGS}"
+    LDFLAGS="$LDFLAGS ${$3_CFLAGS:--l$5}"
     ac_$2_is_there=yes
     AC_CHECK_HEADER([$4], , [ac_$2_is_there=no])
     AC_CHECK_LIB([$5], [$6], [:], [ac_$2_is_there=no])
     if [[ "x$ac_$2_is_there" = "xyes" ]]
       then
         AC_DEFINE([HAVE_$3], [1], [Define if $2 is available.])
-        $3_LIBS=-l$5
       else
         AC_MSG_ERROR([
 $2 doesn't appear to be available.
 $7])
-	CFLAGS="$ac_save_CFLAGS"
-	LDFLAGS="$ac_save_LDFLAGS"
+	unset $3_CFLAGS $3_LIBS
     fi
+    CFLAGS="$ac_save_CFLAGS"
+    LDFLAGS="$ac_save_LDFLAGS"
 fi
 AC_SUBST([$3_LIBS])
 ])
--- kbtin-1.0.17.orig/configure
+++ kbtin-1.0.17/configure
@@ -5801,10 +5801,12 @@ fi
 if [ "X$enable_mccp" != "Xno" ]
   then
     # Missing pkg-config is ok.
+    ZLIB_CFLAGS="$(pkg-config 2>/dev/null --cflags zlib)"
+    ZLIB_LIBS="$(pkg-config 2>/dev/null --libs zlib)"
     ac_save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS $(pkg-config 2>/dev/null --cflags zlib)"
     ac_save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $(pkg-config 2>/dev/null --libs zlib)"
+    CFLAGS="$CFLAGS ${ZLIB_CFLAGS}"
+    LDFLAGS="$LDFLAGS ${ZLIB_CFLAGS:--lz}"
     ac_zlib_is_there=yes
     ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
 if test "x$ac_cv_header_zlib_h" = xyes; then :
@@ -5861,7 +5863,6 @@ fi
 
 $as_echo "#define HAVE_ZLIB 1" >>confdefs.h
 
-        ZLIB_LIBS=-lz
       else
         as_fn_error $? "
 zlib doesn't appear to be available.
@@ -5872,9 +5873,10 @@ issue.  That's kind of a bad idea, thoug
 bandwidth-related lag.
 Debian/Ubuntu: apt-get install zlib1g-dev
 " "$LINENO" 5
-	CFLAGS="$ac_save_CFLAGS"
-	LDFLAGS="$ac_save_LDFLAGS"
+	unset ZLIB_CFLAGS ZLIB_LIBS
     fi
+    CFLAGS="$ac_save_CFLAGS"
+    LDFLAGS="$ac_save_LDFLAGS"
 fi
 
 
@@ -5887,10 +5889,12 @@ fi
 if [ "X$enable_ssl" != "Xno" ]
   then
     # Missing pkg-config is ok.
+    GNUTLS_CFLAGS="$(pkg-config 2>/dev/null --cflags gnutls)"
+    GNUTLS_LIBS="$(pkg-config 2>/dev/null --libs gnutls)"
     ac_save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS $(pkg-config 2>/dev/null --cflags gnutls)"
     ac_save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $(pkg-config 2>/dev/null --libs gnutls)"
+    CFLAGS="$CFLAGS ${GNUTLS_CFLAGS}"
+    LDFLAGS="$LDFLAGS ${GNUTLS_CFLAGS:--lgnutls}"
     ac_gnutls_is_there=yes
     ac_fn_c_check_header_mongrel "$LINENO" "gnutls/gnutls.h" "ac_cv_header_gnutls_gnutls_h" "$ac_includes_default"
 if test "x$ac_cv_header_gnutls_gnutls_h" = xyes; then :
@@ -5947,7 +5951,6 @@ fi
 
 $as_echo "#define HAVE_GNUTLS 1" >>confdefs.h
 
-        GNUTLS_LIBS=-lgnutls
       else
         as_fn_error $? "
 gnutls doesn't appear to be available.
@@ -5958,9 +5961,10 @@ without support for encryption.
 Debian/Ubuntu: apt-get install libgnutls-dev
 BSD: cd /usr/ports/security/gnutls && make install
 " "$LINENO" 5
-	CFLAGS="$ac_save_CFLAGS"
-	LDFLAGS="$ac_save_LDFLAGS"
+	unset GNUTLS_CFLAGS GNUTLS_LIBS
     fi
+    CFLAGS="$ac_save_CFLAGS"
+    LDFLAGS="$ac_save_LDFLAGS"
 fi
 
 
