[packages/jabberd] - rel 4 - C99 fixes from fedora - fix building with newer myslq

baggins baggins at pld-linux.org
Fri Dec 5 09:50:31 CET 2025


commit ff5753351e348f3012cecbcf5dbaf807627d17dc
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Fri Dec 5 11:50:05 2025 +0100

    - rel 4
    - C99 fixes from fedora
    - fix building with newer myslq

 jabberd-c99.patch | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 jabberd.spec      |  14 +++---
 mysql84.patch     |  22 +++++++++
 3 files changed, 163 insertions(+), 5 deletions(-)
---
diff --git a/jabberd.spec b/jabberd.spec
index a925cb7..2d898d3 100644
--- a/jabberd.spec
+++ b/jabberd.spec
@@ -17,7 +17,7 @@ Summary:	Jabber/XMPP server
 Summary(pl.UTF-8):	Serwer Jabber/XMPP
 Name:		jabberd
 Version:	2.7.0
-Release:	3
+Release:	4
 License:	GPL v2+
 Group:		Applications/Communications
 Source0:	https://github.com/jabberd2/jabberd2/releases/download/jabberd-%{version}/%{name}-%{version}.tar.xz
@@ -29,6 +29,8 @@ Patch1:		%{name}-daemonize.patch
 Patch2:		%{name}-default_config.patch
 Patch4:		%{name}-delay_jobs.patch
 Patch5:		%{name}-binary_path.patch
+Patch6:		%{name}-c99.patch
+Patch7:		mysql84.patch
 #bcond bxmpp
 Patch22:	http://www.marquard.net/jabber/patches/patch-flash-v2
 URL:		http://jabberd2.org/
@@ -79,6 +81,8 @@ protokół XMPP.
 %patch -P2 -p1
 %patch -P4 -p1
 %patch -P5 -p1
+%patch -P6 -p1
+%patch -P7 -p1
 
 %if %{with bxmpp}
 %patch -P22 -p0
@@ -171,10 +175,10 @@ fi
 %attr(755,root,root) %{_libdir}/%{name}/router
 %attr(755,root,root) %{_libdir}/%{name}/s2s
 %attr(755,root,root) %{_libdir}/%{name}/sm
