--- /dev/null
+From d559339883f61bfb44188c4fe92851a2905e8a8e Mon Sep 17 00:00:00 2001
+From: Matt Domsch <mdomsch@fedoraproject.org>
+Date: Thu, 23 Jan 2014 10:51:07 -0600
+Subject: [PATCH 1/2] remove libreplace, unneeded on Linux
+
+---
+ configure.ac | 3 ---
+ src/Makefile.am | 2 +-
+ src/libspf2/Makefile.am | 4 ----
+ 3 files changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 63e398c..63e5392 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -273,8 +273,6 @@ AC_CHECK_FUNCS([strchr strcspn strdup strerror])
+ AC_CHECK_FUNCS([strcasecmp strncasecmp strspn strtoul])
+ AC_CHECK_FUNCS([gethostbyname inet_ntoa select strrchr strstr strtol])
+
+-AC_REPLACE_FUNCS([getopt_long_only strncasecmp])
+-AC_REPLACE_FUNCS([__ns_initparse __ns_name_uncompress __ns_msg_getflag])
+ dnl Magnus Holmgren says this avoids linking a private function
+ AC_LIBOBJ([__ns_get16])
+
+@@ -282,7 +280,6 @@ AC_CONFIG_FILES([Makefile
+ Doxyfile
+ src/Makefile
+ src/include/Makefile
+- src/libreplace/Makefile
+ src/libspf2/Makefile
+ src/spfquery/Makefile
+ src/spftest/Makefile
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 307bf10..02f09b4 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -4,5 +4,5 @@ AUTOMAKE_OPTIONS = foreign
+ # Attempt to disable parallel processing.
+ .NOTPARALLEL:
+ .NO_PARALLEL:
+-SUBDIRS = include libreplace libspf2 spfquery spftest spfd spf_example
++SUBDIRS = include libspf2 spfquery spftest spfd spf_example
+ TARGETS =
+diff --git a/src/libspf2/Makefile.am b/src/libspf2/Makefile.am
+index 6b5a147..77ef3b9 100644
+--- a/src/libspf2/Makefile.am
++++ b/src/libspf2/Makefile.am
+@@ -34,10 +34,6 @@ libspf2_la_SOURCES = \
+ spf_utils.c \
+ spf_win32.c
+
+-libspf2_la_LIBADD = $(top_builddir)/src/libreplace/libreplace.la
+-
+-
+-
+ libspf2_la_LDFLAGS = -version-info 3:0:1
+
+ # Copied from the libtool info file:
+--
+1.8.4.2
+
--- /dev/null
+Description: Stop trying to look up the dedicated SPF DNS RR type,
+ which was abolished by RFC 7208. The rr_type variable and the all the
+ "goto retry" commands could be deleted as well, but let's keep the
+ patch minimal.
+
+--- a/src/libspf2/spf_server.c 2012-01-28 09:24:47.000000000 +0100
++++ b/src/libspf2/spf_server.c 2014-06-19 14:09:07.000000000 +0200
+@@ -346,7 +346,7 @@
+ spf_response, spf_recordp);
+
+ /* I am VERY, VERY sorry about the gotos. Shevek. */
+- rr_type = ns_t_spf;
++ rr_type = ns_t_txt;
+ retry:
+ rr_txt = SPF_dns_lookup(resolver, domain, rr_type, TRUE);
+
--- /dev/null
+From c93823faef044150e1b232928d225ff5ff297e6c Mon Sep 17 00:00:00 2001
+From: Simon Arlott <sa.me.uk>
+Date: Sat, 30 Sep 2023 12:18:51 +0100
+Subject: [PATCH] Fix integer underflow
+
+---
+ src/libspf2/spf_compile.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/libspf2/spf_compile.c b/src/libspf2/spf_compile.c
+index b08ffe2..d401028 100644
+--- a/src/libspf2/spf_compile.c
++++ b/src/libspf2/spf_compile.c
+@@ -455,7 +455,11 @@ SPF_c_parse_var(SPF_response_t *spf_response, SPF_data_var_t *data,
+ /* Magic numbers for x/Nc in gdb. */ \
+ data->ds.__unused0 = 0xba; data->ds.__unused1 = 0xbe; \
+ dst = SPF_data_str( data ); \
+- ds_avail = _avail - sizeof(SPF_data_t); \
++ if ((_avail) < sizeof(SPF_data_t)) \
++ return SPF_response_add_error_ptr(spf_response, \
++ SPF_E_BIG_STRING, NULL, src, \
++ "Out of memory for string literal");\
++ ds_avail = (_avail) - sizeof(SPF_data_t); \
+ ds_len = 0; \
+ } while(0)
+
Summary: Implementation of the SPF specification
Summary(pl.UTF-8): Implementacja specyfikacji SPF
Name: libspf2
-Version: 1.2.10
-Release: 2
+Version: 1.2.11
+Release: 3
License: LGPL
Group: Libraries
-Source0: http://www.libspf2.org/spf/%{name}-%{version}.tar.gz
-# Source0-md5: 7bb9937d0705649eaa8646de66dc3562
+# Source0: http://www.libspf2.org/spf/%{name}-%{version}.tar.gz
+Source0: https://github.com/shevek/libspf2/tarball/4915c30#/%{name}.tar.gz
+# Source0-md5: ad5f1b48e4f2b5561df99ca7cbf30e92
Patch0: %{name}-link.patch
+Patch1: 0001-remove-libreplace-unneeded-on-Linux.patch
+# https://github.com/shevek/libspf2/pull/44
+Patch2: integer-underflow.patch
+Patch3: spf_dns-include-std-headers.patch
+Patch4: abolish-spf-rrtype.patch
URL: http://www.libspf2.org/
BuildRequires: autoconf >= 2.59
BuildRequires: automake
Statyczna biblioteka libspf2.
%prep
-%setup -q
+#%%setup -q
+%setup -q -n shevek-libspf2-4915c30
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%build
%{__libtoolize}
--- /dev/null
+Author: Magnus Holmgren <holmgren@debian.org>
+Description: Include arpa/nameser.h and netdb.h from spf_dns.h
+ instead of defining the constants needed unless certain HAVE_ macros are defined.
+ Updated for libspf2 1.2.8/9 by Scott Kitterman <scott@kitterman.com>
+
+--- libspf2-1.2.9~/src/include/spf_dns.h 2008-10-27 12:27:14.000000000 -0400
++++ libspf2-1.2.9/src/include/spf_dns.h 2008-11-04 10:10:58.000000000 -0500
+@@ -63,48 +63,19 @@
+ *
+ */
+
++/* The following two header files might not exist on all platforms,
++ * but at least they exist on Debian with libc6.
++ */
++#include <arpa/nameser.h>
++#include <netdb.h>
+
+ /*
+- * For those who don't have <arpa/nameserv.h>
++ * Type 99 decl does not exist in Debian libc6 (not even 2.7)
+ */
+-
+-/* XXX This should use a more sensible define. */
+-#if !defined( HAVE_NS_TYPE )
+-
+-#define ns_t_invalid 0
+-#define ns_t_a 1
+-#define ns_t_ns 2
+-#define ns_t_cname 5
+-#define ns_t_ptr 12
+-#define ns_t_mx 15
+-#define ns_t_txt 16
+-#define ns_t_aaaa 28
+-/* #define ns_t_a6 38 */
+-#define ns_t_any 255 /**< Wildcard match. */
+-
+-typedef int ns_type;
+-#endif
+-
+ #if ! HAVE_DECL_NS_T_SPF
+ #define ns_t_spf 99
+ #endif
+
+-#if ! HAVE_DECL_NS_T_INVALID
+-#define ns_t_invalid 0
+-#endif
+-
+-
+-/*
+- * For those who don't have <netdb.h>
+- */
+-
+-#if !defined(HAVE_NETDB_H) && !defined(_WIN32)
+-#define NETDB_SUCCESS 0
+-#define HOST_NOT_FOUND 1 /**< NXDOMAIN (authoritative answer)*/
+-#define TRY_AGAIN 2 /**< SERVFAIL (no authoritative answer)*/
+-#define NO_RECOVERY 3 /**< invalid/unimplmeneted query */
+-#define NO_DATA 4 /**< host found, but no RR of req type*/
+-#endif
+ typedef int SPF_dns_stat_t;
+
+ typedef struct SPF_dns_server_struct SPF_dns_server_t;