--- /dev/null
+From 69d5e2d1451d7f2114d4e46dc60eb731eb721c83 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
+Date: Thu, 8 Dec 2016 21:05:10 +0100
+Subject: [PATCH 1/2] build: take into account CFLAGS/LDFLAGS for tests
+
+Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 58ba9b3..67da0fe 100644
+--- a/Makefile
++++ b/Makefile
+@@ -83,7 +83,7 @@ demo-glib: $(LIBRARY) demo-glib.lo
+ $(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $^ $(call pkgconfig, glib-2.0 --libs)
+
+ t/%.t: t/%.c $(LIBRARY) t/taplib.lo
+- $(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $^
++ $(LIBTOOL) --mode=link --tag=CC $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ t/taplib.lo: t/taplib.c
+ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -o $@ -c $^
+--
+2.11.0
+
--- /dev/null
+From 0f9ae3282a20e5877c5e8884d749559dc9d204f2 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
+Date: Thu, 8 Dec 2016 21:09:03 +0100
+Subject: [PATCH 2/2] include <stdlib.h> for putenv()
+
+Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
+---
+ t/05read.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/t/05read.c b/t/05read.c
+index 073c43d..c9bbe93 100644
+--- a/t/05read.c
++++ b/t/05read.c
+@@ -1,5 +1,6 @@
+ #include <stdio.h>
+ #include <errno.h>
++#include <stdlib.h>
+ #include <unistd.h>
+ #include "../termkey.h"
+ #include "taplib.h"
+--
+2.11.0
+
Summary: Library for easy processing of keyboard entry from terminal-based programs
Name: libtermkey
-Version: 0.18
-Release: 2
+Version: 0.20
+Release: 1
License: MIT
Group: Libraries
Source0: http://www.leonerd.org.uk/code/libtermkey/%{name}-%{version}.tar.gz
-# Source0-md5: 3be2e3e5a851a49cc5e8567ac108b520
-Patch0: fix-test-compile.patch
+# Source0-md5: 710ee4e48d8550e65f3adf627aac8465
+Patch0: 0001-build-take-into-account-CFLAGS-LDFLAGS-for-tests.patch
+Patch1: 0002-include-stdlib.h-for-putenv.patch
URL: http://www.leonerd.org.uk/code/libtermkey/
BuildRequires: gcc
BuildRequires: libtool
%prep
%setup -q
+# No need for demos
+%{__sed} -i -e '/^all:/s/$(DEMOS)//' Makefile
+
%build
%{__make} \
CC="%{__cc}" \
CFLAGS="%{rpmcflags}" \
PREFIX=%{_prefix} \
- LIBDIR=%{_libdir}
+ LIBDIR=%{_libdir} \
+ VERBOSE=1
%if %{with tests}
%{__make} test \
CC="%{__cc}" \
- CFLAGS="%{rpmcflags}"
+ CFLAGS="%{rpmcflags}" \
+ VERBOSE=1
%endif
%install