[gentoo-commits] repo/gentoo:master commit in: net-im/biboumi/, net-im/biboumi/files/
commit: d7d34d7858864fd5d350e5de430656f82b3ccc59 Author: Florian Schmaus gentoo org> AuthorDate: Mon Mar 14 11:22:12 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Mon Mar 14 11:22:55 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7d34d78 net-im/biboumi: apply official fix for expact issue Signed-off-by: Florian Schmaus gentoo.org> ...biboumi-9.0-r3.ebuild => biboumi-9.0-r4.ebuild} | 2 +- ...t-use-as-a-namespace-separator-with-expat.patch | 301 + .../biboumi-9.0-fix-namespace-separator.patch | 57 3 files changed, 302 insertions(+), 58 deletions(-) diff --git a/net-im/biboumi/biboumi-9.0-r3.ebuild b/net-im/biboumi/biboumi-9.0-r4.ebuild similarity index 96% rename from net-im/biboumi/biboumi-9.0-r3.ebuild rename to net-im/biboumi/biboumi-9.0-r4.ebuild index 9f6fa3b33906..2c45760b3892 100644 --- a/net-im/biboumi/biboumi-9.0-r3.ebuild +++ b/net-im/biboumi/biboumi-9.0-r4.ebuild @@ -44,7 +44,7 @@ S="${WORKDIR}/${PN}-${MY_PV}" DOCS=( README.rst CHANGELOG.rst doc/user.rst ) PATCHES=( - "${FILESDIR}/${PN}-9.0-fix-namespace-separator.patch" + "${FILESDIR}/${PN}-9.0-do-not-use-as-a-namespace-separator-with-expat.patch" "${FILESDIR}/${PN}-9.0-use-system-catch2.patch" ) diff --git a/net-im/biboumi/files/biboumi-9.0-do-not-use-as-a-namespace-separator-with-expat.patch b/net-im/biboumi/files/biboumi-9.0-do-not-use-as-a-namespace-separator-with-expat.patch new file mode 100644 index ..f82cbae81928 --- /dev/null +++ b/net-im/biboumi/files/biboumi-9.0-do-not-use-as-a-namespace-separator-with-expat.patch @@ -0,0 +1,301 @@ +From 0061298dd0945f7f67e7fa340c6649b179c804d5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?louiz=E2=80=99?= +Date: Thu, 10 Mar 2022 23:23:47 +0100 +Subject: [PATCH] Do not use ':' as a namespace separator with expat + +Instead use \1, and build our own nodes by explicitely separating the +namespace and the node name. +--- + src/xmpp/adhoc_command.cpp | 6 +++--- + src/xmpp/adhoc_commands_handler.cpp | 12 ++-- + src/xmpp/biboumi_adhoc_commands.cpp | 28 ++-- + src/xmpp/xmpp_component.cpp | 2 +- + src/xmpp/xmpp_parser.cpp| 2 +- + src/xmpp/xmpp_parser.hpp| 4 ++-- + src/xmpp/xmpp_stanza.cpp| 14 +- + src/xmpp/xmpp_stanza.hpp| 6 ++ + tests/xmpp.cpp | 2 ++ + 9 files changed, 48 insertions(+), 28 deletions(-) + +diff --git a/src/xmpp/adhoc_command.cpp b/src/xmpp/adhoc_command.cpp +index fbf4ce200b82..f8c8e4f146d6 100644 +--- a/src/xmpp/adhoc_command.cpp b/src/xmpp/adhoc_command.cpp +@@ -26,7 +26,7 @@ void PingStep1(XmppComponent&, AdhocSession&, XmlNode& command_node) + + void HelloStep1(XmppComponent&, AdhocSession&, XmlNode& command_node) + { +- XmlSubNode x(command_node, "jabber:x:data:x"); ++ XmlSubNode x(command_node, "jabber:x:data", "x"); + x["type"] = "form"; + XmlSubNode title(x, "title"); + title.set_inner("Configure your name."); +@@ -65,9 +65,9 @@ void HelloStep2(XmppComponent&, AdhocSession& session, XmlNode& command_node) + } + } + command_node.delete_all_children(); +- XmlSubNode error(command_node, ADHOC_NS":error"); ++ XmlSubNode error(command_node, ADHOC_NS, "error"); + error["type"] = "modify"; +- XmlSubNode condition(error, STANZA_NS":bad-request"); ++ XmlSubNode condition(error, STANZA_NS, "bad-request"); + session.terminate(); + } + +diff --git a/src/xmpp/adhoc_commands_handler.cpp b/src/xmpp/adhoc_commands_handler.cpp +index ff4c1e5506fb..7a84b2e11a45 100644 +--- a/src/xmpp/adhoc_commands_handler.cpp b/src/xmpp/adhoc_commands_handler.cpp +@@ -36,16 +36,16 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, co + auto command_it = this->commands.find(node); + if (command_it == this->commands.end()) + { +- XmlSubNode error(command_node, ADHOC_NS":error"); ++ XmlSubNode error(command_node, ADHOC_NS, "error"); + error["type"] = "cancel"; +- XmlSubNode condition(error, STANZA_NS":item-not-found"); ++ XmlSubNode condition(error, STANZA_NS, "item-not-found"); + } + else if (command_it->second.is_admin_only() && +!Config::is_in_list("admin", jid.bare())) + { +- XmlSubNode error(command_node, ADHOC_NS":error"); ++ XmlSubNode error(command_node, ADHOC_NS, "error"); + error["type"] = "cancel"; +- XmlSubNode condition(error, STANZA_NS":forbidden"); ++ XmlSubNode condition(error, STANZA_NS, "forbidden"); + } + else + { +@@ -94,9 +94,9 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, co + } + else // unsupported action + { +- XmlSubNode error(command_node, ADHOC_NS":error"); ++ XmlSubNode error(command_node, ADHOC_NS, "error"); + error["type"] = "modify"; +-
[gentoo-commits] repo/gentoo:master commit in: net-im/biboumi/, net-im/biboumi/files/
commit: f57017c7b8db7183a8acb80a6292e700c0efd0d6 Author: Florian Schmaus gentoo org> AuthorDate: Sun Feb 27 10:26:14 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Sun Feb 27 10:27:11 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f57017c7 net-im/biboumi: enable src_test Signed-off-by: Florian Schmaus gentoo.org> net-im/biboumi/biboumi-9.0-r3.ebuild | 16 +- .../files/biboumi-9.0-use-system-catch2.patch | 229 + 2 files changed, 242 insertions(+), 3 deletions(-) diff --git a/net-im/biboumi/biboumi-9.0-r3.ebuild b/net-im/biboumi/biboumi-9.0-r3.ebuild index 90caef48feda..9f6fa3b33906 100644 --- a/net-im/biboumi/biboumi-9.0-r3.ebuild +++ b/net-im/biboumi/biboumi-9.0-r3.ebuild @@ -14,9 +14,10 @@ SRC_URI="https://git.louiz.org/biboumi/snapshot/biboumi-${MY_PV}.tar.xz; LICENSE="ZLIB" SLOT="0" KEYWORDS="~amd64" -IUSE="+idn postgres +sqlite +ssl systemd udns" +IUSE="+idn postgres +sqlite +ssl systemd test udns" +RESTRICT="!test? ( test )" -DEPEND=" +COMMON_DEPEND=" dev-libs/expat virtual/libiconv sys-apps/util-linux @@ -28,9 +29,13 @@ DEPEND=" !ssl? ( dev-libs/libgcrypt ) systemd? ( sys-apps/systemd:= ) " +DEPEND=" + ${COMMON_DEPEND} + test? ( dev-cpp/catch:0 ) +" BDEPEND="dev-python/sphinx" RDEPEND=" - ${DEPEND} + ${COMMON_DEPEND} acct-user/biboumi " @@ -40,6 +45,7 @@ DOCS=( README.rst CHANGELOG.rst doc/user.rst ) PATCHES=( "${FILESDIR}/${PN}-9.0-fix-namespace-separator.patch" + "${FILESDIR}/${PN}-9.0-use-system-catch2.patch" ) src_configure() { @@ -94,6 +100,10 @@ src_compile() { cmake_build man } +src_test() { + cmake_build check +} + src_install() { cmake_src_install diff --git a/net-im/biboumi/files/biboumi-9.0-use-system-catch2.patch b/net-im/biboumi/files/biboumi-9.0-use-system-catch2.patch new file mode 100644 index ..edda7a37c50b --- /dev/null +++ b/net-im/biboumi/files/biboumi-9.0-use-system-catch2.patch @@ -0,0 +1,229 @@ +From 414ab9e13fc9e9fa79f7f0a8e1b4a46cd3bd92fd Mon Sep 17 00:00:00 2001 +From: Florian Schmaus +Date: Sun, 27 Feb 2022 11:06:42 +0100 +Subject: [PATCH] Use the system installation of catch2 if possible + +--- + CMakeLists.txt | 41 - + tests/colors.cpp | 2 +- + tests/config.cpp | 2 +- + tests/database.cpp | 2 +- + tests/encoding.cpp | 2 +- + tests/iid.cpp | 2 +- + tests/io_tester.cpp| 2 +- + tests/irc.cpp | 2 +- + tests/jid.cpp | 2 +- + tests/logger.cpp | 2 +- + tests/network.cpp | 2 +- + tests/test.cpp | 2 +- + tests/timed_events.cpp | 2 +- + tests/utils.cpp| 2 +- + tests/uuid.cpp | 2 +- + tests/xmpp.cpp | 2 +- + 16 files changed, 39 insertions(+), 32 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f07b97feb57b..8175012fe070 100644 +--- a/CMakeLists.txt b/CMakeLists.txt +@@ -288,24 +288,31 @@ foreach(file ${source_all}) + endforeach() + + # +-## Add a rule to download the catch unit test framework ++## Catch unit test framework + # +-include(ExternalProject) +-ExternalProject_Add(catch +- GIT_REPOSITORY "https://lab.louiz.org/louiz/Catch.git; +- PREFIX "external" +- UPDATE_COMMAND "" +- CONFIGURE_COMMAND "" +- BUILD_COMMAND "" +- INSTALL_COMMAND "" +- ) +-set_target_properties(catch PROPERTIES EXCLUDE_FROM_ALL TRUE) +-ExternalProject_Get_Property(catch SOURCE_DIR) +-if(NOT EXISTS ${CMAKE_SOURCE_DIR}/tests/catch.hpp) +- target_include_directories(test_suite +-PUBLIC "${SOURCE_DIR}/single_include/" +-) +- add_dependencies(test_suite catch) ++find_package(Catch2 2.2.1) ++if(Catch2_FOUND) ++ target_link_libraries(test_suite Catch2::Catch2) ++else() ++ # No system-wide installation of the catch unit test framework was ++ # found, download it. ++ include(ExternalProject) ++ ExternalProject_Add(catch ++ GIT_REPOSITORY "https://lab.louiz.org/louiz/Catch.git; ++ PREFIX "external" ++ UPDATE_COMMAND "" ++ CONFIGURE_COMMAND "" ++ BUILD_COMMAND "" ++ INSTALL_COMMAND "" ++ ) ++ set_target_properties(catch PROPERTIES EXCLUDE_FROM_ALL TRUE) ++ ExternalProject_Get_Property(catch SOURCE_DIR) ++ if(NOT EXISTS ${CMAKE_SOURCE_DIR}/tests/catch.hpp) ++ target_include_directories(test_suite ++ PUBLIC "${SOURCE_DIR}/single_include/" ++ ) ++ add_dependencies(test_suite catch) ++ endif() + endif() + + # +diff --git a/tests/colors.cpp b/tests/colors.cpp +index bf529896dce7..a9761dfff648 100644 +--- a/tests/colors.cpp b/tests/colors.cpp +@@ -1,4 +1,4 @@ +-#include "catch.hpp" ++#include "catch2/catch.hpp" + + #include + #include +diff --git a/tests/config.cpp b/tests/config.cpp +index ec9844fbd5f6..76cfe92e3e51 100644 +--- a/tests/config.cpp b/tests/config.cpp +@@ -1,4 +1,4 @@ +-#include
[gentoo-commits] repo/gentoo:master commit in: net-im/biboumi/, net-im/biboumi/files/
commit: ceadc1716ca98100b76e0083d0dfae2d9bc6cfc1 Author: Florian Schmaus gentoo org> AuthorDate: Tue Feb 1 10:35:01 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Tue Feb 1 10:35:16 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ceadc171 net-im/biboumi: initial import Signed-off-by: Florian Schmaus gentoo.org> net-im/biboumi/Manifest| 1 + net-im/biboumi/biboumi-9.0-r2.ebuild | 110 + net-im/biboumi/files/biboumi.initd | 21 +++ net-im/biboumi/files/biboumi.logrotate | 10 +++ net-im/biboumi/metadata.xml| 21 +++ 5 files changed, 163 insertions(+) diff --git a/net-im/biboumi/Manifest b/net-im/biboumi/Manifest new file mode 100644 index ..34c6c222de56 --- /dev/null +++ b/net-im/biboumi/Manifest @@ -0,0 +1 @@ +DIST biboumi-9.0.tar.xz 161192 BLAKE2B 27c19f5c44e23caae07bd579b01d663e73cd8b432203ac95ae77e651936eea7cc443f389e589acebe5b36c32e96f215fdf0a86c97193726d601b53b709a2d66e SHA512 cfaacd831b56031906922472275c55fd6f1a5307ebe54959d21e3799ad4612499e8beeb34e8736df9eabc9fec1a861d17567250d64f316ace47395fd6c8f3c18 diff --git a/net-im/biboumi/biboumi-9.0-r2.ebuild b/net-im/biboumi/biboumi-9.0-r2.ebuild new file mode 100644 index ..4f571807cf7e --- /dev/null +++ b/net-im/biboumi/biboumi-9.0-r2.ebuild @@ -0,0 +1,110 @@ +# Copyright 2020-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +MY_PV="${PV/_/-}" + +DESCRIPTION="XMPP gateway to IRC" +HOMEPAGE="https://biboumi.louiz.org/; +SRC_URI="https://git.louiz.org/biboumi/snapshot/biboumi-${MY_PV}.tar.xz; + +LICENSE="ZLIB" +SLOT="0" +KEYWORDS="~amd64" +IUSE="+idn postgres +sqlite +ssl systemd udns" + +DEPEND=" + dev-libs/expat + virtual/libiconv + sys-apps/util-linux + sqlite? ( dev-db/sqlite:3 ) + postgres? ( dev-db/postgresql:* ) + idn? ( net-dns/libidn:= ) + udns? ( net-libs/udns ) + ssl? ( dev-libs/botan:2= ) + !ssl? ( dev-libs/libgcrypt ) + systemd? ( sys-apps/systemd:= ) +" +BDEPEND="dev-python/sphinx" +RDEPEND=" + ${DEPEND} + acct-user/biboumi +" + +S="${WORKDIR}/${PN}-${MY_PV}" + +DOCS=( README.rst CHANGELOG.rst doc/user.rst ) + +src_configure() { + local mycmakeargs=( + -DSERVICE_USER="${PN}" + -DSERVICE_GROUP="${PN}" + ) + + # Account for biboumi's atypical configuration system. + if use systemd; then + mycmakeargs+=(-DWITH_SYSTEMD=yes) + else + mycmakeargs+=(-DWITHOUT_SYSTEMD=yes) + fi + + if use idn; then + mycmakeargs+=(-DWITH_LIBIDN=yes) + else + mycmakeargs+=(-DWITHOUT_LIBIDN=yes) + fi + + if use ssl; then + mycmakeargs+=(-DWITH_BOTAN=yes) + else + mycmakeargs+=(-DWITHOUT_BOTAN=yes) + fi + + if use udns; then + mycmakeargs+=(-DWITH_UDNS=yes) + else + mycmakeargs+=(-DWITHOUT_UDNS=yes) + fi + + if use sqlite; then + mycmakeargs+=(-DWITH_SQLITE3=yes) + else + mycmakeargs+=(-DWITHOUT_SQLITE3=yes) + fi + + if use postgres; then + mycmakeargs+=(-DWITH_POSTGRESQL=yes) + else + mycmakeargs+=(-DWITHOUT_POSTGRESQL=yes) + fi + + cmake_src_configure +} + +src_compile() { + cmake_src_compile + + cmake_build man +} + +src_install() { + cmake_src_install + + newinitd "${FILESDIR}/${PN}.initd" "${PN}" + + insinto /etc/logrotate.d + newins "${FILESDIR}/${PN}.logrotate" "${PN}" + + diropts --owner=biboumi --group=biboumi --mode=750 + if use sqlite; then + keepdir /var/lib/biboumi + fi + keepdir /var/log/biboumi + + insinto /etc/biboumi + insopts --group=biboumi --mode=640 + newins conf/biboumi.cfg biboumi.cfg.example +} diff --git a/net-im/biboumi/files/biboumi.initd b/net-im/biboumi/files/biboumi.initd new file mode 100644 index ..665db9120c9c --- /dev/null +++ b/net-im/biboumi/files/biboumi.initd @@ -0,0 +1,21 @@ +#!/sbin/openrc-run +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="XMPP gateway to IRC" +pidfile="/var/run/biboumi.pid" +command="/usr/bin/biboumi" +command_args="${BIBOUMI_CONFIG:-/etc/biboumi/biboumi.cfg}" +command_user="${BIBOUMI_USER:-biboumi}" +command_background="true" +extra_commands="reload" + +depend() { + use jabber-server +} + +reload() { + ebegin "Reloading configuration of Biboumi" + start-stop-daemon --pidfile ${pidfile} --signal USR1 + eend $? +} diff --git a/net-im/biboumi/files/biboumi.logrotate b/net-im/biboumi/files/biboumi.logrotate new file mode 100644 index ..19964cf60f3f --- /dev/null +++