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-block/open-iscsi/files/, sys-block/open-iscsi/
Date: Wed, 21 Feb 2018 17:42:48
Message-Id: 1519234945.1e9e2ee79e046188ea7fd5e03499f8e37ed64972.whissi@gentoo
1 commit: 1e9e2ee79e046188ea7fd5e03499f8e37ed64972
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 21 17:40:02 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 21 17:42:25 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e9e2ee7
7
8 sys-block/open-iscsi: Bump to v2.0.876
9
10 Closes: https://bugs.gentoo.org/645910
11 Package-Manager: Portage-2.3.24, Repoman-2.3.6
12
13 sys-block/open-iscsi/Manifest | 1 +
14 .../files/open-iscsi-2.0.876-Makefiles.patch | 61 +++++++++++
15 .../files/open-iscsi-2.0.876-musl-fixes.patch | 92 ++++++++++++++++
16 sys-block/open-iscsi/open-iscsi-2.0.876.ebuild | 121 +++++++++++++++++++++
17 4 files changed, 275 insertions(+)
18
19 diff --git a/sys-block/open-iscsi/Manifest b/sys-block/open-iscsi/Manifest
20 index c32070244d8..e8a6d18310e 100644
21 --- a/sys-block/open-iscsi/Manifest
22 +++ b/sys-block/open-iscsi/Manifest
23 @@ -2,3 +2,4 @@ DIST open-iscsi-2.0-872.tar.gz 900081 BLAKE2B 6a4911347c55c1c4906350247ae7d92c2a
24 DIST open-iscsi-2.0-873.tar.gz 667069 BLAKE2B edb427f8483c31499cdde644bbf8d658952952fa8d52a232537e7e6ec71d2d237dcd4e8759de21b65cac757678c7d71c22bd2fe71ed1e7ac152ae8396f080061 SHA512 4e67116cb7dd49381c9279645e5a661f05596ae6be3b832772089828b3764ca2d04b5dea1bcc337071efb52c3c75a6fb943136c659ee59500f3a198ed0dcea6b
25 DIST open-iscsi-2.0.874.tar.gz 625039 BLAKE2B 39e4b818b1c977d43aa6490acd4d65e688c8cd03a7ae4c03d18d6b81aa76773b0a1227b3e8d975f2a14108075bb680434ded5337db296839bd5be012130df9df SHA512 66d8a52b6401229d51873f1ee0f4e7259a8ed584800403a41741c7eeedc0ec21a2b116671cb7259f60918d083ffb46d76860236a1b10fbb94a4c1d61bddae1ae
26 DIST open-iscsi-2.0.875.tar.gz 635121 BLAKE2B 34a7083087c53ed0e59d293d26efe166b09c5ea18b6022869cc9ff3d2edb2fb8b69e2c1ce6c9011bd20fc590b02dafd6d7c13d8bfa1eae6408c4bace13992e5e SHA512 1709011d7d12d3dd9278a0d775af064d5f7da37357f35d6d5c5b3aa8ec16385c28b201b1261f4581dbbbbca3d815015ed8696e1694aa19f3231132f90d1e5b36
27 +DIST open-iscsi-2.0.876.tar.gz 576111 BLAKE2B 2fbe4f37e91730d15bad77feeb9a418a8bbf709582598571a5905080eb60649f3ece6a52e9cf94a28128f2b0bc30093e67f6a47624545243b10bcebe318750ac SHA512 f9319016bd6abf3bf675ad050b0489095a21db58c93f9baaca6adc239129ad08f8e18ed96c91c36406e5c42d35118e67dfde6d3c37e97027467c4472db3b2422
28
29 diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.876-Makefiles.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.876-Makefiles.patch
30 new file mode 100644
31 index 00000000000..2cfa4362285
32 --- /dev/null
33 +++ b/sys-block/open-iscsi/files/open-iscsi-2.0.876-Makefiles.patch
34 @@ -0,0 +1,61 @@
35 +--- a/usr/Makefile
36 ++++ b/usr/Makefile
37 +@@ -69,9 +69,9 @@ iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
38 + iscsistart.o statics.o
39 + $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lrt $(ISCSI_LIB)
40 + clean:
41 +- rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
42 ++ $(RM) *.o $(PROGRAMS) .depend $(LIBSYS)
43 +
44 + depend:
45 +- gcc $(CFLAGS) -M `ls *.c` > .depend
46 ++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
47 +
48 + -include .depend
49 +--- a/utils/Makefile
50 ++++ b/utils/Makefile
51 +@@ -10,9 +10,9 @@ iscsi-iname: md5.o iscsi-iname.o
52 + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(DBM_LIB) -o $@
53 +
54 + clean:
55 +- rm -f *.o $(PROGRAMS) .depend
56 ++ $(RM) *.o $(PROGRAMS) .depend
57 +
58 + depend:
59 +- gcc $(CFLAGS) -M `ls *.c` > .depend
60 ++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
61 +
62 + -include .depend
63 +--- a/utils/fwparam_ibft/Makefile
64 ++++ b/utils/fwparam_ibft/Makefile
65 +@@ -41,11 +41,11 @@ LDFLAGS += -L$(TOPDIR)/libopeniscsiusr -liscsiusr
66 + all: $(OBJS)
67 +
68 + clean:
69 +- rm -f *.o $(CLEANFILES) .depend
70 ++ $(RM) *.o $(CLEANFILES) .depend
71 +
72 + $(OBJS): prom_parse.tab.h prom_parse.h fwparam_ibft.h
73 +
74 + depend:
75 +- gcc $(CFLAGS) -M `ls *.c` > .depend
76 ++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
77 +
78 + -include .depend
79 +--- a/utils/sysdeps/Makefile
80 ++++ b/utils/sysdeps/Makefile
81 +@@ -8,9 +8,9 @@ SYSDEPS_OBJS=sysdeps.o
82 + all: $(SYSDEPS_OBJS)
83 +
84 + clean:
85 +- rm -f *.o .depend
86 ++ $(RM) *.o .depend
87 +
88 + depend:
89 +- gcc $(CFLAGS) -M `ls *.c` > .depend
90 ++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
91 +
92 + -include .depend
93 +--
94 +2.16.2
95 +
96
97 diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.876-musl-fixes.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.876-musl-fixes.patch
98 new file mode 100644
99 index 00000000000..7bb0c5d6e77
100 --- /dev/null
101 +++ b/sys-block/open-iscsi/files/open-iscsi-2.0.876-musl-fixes.patch
102 @@ -0,0 +1,92 @@
103 +--- a/usr/idbm.c
104 ++++ b/usr/idbm.c
105 +@@ -27,2 +27,3 @@
106 + #include <errno.h>
107 ++#include <fcntl.h>
108 + #include <dirent.h>
109 +--- a/usr/iscsiadm.c
110 ++++ b/usr/iscsiadm.c
111 +@@ -3269,2 +3269,3 @@
112 + int do_discover = 0, sub_mode = -1;
113 ++ int argerror = 0;
114 + int portal_type = -1;
115 +@@ -3458,2 +3459,5 @@
116 + usage(0);
117 ++ case '?':
118 ++ log_error("unrecognized character '%c'", optopt);
119 ++ argerror = 1;
120 + }
121 +@@ -3473,4 +3477,3 @@
122 +
123 +- if (optopt) {
124 +- log_error("unrecognized character '%c'", optopt);
125 ++ if (argerror) {
126 + rc = ISCSI_ERR_INVAL;
127 +--- a/utils/fwparam_ibft/fwparam_ppc.c
128 ++++ b/utils/fwparam_ibft/fwparam_ppc.c
129 +@@ -358,3 +358,3 @@
130 + */
131 +- qsort(niclist, nic_count, sizeof(char *), (__compar_fn_t)nic_cmp);
132 ++ qsort(niclist, nic_count, sizeof(char *), (int (*)(const void *, const void *))nic_cmp);
133 +
134 +--- a/iscsiuio/src/unix/libs/bnx2x.c
135 ++++ b/iscsiuio/src/unix/libs/bnx2x.c
136 +@@ -44,3 +44,3 @@
137 + #include <linux/sockios.h>
138 +-#include <linux/ethtool.h>
139 ++#include "ethtool-compat.h"
140 + #include <sys/mman.h>
141 +--- /dev/null
142 ++++ b/iscsiuio/src/unix/libs/ethtool-compat.h
143 +@@ -0,0 +1,51 @@
144 ++/*
145 ++ * ethtool-compat.h: adopted from
146 ++ # ethtool.h: Defines for Linux ethtool.
147 ++ *
148 ++ * Copyright (C) 1998 David S. Miller (davem@××××××.com)
149 ++ * Copyright 2001 Jeff Garzik <jgarzik@×××××.com>
150 ++ * Portions Copyright 2001 Sun Microsystems (thockin@×××.com)
151 ++ * Portions Copyright 2002 Intel (eli.kupermann@×××××.com,
152 ++ * christopher.leech@×××××.com,
153 ++ * scott.feldman@×××××.com)
154 ++ * Portions Copyright (C) Sun Microsystems 2008
155 ++ */
156 ++
157 ++#include <linux/types.h>
158 ++#include <netinet/if_ether.h>
159 ++
160 ++#define ETHTOOL_FWVERS_LEN 32
161 ++#define ETHTOOL_BUSINFO_LEN 32
162 ++#define ETHTOOL_EROMVERS_LEN 32
163 ++
164 ++struct ethtool_drvinfo {
165 ++ __u32 cmd;
166 ++ char driver[32];
167 ++ char version[32];
168 ++ char fw_version[ETHTOOL_FWVERS_LEN];
169 ++ char bus_info[ETHTOOL_BUSINFO_LEN];
170 ++ char erom_version[ETHTOOL_EROMVERS_LEN];
171 ++ char reserved2[12];
172 ++ __u32 n_priv_flags;
173 ++ __u32 n_stats;
174 ++ __u32 testinfo_len;
175 ++ __u32 eedump_len;
176 ++ __u32 regdump_len;
177 ++};
178 ++
179 ++struct ethtool_tcpip4_spec {
180 ++ __be32 ip4src;
181 ++ __be32 ip4dst;
182 ++ __be16 psrc;
183 ++ __be16 pdst;
184 ++ __u8 tos;
185 ++};
186 ++
187 ++struct ethtool_ah_espip4_spec {
188 ++ __be32 ip4src;
189 ++ __be32 ip4dst;
190 ++ __be32 spi;
191 ++ __u8 tos;
192 ++};
193 ++
194 ++#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
195
196 diff --git a/sys-block/open-iscsi/open-iscsi-2.0.876.ebuild b/sys-block/open-iscsi/open-iscsi-2.0.876.ebuild
197 new file mode 100644
198 index 00000000000..2f34ac971b3
199 --- /dev/null
200 +++ b/sys-block/open-iscsi/open-iscsi-2.0.876.ebuild
201 @@ -0,0 +1,121 @@
202 +# Copyright 1999-2018 Gentoo Foundation
203 +# Distributed under the terms of the GNU General Public License v2
204 +
205 +EAPI=6
206 +
207 +inherit autotools versionator linux-info flag-o-matic toolchain-funcs udev systemd
208 +
209 +DESCRIPTION="A performant, transport independent, multi-platform implementation of RFC3720"
210 +HOMEPAGE="http://www.open-iscsi.com/"
211 +SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
212 +
213 +LICENSE="GPL-2"
214 +SLOT="0"
215 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
216 +IUSE="debug infiniband +tcp rdma"
217 +
218 +DEPEND="sys-block/open-isns:=
219 + infiniband? ( sys-fabric/ofed )
220 + sys-kernel/linux-headers"
221 +RDEPEND="${DEPEND}
222 + sys-fs/lsscsi
223 + sys-apps/util-linux"
224 +REQUIRED_USE="infiniband? ( rdma ) || ( rdma tcp )"
225 +
226 +PATCHES=(
227 + "${FILESDIR}/${PN}-2.0.876-musl-fixes.patch"
228 + "${FILESDIR}/${PN}-2.0.876-Makefiles.patch"
229 +)
230 +
231 +pkg_setup() {
232 + linux-info_pkg_setup
233 +
234 + if kernel_is -lt 2 6 16; then
235 + die "Sorry, your kernel must be 2.6.16-rc5 or newer!"
236 + fi
237 +
238 + # Needs to be done, as iscsid currently only starts, when having the iSCSI
239 + # support loaded as module. Kernel builtin options don't work. See this for
240 + # more information:
241 + # https://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966
242 + # If there's a new release, check whether this is still valid!
243 + TCP_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP"
244 + RDMA_MODULES="INFINIBAND_ISER"
245 + INFINIBAND_MODULES="INFINIBAND_IPOIB INIBAND_USER_MAD INFINIBAND_USER_ACCESS"
246 + CONFIG_CHECK_MODULES="tcp? ( ${TCP_MODULES} ) rdma? ( ${RDMA_MODULES} ) infiniband? ( ${INFINIBAND_MODULES} )"
247 + if linux_config_exists; then
248 + if use tcp; then
249 + for module in ${TCP_MODULES}; do
250 + linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"
251 + done
252 + fi
253 + if use infiniband; then
254 + for module in ${INFINIBAND_MODULES}; do
255 + linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"
256 + done
257 + fi
258 + if use rdma; then
259 + for module in ${RDMA_MODULES}; do
260 + linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"$
261 + done
262 + fi
263 + fi
264 +}
265 +
266 +src_prepare() {
267 + sed -i -e 's:^\(iscsid.startup\)\s*=.*:\1 = /usr/sbin/iscsid:' etc/iscsid.conf || die
268 + default
269 +
270 + pushd iscsiuio >/dev/null || die
271 + eautoreconf
272 + popd >/dev/null || die
273 +}
274 +
275 +src_configure() {
276 + use debug && append-cppflags -DDEBUG_TCP -DDEBUG_SCSI
277 + append-lfs-flags
278 +}
279 +
280 +src_compile() {
281 + # Stuffing CPPFLAGS into CFLAGS isn't entirely correct, but the build
282 + # is messed up already here, so it's not making it that much worse.
283 + KSRC="${KV_DIR}" CFLAGS="" \
284 + emake \
285 + OPTFLAGS="${CFLAGS} ${CPPFLAGS}" \
286 + AR="$(tc-getAR)" CC="$(tc-getCC)" \
287 + user
288 +}
289 +
290 +src_install() {
291 + emake DESTDIR="${ED}" sbindir="/usr/sbin" install
292 + # Upstream make is not deterministic, per bug #601514
293 + rm -f "${ED}"/etc/initiatorname.iscsi
294 +
295 + dodoc README THANKS
296 +
297 + docinto test/
298 + dodoc test/*
299 +
300 + insinto /etc/iscsi
301 + newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example
302 +
303 + newconfd "${FILESDIR}"/iscsid-conf.d iscsid
304 + newinitd "${FILESDIR}"/iscsid-init.d iscsid
305 +
306 + systemd_dounit "${S%/}"/etc/systemd/iscsid.service
307 +
308 + keepdir /var/db/iscsi
309 + fperms 700 /var/db/iscsi
310 + fperms 600 /etc/iscsi/iscsid.conf
311 +}
312 +
313 +pkg_postinst() {
314 + in='/etc/iscsi/initiatorname.iscsi'
315 + if [ ! -f "${EROOT}${in}" -a -f "${EROOT}${in}.example" ]; then
316 + {
317 + cat "${EROOT}${in}.example"
318 + echo "# InitiatorName generated by ${CATEGORY}/${PF} at $(date -uR)"
319 + echo "InitiatorName=$(${ROOT}/usr/sbin/iscsi-iname)"
320 + } >> "${EROOT}${in}.tmp" && mv -f "${EROOT}${in}.tmp" "${EROOT}${in}"
321 + fi
322 +}