Skip to content
Snippets Groups Projects
Verified Commit 01a7d53e authored by Robin Candau's avatar Robin Candau
Browse files

upgpkg: 6.4.9-1: New upstream release + Add patch to fix build against libxml2

Fixes #1
parent aa6049e0
No related branches found
No related tags found
No related merge requests found
pkgbase = zabbix
pkgver = 6.4.8
pkgrel = 2
pkgver = 6.4.9
pkgrel = 1
url = https://www.zabbix.com/
arch = x86_64
license = GPL
......@@ -15,7 +15,7 @@ pkgbase = zabbix
makedepends = pkgconfig
makedepends = pcre2
makedepends = openipmi
source = https://cdn.zabbix.com/zabbix/sources/stable/6.4/zabbix-6.4.8.tar.gz
source = https://cdn.zabbix.com/zabbix/sources/stable/6.4/zabbix-6.4.9.tar.gz
source = zabbix-agent.service
source = zabbix-agent.sysusers
source = zabbix-agent.tmpfiles
......@@ -32,7 +32,8 @@ pkgbase = zabbix
source = zabbix-web-service.service
source = zabbix-web-service.sysusers
source = zabbix-web-service.tmpfiles
sha512sums = 712e9f3fdb772475137c7238e8ca26f510180c147b7aa74b29567033f62d4beb00275b96aaf05c978fec341b08c82102ecf1976a5e8af257e848ae3974a6fec9
source = fix-build-with-libxml2.patch
sha512sums = 3caa35ddc5abb6bcdfb2d7e24cb20d27caf2974dbc8897ac8d44b8f4935576bbf00a7a5f962229dd6c7a439f826e292b02d777276264eaaccf870e2dc5440813
sha512sums = 8c1fa2676bc0ef91bc39ec5f97b4d3ba5c365d063420455a3785121a54e120bc5afeacde42a48f4509c115f940dcc3b6c2f43044a7fbfb421182fc93b22a2444
sha512sums = 3ab3ac1acc7e35c8896157aef601ebc30815237ac5252cbd0c1ecb26eeaf9eccf5c49938ae8c85bb79a6f95f607f082f6b80ed660829599ec03aa626cca6d3dc
sha512sums = ca6b4779de23829dfdd80ee21e924fbe4e2754f4e693bed4b1a2aa846cd87d150e399b1169d7fe58d30c50ed837c1b8254e580de420267d0a1834d6dc409c43d
......@@ -49,6 +50,7 @@ pkgbase = zabbix
sha512sums = 545bb284ac28386f8b9f33f0c5066bb73b3634fab8760861bc172fe83897f22e54ecaf186970f0ef178256c9ff152a3e806636145a77af78964f7af0fdcec1a1
sha512sums = 2766787aaeef2f48909c52deb411b47971931a972282f701c401f8315264c8817fc1f9f49a2672152c78a0ebba7d72329c18b441e134c5ec3db5f12681b6e590
sha512sums = 309f55c8c381364eca6d31c4709a0ebb7e04cefad9e51f44173d839a58e7f8e95e3c678922f9e1fe42cff90dba5144cc7ee3a6e1c236b079b501c0e08ad2152d
sha512sums = 1e29dd44ac8b51b768352bdfbb4176f2ea82fa2a0887fd59ab2f114874745833a013874896850fce515e25ae56f39d16192b27f3044319725e8f77c6f64c00e5
pkgname = zabbix-server
pkgdesc = Monitoring software for networks and applications
......
......@@ -4,8 +4,8 @@
pkgbase=zabbix
pkgname=(zabbix-server zabbix-agent{,2} zabbix-proxy zabbix-frontend-php zabbix-web-service)
pkgver=6.4.8
pkgrel=2
pkgver=6.4.9
pkgrel=1
arch=(x86_64)
url='https://www.zabbix.com/'
license=(GPL)
......@@ -15,9 +15,10 @@ source=("https://cdn.zabbix.com/zabbix/sources/stable/${pkgver%.*}/zabbix-${pkgv
zabbix-agent2.service
zabbix-server{-mysql,-pgsql}.service zabbix-server.{sysusers,tmpfiles}
zabbix-proxy{-sqlite,-mysql,-pgsql}.service zabbix-proxy.{sysusers,tmpfiles}
zabbix-web-service.{service,sysusers,tmpfiles})
zabbix-web-service.{service,sysusers,tmpfiles}
fix-build-with-libxml2.patch)
sha512sums=('712e9f3fdb772475137c7238e8ca26f510180c147b7aa74b29567033f62d4beb00275b96aaf05c978fec341b08c82102ecf1976a5e8af257e848ae3974a6fec9'
sha512sums=('3caa35ddc5abb6bcdfb2d7e24cb20d27caf2974dbc8897ac8d44b8f4935576bbf00a7a5f962229dd6c7a439f826e292b02d777276264eaaccf870e2dc5440813'
'8c1fa2676bc0ef91bc39ec5f97b4d3ba5c365d063420455a3785121a54e120bc5afeacde42a48f4509c115f940dcc3b6c2f43044a7fbfb421182fc93b22a2444'
'3ab3ac1acc7e35c8896157aef601ebc30815237ac5252cbd0c1ecb26eeaf9eccf5c49938ae8c85bb79a6f95f607f082f6b80ed660829599ec03aa626cca6d3dc'
'ca6b4779de23829dfdd80ee21e924fbe4e2754f4e693bed4b1a2aa846cd87d150e399b1169d7fe58d30c50ed837c1b8254e580de420267d0a1834d6dc409c43d'
......@@ -33,7 +34,8 @@ sha512sums=('712e9f3fdb772475137c7238e8ca26f510180c147b7aa74b29567033f62d4beb002
'64042ddf511b56b2a5a311e34643f4e049c09d909ea65b7343a8a9637f33dc59f2b1342201290ca0774cbcbf616096b3696982047fb622b7d51afb5eceb298dd'
'545bb284ac28386f8b9f33f0c5066bb73b3634fab8760861bc172fe83897f22e54ecaf186970f0ef178256c9ff152a3e806636145a77af78964f7af0fdcec1a1'
'2766787aaeef2f48909c52deb411b47971931a972282f701c401f8315264c8817fc1f9f49a2672152c78a0ebba7d72329c18b441e134c5ec3db5f12681b6e590'
'309f55c8c381364eca6d31c4709a0ebb7e04cefad9e51f44173d839a58e7f8e95e3c678922f9e1fe42cff90dba5144cc7ee3a6e1c236b079b501c0e08ad2152d')
'309f55c8c381364eca6d31c4709a0ebb7e04cefad9e51f44173d839a58e7f8e95e3c678922f9e1fe42cff90dba5144cc7ee3a6e1c236b079b501c0e08ad2152d'
'1e29dd44ac8b51b768352bdfbb4176f2ea82fa2a0887fd59ab2f114874745833a013874896850fce515e25ae56f39d16192b27f3044319725e8f77c6f64c00e5')
prepare() {
cd $pkgbase-$pkgver
......@@ -43,6 +45,10 @@ prepare() {
conf/zabbix_{agentd,proxy,server}.conf src/go/conf/zabbix_web_service.conf
autoreconf -fi
# Temporary patch to fix build against libxml2
# See https://support.zabbix.com/browse/ZBX-23738
patch -Np1 <${srcdir}/fix-build-with-libxml2.patch
}
build() {
......
diff --git a/ChangeLog.d/bugfix/ZBX-23738 b/ChangeLog.d/bugfix/ZBX-23738
new file mode 100644
index 0000000..f7c7dd5
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-23738
@@ -0,0 +1 @@
+.......PS. [ZBX-23738] fixed Zabbix backend sources for libxml2 2.12.0 version changes (akozlovs)
diff --git a/m4/libxml2.m4 b/m4/libxml2.m4
index b0a3c77..282d3b6 100644
--- a/m4/libxml2.m4
+++ b/m4/libxml2.m4
@@ -30,10 +30,13 @@ AS_HELP_STRING([--with-libxml2@<:@=ARG@:>@],
[
if test "$withval" = "no"; then
want_libxml2="no"
+ _libxml2_with="no"
elif test "$withval" = "yes"; then
want_libxml2="yes"
+ _libxml2_with="yes"
else
want_libxml2="yes"
+ _libxml2_with=$withval
fi
],
[want_libxml2="no"]
@@ -49,27 +52,43 @@ AS_HELP_STRING([--with-libxml2@<:@=ARG@:>@],
dnl
if test "$want_libxml2" = "yes"; then
- AC_REQUIRE([PKG_PROG_PKG_CONFIG])
- m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG()], [:])
+ if test "$_libxml2_with" != "yes"; then
+ XML2_INCDIR=$_libxml2_with/include
+ XML2_LIBDIR=$_libxml2_with/lib
+ LIBXML2_CFLAGS="-I$XML2_INCDIR"
+ LIBXML2_LDFLAGS="-L$XML2_LIBDIR"
+ _full_libxml2_libs=$LIBXML2_LDFLAGS
+ configured_libxml2="yes"
+ else
+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG()], [:])
+
+ if test -x "$PKG_CONFIG"; then
- if test -x "$PKG_CONFIG"; then
+ LIBXML2_CFLAGS="`$PKG_CONFIG --cflags libxml-2.0`"
- LIBXML2_CFLAGS="`$PKG_CONFIG --cflags libxml-2.0`"
+ _full_libxml2_libs="`$PKG_CONFIG --libs libxml-2.0`"
+
+ for i in $_full_libxml2_libs; do
+ case $i in
+ -lxml2)
+ ;;
+ -L*)
+ LIBXML2_LDFLAGS="${LIBXML2_LDFLAGS} $i"
+ ;;
+ -R*)
+ LIBXML2_LDFLAGS="${LIBXML2_LDFLAGS} -Wl,$i"
+ ;;
+ esac
+ done
- _full_libxml2_libs="`$PKG_CONFIG --libs libxml-2.0`"
+ configured_libxml2="yes"
+ else
+ configured_libxml2="no"
+ fi
+ fi
- for i in $_full_libxml2_libs; do
- case $i in
- -lxml2)
- ;;
- -L*)
- LIBXML2_LDFLAGS="${LIBXML2_LDFLAGS} $i"
- ;;
- -R*)
- LIBXML2_LDFLAGS="${LIBXML2_LDFLAGS} -Wl,$i"
- ;;
- esac
- done
+ if test "$configured_libxml2" = "yes"; then
if test "x$enable_static" = "xyes"; then
for i in $_full_libxml2_libs; do
@@ -88,6 +107,20 @@ AS_HELP_STRING([--with-libxml2@<:@=ARG@:>@],
done
fi
+ if test "$_libxml2_with" != "yes"; then
+ if test -f $_libxml2_with/include/libxml2/libxml/xmlversion.h; then
+ LIBXML2_VERSION=`cat $_libxml2_with/include/libxml2/libxml/xmlversion.h \
+ | grep '#define.*LIBXML_DOTTED_VERSION.*' \
+ | sed -e 's/#define LIBXML_DOTTED_VERSION *//' \
+ | sed -e 's/ *\/\*.*\*\///' \
+ | sed -e 's/\"//g'`
+ else
+ AC_MSG_ERROR([Not found libxml2 library])
+ fi
+ else
+ LIBXML2_VERSION=`$PKG_CONFIG --version libxml-2.0`
+ fi
+
_save_libxml2_libs="${LIBS}"
_save_libxml2_ldflags="${LDFLAGS}"
_save_libxml2_cflags="${CFLAGS}"
@@ -96,7 +129,7 @@ AS_HELP_STRING([--with-libxml2@<:@=ARG@:>@],
CFLAGS="${CFLAGS} ${LIBXML2_CFLAGS}"
AC_CHECK_LIB(xml2, xmlReadMemory, [
- LIBXML2_LIBS="-lxml2 ${LIBXML2_LIBS}"
+ LIBXML2_LIBS="${LIBXML2_LIBS} -lxml2"
],[
AC_MSG_ERROR([Not found libxml2 library])
])
@@ -108,8 +141,6 @@ AS_HELP_STRING([--with-libxml2@<:@=ARG@:>@],
unset _save_libxml2_ldflags
unset _save_libxml2_cflags
- LIBXML2_VERSION=`$PKG_CONFIG --version libxml-2.0`
-
AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if libxml2 libraries are available])
found_libxml2="yes"
diff --git a/src/libs/zbxpreproc/item_preproc.c b/src/libs/zbxpreproc/item_preproc.c
index 88f94c6..8921b2d 100644
--- a/src/libs/zbxpreproc/item_preproc.c
+++ b/src/libs/zbxpreproc/item_preproc.c
@@ -27,6 +27,7 @@
#include "zbxxml.h"
#ifdef HAVE_LIBXML2
# include <libxml/xpath.h>
+# include <libxml/parser.h>
#endif
#include "zbxnum.h"
@@ -896,7 +897,7 @@ int item_preproc_get_error_from_xml(const zbx_variant_t *value, const char *para
xmlDoc *doc = NULL;
xmlXPathContext *xpathCtx = NULL;
xmlXPathObject *xpathObj = NULL;
- xmlErrorPtr pErr;
+ const xmlError *pErr;
xmlBufferPtr xmlBufferLocal;
zbx_variant_copy(&value_str, value);
diff --git a/src/libs/zbxpreproc/pp_manager.c b/src/libs/zbxpreproc/pp_manager.c
index 9959a9f..a39f95d 100644
--- a/src/libs/zbxpreproc/pp_manager.c
+++ b/src/libs/zbxpreproc/pp_manager.c
@@ -34,6 +34,7 @@
#ifdef HAVE_LIBXML2
# include <libxml/xpath.h>
+# include <libxml/parser.h>
#endif
#define PP_STARTUP_TIMEOUT 10
diff --git a/src/libs/zbxxml/xml.c b/src/libs/zbxxml/xml.c
index 00eadce..7763be8 100644
--- a/src/libs/zbxxml/xml.c
+++ b/src/libs/zbxxml/xml.c
@@ -27,6 +27,7 @@
#ifdef HAVE_LIBXML2
# include <libxml/xpath.h>
+# include <libxml/parser.h>
#endif
typedef struct _zbx_xml_node_t zbx_xml_node_t;
@@ -282,7 +283,7 @@ int zbx_query_xpath(zbx_variant_t *value, const char *params, char **errmsg)
xmlXPathContext *xpathCtx;
xmlXPathObject *xpathObj;
xmlNodeSetPtr nodeset;
- xmlErrorPtr pErr;
+ const xmlError *pErr;
xmlBufferPtr xmlBufferLocal;
if (NULL == (doc = xmlReadMemory(value->data.str, strlen(value->data.str), "noname.xml", NULL, 0)))
@@ -638,7 +639,7 @@ static void vector_to_json(zbx_vector_xml_node_ptr_t *nodes, struct zbx_json *js
******************************************************************************/
int zbx_open_xml(char *data, int options, int maxerrlen, void **xml_doc, void **root_node, char **errmsg)
{
- xmlErrorPtr pErr;
+ const xmlError *pErr;
if (NULL == (*xml_doc = xmlReadMemory(data, strlen(data), "noname.xml", NULL, options)))
{
@@ -694,7 +695,7 @@ int zbx_open_xml(char *data, int options, int maxerrlen, void **xml_doc, void **
******************************************************************************/
int zbx_check_xml_memory(char *mem, int maxerrlen, char **errmsg)
{
- xmlErrorPtr pErr;
+ const xmlError *pErr;
if (NULL == mem)
{
@@ -949,7 +950,7 @@ int zbx_json_to_xml(char *json_data, char **xstr, char **errmsg)
int size, ret = FAIL;
struct zbx_json_parse jp;
xmlDoc *doc = NULL;
- xmlErrorPtr pErr;
+ const xmlError *pErr;
xmlChar *xmem;
if (NULL == (doc = xmlNewDoc(BAD_CAST XML_DEFAULT_VERSION)))
@@ -1005,7 +1006,11 @@ zbx_libxml_error_t;
* err - [IN] the libxml2 error message *
* *
******************************************************************************/
+#if 21200 > LIBXML_VERSION /* version 2.12.0 */
static void libxml_handle_error_xpath_check(void *user_data, xmlErrorPtr err)
+#else
+static void libxml_handle_error_xpath_check(void *user_data, const xmlError *err)
+#endif
{
zbx_libxml_error_t *err_ctx;
@@ -1155,7 +1160,11 @@ out:
* err - [IN] the libxml2 error message *
* *
******************************************************************************/
+#if 21200 > LIBXML_VERSION /* version 2.12.0 */
static void libxml_handle_error_try_read_value(void *user_data, xmlErrorPtr err)
+#else
+static void libxml_handle_error_try_read_value(void *user_data, const xmlError *err)
+#endif
{
ZBX_UNUSED(user_data);
ZBX_UNUSED(err);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment