1 |
commit: fa0328d9ed0a32193aaf0df9ae19ea33d4317856 |
2 |
Author: Florian Schmaus <flow <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 26 20:46:43 2022 +0000 |
4 |
Commit: Florian Schmaus <flow <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 26 20:46:43 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa0328d9 |
7 |
|
8 |
net-im/biboumi: add 9.0-r3 with fix for newer libexpat |
9 |
|
10 |
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org> |
11 |
|
12 |
net-im/biboumi/biboumi-9.0-r3.ebuild | 114 +++++++++++++++++++++ |
13 |
.../biboumi-9.0-fix-namespace-separator.patch | 57 +++++++++++ |
14 |
2 files changed, 171 insertions(+) |
15 |
|
16 |
diff --git a/net-im/biboumi/biboumi-9.0-r3.ebuild b/net-im/biboumi/biboumi-9.0-r3.ebuild |
17 |
new file mode 100644 |
18 |
index 000000000000..90caef48feda |
19 |
--- /dev/null |
20 |
+++ b/net-im/biboumi/biboumi-9.0-r3.ebuild |
21 |
@@ -0,0 +1,114 @@ |
22 |
+# Copyright 2020-2022 Gentoo Authors |
23 |
+# Distributed under the terms of the GNU General Public License v2 |
24 |
+ |
25 |
+EAPI=8 |
26 |
+ |
27 |
+inherit cmake |
28 |
+ |
29 |
+MY_PV="${PV/_/-}" |
30 |
+ |
31 |
+DESCRIPTION="XMPP gateway to IRC" |
32 |
+HOMEPAGE="https://biboumi.louiz.org/" |
33 |
+SRC_URI="https://git.louiz.org/biboumi/snapshot/biboumi-${MY_PV}.tar.xz" |
34 |
+ |
35 |
+LICENSE="ZLIB" |
36 |
+SLOT="0" |
37 |
+KEYWORDS="~amd64" |
38 |
+IUSE="+idn postgres +sqlite +ssl systemd udns" |
39 |
+ |
40 |
+DEPEND=" |
41 |
+ dev-libs/expat |
42 |
+ virtual/libiconv |
43 |
+ sys-apps/util-linux |
44 |
+ sqlite? ( dev-db/sqlite:3 ) |
45 |
+ postgres? ( dev-db/postgresql:* ) |
46 |
+ idn? ( net-dns/libidn:= ) |
47 |
+ udns? ( net-libs/udns ) |
48 |
+ ssl? ( dev-libs/botan:2= ) |
49 |
+ !ssl? ( dev-libs/libgcrypt ) |
50 |
+ systemd? ( sys-apps/systemd:= ) |
51 |
+" |
52 |
+BDEPEND="dev-python/sphinx" |
53 |
+RDEPEND=" |
54 |
+ ${DEPEND} |
55 |
+ acct-user/biboumi |
56 |
+" |
57 |
+ |
58 |
+S="${WORKDIR}/${PN}-${MY_PV}" |
59 |
+ |
60 |
+DOCS=( README.rst CHANGELOG.rst doc/user.rst ) |
61 |
+ |
62 |
+PATCHES=( |
63 |
+ "${FILESDIR}/${PN}-9.0-fix-namespace-separator.patch" |
64 |
+) |
65 |
+ |
66 |
+src_configure() { |
67 |
+ local mycmakeargs=( |
68 |
+ -DSERVICE_USER="${PN}" |
69 |
+ -DSERVICE_GROUP="${PN}" |
70 |
+ ) |
71 |
+ |
72 |
+ # Account for biboumi's atypical configuration system. |
73 |
+ if use systemd; then |
74 |
+ mycmakeargs+=(-DWITH_SYSTEMD=yes) |
75 |
+ else |
76 |
+ mycmakeargs+=(-DWITHOUT_SYSTEMD=yes) |
77 |
+ fi |
78 |
+ |
79 |
+ if use idn; then |
80 |
+ mycmakeargs+=(-DWITH_LIBIDN=yes) |
81 |
+ else |
82 |
+ mycmakeargs+=(-DWITHOUT_LIBIDN=yes) |
83 |
+ fi |
84 |
+ |
85 |
+ if use ssl; then |
86 |
+ mycmakeargs+=(-DWITH_BOTAN=yes) |
87 |
+ else |
88 |
+ mycmakeargs+=(-DWITHOUT_BOTAN=yes) |
89 |
+ fi |
90 |
+ |
91 |
+ if use udns; then |
92 |
+ mycmakeargs+=(-DWITH_UDNS=yes) |
93 |
+ else |
94 |
+ mycmakeargs+=(-DWITHOUT_UDNS=yes) |
95 |
+ fi |
96 |
+ |
97 |
+ if use sqlite; then |
98 |
+ mycmakeargs+=(-DWITH_SQLITE3=yes) |
99 |
+ else |
100 |
+ mycmakeargs+=(-DWITHOUT_SQLITE3=yes) |
101 |
+ fi |
102 |
+ |
103 |
+ if use postgres; then |
104 |
+ mycmakeargs+=(-DWITH_POSTGRESQL=yes) |
105 |
+ else |
106 |
+ mycmakeargs+=(-DWITHOUT_POSTGRESQL=yes) |
107 |
+ fi |
108 |
+ |
109 |
+ cmake_src_configure |
110 |
+} |
111 |
+ |
112 |
+src_compile() { |
113 |
+ cmake_src_compile |
114 |
+ |
115 |
+ cmake_build man |
116 |
+} |
117 |
+ |
118 |
+src_install() { |
119 |
+ cmake_src_install |
120 |
+ |
121 |
+ newinitd "${FILESDIR}/${PN}.initd" "${PN}" |
122 |
+ |
123 |
+ insinto /etc/logrotate.d |
124 |
+ newins "${FILESDIR}/${PN}.logrotate" "${PN}" |
125 |
+ |
126 |
+ diropts --owner=biboumi --group=biboumi --mode=750 |
127 |
+ if use sqlite; then |
128 |
+ keepdir /var/lib/biboumi |
129 |
+ fi |
130 |
+ keepdir /var/log/biboumi |
131 |
+ |
132 |
+ insinto /etc/biboumi |
133 |
+ insopts --group=biboumi --mode=640 |
134 |
+ newins conf/biboumi.cfg biboumi.cfg.example |
135 |
+} |
136 |
|
137 |
diff --git a/net-im/biboumi/files/biboumi-9.0-fix-namespace-separator.patch b/net-im/biboumi/files/biboumi-9.0-fix-namespace-separator.patch |
138 |
new file mode 100644 |
139 |
index 000000000000..507382f66f67 |
140 |
--- /dev/null |
141 |
+++ b/net-im/biboumi/files/biboumi-9.0-fix-namespace-separator.patch |
142 |
@@ -0,0 +1,57 @@ |
143 |
+From 380abf66e930f5c4ead591014f31624d80a3151c Mon Sep 17 00:00:00 2001 |
144 |
+From: Florian Schmaus <flo@×××××××××.eu> |
145 |
+Date: Sat, 26 Feb 2022 21:41:34 +0100 |
146 |
+Subject: [PATCH] Fix bad namespace separator |
147 |
+ |
148 |
+Fixes: https://lab.louiz.org/louiz/biboumi/-/issues/3465 |
149 |
+--- |
150 |
+ src/xmpp/xmpp_parser.cpp | 2 +- |
151 |
+ src/xmpp/xmpp_parser.hpp | 4 ++-- |
152 |
+ src/xmpp/xmpp_stanza.cpp | 2 +- |
153 |
+ 3 files changed, 4 insertions(+), 4 deletions(-) |
154 |
+ |
155 |
+diff --git a/src/xmpp/xmpp_parser.cpp b/src/xmpp/xmpp_parser.cpp |
156 |
+index 781fe4cd94b0..1f25fa6f982b 100644 |
157 |
+--- a/src/xmpp/xmpp_parser.cpp |
158 |
++++ b/src/xmpp/xmpp_parser.cpp |
159 |
+@@ -38,7 +38,7 @@ XmppParser::XmppParser(): |
160 |
+ void XmppParser::init_xml_parser() |
161 |
+ { |
162 |
+ // Create the expat parser |
163 |
+- this->parser = XML_ParserCreateNS("UTF-8", ':'); |
164 |
++ this->parser = XML_ParserCreateNS("UTF-8", '\1'); |
165 |
+ XML_SetUserData(this->parser, static_cast<void*>(this)); |
166 |
+ |
167 |
+ // Install Expat handlers |
168 |
+diff --git a/src/xmpp/xmpp_parser.hpp b/src/xmpp/xmpp_parser.hpp |
169 |
+index ec42f9a326e1..1e5e4e55a875 100644 |
170 |
+--- a/src/xmpp/xmpp_parser.hpp |
171 |
++++ b/src/xmpp/xmpp_parser.hpp |
172 |
+@@ -18,9 +18,9 @@ |
173 |
+ * stanza is reasonnably short. |
174 |
+ * |
175 |
+ * The element names generated by expat contain the namespace of the |
176 |
+- * element, a colon (':') and then the actual name of the element. To get |
177 |
++ * element, a \1 separator and then the actual name of the element. To get |
178 |
+ * an element "x" with a namespace of "http://jabber.org/protocol/muc", you |
179 |
+- * just look for an XmlNode named "http://jabber.org/protocol/muc:x" |
180 |
++ * just look for an XmlNode named "http://jabber.org/protocol/muc\1x" |
181 |
+ * |
182 |
+ * TODO: enforce the size-limit for the stanza (limit the number of childs |
183 |
+ * it can contain). For example forbid the parser going further than level |
184 |
+diff --git a/src/xmpp/xmpp_stanza.cpp b/src/xmpp/xmpp_stanza.cpp |
185 |
+index 435f33313b09..bd668cf2f28d 100644 |
186 |
+--- a/src/xmpp/xmpp_stanza.cpp |
187 |
++++ b/src/xmpp/xmpp_stanza.cpp |
188 |
+@@ -52,7 +52,7 @@ XmlNode::XmlNode(const std::string& name, XmlNode* parent): |
189 |
+ parent(parent) |
190 |
+ { |
191 |
+ // split the namespace and the name |
192 |
+- auto n = name.rfind(':'); |
193 |
++ auto n = name.rfind('\1'); |
194 |
+ if (n == std::string::npos) |
195 |
+ this->name = name; |
196 |
+ else |
197 |
+-- |
198 |
+2.34.1 |
199 |
+ |