-%attr(755,root,root) %{_libdir}/%{name}/libstorage.so*
-%attr(755,root,root) %{_libdir}/%{name}/authreg_*.so*
-%attr(755,root,root) %{_libdir}/%{name}/mod_*.so*
-%attr(755,root,root) %{_libdir}/%{name}/storage_*.so*
+%{_libdir}/%{name}/libstorage.so*
+%{_libdir}/%{name}/authreg_*.so*
+%{_libdir}/%{name}/mod_*.so*
+%{_libdir}/%{name}/storage_*.so*
 # XXX: are these needed?
 %{_libdir}/%{name}/*.la
 %dir %attr(770,root,jabber) /var/lib/%{name}
diff --git a/jabberd-c99.patch b/jabberd-c99.patch
new file mode 100644
index 0000000..5515359
--- /dev/null
+++ b/jabberd-c99.patch
@@ -0,0 +1,132 @@
+diff --git a/configure b/configure
+index 551a963ae06a3624..06ba2c4ebde3e9ab 100755
+--- a/configure
++++ b/configure
+@@ -16341,8 +16341,9 @@ else
+ /* end confdefs.h.  */
+ #include <stdio.h>
+                                     #include <signal.h>
+-                                    segv() { exit(1); }
+-                                    main() { char b[10]; signal(SIGSEGV,segv); snprintf(b,10,"%s",NULL); exit(0); }
++                                    #include <stdlib.h>
++                                    void segv() { exit(1); }
++                                    int main() { char b[10]; signal(SIGSEGV,segv); snprintf(b,10,"%s",NULL); exit(0); }
+ _ACEOF
+ if ac_fn_c_try_run "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+@@ -16373,9 +16374,10 @@ else
+ #include <stdio.h>
+                                     #include <signal.h>
+                                     #include <stdarg.h>
+-                                    segv() { exit(1); }
+-                                    expand(char *f,...) { va_list ap; char b[10]; va_start(ap,f); vsnprintf(b,10,f,ap); va_end(ap); }
+-                                    main() { char b[10]; signal(SIGSEGV,segv); expand("%s", NULL); exit(0); }
++                                    #include <stdlib.h>
++                                    void segv() { exit(1); }
++                                    void expand(char *f,...) { va_list ap; char b[10]; va_start(ap,f); vsnprintf(b,10,f,ap); va_end(ap); }
++                                    int main() { char b[10]; signal(SIGSEGV,segv); expand("%s", NULL); exit(0); }
+ _ACEOF
+ if ac_fn_c_try_run "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+diff --git a/configure.ac b/configure.ac
+index af173540785271fd..071933830f3676b2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -323,8 +323,9 @@ if test "x-$ac_cv_func_snprintf" = "x-yes" ; then
+     AC_MSG_CHECKING([if snprintf can handle NULL arguments])
+     AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
+                                     #include <signal.h>
+-                                    segv() { exit(1); }
+-                                    main() { char b[10]; signal(SIGSEGV,segv); snprintf(b,10,"%s",NULL); exit(0); }]])],
++                                    #include <stdlib.h>
++                                    void segv() { exit(1); }
++                                    int main() { char b[10]; signal(SIGSEGV,segv); snprintf(b,10,"%s",NULL); exit(0); }]])],
+                   AC_MSG_RESULT(yes),
+                   [AC_MSG_RESULT(no)
+                    AC_DEFINE(HAVE_BROKEN_SNPRINTF,1,[Define to 1 if 'snprintf' cannot handle NULL arguments.])])
+@@ -334,9 +335,10 @@ if test "x-$ac_cv_func_vsnprintf" = "x-yes" ; then
+     AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
+                                     #include <signal.h>
+                                     #include <stdarg.h>
+-                                    segv() { exit(1); }
+-                                    expand(char *f,...) { va_list ap; char b[10]; va_start(ap,f); vsnprintf(b,10,f,ap); va_end(ap); }
+-                                    main() { char b[10]; signal(SIGSEGV,segv); expand("%s", NULL); exit(0); }]])],
++                                    #include <stdlib.h>
++                                    void segv() { exit(1); }
++                                    void expand(char *f,...) { va_list ap; char b[10]; va_start(ap,f); vsnprintf(b,10,f,ap); va_end(ap); }
++                                    int main() { char b[10]; signal(SIGSEGV,segv); expand("%s", NULL); exit(0); }]])],
+                   AC_MSG_RESULT(yes),
+                   [AC_MSG_RESULT(no)
+                    AC_DEFINE(HAVE_BROKEN_VSNPRINTF,1,[Define to 1 if 'vsnprintf' cannot handle NULL arguments.])])
+diff --git a/storage/authreg_ldapfull.c b/storage/authreg_ldapfull.c
+index 6dbf202bf8627925..a545ad1dcb6cccb9 100644
+--- a/storage/authreg_ldapfull.c
++++ b/storage/authreg_ldapfull.c
+@@ -35,6 +35,7 @@
+ #ifdef STORAGE_LDAP
+ #ifdef HAVE_CRYPT
+ #include <unistd.h>
++#include <crypt.h>
+ #endif
+ 
+ #ifdef HAVE_SSL
+diff --git a/storage/authreg_mysql.c b/storage/authreg_mysql.c
+index 0b35d6ddfd40c3af..5e15143837e66c08 100644
+--- a/storage/authreg_mysql.c
++++ b/storage/authreg_mysql.c
+@@ -34,6 +34,7 @@
+ #else
+ #ifdef HAVE_CRYPT
+ #include <unistd.h>
++#include <crypt.h>
+ #endif
+ #endif
+ 
+diff --git a/storage/authreg_pgsql.c b/storage/authreg_pgsql.c
+index 446fa1f8217b162a..1065c5d35b629737 100644
+--- a/storage/authreg_pgsql.c
++++ b/storage/authreg_pgsql.c
+@@ -32,6 +32,7 @@
+ #else
+ #ifdef HAVE_CRYPT
+ #include <unistd.h>
++#include <crypt.h>
+ #endif
+ #endif
+ 
+diff --git a/storage/authreg_sqlite.c b/storage/authreg_sqlite.c
+index 25058ee639238a91..dcd4cadba3504fa5 100644
+--- a/storage/authreg_sqlite.c
++++ b/storage/authreg_sqlite.c
+@@ -41,6 +41,7 @@
+ #else
+ #ifdef HAVE_CRYPT
+ #include <unistd.h>
++#include <crypt.h>
+ #endif
+ #endif
+ 
+diff --git a/sx/websocket.c b/sx/websocket.c
+index b08e135f4966c592..4df051559850dfe1 100644
+--- a/sx/websocket.c
++++ b/sx/websocket.c
+@@ -22,6 +22,7 @@
+  * http://tools.ietf.org/html/rfc7395
+  */
+ 
++#define _GNU_SOURCE
+ #include "sx.h"
+ #include <stdarg.h>
+ #include <string.h>
+diff --git a/util/crypt_blowfish.h b/util/crypt_blowfish.h
+index d81e8cbdea9473d0..8ba1a917a84e9276 100644
+--- a/util/crypt_blowfish.h
++++ b/util/crypt_blowfish.h
+@@ -23,7 +23,6 @@
+ #endif
+ 
+ extern char *bcrypt(__const char *key, __const char *setting);
+-extern char *crypt_r(__const char *key, __const char *setting, void *data);
+ 
+ #ifndef __SKIP_OW
+ extern char *crypt_rn(__const char *key, __const char *setting,
diff --git a/mysql84.patch b/mysql84.patch
new file mode 100644
index 0000000..ff22157
--- /dev/null
+++ b/mysql84.patch
@@ -0,0 +1,22 @@
+--- jabberd-2.7.0/storage/authreg_mysql.c.orig	2025-12-05 11:44:29.000000000 +0100
++++ jabberd-2.7.0/storage/authreg_mysql.c	2025-12-05 11:46:46.116654091 +0100
+@@ -489,7 +489,7 @@
+     mysqlcontext_t mysqlcontext;
+     int fail = 0;
+     /* enable reconnect */
+-    my_bool reconnect= 1;
++    bool reconnect= 1;
+ 
+     /* configure the database context with field names and SQL statements */
+     mysqlcontext = (mysqlcontext_t) malloc( sizeof( struct mysqlcontext_st ) );
+--- jabberd-2.7.0/storage/storage_mysql.c~	2018-04-22 11:41:35.000000000 +0200
++++ jabberd-2.7.0/storage/storage_mysql.c	2025-12-05 11:47:16.593320763 +0100
+@@ -585,7 +585,7 @@
+     MYSQL *conn;
+     drvdata_t data;
+     /* enable reconnect */
+-    my_bool reconnect= 1;
++    bool reconnect= 1;
+ 
+     host = config_get_one(drv->st->config, "storage.mysql.host", 0);
+     port = config_get_one(drv->st->config, "storage.mysql.port", 0);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/jabberd.git/commitdiff/ff5753351e348f3012cecbcf5dbaf807627d17dc




More information about the pld-cvs-commit mailing list