1 |
commit: 8ccdb781a9296e090b48e0ab1c18f802a4461c8b |
2 |
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 2 18:48:15 2017 +0000 |
4 |
Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 2 18:49:51 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ccdb781 |
7 |
|
8 |
sys-block/open-iscsi: bup |
9 |
|
10 |
Package-Manager: portage-2.3.0 |
11 |
|
12 |
sys-block/open-iscsi/Manifest | 1 + |
13 |
.../files/open-iscsi-2.0.874-Makefiles.patch | 116 +++++++++++++++++++++ |
14 |
.../files/open-iscsi-2.0.874-musl-fixes.patch | 51 +++++++++ |
15 |
sys-block/open-iscsi/open-iscsi-2.0.874.ebuild | 106 +++++++++++++++++++ |
16 |
4 files changed, 274 insertions(+) |
17 |
|
18 |
diff --git a/sys-block/open-iscsi/Manifest b/sys-block/open-iscsi/Manifest |
19 |
index 10492fa..b9fdb58 100644 |
20 |
--- a/sys-block/open-iscsi/Manifest |
21 |
+++ b/sys-block/open-iscsi/Manifest |
22 |
@@ -1,2 +1,3 @@ |
23 |
DIST open-iscsi-2.0-872.tar.gz 900081 SHA256 37753697a170223ac02a292b3a23a315a3c747b490c42480e4057b676c9f8d4f SHA512 d26c87772b0b1d13a8bd2eea9db86b3c61af83efbb788116c01ab6a914ff3de634a7b1bff56c1161b28965315543edbfc2735b6c7fbd3f7797471fde63b69cc0 WHIRLPOOL 4b04c8481c6c5f094ca6f7761828006a84eda7a22a6b3a4d65e7b3e4b39e73ef839ec710b491e7ca731b047fa8c74a9c03a17e85519a62dfbeb95222cfbdd935 |
24 |
DIST open-iscsi-2.0-873.tar.gz 667069 SHA256 7dd9f2f97da417560349a8da44ea4fcfe98bfd5ef284240a2cc4ff8e88ac7cd9 SHA512 4e67116cb7dd49381c9279645e5a661f05596ae6be3b832772089828b3764ca2d04b5dea1bcc337071efb52c3c75a6fb943136c659ee59500f3a198ed0dcea6b WHIRLPOOL 05af106f11da9f9f02c10edd5412d0f99816349e06e192059700eb1ae24a36027c3f0d7ed423aa7bb1c0b9d8b3aa1b6aa72a2aadb00f27762edf16b7f7d08c09 |
25 |
+DIST open-iscsi-2.0.874.tar.gz 625039 SHA256 d0071bf00fdf6591cd6ea5caf89fa57ada03d263da1f80f17deff76acf7419e1 SHA512 66d8a52b6401229d51873f1ee0f4e7259a8ed584800403a41741c7eeedc0ec21a2b116671cb7259f60918d083ffb46d76860236a1b10fbb94a4c1d61bddae1ae WHIRLPOOL 488aea5551a299bbb15118efc52d7c228836e9cc7973a99ee4b8dfcfea4b7b14e86791e65230d25c244b6b5fe8ffaf1ae3df01f5a7b223b93c15aeb035a12852 |
26 |
|
27 |
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.874-Makefiles.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.874-Makefiles.patch |
28 |
new file mode 100644 |
29 |
index 00000000..33c5d8a |
30 |
--- /dev/null |
31 |
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.874-Makefiles.patch |
32 |
@@ -0,0 +1,116 @@ |
33 |
+diff -dur a/Makefile b/Makefile |
34 |
+--- a/Makefile 2016-09-29 13:33:24.000000000 -0500 |
35 |
++++ b/Makefile 2017-01-02 11:25:04.606549073 -0600 |
36 |
+@@ -14,8 +14,8 @@ |
37 |
+ etcdir = /etc |
38 |
+ initddir = $(etcdir)/init.d |
39 |
+ |
40 |
+-MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8 iscsiuio/docs/iscsiuio.8 |
41 |
+-PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname iscsiuio/src/unix/iscsiuio |
42 |
++MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8 doc/iscsistart.8 doc/iscsi-iname.8 |
43 |
++PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname usr/iscsistart |
44 |
+ INSTALL = install |
45 |
+ ETCFILES = etc/iscsid.conf |
46 |
+ IFACEFILES = etc/iface.example |
47 |
+@@ -99,11 +99,11 @@ |
48 |
+ # ugh, auto-detection is evil |
49 |
+ # Gentoo maintains their own init.d stuff |
50 |
+ install_initd: |
51 |
+- if [ -f /etc/debian_version ]; then \ |
52 |
++ if [ -f $(DESTDIR)$(etcdir)/debian_version ]; then \ |
53 |
+ $(MAKE) install_initd_debian ; \ |
54 |
+- elif [ -f /etc/redhat-release ]; then \ |
55 |
++ elif [ -f $(DESTDIR)$(etcdir)/redhat-release ]; then \ |
56 |
+ $(MAKE) install_initd_redhat ; \ |
57 |
+- elif [ -f /etc/SuSE-release ]; then \ |
58 |
++ elif [ -f $(DESTDIR)$(etcdir)/SuSE-release ]; then \ |
59 |
+ $(MAKE) install_initd_suse ; \ |
60 |
+ fi |
61 |
+ |
62 |
+@@ -130,7 +130,7 @@ |
63 |
+ $(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi/ifaces |
64 |
+ |
65 |
+ install_etc: $(ETCFILES) |
66 |
+- if [ ! -f $(DESTDIR)/etc/iscsi/iscsid.conf ]; then \ |
67 |
++ if [ ! -f $(DESTDIR)$(etcdir)/iscsi/iscsid.conf ]; then \ |
68 |
+ $(INSTALL) -d $(DESTDIR)$(etcdir)/iscsi ; \ |
69 |
+ $(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi ; \ |
70 |
+ fi |
71 |
+@@ -143,11 +143,11 @@ |
72 |
+ $(MAKE) -C kernel install_kernel |
73 |
+ |
74 |
+ install_iname: |
75 |
+- if [ ! -f $(DESTDIR)/etc/iscsi/initiatorname.iscsi ]; then \ |
76 |
+- echo "InitiatorName=`$(DESTDIR)/sbin/iscsi-iname`" > $(DESTDIR)/etc/iscsi/initiatorname.iscsi ; \ |
77 |
++ if [ ! -f $(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi ]; then \ |
78 |
++ echo "InitiatorName=`$(DESTDIR)$(sbindir)/iscsi-iname`" > $(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi ; \ |
79 |
+ echo "***************************************************" ; \ |
80 |
+- echo "Setting InitiatorName to `cat $(DESTDIR)/etc/iscsi/initiatorname.iscsi`" ; \ |
81 |
+- echo "To override edit $(DESTDIR)/etc/iscsi/initiatorname.iscsi" ; \ |
82 |
++ echo "Setting InitiatorName to `cat $(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi`" ; \ |
83 |
++ echo "To override edit $(etcdir)/iscsi/initiatorname.iscsi" ; \ |
84 |
+ echo "***************************************************" ; \ |
85 |
+ fi |
86 |
+ |
87 |
+diff -dur a/usr/Makefile b/usr/Makefile |
88 |
+--- a/usr/Makefile 2016-09-29 13:33:24.000000000 -0500 |
89 |
++++ b/usr/Makefile 2017-01-02 11:27:55.417297639 -0600 |
90 |
+@@ -63,9 +63,9 @@ |
91 |
+ iscsistart.o statics.o |
92 |
+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lrt |
93 |
+ clean: |
94 |
+- rm -f *.o $(PROGRAMS) .depend $(LIBSYS) |
95 |
++ $(RM) *.o $(PROGRAMS) .depend $(LIBSYS) |
96 |
+ |
97 |
+ depend: |
98 |
+- gcc $(CFLAGS) -M `ls *.c` > .depend |
99 |
++ $(CC) $(CFLAGS) -M `ls *.c` > .depend |
100 |
+ |
101 |
+ -include .depend |
102 |
+diff -dur a/utils/fwparam_ibft/Makefile b/utils/fwparam_ibft/Makefile |
103 |
+--- a/utils/fwparam_ibft/Makefile 2016-09-29 13:33:24.000000000 -0500 |
104 |
++++ b/utils/fwparam_ibft/Makefile 2017-01-02 11:30:42.358440507 -0600 |
105 |
+@@ -33,11 +33,11 @@ |
106 |
+ all: $(OBJS) |
107 |
+ |
108 |
+ clean: |
109 |
+- rm -f *.o $(CLEANFILES) .depend |
110 |
++ $(RM) *.o $(CLEANFILES) .depend |
111 |
+ |
112 |
+ $(OBJS): prom_parse.tab.h prom_parse.h fwparam_ibft.h |
113 |
+ |
114 |
+ depend: |
115 |
+- gcc $(CFLAGS) -M `ls *.c` > .depend |
116 |
++ $(CC) $(CFLAGS) -M `ls *.c` > .depend |
117 |
+ |
118 |
+ -include .depend |
119 |
+diff -dur a/utils/Makefile b/utils/Makefile |
120 |
+--- a/utils/Makefile 2016-09-29 13:33:24.000000000 -0500 |
121 |
++++ b/utils/Makefile 2017-01-02 11:29:24.193611039 -0600 |
122 |
+@@ -10,9 +10,9 @@ |
123 |
+ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(DBM_LIB) -o $@ |
124 |
+ |
125 |
+ clean: |
126 |
+- rm -f *.o $(PROGRAMS) .depend |
127 |
++ $(RM) *.o $(PROGRAMS) .depend |
128 |
+ |
129 |
+ depend: |
130 |
+- gcc $(CFLAGS) -M `ls *.c` > .depend |
131 |
++ $(GCC) $(CFLAGS) -M `ls *.c` > .depend |
132 |
+ |
133 |
+ -include .depend |
134 |
+diff -dur a/utils/sysdeps/Makefile b/utils/sysdeps/Makefile |
135 |
+--- a/utils/sysdeps/Makefile 2016-09-29 13:33:24.000000000 -0500 |
136 |
++++ b/utils/sysdeps/Makefile 2017-01-02 11:31:24.219926338 -0600 |
137 |
+@@ -8,9 +8,9 @@ |
138 |
+ all: $(SYSDEPS_OBJS) |
139 |
+ |
140 |
+ clean: |
141 |
+- rm -f *.o .depend |
142 |
++ $(RM) *.o .depend |
143 |
+ |
144 |
+ depend: |
145 |
+- gcc $(CFLAGS) -M `ls *.c` > .depend |
146 |
++ $(CC) $(CFLAGS) -M `ls *.c` > .depend |
147 |
+ |
148 |
+ -include .depend |
149 |
|
150 |
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.874-musl-fixes.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.874-musl-fixes.patch |
151 |
new file mode 100644 |
152 |
index 00000000..cf8b762 |
153 |
--- /dev/null |
154 |
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.874-musl-fixes.patch |
155 |
@@ -0,0 +1,51 @@ |
156 |
+--- ./utils/fwparam_ibft/fwparam_ppc.c 2016-09-29 13:33:24.000000000 -0500 |
157 |
++++ ./utils/fwparam_ibft/fwparam_ppc.c 2017-01-02 11:37:32.738351217 -0600 |
158 |
+@@ -356,7 +356,7 @@ |
159 |
+ * Sort the nics into "natural" order. The proc fs |
160 |
+ * device-tree has them in somewhat random, or reversed order. |
161 |
+ */ |
162 |
+- qsort(niclist, nic_count, sizeof(char *), (__compar_fn_t)nic_cmp); |
163 |
++ qsort(niclist, nic_count, sizeof(char *), (int (*)(const void *, const void *))nic_cmp); |
164 |
+ |
165 |
+ snprintf(prefix, sizeof(prefix), "%s/%s", devtree, "aliases"); |
166 |
+ dev_count = 0; |
167 |
+--- ./usr/idbm.c.orig |
168 |
++++ ./usr/idbm.c |
169 |
+@@ -25,6 +25,7 @@ |
170 |
+ #include <stdlib.h> |
171 |
+ #include <string.h> |
172 |
+ #include <errno.h> |
173 |
++#include <fcntl.h> |
174 |
+ #include <dirent.h> |
175 |
+ #include <limits.h> |
176 |
+ #include <sys/stat.h> |
177 |
+--- a/usr/iscsiadm.c 2016-09-29 13:33:24.000000000 -0500 |
178 |
++++ b/usr/iscsiadm.c 2017-01-02 11:46:37.643506953 -0600 |
179 |
+@@ -3262,6 +3262,7 @@ |
180 |
+ int tpgt = PORTAL_GROUP_TAG_UNKNOWN, killiscsid=-1, do_show=0; |
181 |
+ int packet_size=32, ping_count=1, ping_interval=0; |
182 |
+ int do_discover = 0, sub_mode = -1; |
183 |
++ int argerror = 0; |
184 |
+ int portal_type = -1; |
185 |
+ struct sigaction sa_old; |
186 |
+ struct sigaction sa_new; |
187 |
+@@ -3426,6 +3427,9 @@ |
188 |
+ break; |
189 |
+ case 'h': |
190 |
+ usage(0); |
191 |
++ case '?': |
192 |
++ log_error("unrecognized character '%c'", optopt); |
193 |
++ argerror = 1; |
194 |
+ } |
195 |
+ |
196 |
+ if (name && value) { |
197 |
+@@ -3441,8 +3445,7 @@ |
198 |
+ } |
199 |
+ } |
200 |
+ |
201 |
+- if (optopt) { |
202 |
+- log_error("unrecognized character '%c'", optopt); |
203 |
++ if (argerror) { |
204 |
+ rc = ISCSI_ERR_INVAL; |
205 |
+ goto free_ifaces; |
206 |
+ } |
207 |
|
208 |
diff --git a/sys-block/open-iscsi/open-iscsi-2.0.874.ebuild b/sys-block/open-iscsi/open-iscsi-2.0.874.ebuild |
209 |
new file mode 100644 |
210 |
index 00000000..61e16f0 |
211 |
--- /dev/null |
212 |
+++ b/sys-block/open-iscsi/open-iscsi-2.0.874.ebuild |
213 |
@@ -0,0 +1,106 @@ |
214 |
+# Copyright 1999-2017 Gentoo Foundation |
215 |
+# Distributed under the terms of the GNU General Public License v2 |
216 |
+# $Id$ |
217 |
+ |
218 |
+EAPI=6 |
219 |
+ |
220 |
+inherit versionator linux-info eutils flag-o-matic toolchain-funcs udev |
221 |
+ |
222 |
+DESCRIPTION="A performant, transport independent, multi-platform implementation of RFC3720" |
223 |
+HOMEPAGE="http://www.open-iscsi.org/" |
224 |
+SRC_URI="http://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
225 |
+ |
226 |
+LICENSE="GPL-2" |
227 |
+SLOT="0" |
228 |
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" |
229 |
+IUSE="debug infiniband slp +tcp rdma" |
230 |
+ |
231 |
+DEPEND="sys-block/open-isns:= |
232 |
+ slp? ( net-libs/openslp ) |
233 |
+ infiniband? ( sys-fabric/ofed )" |
234 |
+RDEPEND="${DEPEND} |
235 |
+ sys-fs/lsscsi |
236 |
+ sys-apps/util-linux" |
237 |
+REQUIRED_USE="infiniband? ( rdma ) || ( rdma tcp )" |
238 |
+ |
239 |
+pkg_setup() { |
240 |
+ linux-info_pkg_setup |
241 |
+ |
242 |
+ if kernel_is -lt 2 6 16; then |
243 |
+ die "Sorry, your kernel must be 2.6.16-rc5 or newer!" |
244 |
+ fi |
245 |
+ |
246 |
+ # Needs to be done, as iscsid currently only starts, when having the iSCSI |
247 |
+ # support loaded as module. Kernel builtin options don't work. See this for |
248 |
+ # more information: |
249 |
+ # https://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966 |
250 |
+ # If there's a new release, check whether this is still valid! |
251 |
+ TCP_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP" |
252 |
+ RDMA_MODULES="INFINIBAND_ISER" |
253 |
+ INFINIBAND_MODULES="INFINIBAND_IPOIB INIBAND_USER_MAD INFINIBAND_USER_ACCESS" |
254 |
+ CONFIG_CHECK_MODULES="tcp? ( ${TCP_MODULES} ) rdma? ( ${RDMA_MODULES} ) infiniband? ( ${INFINIBAND_MODULES} )" |
255 |
+ if linux_config_exists; then |
256 |
+ if use tcp; then |
257 |
+ for module in ${TCP_MODULES}; do |
258 |
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)" |
259 |
+ done |
260 |
+ fi |
261 |
+ if use infiniband; then |
262 |
+ for module in ${INFINIBAND_MODULES}; do |
263 |
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)" |
264 |
+ done |
265 |
+ fi |
266 |
+ if use rdma; then |
267 |
+ for module in ${RDMA_MODULES}; do |
268 |
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"$ |
269 |
+ done |
270 |
+ fi |
271 |
+ fi |
272 |
+} |
273 |
+ |
274 |
+src_prepare() { |
275 |
+ epatch "${FILESDIR}"/${P}-Makefiles.patch |
276 |
+ epatch "${FILESDIR}"/${P}-musl-fixes.patch |
277 |
+ eapply_user |
278 |
+ |
279 |
+ sed -i -e 's:^\(iscsid.startup\)\s*=.*:\1 = /usr/sbin/iscsid:' etc/iscsid.conf || die |
280 |
+} |
281 |
+ |
282 |
+src_configure() { |
283 |
+ use debug && append-cppflags -DDEBUG_TCP -DDEBUG_SCSI |
284 |
+ append-lfs-flags |
285 |
+} |
286 |
+ |
287 |
+src_compile() { |
288 |
+ # Stuffing CPPFLAGS into CFLAGS isn't entirely correct, but the build |
289 |
+ # is messed up already here, so it's not making it that much worse. |
290 |
+ KSRC="${KV_DIR}" CFLAGS="" \ |
291 |
+ emake \ |
292 |
+ OPTFLAGS="${CFLAGS} ${CPPFLAGS}" \ |
293 |
+ AR="$(tc-getAR)" CC="$(tc-getCC)" \ |
294 |
+ user |
295 |
+} |
296 |
+ |
297 |
+src_install() { |
298 |
+ emake DESTDIR="${ED}" sbindir="/usr/sbin" install |
299 |
+ |
300 |
+ dodoc README THANKS |
301 |
+ |
302 |
+ docinto test/ |
303 |
+ dodoc test/* |
304 |
+ |
305 |
+ insinto /etc/iscsi |
306 |
+ newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example |
307 |
+ |
308 |
+ # udev pieces |
309 |
+ udev_dorules "${FILESDIR}"/99-iscsi.rules |
310 |
+ exeinto /etc/udev/scripts |
311 |
+ doexe "${FILESDIR}"/iscsidev.sh |
312 |
+ |
313 |
+ newconfd "${FILESDIR}"/iscsid-conf.d iscsid |
314 |
+ newinitd "${FILESDIR}"/iscsid-init.d iscsid |
315 |
+ |
316 |
+ keepdir /var/db/iscsi |
317 |
+ fperms 700 /var/db/iscsi |
318 |
+ fperms 600 /etc/iscsi/iscsid.conf |
319 |
+} |