diff --git a/neon-0.30.2-lockprintf.patch b/neon-0.30.2-lockprintf.patch
new file mode 100644
index 0000000..389fc24
--- /dev/null
+++ b/neon-0.30.2-lockprintf.patch
@@ -0,0 +1,22 @@
+
+Supress gcc warnings.
+
+--- neon-0.30.2/test/lock.c.lockprintf
++++ neon-0.30.2/test/lock.c
+@@ -73,11 +73,11 @@
+ const char *token_href)
+ {
+ static char buf[BUFSIZ];
+- sprintf(buf,
+- "\n"
+- ""
+- "%s\n",
+- activelock(scope, depth, owner, timeout, token_href));
++ ne_snprintf(buf, sizeof buf,
++ "\n"
++ ""
++ "%s\n",
++ activelock(scope, depth, owner, timeout, token_href));
+ return buf;
+ }
+
diff --git a/neon.spec b/neon.spec
index 7460dd3..fe9a8e5 100644
--- a/neon.spec
+++ b/neon.spec
@@ -3,13 +3,14 @@
Summary: An HTTP and WebDAV client library
Name: neon
Version: 0.30.2
-Release: 6%{?dist}
+Release: 7%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.webdav.org/neon/
Source0: http://www.webdav.org/neon/neon-%{version}.tar.gz
Patch0: neon-0.27.0-multilib.patch
Patch1: neon-0.30.2-sysuioh.patch
+Patch2: neon-0.30.2-lockprintf.patch
BuildRequires: expat-devel, openssl-devel, zlib-devel, krb5-devel, libproxy-devel
BuildRequires: pkgconfig, pakchois-devel
Requires: ca-certificates
@@ -40,6 +41,7 @@ The development library for the C language HTTP and WebDAV client library.
%setup -q
%patch0 -p1 -b .multilib
%patch1 -p1 -b .sysuioh
+%patch2 -p1 -b .lockprintf
# prevent installation of HTML docs
sed -ibak '/^install-docs/s/install-html//' Makefile.in
@@ -63,6 +65,7 @@ sed -ri "/^dependency_libs/{s,-l[^ ']*,,g}" \
%if %{with tests}
%check
+export TEST_QUIET=0
make %{?_smp_mflags} check
%endif
@@ -84,6 +87,9 @@ make %{?_smp_mflags} check
%{_libdir}/*.so
%changelog
+* Thu Jun 28 2018 Joe Orton - 0.30.2-7
+- fix gcc warnings in test suite build
+
* Thu Jun 28 2018 Joe Orton - 0.30.2-6
- fix implicit writev declaration (Mattias Ellert, #1572180)
- add build conditional for tests