summaryrefslogtreecommitdiff
path: root/dev-db/recutils
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-10-07 04:26:50 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-10-07 04:26:50 +0100
commit7ad61ca2bfc8f8da08d2fb3085e4333dcccb0a64 (patch)
treef7c41a49b46acf8ae70e84a70c452a7d121c5458 /dev-db/recutils
parentd6106fb0c1ab8f79024ab6a9ac2062ddc85d4e07 (diff)
gentoo auto-resync : 07:10:2024 - 04:26:50
Diffstat (limited to 'dev-db/recutils')
-rw-r--r--dev-db/recutils/Manifest13
-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.patch90
-rw-r--r--dev-db/recutils/files/1.9/0006-configure.ac-add-options-for-dependencies.patch190
-rw-r--r--dev-db/recutils/files/1.9/0007-configure.ac-modernise.patch102
-rw-r--r--dev-db/recutils/files/1.9/0008-configure.ac-call-PKG_PROG_PKG_CONFIG-unconditionall.patch36
-rw-r--r--dev-db/recutils/files/1.9/0009-Port-to-newer-mdbutils-0.9.0.patch64
-rw-r--r--dev-db/recutils/files/1.9/0010-configure.ac-use-pkg-config-to-find-curl.patch43
-rw-r--r--dev-db/recutils/metadata.xml15
-rw-r--r--dev-db/recutils/recutils-1.9.ebuild65
13 files changed, 1072 insertions, 0 deletions
diff --git a/dev-db/recutils/Manifest b/dev-db/recutils/Manifest
new file mode 100644
index 000000000000..ab981278ac61
--- /dev/null
+++ b/dev-db/recutils/Manifest
@@ -0,0 +1,13 @@
+AUX 1.9/0001-db-fix-rec_db_set-crash-with-empty-databases.patch 1931 BLAKE2B 80be524e548e51a59640409b48a0853f77c08d0703e2c8396c79854e35325f773acd5161722639a6512a29ecffb35f8d1d34c90783a87acf7df123b4b2ea9f6f SHA512 bf49294209acbbcbcb268b6eb870643b80565bccc63b34124359cedecd663ea36c755b37f386341dffdeb91df18dac61429d83ea8c3c71f008c2faf79c3448bc
+AUX 1.9/0002-C99-compatibility-fix.patch 2368 BLAKE2B 45abc75feb34e6f5ada0f0544e0b04110fd9259a915ed58e2f992f008169f5ed0a833aa8197fe666d62318ef0988725197cb24778e1e15c7f172eb785798e478 SHA512 ff19a213dc0ceb42230a44f48e43dcdc13429ef3646f511666c83195835bc23c1e1fcb74aece2e79c389aa9150603fb8e089a600519ea336b252e2fde748a74e
+AUX 1.9/0003-Fix-bison-and-flex-build-rules.patch 8031 BLAKE2B b0535239d48a9299c1c24fcb7f58fde81ed4519d5cd238c12557b1dbd970c95b40d2b34e0aa917de02e5813d681848f9f32a5b65046c1291fdd8f9d40ffc9125 SHA512 962a07df2af86f14af801be4e737a02b3e20e278e0488e5118845804c78dd66f5c5cfdb9b7d3319c417f5ca9c98eaf3b99f9abef17b5ff89135cb801a00b65eb
+AUX 1.9/0004-rec-crypt.c-do-not-assume-the-output-buffer-is-NULL-.patch 3253 BLAKE2B 22900ee5030a11a2a661e96b97cf21de5381e785baa2a2e84dc849d3dffe082ab766351de47a2965fe38d39c5e0b4c9794e49f0060e106a153b63cc6a468806e SHA512 89ebdcf640779ab1475db918455813b2ef49dbebd7f3a2b1497125a174aaafe174aac24dfdf023712b8c86b065852437e6cc69699d6f70a031fc1d00bbabff32
+AUX 1.9/0005-torture-add-missing-includes-for-free.patch 3056 BLAKE2B b6f9e999cfb22a294aa829743007e2abb2014c1f4ef94cabfe2e8ba58054ecfc612adb688fee668de4a56293e60e765b8df50a401d385c07ae3d7fb9c8bf3722 SHA512 cd30c7770c86273678b96b41bcf1a782207b388fc9542a0ba020a93393e8bf7f1cb3ea0db3618d33229f0b887723bd8f88f0a4d2fd79a672c0151e9e867b96bd
+AUX 1.9/0006-configure.ac-add-options-for-dependencies.patch 6189 BLAKE2B 175e0cd456279ed60bf7bd46dbbde20ae24444d173392477fbce5f350275157ffa0430f294c2ba9e9dcd09c13a48b3ce430d9b2a375aacaab51f841fd32d6458 SHA512 75272a9a7a43c70d1501b3219446fbbb97fa056676e302610bf187a9f179f897e0a891b1a0bdd227fe759f0e2b6721de086274b7feb9d59f55546504ef3ba401
+AUX 1.9/0007-configure.ac-modernise.patch 3064 BLAKE2B a48d78f15b9da375453a94a60e37e19080588b63722db83b2f8e7d339b0d8b64f546a58deb58c6dd19467f385998a8617ee7d9fe21d00c3738ae6c06f43d0abd SHA512 8328fcf78d0428b3c397c31b875bfd54a5c6feafcf4eebf4dde88dc71bb412ef6f5eb49c3fad06a1678cfa995cbd5f6b481cfa5468063586f65606773947e096
+AUX 1.9/0008-configure.ac-call-PKG_PROG_PKG_CONFIG-unconditionall.patch 1200 BLAKE2B eda53eee3379987fb93df87c028d06dc664fd2609b6130babac56ae096dbc0b4f6201fffcfa272ddcc13ce53c8a9a9925e2aa4bb3bc0f1dc95394d935c8e3aa0 SHA512 442b4d7b07279c641a19b74d4a552f1aa12ce769ca18ce7d8462415d91f0d412025060c9bea943007f676b0d9d535234d152ff8ea4877b221426dc1b55edc3a7
+AUX 1.9/0009-Port-to-newer-mdbutils-0.9.0.patch 2173 BLAKE2B 27213a8fddc10ad9f075f80591d97699bcdecffc9274d4f6e6746b1456f124d9dcb743fae4252fdd245e11005ba0da510bdf1141e2d848db3ef7f219879cb93c SHA512 d75196de27d46489553230c7d21ab775a0dded704209adaef87df4ef8a62ef7322a98116ad6d0d869dc4ad12e11484b8d2da42e2a36f6d3c8153898fa8b3fd0c
+AUX 1.9/0010-configure.ac-use-pkg-config-to-find-curl.patch 1443 BLAKE2B c99a0d501273067f40552c8be3adfce22a4ee7f88f2a3f858eb52219811c703c97e31e106541d3c7513c4bdda02b8491c7b1b91ae24a6f43bcaa231de8688b40 SHA512 31842f8439778f45b72971c4a9a634e58d1c7424d1777f43d2dafd3ae122f04d6dcccf37521974e6ea99f58e18e6e5b35190fceba7e0266655f225d2908be00b
+DIST recutils-1.9.tar.gz 2759999 BLAKE2B 839dbcd36e7fe0ececbf3ef3a1b842890e876c6feda2bc003c921c53eba83b70f38baa5a536962253eec5b06eed29c6e301751d7b6586f0ef0c5ea35d94a44d7 SHA512 775b3b8925a4e5c6f04c6376291b966bdc271f172be2bca06b1f02155ecba12d916c22219f85fe0393f7f9f200f3788ab5fa5d522da2b84b2a0c0ec198318809
+EBUILD recutils-1.9.ebuild 1047 BLAKE2B 4248100bffedd08c52928a24797a44e2e67bb84948465d1bb66cb4cb0e50315681af8479696370bf6a854108ed6855d47e6cc238fee1ac407c968fe8bf5fa85d SHA512 513f3f984bfbd25ccaf83c72673c4429dd0ec5700f52817da48a8de80992fe258b6fcf2fa40b7cc466d30b442fa3afd30b01773df73b49629c43691758b698ba
+MISC metadata.xml 514 BLAKE2B a2bcd3d4dbe7bec4cefe6a8750bcd9d435888970c375808c00871a5c808c220a6d1f6d34129a6bd6d84a4d5af56a81b2d069e5a6ee6b9efe8fecb234fca250f4 SHA512 158fbf7a4650bbf4515026ef8ed6ae520ef510526f25ba25d978ed69598e66c06b4655c60a133c8a5e106adffcf34ce13b5e852f7dbe62dad6f040478fd8412d
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..aa085cac4af5
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0005-torture-add-missing-includes-for-free.patch
@@ -0,0 +1,90 @@
+https://lists.gnu.org/archive/html/bug-recutils/2024-10/msg00002.html
+
+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..ead6cd696b12
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0006-configure.ac-add-options-for-dependencies.patch
@@ -0,0 +1,190 @@
+https://lists.gnu.org/archive/html/bug-recutils/2024-10/msg00002.html
+
+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..8393ea1bab5b
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0007-configure.ac-modernise.patch
@@ -0,0 +1,102 @@
+https://lists.gnu.org/archive/html/bug-recutils/2024-10/msg00002.html
+
+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..aeb53c6b6808
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0008-configure.ac-call-PKG_PROG_PKG_CONFIG-unconditionall.patch
@@ -0,0 +1,36 @@
+https://lists.gnu.org/archive/html/bug-recutils/2024-10/msg00002.html
+
+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..7016ad19d508
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0009-Port-to-newer-mdbutils-0.9.0.patch
@@ -0,0 +1,64 @@
+https://lists.gnu.org/archive/html/bug-recutils/2024-10/msg00002.html
+
+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..432b605daada
--- /dev/null
+++ b/dev-db/recutils/files/1.9/0010-configure.ac-use-pkg-config-to-find-curl.patch
@@ -0,0 +1,43 @@
+https://lists.gnu.org/archive/html/bug-recutils/2024-10/msg00002.html
+
+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
+}