summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-10-06 06:18:00 +0100
committerSam James <sam@gentoo.org>2024-10-06 06:27:15 +0100
commit4719dfd51f5555198c0f987475548742702ee47f (patch)
tree1d6d389b15ffaea27addd86af09e72c79a983647 /dev-db/recutils
parentwww-servers/nginx: Fix src_install (diff)
downloadgentoo-4719dfd51f5555198c0f987475548742702ee47f.tar.gz
gentoo-4719dfd51f5555198c0f987475548742702ee47f.tar.bz2
gentoo-4719dfd51f5555198c0f987475548742702ee47f.zip
dev-db/recutils: new package, add 1.9
Restored from ee12e968b20ac1efdef5f66f392ae62b664978d2. Bug: https://bugs.gentoo.org/600524 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-db/recutils')
-rw-r--r--dev-db/recutils/Manifest1
-rw-r--r--dev-db/recutils/files/1.9/0001-db-fix-rec_db_set-crash-with-empty-databases.patch70
-rw-r--r--dev-db/recutils/files/1.9/0002-C99-compatibility-fix.patch76
-rw-r--r--dev-db/recutils/files/1.9/0003-Fix-bison-and-flex-build-rules.patch198
-rw-r--r--dev-db/recutils/files/1.9/0004-rec-crypt.c-do-not-assume-the-output-buffer-is-NULL-.patch110
-rw-r--r--dev-db/recutils/files/1.9/0005-torture-add-missing-includes-for-free.patch88
-rw-r--r--dev-db/recutils/files/1.9/0006-configure.ac-add-options-for-dependencies.patch188
-rw-r--r--dev-db/recutils/files/1.9/0007-configure.ac-modernise.patch100
-rw-r--r--dev-db/recutils/files/1.9/0008-configure.ac-call-PKG_PROG_PKG_CONFIG-unconditionall.patch34
-rw-r--r--dev-db/recutils/files/1.9/0009-Port-to-newer-mdbutils-0.9.0.patch62
-rw-r--r--dev-db/recutils/files/1.9/0010-configure.ac-use-pkg-config-to-find-curl.patch41
-rw-r--r--dev-db/recutils/metadata.xml15
-rw-r--r--dev-db/recutils/recutils-1.9.ebuild65
13 files changed, 1048 insertions, 0 deletions
diff --git a/dev-db/recutils/Manifest b/dev-db/recutils/Manifest
new file mode 100644
index 000000000000..2e0afd0eeada
--- /dev/null
+++ b/dev-db/recutils/Manifest
@@ -0,0 +1 @@
+DIST recutils-1.9.tar.gz 2759999 BLAKE2B 839dbcd36e7fe0ececbf3ef3a1b842890e876c6feda2bc003c921c53eba83b70f38baa5a536962253eec5b06eed29c6e301751d7b6586f0ef0c5ea35d94a44d7 SHA512 775b3b8925a4e5c6f04c6376291b966bdc271f172be2bca06b1f02155ecba12d916c22219f85fe0393f7f9f200f3788ab5fa5d522da2b84b2a0c0ec198318809
diff --git a/dev-db/recutils/files/1.9/0001-db-fix-rec_db_set-crash-with-empty-databases.patch b/dev-db/recutils/files/1.9/0001-db-fix-rec_db_set-crash-with-empty-databases.patch
new file mode 100644
index 000000000000..ba39ee61fdc9
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0001-db-fix-rec_db_set-crash-with-empty-databases.patch
@@ -0,0 +1,70 @@
+From 9f08064fef75ce02df9b6133d240c0fa84df458e Mon Sep 17 00:00:00 2001
+Message-ID: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
+Date: Mon, 25 Apr 2022 09:32:09 +0200
+Subject: [PATCH 01/10] db: fix rec_db_set crash with empty databases
+
+2022-04-25 Jose E. Marchesi <jemarch@gnu.org>
+
+ * src/rec-db.c (rec_db_set): Avoid segfault with databases with no
+ record sets.
+ * torture/utils/recset.sh: New test.
+---
+ ChangeLog | 6 ++++++
+ src/rec-db.c | 2 +-
+ torture/utils/recset.sh | 8 ++++++++
+ 3 files changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index eb79621..5527ba2 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,9 @@
++2022-04-25 Jose E. Marchesi <jemarch@gnu.org>
++
++ * src/rec-db.c (rec_db_set): Avoid segfault with databases with no
++ record sets.
++ * torture/utils/recset.sh: New test.
++
+ 2022-04-16 Jose E. Marchesi <jemarch@gnu.org>
+
+ * configure.ac: Bump version to 1.9.
+diff --git a/src/rec-db.c b/src/rec-db.c
+index 1d91441..e90a734 100644
+--- a/src/rec-db.c
++++ b/src/rec-db.c
+@@ -1431,7 +1431,7 @@ bool rec_db_set (rec_db_t db,
+ rset = rec_db_get_rset (db, 0);
+
+ /* Don't process empty record sets. */
+- if (rec_rset_num_records (rset) == 0)
++ if (!rset || rec_rset_num_records (rset) == 0)
+ return true;
+
+ /* If the user requested to manipulate random records then calculate
+diff --git a/torture/utils/recset.sh b/torture/utils/recset.sh
+index f44ee59..d73d530 100755
+--- a/torture/utils/recset.sh
++++ b/torture/utils/recset.sh
+@@ -98,10 +98,18 @@ field2: value32
+ field3: value33
+ '
+
++test_declare_input_file empty ''
++
+ #
+ # Declare tests.
+ #
+
++test_tool recset-empty ok \
++ recset \
++ '' \
++ empty \
++ ''
++
+ test_tool recset-append-field ok \
+ recset \
+ '-n 0 -f foo -a bar' \
+--
+2.46.2
+
diff --git a/dev-db/recutils/files/1.9/0002-C99-compatibility-fix.patch b/dev-db/recutils/files/1.9/0002-C99-compatibility-fix.patch
new file mode 100644
index 000000000000..e63211b14310
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0002-C99-compatibility-fix.patch
@@ -0,0 +1,76 @@
+From e154822aeec19cb790f8618ee740875c048859e4 Mon Sep 17 00:00:00 2001
+Message-ID: <e154822aeec19cb790f8618ee740875c048859e4.1728191717.git.sam@gentoo.org>
+In-Reply-To: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+References: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+From: Florian Weimer <fweimer@redhat.com>
+Date: Thu, 15 Dec 2022 14:55:10 +0100
+Subject: [PATCH 02/10] C99 compatibility fix
+
+I researched this quite a bit, and this approach seems to be the least
+bad option.
+
+Future compilers are likely to require functions to be declared before
+they can be called. The flex lexer generator can be taught to create a
+header file with the required declarations. However, automake conspires
+against us to use it during the build. So I extracted the relevant
+declarations by hand and put it into a non-generated header file. At
+least the declarations are checked against the definitions in
+rec-sex-lex.c, so maybe it's not too bad after all.
+
+Related to:
+
+ <https://fedoraproject.org/wiki/Changes/PortingToModernC>
+ <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
+---
+ src/rec-sex-lex.l | 2 +-
+ src/rec-sex-parser.c | 2 +-
+ src/rec-sex-tab.y | 2 +-
+ 4 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/rec-sex-lex.l b/src/rec-sex-lex.l
+index 1e537bf..2d4a891 100644
+--- a/src/rec-sex-lex.l
++++ b/src/rec-sex-lex.l
+@@ -26,12 +26,12 @@
+ %option bison-bridge
+ %option extra-type="void *"
+
+-%option header-file="rec-sex-lex.h"
+ %option nounput
+ %option noinput
+ %top {
+ /* This code goes at the "top" of the generated file. */
+ #include <config.h>
++ #include "rec-sex-lex.h"
+ }
+
+ %{
+diff --git a/src/rec-sex-parser.c b/src/rec-sex-parser.c
+index e5bcd33..4eb188a 100644
+--- a/src/rec-sex-parser.c
++++ b/src/rec-sex-parser.c
+@@ -25,7 +25,7 @@
+
+ #include <rec-sex-parser.h>
+ #include "rec-sex-tab.h"
+-/*#include "rec-sex-lex.h" */
++#include "rec-sex-lex.h"
+
+ struct rec_sex_parser_s
+ {
+diff --git a/src/rec-sex-tab.y b/src/rec-sex-tab.y
+index 6c31edd..f011bc4 100644
+--- a/src/rec-sex-tab.y
++++ b/src/rec-sex-tab.y
+@@ -33,7 +33,7 @@
+ #include <rec-sex-ast.h>
+ #include <rec-sex-parser.h>
+ #include "rec-sex-tab.h"
+- /* #include "rec-sex-lex.h" */
++ #include "rec-sex-lex.h"
+
+ void sexerror (rec_sex_parser_t context, const char *err)
+ {
+--
+2.46.2
+
diff --git a/dev-db/recutils/files/1.9/0003-Fix-bison-and-flex-build-rules.patch b/dev-db/recutils/files/1.9/0003-Fix-bison-and-flex-build-rules.patch
new file mode 100644
index 000000000000..65dd25d3801d
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0003-Fix-bison-and-flex-build-rules.patch
@@ -0,0 +1,198 @@
+From c09d1b1fa83be41f6d0568c50cc287ae718de498 Mon Sep 17 00:00:00 2001
+Message-ID: <c09d1b1fa83be41f6d0568c50cc287ae718de498.1728191717.git.sam@gentoo.org>
+In-Reply-To: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+References: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
+Date: Mon, 5 Jun 2023 23:44:03 +0200
+Subject: [PATCH 03/10] Fix bison and flex build rules.
+
+2023-06-05 Jose E. Marchesi <jemarch@gnu.org>
+
+ * configure.ac: Use gl_PROG_BISON instead of gl_BISON.
+ * src/Makefile.am: Fix bison and flex rules.
+ * src/rec-sex-ast.h: Include stddef.h for size_t.
+ * src/rec-sex-lex.l: Use header-file option and fix includes.
+ * .gitignore: Ignore /src/rec-sex-lex.h.
+---
+ ChangeLog | 8 +++++
+ configure.ac | 2 +-
+ src/Makefile.am | 90 +++++++++++++++++++++++++++++++++++++++++++++--
+ src/rec-sex-ast.h | 1 +
+ src/rec-sex-lex.l | 5 ++-
+ 6 files changed, 103 insertions(+), 4 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 5527ba2..d7cba1a 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,11 @@
++2023-06-05 Jose E. Marchesi <jemarch@gnu.org>
++
++ * configure.ac: Use gl_PROG_BISON instead of gl_BISON.
++ * src/Makefile.am: Fix bison and flex rules.
++ * src/rec-sex-ast.h: Include stddef.h for size_t.
++ * src/rec-sex-lex.l: Use header-file option and fix includes.
++ * .gitignore: Ignore /src/rec-sex-lex.h.
++
+ 2022-04-25 Jose E. Marchesi <jemarch@gnu.org>
+
+ * src/rec-db.c (rec_db_set): Avoid segfault with databases with no
+diff --git a/configure.ac b/configure.ac
+index 57dfb6a..24495b4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -46,7 +46,7 @@ AC_ARG_VAR([LEX], [The flex implementation to use.])
+ AC_ARG_VAR([LEXLIB], [Options for linking with the flex runtime library.])
+ AC_ARG_VAR([LEX_OUTPUT_ROOT], [Base of the file name that the lexer generates.])
+
+-gl_BISON
++gl_PROG_BISON([RECUTILS_BISON],[3.6])
+
+ dnl System
+ AC_CANONICAL_HOST
+diff --git a/src/Makefile.am b/src/Makefile.am
+index cb7cf7a..f1e8fa7 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -17,6 +17,11 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+
++BUILT_SOURCES=
++MOSTLYCLEANFILES=
++MAINTAINERCLEANFILES=
++EXTRA_DIST=
++
+ lib_LTLIBRARIES = librec.la
+
+ include_HEADERS = rec.h
+@@ -52,9 +57,90 @@ else
+ librec_la_SOURCES += rec-crypt-dummy.c
+ endif
+
+-BUILT_SOURCES = rec-sex-tab.h
+-AM_YFLAGS = -d
+ AM_LFLAGS = -d
++# The Automake generated .l.c rule is broken: When executed in a VPATH build,
++# - The .c file gets generated in the build directory. But since it requires
++# special tools to rebuild it, we need to distribute it in the tarballs,
++# and by the GNU Coding Standards
++# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>
++# the file should be generated in the source directory.
++# - The #line directives in the .c file refer to a nonexistent file once it
++# has been moved from the build directory to the source directory. This
++# leads to error if 'lcov' is used later.
++# Additionally, here we assume Flex and therefore don't need the ylwrap script.
++# Therefore we override this rule.
++# Since this is a rule that produces multiple files, we apply the idiom from
++# <https://lists.gnu.org/archive/html/bug-make/2020-09/msg00008.html>, so that
++# it works also in parallel 'make'.
++generate-rec-sex-lex:
++ $(AM_V_LEX)$(LEX) $(LFLAGS) $(AM_LFLAGS) -t $(srcdir)/rec-sex-lex.l > rec-sex-lex.c \
++ && test ':' = '$(LEX)' || { \
++ sed -e 's|".*/rec-sex-lex\.l"|"rec-sex-lex.l"|' \
++ -e 's|"lex\.yy\.c"|"rec-sex-lex.c"|' \
++ < rec-sex-lex.c > rec-sex-lex.c-tmp \
++ && sed -e 's|".*/rec-sex-lex\.l"|"rec-sex-lex.l"|' \
++ < rec-sex-lex.h > rec-sex-lex.h-tmp \
++ && rm -f rec-sex-lex.c rec-sex-lex.h \
++ && mv rec-sex-lex.c-tmp $(srcdir)/rec-sex-lex.c \
++ && mv rec-sex-lex.h-tmp $(srcdir)/rec-sex-lex.h; \
++ }
++.PHONY: generate-rec-sex-lex
++# The above rule will generate files with time-stamp order
++# rec-sex-lex.l <= rec-sex-lex.c <= rec-sex-lex.h.
++rec-sex-lex.c: rec-sex-lex.l
++ @{ test -f $(srcdir)/rec-sex-lex.c && test ! $(srcdir)/rec-sex-lex.c -ot $(srcdir)/rec-sex-lex.l; } || $(MAKE) generate-rec-sex-lex
++rec-sex-lex.h: rec-sex-lex.c
++ @{ test -f $(srcdir)/rec-sex-lex.h && test ! $(srcdir)/rec-sex-lex.h -ot $(srcdir)/rec-sex-lex.c; } || $(MAKE) generate-rec-sex-lex
++BUILT_SOURCES += rec-sex-lex.c rec-sex-lex.h
++MOSTLYCLEANFILES += rec-sex-lex.c-tmp rec-sex-lex.h-tmp
++MAINTAINERCLEANFILES += $(srcdir)/rec-sex-lex.c $(srcdir)/rec-sex-lex.h
++EXTRA_DIST += rec-sex-lex.l rec-sex-lex.c rec-sex-lex.h
++
++AM_YFLAGS = -t --report=state
++# The Automake generated .y.c rule is broken: When executed in a VPATH build,
++# - The .c file gets generated in the build directory. But since it requires
++# special tools to rebuild it, we need to distribute it in the tarballs,
++# and by the GNU Coding Standards
++# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>
++# the file should be generated in the source directory.
++# - The #line directives in the .c file refer to a nonexistent file once it
++# has been moved from the build directory to the source directory. This
++# leads to error if 'lcov' is used later.
++# Additionally, here we assume GNU Bison and therefore don't need the ylwrap
++# script.
++# Therefore we override this rule.
++# Since this is a rule that produces multiple files, we apply the idiom from
++# <https://lists.gnu.org/archive/html/bug-make/2020-09/msg00008.html>, so that
++# it works also in parallel 'make'.
++generate-rec-sex-tab:
++ $(AM_V_YACC)$(RECUTILS_BISON) -d $(YFLAGS) $(AM_YFLAGS) $(srcdir)/rec-sex-tab.y \
++ && test ':' = '$(POKE_BISON)' || { \
++ sed -e 's|".*/rec-sex-tab\.y"|"rec-sex-tab.y"|' \
++ -e 's|"rec-sex-tab\.tab\.c"|"rec-sex-tab.c"|' \
++ -e 's|"rec-sex-tab\.tab\.h"|"rec-sex-tab.h"|' \
++ < rec-sex-tab.tab.c > rec-sex-tab.c-tmp \
++ && sed -e 's|".*/rec-sex-tab\.y"|"rec-sex-tab.y"|' \
++ -e 's|"rec-sex-tab\.tab\.h"|"rec-sex-tab.h"|' \
++ < rec-sex-tab.tab.h > rec-sex-tab.h-tmp \
++ && rm -f rec-sex-tab.tab.c rec-sex-tab.tab.h \
++ && mv rec-sex-tab.c-tmp $(srcdir)/rec-sex-tab.c \
++ && mv rec-sex-tab.h-tmp $(srcdir)/rec-sex-tab.h; \
++ }
++.PHONY: generate-rec-sex-tab
++# The above rule will generate files with time-stamp order
++# rec-sex-tab.y <= rec-sex-tab.c <= rec-sex-tab.h.
++rec-sex-tab.c: rec-sex-tab.y
++ @{ test -f $(srcdir)/rec-sex-tab.c && test ! $(srcdir)/rec-sex-tab.c -ot $(srcdir)/rec-sex-tab.y; } || $(MAKE) generate-rec-sex-tab
++rec-sex-tab.h: rec-sex-tab.c
++ @{ test -f $(srcdir)/rec-sex-tab.h && test ! $(srcdir)/rec-sex-tab.h -ot $(srcdir)/rec-sex-tab.c; } || $(MAKE) generate-rec-sex-tab
++BUILT_SOURCES += rec-sex-tab.c rec-sex-tab.h
++MOSTLYCLEANFILES += \
++ rec-sex-tab.tab.c rec-sex-tab.tab.h \
++ rec-sex-tab.c-tmp rec-sex-tab.h-tmp \
++ rec-sex-tab.output
++MAINTAINERCLEANFILES += $(srcdir)/rec-sex-tab.c $(srcdir)/rec-sex-tab.h
++EXTRA_DIST += rec-sex-tab.y rec-sex-tab.c rec-sex-tab.h
++
+ AM_CFLAGS =
+ if USE_COVERAGE
+ AM_CFLAGS += -fprofile-arcs -ftest-coverage
+diff --git a/src/rec-sex-ast.h b/src/rec-sex-ast.h
+index e2ef0dc..b5c6a79 100644
+--- a/src/rec-sex-ast.h
++++ b/src/rec-sex-ast.h
+@@ -22,6 +22,7 @@
+
+ #include <config.h>
+
++#include <stddef.h> /* For size_t */
+ #include <stdbool.h>
+
+ enum rec_sex_ast_node_type_e
+diff --git a/src/rec-sex-lex.l b/src/rec-sex-lex.l
+index 2d4a891..8eee8dd 100644
+--- a/src/rec-sex-lex.l
++++ b/src/rec-sex-lex.l
+@@ -25,13 +25,16 @@
+ %option reentrant
+ %option bison-bridge
+ %option extra-type="void *"
++%option header-file="rec-sex-lex.h"
+
+ %option nounput
+ %option noinput
+ %top {
+ /* This code goes at the "top" of the generated file. */
+ #include <config.h>
+- #include "rec-sex-lex.h"
++ #include <rec-sex-ast.h>
++ #include <rec-sex-parser.h>
++ #include "rec-sex-tab.h"
+ }
+
+ %{
+--
+2.46.2
+
diff --git a/dev-db/recutils/files/1.9/0004-rec-crypt.c-do-not-assume-the-output-buffer-is-NULL-.patch b/dev-db/recutils/files/1.9/0004-rec-crypt.c-do-not-assume-the-output-buffer-is-NULL-.patch
new file mode 100644
index 000000000000..b566d9224ba2
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0004-rec-crypt.c-do-not-assume-the-output-buffer-is-NULL-.patch
@@ -0,0 +1,110 @@
+From 2160498461d6a9298cc7e6707bf3cad94d66d14f Mon Sep 17 00:00:00 2001
+Message-ID: <2160498461d6a9298cc7e6707bf3cad94d66d14f.1728191717.git.sam@gentoo.org>
+In-Reply-To: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+References: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+From: Craig Mason-Jones <craig@lateral.co.za>
+Date: Sun, 3 Sep 2023 12:04:37 +0200
+Subject: [PATCH 04/10] rec-crypt.c: do not assume the output buffer is NULL
+ terminated in rec_decrypt
+
+2023-09-03 Craig Mason-Jones <craig@lateral.co.za>
+
+ * torture/utils/recsel.sh (recsel-confidential-12): New test.
+ (confidential12): New input file.
+ * src/rec-crypt.c (rec_decrypt): The output buffer may not be
+ null-terminated.
+---
+ ChangeLog | 7 +++++++
+ src/rec-crypt.c | 15 +++++++++------
+ torture/utils/recsel.sh | 17 +++++++++++++++++
+ 3 files changed, 33 insertions(+), 6 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index d7cba1a..02c15d2 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,10 @@
++2023-09-03 Craig Mason-Jones <craig@lateral.co.za>
++
++ * torture/utils/recsel.sh (recsel-confidential-12): New test.
++ (confidential12): New input file.
++ * src/rec-crypt.c (rec_decrypt): The output buffer may not be
++ null-terminated.
++
+ 2023-06-05 Jose E. Marchesi <jemarch@gnu.org>
+
+ * configure.ac: Use gl_PROG_BISON instead of gl_BISON.
+diff --git a/src/rec-crypt.c b/src/rec-crypt.c
+index 97e92f4..5c88716 100644
+--- a/src/rec-crypt.c
++++ b/src/rec-crypt.c
+@@ -219,22 +219,25 @@ rec_decrypt (char *in,
+ /* Make sure the decrypted data is ok by checking the CRC at the end
+ of the sequence. */
+
+- if (strlen(*out) > 4)
++ /* If there no padding added in the encryption stage, the data and
++ CRC fills the output buffer. This means that strlen (*out) would
++ fail, because it might buffer over-run. */
++ size_t outlen = strnlen (*out, *out_size);
++
++ if (outlen > 4)
+ {
+ uint32_t crc = 0;
+-
+- memcpy (&crc, *out + strlen(*out) - 4, 4);
++ memcpy (&crc, *out + outlen - 4, 4);
+ #if defined WORDS_BIGENDIAN
+ crc = rec_endian_swap (crc);
+ #endif
+-
+- if (crc32 (*out, strlen(*out) - 4) != crc)
++ if (crc32 (*out, outlen - 4) != crc)
+ {
+ gcry_cipher_close (handler);
+ return false;
+ }
+
+- (*out)[strlen(*out) - 4] = '\0';
++ (*out)[outlen - 4] = '\0';
+ }
+ else
+ {
+diff --git a/torture/utils/recsel.sh b/torture/utils/recsel.sh
+index b868cef..6ce2a59 100755
+--- a/torture/utils/recsel.sh
++++ b/torture/utils/recsel.sh
+@@ -171,6 +171,15 @@ User: foo
+ Password: encrypted-MHyd3Dqz+iaViL8h1m18sA==
+ '
+
++test_declare_input_file confidential12 \
++'%rec: Login
++%doc: Login to a website or application
++%type: Name line
++%confidential: Password
++
++Name: Test2
++Password: encrypted-YaDdF2AIprCfgUjOPlCWO8/WFq0=
++'
+ test_declare_input_file sort \
+ '%rec: Sorted
+ %sort: Id
+@@ -1242,6 +1251,14 @@ test_tool recsel-confidential-num ok \
+ Password: secret
+ '
+
++test_tool recsel-confidential-12 ok \
++ recsel \
++ '-s thisismyverysecretpassword' \
++ confidential12 \
++'Name: Test2
++Password: 123456789012
++'
++
+ fi # crypt_support
+
+ test_tool recsel-sort ok \
+--
+2.46.2
+
diff --git a/dev-db/recutils/files/1.9/0005-torture-add-missing-includes-for-free.patch b/dev-db/recutils/files/1.9/0005-torture-add-missing-includes-for-free.patch
new file mode 100644
index 000000000000..f534384c9752
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0005-torture-add-missing-includes-for-free.patch
@@ -0,0 +1,88 @@
+From fb9fafca61f07be0dded5a5ca6f74dd6cc0bec2c Mon Sep 17 00:00:00 2001
+Message-ID: <fb9fafca61f07be0dded5a5ca6f74dd6cc0bec2c.1728191717.git.sam@gentoo.org>
+In-Reply-To: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+References: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Sun, 6 Oct 2024 05:01:27 +0100
+Subject: [PATCH 05/10] torture: add missing includes for free()
+
+Add a bunch of missing `<stdlib.h>` includes for `free()`.
+
+2024-10-06 Sam James <sam@gentoo.org>
+
+ * torture/rec-parser/rec-parse-record-str.c: Include stdlib.h.
+ * torture/rec-parser/rec-parse-record.c: Ditto.
+ * torture/rec-writer/rec-write-comment-str.c: Ditto.
+ * torture/rec-writer/rec-write-field-name-str.c: Ditto.
+ * torture/rec-writer/rec-write-field-str.c: Ditto.
+---
+ torture/rec-parser/rec-parse-record-str.c | 1 +
+ torture/rec-parser/rec-parse-record.c | 1 +
+ torture/rec-writer/rec-write-comment-str.c | 1 +
+ torture/rec-writer/rec-write-field-name-str.c | 1 +
+ torture/rec-writer/rec-write-field-str.c | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/torture/rec-parser/rec-parse-record-str.c b/torture/rec-parser/rec-parse-record-str.c
+index 141aa15..3d0c3bb 100644
+--- a/torture/rec-parser/rec-parse-record-str.c
++++ b/torture/rec-parser/rec-parse-record-str.c
+@@ -26,6 +26,7 @@
+ #include <config.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <check.h>
+
+ #include <rec.h>
+diff --git a/torture/rec-parser/rec-parse-record.c b/torture/rec-parser/rec-parse-record.c
+index 79e34ff..f77f6cd 100644
+--- a/torture/rec-parser/rec-parse-record.c
++++ b/torture/rec-parser/rec-parse-record.c
+@@ -26,6 +26,7 @@
+ #include <config.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <check.h>
+
+ #include <rec.h>
+diff --git a/torture/rec-writer/rec-write-comment-str.c b/torture/rec-writer/rec-write-comment-str.c
+index 21849e2..0b7d916 100644
+--- a/torture/rec-writer/rec-write-comment-str.c
++++ b/torture/rec-writer/rec-write-comment-str.c
+@@ -26,6 +26,7 @@
+ #include <config.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <check.h>
+
+ #include <rec.h>
+diff --git a/torture/rec-writer/rec-write-field-name-str.c b/torture/rec-writer/rec-write-field-name-str.c
+index 1687243..a8ec6c2 100644
+--- a/torture/rec-writer/rec-write-field-name-str.c
++++ b/torture/rec-writer/rec-write-field-name-str.c
+@@ -26,6 +26,7 @@
+ #include <config.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <check.h>
+
+ #include <rec.h>
+diff --git a/torture/rec-writer/rec-write-field-str.c b/torture/rec-writer/rec-write-field-str.c
+index efbeb54..3a5b7b0 100644
+--- a/torture/rec-writer/rec-write-field-str.c
++++ b/torture/rec-writer/rec-write-field-str.c
+@@ -26,6 +26,7 @@
+ #include <config.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <check.h>
+
+ #include <rec.h>
+--
+2.46.2
+
diff --git a/dev-db/recutils/files/1.9/0006-configure.ac-add-options-for-dependencies.patch b/dev-db/recutils/files/1.9/0006-configure.ac-add-options-for-dependencies.patch
new file mode 100644
index 000000000000..d4aaf88661e6
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0006-configure.ac-add-options-for-dependencies.patch
@@ -0,0 +1,188 @@
+From 42e038b1024c4e225b8309bab2438137f2c0a088 Mon Sep 17 00:00:00 2001
+Message-ID: <42e038b1024c4e225b8309bab2438137f2c0a088.1728191717.git.sam@gentoo.org>
+In-Reply-To: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+References: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Sun, 6 Oct 2024 05:04:15 +0100
+Subject: [PATCH 06/10] configure.ac: add options for dependencies
+
+Avoid "automagic" dependencies by adding options to control them so
+they can be easily overridden, rather than detection based on installed
+packages.
+
+2024-10-06 Sam James <sam@gentoo.org>
+
+ * configure.ac: Add --enable-curl, --enable-uuid, --enable-mdb.
+---
+ configure.ac | 129 ++++++++++++++++++++++++++-------------------------
+ 1 file changed, 67 insertions(+), 62 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 24495b4..d6ffb01 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -84,18 +84,35 @@ AM_CONDITIONAL([CHECK], [test "x$have_check" != "xno"])
+ AC_SUBST([CHECK_CFLAGS])
+ AC_SUBST([CHECK_LIBS])
+
++AC_ARG_ENABLE([curl],
++ AS_HELP_STRING([--enable-curl],
++ [Enable support for remote descriptors using libcurl (default is YES)]),
++ [curl_enabled=$enableval], [curl_enabled=yes])
+ have_curl=no
+-AC_CHECK_LIB([curl],[curl_global_init],[have_curl=yes],)
+-if test "x$have_curl" = "xyes"; then
+- CURLLIBS=-lcurl
+-fi
++AS_IF([test "x$curl_enabled" = "xyes"], [
++ AC_CHECK_LIB([curl], [curl_global_init], [have_curl=yes], [])
++ AS_IF([test "x$have_curl" = "xyes"], [
++ CURLLIBS=-lcurl
++ ], [
++ AC_MSG_ERROR([curl support enabled but libcurl not found])
++ ])
++], [])
+ AC_SUBST([CURLLIBS])
+
++AC_ARG_ENABLE([uuid],
++ AS_HELP_STRING([--enable-uuid],
++ [Compile recutils with support for uuid types (default is YES)]),
++ [uuid_enabled=$enableval], [uuid_enabled=yes])
++
+ have_uuid=no
+-AC_CHECK_LIB([uuid],[uuid_generate],[have_uuid=yes],)
+-if test "x$have_uuid" = "xyes"; then
+- UUIDLIBS=-luuid
+-fi
++AS_IF([test "x$uuid_enabled" = "xyes"], [
++ AC_CHECK_LIB([uuid], [uuid_generate], [have_uuid=yes], [])
++ AS_IF([test "x$have_uuid" = "xyes"], [
++ UUIDLIBS=-luuid
++ ], [
++ AC_MSG_ERROR([uuid support enabled but libuuid not found])
++ ])
++], [])
+ AC_SUBST([UUIDLIBS])
+ AC_SUBST([have_uuid])
+
+@@ -105,45 +122,56 @@ AC_ARG_ENABLE([encryption],
+ [crypt_enabled=$enableval], [crypt_enabled=yes])
+
+ crypt_support=no
+-if test "x$crypt_enabled" = "xyes"; then
++AS_IF([test "x$crypt_enabled" = "xyes"], [
++ AC_LIB_HAVE_LINKFLAGS([gcrypt], [gpg-error], [#include <gpg-error.h>])
++ crypt_support=$HAVE_LIBGCRYPT
+
+- AC_LIB_HAVE_LINKFLAGS([gcrypt],[gpg-error],[#include <gpg-error.h>])
+- crypt_support=$HAVE_LIBGCRYPT
+-
+- if test "x$crypt_support" = "xyes"; then
+- AC_DEFINE([REC_CRYPT_SUPPORT],[1],[Compile encryption support])
+- fi
+-fi
++ AS_IF([test "x$crypt_support" = "xyes"], [
++ AC_DEFINE([REC_CRYPT_SUPPORT], [1], [Compile encryption support])
++ ], [])
++], [])
+
+ AM_CONDITIONAL([CRYPT], [test "x$crypt_support" = "xyes"])
+ AC_SUBST([crypt_support])
+
+-have_glib=no
+-PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.0.0],
+- [have_glib=yes], [have_glib=no])
+-
++AC_ARG_ENABLE([mdb],
++ AS_HELP_STRING([--enable-mdb],
++ [Build the mdb2rec utility (default is YES)]),
++ [mdb_enabled=$enableval], [mdb_enabled=yes])
+ have_mdb=no
+-AC_CHECK_LIB([mdb],[mdb_init],[have_mdb=yes],)
+-if test "x$have_mdb" = "xyes"; then
+- MDBLIBS=-lmdb
+-
+- OLD_CFLAGS=$CFLAGS
+- CFLAGS="$CFLAGS $pkg_cv_GLIB_CFLAGS"
+- mdb_uses_sdatetime=no
+- AC_CHECK_DECL([MDB_SDATETIME],[mdb_uses_sdatetime=yes],,[#include <glib.h>
+-#include <mdbtools.h>])
+- CFLAGS=$OLD_CFLAGS
+-
+- if test "x$mdb_uses_sdatetime" = "xyes"; then
+- MDB_DATETIME="MDB_SDATETIME"
+- else
+- MDB_DATETIME="MDB_DATETIME"
+- fi
+-
+- AC_SUBST([MDB_DATETIME])
+-fi
++AS_IF([test "x$mdb_enabled" = "xyes"], [
++ AC_CHECK_LIB([mdb], [mdb_init], [have_mdb=yes], [])
++ AS_IF([test "x$have_mdb" = "xyes"], [
++ MDBLIBS=-lmdb
++
++ OLD_CFLAGS=$CFLAGS
++ CFLAGS="$CFLAGS $pkg_cv_GLIB_CFLAGS"
++ mdb_uses_sdatetime=no
++ AC_CHECK_DECL([MDB_SDATETIME], [mdb_uses_sdatetime=yes], [], [
++ #include <glib.h>
++ #include <mdbtools.h>
++ ])
++ CFLAGS=$OLD_CFLAGS
++
++ AS_IF([test "x$mdb_uses_sdatetime" = "xyes"], [
++ MDB_DATETIME="MDB_SDATETIME"
++ ], [
++ MDB_DATETIME="MDB_DATETIME"
++ ])
++ ], [
++ AC_MSG_ERROR([mdb support enabled but libmdb not found])
++ ])
++
++ AC_SUBST([MDB_DATETIME])
++], [])
+ AC_SUBST([MDBLIBS])
+
++have_glib=no
++AS_IF([test "x$mdb_enabled" = "xyes"], [
++ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.0.0],
++ [have_glib=yes], [have_glib=no])
++], [])
++
+ AM_CONDITIONAL([COMPILE_MDB2REC],
+ [test "x$have_glib" = "xyes" && test "x$have_mdb" = "xyes"])
+ AM_CONDITIONAL([REMOTE_DESCRIPTORS], [test "x$have_curl" = "xyes"])
+@@ -217,29 +245,6 @@ AC_OUTPUT
+
+ dnl Report warnings
+
+-if test "x$have_check" = "xno"; then
+- echo "warning: libcheck was not found in the system."
+- echo "warning: unit tests wont be compiled and executed upon make check."
+-fi
+-
+-if test "x$have_mdb" = "xno"; then
+- echo "warning: libmdb was not found in the system."
+- echo "warning: the mdb2rec utility won't get built."
+-fi
+-
+-if test "x$have_glib" = "xno"; then
+- echo "warning: glib was not found in the system."
+- echo "warning: the mdb2rec utility won't get built."
+-fi
+-
+-if test "x$crypt_support" = "xno"; then
+- echo "warning: building recutils without encryption support."
+-fi
+-
+-if test "x$have_uuid" = "xno"; then
+- echo "warning: building recutils without support for uuid types."
+-fi
+-
+ if test "x$bash_headers_available" = "xno" || test "x$bash_builtins_enabled" = "xno"; then
+ echo "warning: not building the recutils bash builtins."
+ fi
+--
+2.46.2
+
diff --git a/dev-db/recutils/files/1.9/0007-configure.ac-modernise.patch b/dev-db/recutils/files/1.9/0007-configure.ac-modernise.patch
new file mode 100644
index 000000000000..88058dc70b23
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0007-configure.ac-modernise.patch
@@ -0,0 +1,100 @@
+From f2df87685e11e59429d5866f6cd21f357308abb2 Mon Sep 17 00:00:00 2001
+Message-ID: <f2df87685e11e59429d5866f6cd21f357308abb2.1728191717.git.sam@gentoo.org>
+In-Reply-To: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+References: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Sun, 6 Oct 2024 05:20:51 +0100
+Subject: [PATCH 07/10] configure.ac: modernise
+
+Modernise configure.ac by using more careful [] quoting as well as
+AS_IF and AC_MSG_WARN.
+
+See beb6d826338fb854b5c73458a1d52662b04c171c in autoconf.git.
+
+2024-10-06 Sam James <sam@gentoo.org>
+
+ * configure.ac: Quote.
+ Use AS_IF and AC_MSG_WARN.
+ Drop deprecated AC_PROG_CC_C99 and unnecessary AM_PROG_CC_C_O.
+---
+ configure.ac | 28 +++++++++++++---------------
+ 1 file changed, 13 insertions(+), 15 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d6ffb01..a190f5e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -23,7 +23,7 @@ AC_INIT([GNU recutils], [1.9], [bug-recutils@gnu.org])
+ dnl Must come before AM_INIT_AUTOMAKE
+ AC_CONFIG_AUX_DIR([build-aux])
+ AM_INIT_AUTOMAKE([subdir-objects])
+-AC_CONFIG_HEADERS(src/config.h)
++AC_CONFIG_HEADERS([src/config.h])
+ AC_CONFIG_MACRO_DIR([m4])
+
+ dnl Autobuild
+@@ -33,8 +33,6 @@ AC_PROG_CC
+ gl_EARLY
+
+ LT_INIT
+-AC_PROG_CC_C99
+-AM_PROG_CC_C_O
+
+ dnl Both lex and yacc are required to generate the lexer/parser source
+ dnl files.
+@@ -59,18 +57,18 @@ gl_INIT
+ # However, this means invoking executables, which we generally cannot do
+ # when cross-compiling, so we test to avoid that (the variable
+ # "cross_compiling" is set by AC_PROG_CC).
+-if test $cross_compiling = no; then
+- AM_MISSING_PROG(HELP2MAN, help2man)
+-else
++AS_IF([test "x$cross_compiling" = "xno"], [
++ AM_MISSING_PROG([HELP2MAN], [help2man])
++], [
+ HELP2MAN=:
+-fi
++])
+
+ dnl Seach for headers
+ AC_CHECK_HEADERS([malloc.h string.h])
+
+ dnl Search for data types
+-AC_CHECK_TYPE(size_t, unsigned)
+-AC_CHECK_TYPE(off_t, long)
++AC_CHECK_TYPE([size_t], [unsigned])
++AC_CHECK_TYPE([off_t], [long])
+
+ dnl Search for functions
+ AC_FUNC_FSEEKO
+@@ -191,12 +189,12 @@ AC_ARG_WITH([bash-headers],
+ [location of the bash header files (default is /usr/include/bash)]),
+ [BASH_HEADERS=$withval],)
+
+-if test -f ${BASH_HEADERS}/config.h; then
++AS_IF([test -f ${BASH_HEADERS}/config.h], [
+ AC_SUBST([BASH_HEADERS])
+ bash_headers_available=yes
+-else
++], [
+ bash_headers_available=no
+-fi
++])
+
+ AC_ARG_ENABLE([bash-builtins],
+ AS_HELP_STRING([--enable-bash-builtins],
+@@ -245,8 +243,8 @@ AC_OUTPUT
+
+ dnl Report warnings
+
+-if test "x$bash_headers_available" = "xno" || test "x$bash_builtins_enabled" = "xno"; then
+- echo "warning: not building the recutils bash builtins."
+-fi
++AS_IF([test "x$bash_headers_available" = "xno" || test "x$bash_builtins_enabled" = "xno"], [
++ AC_MSG_WARN([Not building the recutils bash builtins])
++], [])
+
+ dnl End of configure.ac
+--
+2.46.2
+
diff --git a/dev-db/recutils/files/1.9/0008-configure.ac-call-PKG_PROG_PKG_CONFIG-unconditionall.patch b/dev-db/recutils/files/1.9/0008-configure.ac-call-PKG_PROG_PKG_CONFIG-unconditionall.patch
new file mode 100644
index 000000000000..6438b94022a6
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0008-configure.ac-call-PKG_PROG_PKG_CONFIG-unconditionall.patch
@@ -0,0 +1,34 @@
+From 00e5dcacbec2f59466402c56d729ade31d845d6a Mon Sep 17 00:00:00 2001
+Message-ID: <00e5dcacbec2f59466402c56d729ade31d845d6a.1728191717.git.sam@gentoo.org>
+In-Reply-To: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+References: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Sun, 6 Oct 2024 05:32:19 +0100
+Subject: [PATCH 08/10] configure.ac: call PKG_PROG_PKG_CONFIG unconditionally
+
+PKG_PROG_PKG_CONFIG has a catch when used with AS_IF because it is
+only expanded once, so it can be problematic if expanded in a (rare)
+option which isn't enabled. Unconditionally call it to avoid this.
+
+2024-10-06 Sam James <sam@gentoo.org>
+
+ * configure.ac: Call PKG_PROG_PKG_CONFIG unconditionally.
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index a190f5e..e0caa02 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -74,6 +74,7 @@ dnl Search for functions
+ AC_FUNC_FSEEKO
+
+ dnl Search for required libraries
++PKG_PROG_PKG_CONFIG
+
+ have_check=no
+ PKG_CHECK_MODULES([CHECK], [check],
+--
+2.46.2
+
diff --git a/dev-db/recutils/files/1.9/0009-Port-to-newer-mdbutils-0.9.0.patch b/dev-db/recutils/files/1.9/0009-Port-to-newer-mdbutils-0.9.0.patch
new file mode 100644
index 000000000000..ffdfc655b9aa
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0009-Port-to-newer-mdbutils-0.9.0.patch
@@ -0,0 +1,62 @@
+From 35c6919708e73d1dd3eba67813a7ab3f6f62477b Mon Sep 17 00:00:00 2001
+Message-ID: <35c6919708e73d1dd3eba67813a7ab3f6f62477b.1728191717.git.sam@gentoo.org>
+In-Reply-To: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+References: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Sun, 6 Oct 2024 05:48:41 +0100
+Subject: [PATCH 09/10] Port to newer mdbutils (>=0.9.0)
+
+mdbutils-0.9.0 dropped mdb_init and mdb_exit, per NEWS:
+> The previously-deprecated functions mdb_init() and mdb_exit() have been
+> removed. These functions did nothing; any calls to them should be excised with
+> prejudice.
+
+2024-10-06 Sam James <sam@gentoo.org>
+
+ * configure.ac: Check for mdb_backends_init instead of mdb_init.
+ * utils/mdb2rec.c: Drop <glib.h> include, as it conflicts with
+ libmdb's 'fakeglib'.
+ (process_mdb): Drop mdb_init call. Pass MdbHandle to mdb_set_date_fmt.
+---
+ configure.ac | 2 +-
+ utils/mdb2rec.c | 4 +---
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index e0caa02..7e47b9d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -139,7 +139,7 @@ AC_ARG_ENABLE([mdb],
+ [mdb_enabled=$enableval], [mdb_enabled=yes])
+ have_mdb=no
+ AS_IF([test "x$mdb_enabled" = "xyes"], [
+- AC_CHECK_LIB([mdb], [mdb_init], [have_mdb=yes], [])
++ AC_CHECK_LIB([mdb], [mdb_init_backends], [have_mdb=yes], [])
+ AS_IF([test "x$have_mdb" = "xyes"], [
+ MDBLIBS=-lmdb
+
+diff --git a/utils/mdb2rec.c b/utils/mdb2rec.c
+index 1e25397..5ee0369 100644
+--- a/utils/mdb2rec.c
++++ b/utils/mdb2rec.c
+@@ -26,7 +26,6 @@
+ #include <gettext.h>
+ #define _(str) gettext (str)
+
+-#include <glib.h>
+ #include <mdbtools.h>
+
+ #include <rec.h>
+@@ -428,8 +427,7 @@ process_mdb (void)
+ recutl_out_of_memory ();
+
+ /* Initialize libmdb and open the input file. */
+- mdb_init();
+- mdb_set_date_fmt ("%Y-%m-%dT%H:%M:%S%z"); /* ISO 8601 */
++ mdb_set_date_fmt (mdb, "%Y-%m-%dT%H:%M:%S%z"); /* ISO 8601 */
+
+ mdb = mdb_open (mdb2rec_mdb_file, MDB_NOFLAGS);
+ if (!mdb)
+--
+2.46.2
+
diff --git a/dev-db/recutils/files/1.9/0010-configure.ac-use-pkg-config-to-find-curl.patch b/dev-db/recutils/files/1.9/0010-configure.ac-use-pkg-config-to-find-curl.patch
new file mode 100644
index 000000000000..de97b9991ffc
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0010-configure.ac-use-pkg-config-to-find-curl.patch
@@ -0,0 +1,41 @@
+From 64708d4525603869e4ad22d468cb0d56e2f851c3 Mon Sep 17 00:00:00 2001
+Message-ID: <64708d4525603869e4ad22d468cb0d56e2f851c3.1728191717.git.sam@gentoo.org>
+In-Reply-To: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+References: <9f08064fef75ce02df9b6133d240c0fa84df458e.1728191717.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Sun, 6 Oct 2024 05:53:52 +0100
+Subject: [PATCH 10/10] configure.ac: use pkg-config to find curl
+
+A bunch of checks were already relying on pkg-config, let's do it
+for curl too.
+
+2024-10-06 Sam James <sam@gentoo.org>
+
+ * configure.ac: Find curl via pkg-config.
+---
+ configure.ac | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7e47b9d..44bad76 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -89,14 +89,10 @@ AC_ARG_ENABLE([curl],
+ [curl_enabled=$enableval], [curl_enabled=yes])
+ have_curl=no
+ AS_IF([test "x$curl_enabled" = "xyes"], [
+- AC_CHECK_LIB([curl], [curl_global_init], [have_curl=yes], [])
+- AS_IF([test "x$have_curl" = "xyes"], [
+- CURLLIBS=-lcurl
+- ], [
++ PKG_CHECK_MODULES([CURL], [libcurl], [have_curl=yes], [
+ AC_MSG_ERROR([curl support enabled but libcurl not found])
+ ])
+ ], [])
+-AC_SUBST([CURLLIBS])
+
+ AC_ARG_ENABLE([uuid],
+ AS_HELP_STRING([--enable-uuid],
+--
+2.46.2
+
diff --git a/dev-db/recutils/metadata.xml b/dev-db/recutils/metadata.xml
new file mode 100644
index 000000000000..35d54fa93b50
--- /dev/null
+++ b/dev-db/recutils/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+ <use>
+ <flag name="curl">Enable support for remote descriptors using <pkg>net-misc/curl</pkg></flag>
+ <flag name="mdb">Build the mdb2rec utility using <pkg>app-office/mdbtools</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="savannah">recutils</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/recutils/recutils-1.9.ebuild b/dev-db/recutils/recutils-1.9.ebuild
new file mode 100644
index 000000000000..cff0821ae74e
--- /dev/null
+++ b/dev-db/recutils/recutils-1.9.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Tools and libraries to access human-editable, plain text databases"
+HOMEPAGE="https://www.gnu.org/software/recutils/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="crypt curl mdb nls"
+
+RDEPEND="
+ sys-libs/readline:=
+ kernel_linux? ( sys-apps/util-linux )
+ crypt? (
+ dev-libs/libgcrypt:=
+ dev-libs/libgpg-error
+ )
+ curl? ( net-misc/curl )
+ mdb? (
+ app-office/mdbtools:=
+ dev-libs/glib:2
+ )
+ nls? ( virtual/libintl )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ sys-devel/flex
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PV}
+)
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ export LEX=flex
+
+ local myeconfargs=(
+ --enable-uuid
+ $(use_enable crypt encryption)
+ $(use_enable curl)
+ $(use_enable mdb)
+ $(use_enable nls)
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+src_test() {
+ # tests have parallel issues
+ emake -j1 check
+}