Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/multipath-tools/files/, sys-fs/multipath-tools/
Date: Sat, 02 May 2020 07:29:13
Message-Id: 1588404539.6e3a04d1532db375c74b38c71963316ef4a466f0.whissi@gentoo
1 commit: 6e3a04d1532db375c74b38c71963316ef4a466f0
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 2 07:28:43 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sat May 2 07:28:59 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e3a04d1
7
8 sys-fs/multipath-tools: add json-c-0.14 support
9
10 Closes: https://bugs.gentoo.org/720330
11 Package-Manager: Portage-2.3.99, Repoman-2.3.22
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 .../files/multipath-tools-0.8.3-json-c-0.14.patch | 28 +++++++
15 .../multipath-tools-0.8.3-r2.ebuild | 92 ++++++++++++++++++++++
16 2 files changed, 120 insertions(+)
17
18 diff --git a/sys-fs/multipath-tools/files/multipath-tools-0.8.3-json-c-0.14.patch b/sys-fs/multipath-tools/files/multipath-tools-0.8.3-json-c-0.14.patch
19 new file mode 100644
20 index 00000000000..34d02f7b5d7
21 --- /dev/null
22 +++ b/sys-fs/multipath-tools/files/multipath-tools-0.8.3-json-c-0.14.patch
23 @@ -0,0 +1,28 @@
24 +From 8438a9cd8d7ed88645fa8e6a8f19c0fd9ae872a7 Mon Sep 17 00:00:00 2001
25 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@×××××××××××××.org>
26 +Date: Mon, 13 Apr 2020 19:22:02 +0200
27 +Subject: [PATCH] Add support for upcoming json-c 0.14.0.
28 +
29 +TRUE/FALSE are not defined anymore. 1 and 0 are used instead.
30 +This is backwards compatible, as earlier versions of json-c are
31 +using the same integer values in their present definitions.
32 +---
33 + libdmmp/libdmmp_private.h | 2 +-
34 + 1 file changed, 1 insertion(+), 1 deletion(-)
35 +
36 +diff --git a/libdmmp/libdmmp_private.h b/libdmmp/libdmmp_private.h
37 +index ac85b63f..4378962b 100644
38 +--- a/libdmmp/libdmmp_private.h
39 ++++ b/libdmmp/libdmmp_private.h
40 +@@ -82,7 +82,7 @@ static out_type func_name(struct dmmp_context *ctx, const char *var_name) { \
41 + do { \
42 + json_type j_type = json_type_null; \
43 + json_object *j_obj_tmp = NULL; \
44 +- if (json_object_object_get_ex(j_obj, key, &j_obj_tmp) != TRUE) { \
45 ++ if (json_object_object_get_ex(j_obj, key, &j_obj_tmp) != 1) { \
46 + _error(ctx, "Invalid JSON output from multipathd IPC: " \
47 + "key '%s' not found", key); \
48 + rc = DMMP_ERR_IPC_ERROR; \
49 +--
50 +2.26.0
51 +
52
53 diff --git a/sys-fs/multipath-tools/multipath-tools-0.8.3-r2.ebuild b/sys-fs/multipath-tools/multipath-tools-0.8.3-r2.ebuild
54 new file mode 100644
55 index 00000000000..feb9ba35c84
56 --- /dev/null
57 +++ b/sys-fs/multipath-tools/multipath-tools-0.8.3-r2.ebuild
58 @@ -0,0 +1,92 @@
59 +# Copyright 1999-2020 Gentoo Authors
60 +# Distributed under the terms of the GNU General Public License v2
61 +
62 +EAPI="7"
63 +
64 +inherit linux-info systemd toolchain-funcs udev vcs-snapshot toolchain-funcs
65 +
66 +DESCRIPTION="Device mapper target autoconfig"
67 +HOMEPAGE="http://christophe.varoqui.free.fr/"
68 +SRC_URI="https://git.opensvc.com/?p=multipath-tools/.git;a=snapshot;h=${PV};sf=tgz -> ${P}.tar.gz"
69 +
70 +LICENSE="GPL-2"
71 +SLOT="0"
72 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86"
73 +IUSE="systemd rbd"
74 +
75 +BDEPEND="virtual/pkgconfig"
76 +
77 +RDEPEND="
78 + dev-libs/json-c:=
79 + dev-libs/libaio
80 + dev-libs/userspace-rcu:=
81 + >=sys-fs/lvm2-2.02.45
82 + >=virtual/libudev-232-r3
83 + sys-libs/readline:0=
84 + rbd? ( sys-cluster/ceph )
85 + systemd? ( sys-apps/systemd )
86 +"
87 +
88 +DEPEND="${RDEPEND}"
89 +
90 +CONFIG_CHECK="~DM_MULTIPATH"
91 +
92 +RESTRICT="test"
93 +
94 +PATCHES=(
95 + "${FILESDIR}"/${PN}-0.7.5-respect-flags.patch
96 + "${FILESDIR}"/${PN}-0.8.3-no-gziped-docs.patch
97 + "${FILESDIR}"/${PN}-0.8.3-json-c-0.14.patch
98 +)
99 +
100 +get_systemd_pv() {
101 + use systemd && \
102 + $(tc-getPKG_CONFIG) --modversion systemd
103 +}
104 +
105 +src_prepare() {
106 + default
107 +
108 + # The upstream lacks any way to configure the build at present
109 + # and ceph is a huge dependency, so we're using sed to make it
110 + # optional until the upstream has a proper configure system
111 + if ! use rbd ; then
112 + sed \
113 + -e "s/libcheckrbd.so/# libcheckrbd.so/" \
114 + -e "s/-lrados//" \
115 + -i libmultipath/checkers/Makefile \
116 + || die
117 + fi
118 +}
119 +
120 +src_compile() {
121 + # LIBDM_API_FLUSH involves grepping files in /usr/include,
122 + # so force the test to go the way we want #411337.
123 + emake \
124 + CC="$(tc-getCC)" \
125 + LIBDM_API_FLUSH=1 SYSTEMD="$(get_systemd_pv)"
126 +}
127 +
128 +src_install() {
129 + dodir /sbin /usr/share/man/man{5,8}
130 + emake \
131 + DESTDIR="${D}" \
132 + RUN=run \
133 + SYSTEMD=$(get_systemd_pv) \
134 + unitdir="$(systemd_get_systemunitdir)" \
135 + libudevdir='${prefix}'/"$(get_udevdir)" \
136 + pkgconfdir='${prefix}'/usr/'${LIB}'/pkgconfig \
137 + install
138 +
139 + newinitd "${FILESDIR}"/multipathd-r1.rc multipathd
140 + newinitd "${FILESDIR}"/multipath.rc multipath
141 +
142 + einstalldocs
143 +}
144 +
145 +pkg_postinst() {
146 + if [[ -z ${REPLACING_VERSIONS} ]]; then
147 + elog "If you need multipath on your system, you must"
148 + elog "add 'multipath' into your boot runlevel!"
149 + fi
150 +}