1 |
commit: 7b39f68de4ed86238ae0ebbf4394eee0edba867c |
2 |
Author: Ronny (tastytea) Gutbrod <gentoo <AT> tastytea <DOT> de> |
3 |
AuthorDate: Mon Aug 24 17:37:47 2020 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net> |
5 |
CommitDate: Mon Aug 24 17:44:04 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7b39f68d |
7 |
|
8 |
net-im/biboumi: Revbump 9.0_rc1-r1; Add CAP message patch. |
9 |
|
10 |
Patches a bug that prevented connections to FreeNode. |
11 |
From <https://lab.louiz.org/louiz/biboumi/-/commit/b98434b>. |
12 |
|
13 |
Signed-off-by: Ronny (tastytea) Gutbrod <gentoo <AT> tastytea.de> |
14 |
|
15 |
net-im/biboumi/biboumi-9.0_rc1-r1.ebuild | 100 +++++++++++++++++++++ |
16 |
.../files/biboumi-9.0_rc1-split-cap-on-space.patch | 70 +++++++++++++++ |
17 |
2 files changed, 170 insertions(+) |
18 |
|
19 |
diff --git a/net-im/biboumi/biboumi-9.0_rc1-r1.ebuild b/net-im/biboumi/biboumi-9.0_rc1-r1.ebuild |
20 |
new file mode 100644 |
21 |
index 0000000..93f7451 |
22 |
--- /dev/null |
23 |
+++ b/net-im/biboumi/biboumi-9.0_rc1-r1.ebuild |
24 |
@@ -0,0 +1,100 @@ |
25 |
+# Copyright 2020 Gentoo Authors |
26 |
+# Distributed under the terms of the GNU General Public License v2 |
27 |
+ |
28 |
+EAPI=7 |
29 |
+ |
30 |
+inherit cmake fcaps |
31 |
+ |
32 |
+MY_PV="${PV/_/-}" |
33 |
+ |
34 |
+DESCRIPTION="XMPP gateway to IRC" |
35 |
+HOMEPAGE="https://biboumi.louiz.org/" |
36 |
+SRC_URI="https://git.louiz.org/biboumi/snapshot/biboumi-${MY_PV}.tar.xz" |
37 |
+ |
38 |
+LICENSE="ZLIB" |
39 |
+SLOT="0" |
40 |
+KEYWORDS="~amd64" |
41 |
+IUSE="+idn logrotate postgres +sqlite +ssl systemd udns" |
42 |
+ |
43 |
+DEPEND=" |
44 |
+ dev-libs/expat |
45 |
+ virtual/libiconv |
46 |
+ sys-apps/util-linux |
47 |
+ sqlite? ( dev-db/sqlite ) |
48 |
+ postgres? ( dev-db/postgresql:* ) |
49 |
+ idn? ( net-dns/libidn ) |
50 |
+ udns? ( net-libs/udns ) |
51 |
+ ssl? ( dev-libs/botan:2 ) |
52 |
+ !ssl? ( dev-libs/libgcrypt ) |
53 |
+ systemd? ( sys-apps/systemd ) |
54 |
+" |
55 |
+BDEPEND="dev-python/sphinx" |
56 |
+RDEPEND=" |
57 |
+ ${DEPEND} |
58 |
+ acct-user/biboumi" |
59 |
+ |
60 |
+PATCHES=( "${FILESDIR}/biboumi-9.0_rc1-split-cap-on-space.patch" ) |
61 |
+ |
62 |
+S="${WORKDIR}/${PN}-${MY_PV}" |
63 |
+ |
64 |
+DOCS=( README.rst CHANGELOG.rst doc/user.rst ) |
65 |
+ |
66 |
+# Allow biboumi to run an identd on port 113. |
67 |
+FILECAPS=( cap_net_bind_service+ep usr/bin/biboumi ) |
68 |
+ |
69 |
+src_prepare() { |
70 |
+ cmake_src_prepare |
71 |
+ |
72 |
+ if ! use systemd; then # Don't install biboumi.service. |
73 |
+ sed -i '/DESTINATION lib\/systemd\/system/d' CMakeLists.txt || die |
74 |
+ fi |
75 |
+} |
76 |
+ |
77 |
+src_configure() { |
78 |
+ local mycmakeargs=( |
79 |
+ -DWITH_BOTAN="$(usex ssl)" |
80 |
+ -DWITH_LIBIDN="$(usex idn)" |
81 |
+ -DWITH_SYSTEMD="$(usex systemd)" |
82 |
+ -DWITH_UDNS="$(usex udns)" |
83 |
+ -DWITH_SQLITE3="$(usex sqlite)" |
84 |
+ -DWITH_POSTGRESQL="$(usex postgres)" |
85 |
+ |
86 |
+ -DWITHOUT_SYSTEMD="$(usex systemd no yes)" |
87 |
+ -DWITHOUT_POSTGRESQL="$(usex postgres no yes)" |
88 |
+ ) # The WITHOUT_* is really needed. |
89 |
+ |
90 |
+ cmake_src_configure |
91 |
+} |
92 |
+ |
93 |
+src_compile() { |
94 |
+ cmake_src_compile |
95 |
+ |
96 |
+ cmake_build man |
97 |
+} |
98 |
+ |
99 |
+src_install() { |
100 |
+ cmake_src_install |
101 |
+ |
102 |
+ if ! use systemd; then |
103 |
+ newinitd "${FILESDIR}/${PN}.initd" "${PN}" |
104 |
+ fi |
105 |
+ |
106 |
+ if use logrotate; then |
107 |
+ insinto etc/logrotate.d |
108 |
+ if use systemd; then |
109 |
+ newins "${FILESDIR}/${PN}.logrotate.systemd" "${PN}" |
110 |
+ else |
111 |
+ newins "${FILESDIR}/${PN}.logrotate.openrc" "${PN}" |
112 |
+ fi |
113 |
+ fi |
114 |
+ |
115 |
+ diropts --owner=biboumi --group=biboumi --mode=750 |
116 |
+ if use sqlite; then |
117 |
+ keepdir var/lib/biboumi |
118 |
+ fi |
119 |
+ keepdir var/log/biboumi |
120 |
+ |
121 |
+ insinto etc/biboumi |
122 |
+ insopts --group=biboumi --mode=640 |
123 |
+ newins conf/biboumi.cfg biboumi.cfg.example |
124 |
+} |
125 |
|
126 |
diff --git a/net-im/biboumi/files/biboumi-9.0_rc1-split-cap-on-space.patch b/net-im/biboumi/files/biboumi-9.0_rc1-split-cap-on-space.patch |
127 |
new file mode 100644 |
128 |
index 0000000..af86ead |
129 |
--- /dev/null |
130 |
+++ b/net-im/biboumi/files/biboumi-9.0_rc1-split-cap-on-space.patch |
131 |
@@ -0,0 +1,70 @@ |
132 |
+From b98434b5d04d1ada9b24475e17ee8947d96ad1e3 Mon Sep 17 00:00:00 2001 |
133 |
+From: =?UTF-8?q?louiz=E2=80=99?= <louiz@×××××.org> |
134 |
+Date: Sun, 16 Aug 2020 16:05:15 +0200 |
135 |
+Subject: [PATCH] In CAP messages, handle the last arg as a list of |
136 |
+ capabilities |
137 |
+ |
138 |
+Instead of just one. This fixes the issue of the "trailing whitespace" since we |
139 |
+now split it on ' ' |
140 |
+ |
141 |
+Fix #3442 |
142 |
+--- |
143 |
+ src/irc/irc_client.cpp | 25 ++++++++++++++----------- |
144 |
+ tests/utils.cpp | 3 +++ |
145 |
+ 2 files changed, 17 insertions(+), 11 deletions(-) |
146 |
+ |
147 |
+diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp |
148 |
+index 3ae5ac6..5f0d9b9 100644 |
149 |
+--- a/src/irc/irc_client.cpp |
150 |
++++ b/src/irc/irc_client.cpp |
151 |
+@@ -1340,19 +1340,22 @@ long int IrcClient::get_throttle_limit() const |
152 |
+ void IrcClient::on_cap(const IrcMessage &message) |
153 |
+ { |
154 |
+ const auto& sub_command = message.arguments[1]; |
155 |
+- const auto& cap = message.arguments[2]; |
156 |
+- auto it = this->capabilities.find(cap); |
157 |
+- if (it == this->capabilities.end()) |
158 |
++ const auto& caps = utils::split(message.arguments[2], ' ', false); |
159 |
++ for (const auto& cap: caps) |
160 |
+ { |
161 |
+- log_warning("Received a CAP message for something we didn’t ask, or that we already handled."); |
162 |
+- return; |
163 |
++ auto it = this->capabilities.find(cap); |
164 |
++ if (it == this->capabilities.end()) |
165 |
++ { |
166 |
++ log_warning("Received a CAP message for something we didn’t ask, or that we already handled: [", cap, "]"); |
167 |
++ return; |
168 |
++ } |
169 |
++ Capability& capability = it->second; |
170 |
++ if (sub_command == "ACK") |
171 |
++ capability.on_ack(); |
172 |
++ else if (sub_command == "NACK") |
173 |
++ capability.on_nack(); |
174 |
++ this->capabilities.erase(it); |
175 |
+ } |
176 |
+- Capability& capability = it->second; |
177 |
+- if (sub_command == "ACK") |
178 |
+- capability.on_ack(); |
179 |
+- else if (sub_command == "NACK") |
180 |
+- capability.on_nack(); |
181 |
+- this->capabilities.erase(it); |
182 |
+ if (this->capabilities.empty()) |
183 |
+ this->cap_end(); |
184 |
+ } |
185 |
+diff --git a/tests/utils.cpp b/tests/utils.cpp |
186 |
+index 6de19f0..6151733 100644 |
187 |
+--- a/tests/utils.cpp |
188 |
++++ b/tests/utils.cpp |
189 |
+@@ -28,6 +28,9 @@ TEST_CASE("String split") |
190 |
+ CHECK(splitted.size() == 2); |
191 |
+ CHECK(splitted[0] == ""); |
192 |
+ CHECK(splitted[1] == "a"); |
193 |
++ splitted = utils::split("multi-prefix ", ' '); |
194 |
++ CHECK(splitted[0] == "multi-prefix"); |
195 |
++ CHECK(splitted.size() == 1); |
196 |
+ } |
197 |
+ |
198 |
+ TEST_CASE("tolower") |
199 |
+-- |
200 |
+2.26.2 |
201 |
+ |