Fixed handling of libJudy bundling for RPM packages. (#9875)
Austin S. Hemmelgarn committed
Sep 4, 2020 at 18:04 UTC
4f108b1ff259c66dacfce11306ca885b99a57b56
4 files changed
+37
Makefile.am
+1
@@ -74,6 +74,7 @@ dist_noinst_DATA = \
74
packaging/mosquitto.checksums \
75
packaging/bundle-dashboard.sh \
76
packaging/bundle-ebpf.sh \
77
+ packaging/bundle-judy.sh \
78
packaging/bundle-libbpf.sh \
79
packaging/bundle-mosquitto.sh \
80
packaging/check-kernel-config.sh \
netdata.spec.in
+12
@@ -132,9 +132,14 @@ BuildRequires: judy-devel
132
BuildRequires: liblz4-devel
133
BuildRequires: libjson-c-devel
134
%else
135
+%if 0%{?fedora}
136
BuildRequires: Judy-devel
137
BuildRequires: lz4-devel
138
BuildRequires: json-c-devel
139
+%else
140
+BuildRequires: lz4-devel
141
+BuildRequires: json-c-devel
142
+%endif
143
%endif
144
145
# Core build requirements for service install
@@ -245,6 +250,10 @@ happened, on your systems and applications.
250
%setup -q -n %{name}-%{version}
251
export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-mosquitto.sh ${RPM_BUILD_DIR}/%{name}-%{version}
252
export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-lws.sh ${RPM_BUILD_DIR}/%{name}-%{version}
253
+# Only bundle libJudy if this isn't Fedora or SUSE
254
+%if 0%{!?fedora:1} && 0%{!?suse_version:1}
255
+export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-judy.sh ${RPM_BUILD_DIR}/%{name}-%{version}
256
+%endif
257
%if 0%{?have_bpf}
258
export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-libbpf.sh ${RPM_BUILD_DIR}/%{name}-%{version}
259
%endif
@@ -253,6 +262,9 @@ export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging
262
# Conf step
263
autoreconf -ivf
264
%configure \
265
+ %if 0%{!?fedora:1} && 0%{!?suse_version:1}
266
+ --with-libjudy=externaldeps/libJudy
267
+ %endif
268
--prefix="%{_prefix}" \
269
--sysconfdir="%{_sysconfdir}" \
270
--localstatedir="%{_localstatedir}" \
packaging/bundle-judy.sh
new
+23
@@ -0,0 +1,23 @@
1
+#!/bin/sh
2
+
3
+JUDY_TARBALL="v$(cat "${1}/packaging/judy.version").tar.gz"
4
+JUDY_BUILD_PATH="${1}/externaldeps/libJudy/libjudy-$(cat "${1}/packaging/judy.version")"
5
+
6
+mkdir -p "${1}/externaldeps/libJudy" || exit 1
7
+curl -sSL --connect-timeout 10 --retry 3 "https://github.com/netdata/libjudy/archive/${JUDY_TARBALL}" > "${JUDY_TARBALL}" || exit 1
8
+sha256sum -c "${1}/packaging/judy.checksums" || exit 1
9
+tar -xzf "${JUDY_TARBALL}" -C "${1}/externaldeps/libJudy" || exit 1
10
+OLDPWD="${PWD}"
11
+cd "${JUDY_BUILD_PATH}" || exit 1
12
+libtoolize --force --copy || exit 1
13
+aclocal || exit 1
14
+autoheader || exit 1
15
+automake --add-missing --force --copy --include-deps || exit 1
16
+autoconf || exit 1
17
+./configure || exit 1
18
+make -C src || exit 1
19
+ar -r src/libJudy.a src/Judy*/*.o || exit 1
20
+cd "${OLDPWD}" || exit 1
21
+
22
+cp -a "${JUDY_BUILD_PATH}/src/libJudy.a" "${1}/externaldeps/libJudy" || exit 1
23
+cp -a "${JUDY_BUILD_PATH}/src/Judy.h" "${1}/externaldeps/libJudy" || exit 1
packaging/installer/install-required-packages.sh
+1
@@ -1131,6 +1131,7 @@ declare -A pkg_judy=(
1131
['gentoo']="dev-libs/judy"
1132
['arch']="judy"
1133
['freebsd']="Judy"
1134
+ ['fedora']="Judy-devel"
1135
['default']="NOTREQUIRED"
1136
)
1137