commit:     8ccdb781a9296e090b48e0ab1c18f802a4461c8b
Author:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  2 18:48:15 2017 +0000
Commit:     Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Mon Jan  2 18:49:51 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ccdb781

sys-block/open-iscsi: bup

Package-Manager: portage-2.3.0

 sys-block/open-iscsi/Manifest                      |   1 +
 .../files/open-iscsi-2.0.874-Makefiles.patch       | 116 +++++++++++++++++++++
 .../files/open-iscsi-2.0.874-musl-fixes.patch      |  51 +++++++++
 sys-block/open-iscsi/open-iscsi-2.0.874.ebuild     | 106 +++++++++++++++++++
 4 files changed, 274 insertions(+)

diff --git a/sys-block/open-iscsi/Manifest b/sys-block/open-iscsi/Manifest
index 10492fa..b9fdb58 100644
--- a/sys-block/open-iscsi/Manifest
+++ b/sys-block/open-iscsi/Manifest
@@ -1,2 +1,3 @@
 DIST open-iscsi-2.0-872.tar.gz 900081 SHA256 
37753697a170223ac02a292b3a23a315a3c747b490c42480e4057b676c9f8d4f SHA512 
d26c87772b0b1d13a8bd2eea9db86b3c61af83efbb788116c01ab6a914ff3de634a7b1bff56c1161b28965315543edbfc2735b6c7fbd3f7797471fde63b69cc0
 WHIRLPOOL 
4b04c8481c6c5f094ca6f7761828006a84eda7a22a6b3a4d65e7b3e4b39e73ef839ec710b491e7ca731b047fa8c74a9c03a17e85519a62dfbeb95222cfbdd935
 DIST open-iscsi-2.0-873.tar.gz 667069 SHA256 
7dd9f2f97da417560349a8da44ea4fcfe98bfd5ef284240a2cc4ff8e88ac7cd9 SHA512 
4e67116cb7dd49381c9279645e5a661f05596ae6be3b832772089828b3764ca2d04b5dea1bcc337071efb52c3c75a6fb943136c659ee59500f3a198ed0dcea6b
 WHIRLPOOL 
05af106f11da9f9f02c10edd5412d0f99816349e06e192059700eb1ae24a36027c3f0d7ed423aa7bb1c0b9d8b3aa1b6aa72a2aadb00f27762edf16b7f7d08c09
+DIST open-iscsi-2.0.874.tar.gz 625039 SHA256 
d0071bf00fdf6591cd6ea5caf89fa57ada03d263da1f80f17deff76acf7419e1 SHA512 
66d8a52b6401229d51873f1ee0f4e7259a8ed584800403a41741c7eeedc0ec21a2b116671cb7259f60918d083ffb46d76860236a1b10fbb94a4c1d61bddae1ae
 WHIRLPOOL 
488aea5551a299bbb15118efc52d7c228836e9cc7973a99ee4b8dfcfea4b7b14e86791e65230d25c244b6b5fe8ffaf1ae3df01f5a7b223b93c15aeb035a12852

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
new file mode 100644
index 00000000..33c5d8a
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.874-Makefiles.patch
@@ -0,0 +1,116 @@
+diff -dur a/Makefile b/Makefile
+--- a/Makefile 2016-09-29 13:33:24.000000000 -0500
++++ b/Makefile 2017-01-02 11:25:04.606549073 -0600
+@@ -14,8 +14,8 @@
+ etcdir = /etc
+ initddir = $(etcdir)/init.d
+ 
+-MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8 
iscsiuio/docs/iscsiuio.8
+-PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname 
iscsiuio/src/unix/iscsiuio
++MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8 doc/iscsistart.8 
doc/iscsi-iname.8
++PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname 
usr/iscsistart
+ INSTALL = install
+ ETCFILES = etc/iscsid.conf
+ IFACEFILES = etc/iface.example
+@@ -99,11 +99,11 @@
+ # ugh, auto-detection is evil
+ # Gentoo maintains their own init.d stuff
+ install_initd:
+-      if [ -f /etc/debian_version ]; then \
++      if [ -f $(DESTDIR)$(etcdir)/debian_version ]; then \
+               $(MAKE) install_initd_debian ; \
+-      elif [ -f /etc/redhat-release ]; then \
++      elif [ -f $(DESTDIR)$(etcdir)/redhat-release ]; then \
+               $(MAKE) install_initd_redhat ; \
+-      elif [ -f /etc/SuSE-release ]; then \
++      elif [ -f $(DESTDIR)$(etcdir)/SuSE-release ]; then \
+               $(MAKE) install_initd_suse ; \
+       fi
+ 
+@@ -130,7 +130,7 @@
+       $(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi/ifaces
+ 
+ install_etc: $(ETCFILES)
+-      if [ ! -f $(DESTDIR)/etc/iscsi/iscsid.conf ]; then \
++      if [ ! -f $(DESTDIR)$(etcdir)/iscsi/iscsid.conf ]; then \
+               $(INSTALL) -d $(DESTDIR)$(etcdir)/iscsi ; \
+               $(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi ; \
+       fi
+@@ -143,11 +143,11 @@
+       $(MAKE) -C kernel install_kernel
+ 
+ install_iname:
+-      if [ ! -f $(DESTDIR)/etc/iscsi/initiatorname.iscsi ]; then \
+-              echo "InitiatorName=`$(DESTDIR)/sbin/iscsi-iname`" > 
$(DESTDIR)/etc/iscsi/initiatorname.iscsi ; \
++      if [ ! -f $(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi ]; then \
++              echo "InitiatorName=`$(DESTDIR)$(sbindir)/iscsi-iname`" > 
$(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi ; \
+               echo "***************************************************" ; \
+-              echo "Setting InitiatorName to `cat 
$(DESTDIR)/etc/iscsi/initiatorname.iscsi`" ; \
+-              echo "To override edit 
$(DESTDIR)/etc/iscsi/initiatorname.iscsi" ; \
++              echo "Setting InitiatorName to `cat 
$(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi`" ; \
++              echo "To override edit $(etcdir)/iscsi/initiatorname.iscsi" ; \
+               echo "***************************************************" ; \
+       fi
+ 
+diff -dur a/usr/Makefile b/usr/Makefile
+--- a/usr/Makefile     2016-09-29 13:33:24.000000000 -0500
++++ b/usr/Makefile     2017-01-02 11:27:55.417297639 -0600
+@@ -63,9 +63,9 @@
+               iscsistart.o statics.o
+       $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lrt
+ clean:
+-      rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
++      $(RM) *.o $(PROGRAMS) .depend $(LIBSYS)
+ 
+ depend:
+-      gcc $(CFLAGS) -M `ls *.c` > .depend
++      $(CC) $(CFLAGS) -M `ls *.c` > .depend
+ 
+ -include .depend
+diff -dur a/utils/fwparam_ibft/Makefile b/utils/fwparam_ibft/Makefile
+--- a/utils/fwparam_ibft/Makefile      2016-09-29 13:33:24.000000000 -0500
++++ b/utils/fwparam_ibft/Makefile      2017-01-02 11:30:42.358440507 -0600
+@@ -33,11 +33,11 @@
+ all: $(OBJS)
+ 
+ clean:
+-      rm -f *.o $(CLEANFILES) .depend
++      $(RM) *.o $(CLEANFILES) .depend
+ 
+ $(OBJS): prom_parse.tab.h prom_parse.h fwparam_ibft.h
+ 
+ depend:
+-      gcc $(CFLAGS) -M `ls *.c` > .depend
++      $(CC) $(CFLAGS) -M `ls *.c` > .depend
+ 
+ -include .depend
+diff -dur a/utils/Makefile b/utils/Makefile
+--- a/utils/Makefile   2016-09-29 13:33:24.000000000 -0500
++++ b/utils/Makefile   2017-01-02 11:29:24.193611039 -0600
+@@ -10,9 +10,9 @@
+       $(CC) $(CFLAGS) $(LDFLAGS) $^ $(DBM_LIB) -o $@
+ 
+ clean:
+-      rm -f *.o $(PROGRAMS) .depend
++      $(RM) *.o $(PROGRAMS) .depend
+ 
+ depend:
+-      gcc $(CFLAGS) -M `ls *.c` > .depend
++      $(GCC) $(CFLAGS) -M `ls *.c` > .depend
+ 
+ -include .depend
+diff -dur a/utils/sysdeps/Makefile b/utils/sysdeps/Makefile
+--- a/utils/sysdeps/Makefile   2016-09-29 13:33:24.000000000 -0500
++++ b/utils/sysdeps/Makefile   2017-01-02 11:31:24.219926338 -0600
+@@ -8,9 +8,9 @@
+ all: $(SYSDEPS_OBJS)
+ 
+ clean:
+-      rm -f *.o .depend
++      $(RM) *.o .depend
+ 
+ depend:
+-      gcc $(CFLAGS) -M `ls *.c` > .depend
++      $(CC) $(CFLAGS) -M `ls *.c` > .depend
+ 
+ -include .depend

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
new file mode 100644
index 00000000..cf8b762
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.874-musl-fixes.patch
@@ -0,0 +1,51 @@
+--- ./utils/fwparam_ibft/fwparam_ppc.c 2016-09-29 13:33:24.000000000 -0500
++++ ./utils/fwparam_ibft/fwparam_ppc.c 2017-01-02 11:37:32.738351217 -0600
+@@ -356,7 +356,7 @@
+        * Sort the nics into "natural" order.  The proc fs
+        * device-tree has them in somewhat random, or reversed order.
+        */
+-      qsort(niclist, nic_count, sizeof(char *), (__compar_fn_t)nic_cmp);
++      qsort(niclist, nic_count, sizeof(char *), (int (*)(const void *, const 
void *))nic_cmp);
+ 
+       snprintf(prefix, sizeof(prefix), "%s/%s", devtree, "aliases");
+       dev_count = 0;
+--- ./usr/idbm.c.orig
++++ ./usr/idbm.c
+@@ -25,6 +25,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
++#include <fcntl.h>
+ #include <dirent.h>
+ #include <limits.h>
+ #include <sys/stat.h>
+--- a/usr/iscsiadm.c   2016-09-29 13:33:24.000000000 -0500
++++ b/usr/iscsiadm.c   2017-01-02 11:46:37.643506953 -0600
+@@ -3262,6 +3262,7 @@
+       int tpgt = PORTAL_GROUP_TAG_UNKNOWN, killiscsid=-1, do_show=0;
+       int packet_size=32, ping_count=1, ping_interval=0;
+       int do_discover = 0, sub_mode = -1;
++      int argerror = 0;
+       int portal_type = -1;
+       struct sigaction sa_old;
+       struct sigaction sa_new;
+@@ -3426,6 +3427,9 @@
+                       break;
+               case 'h':
+                       usage(0);
++              case '?':
++                      log_error("unrecognized character '%c'", optopt);
++                      argerror = 1;
+               }
+ 
+               if (name && value) {
+@@ -3441,8 +3445,7 @@
+               }
+       }
+ 
+-      if (optopt) {
+-              log_error("unrecognized character '%c'", optopt);
++      if (argerror) {
+               rc = ISCSI_ERR_INVAL;
+               goto free_ifaces;
+       }

diff --git a/sys-block/open-iscsi/open-iscsi-2.0.874.ebuild 
b/sys-block/open-iscsi/open-iscsi-2.0.874.ebuild
new file mode 100644
index 00000000..61e16f0
--- /dev/null
+++ b/sys-block/open-iscsi/open-iscsi-2.0.874.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit versionator linux-info eutils flag-o-matic toolchain-funcs udev
+
+DESCRIPTION="A performant, transport independent, multi-platform 
implementation of RFC3720"
+HOMEPAGE="http://www.open-iscsi.org/";
+SRC_URI="http://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug infiniband slp +tcp rdma"
+
+DEPEND="sys-block/open-isns:=
+       slp? ( net-libs/openslp )
+       infiniband? ( sys-fabric/ofed )"
+RDEPEND="${DEPEND}
+       sys-fs/lsscsi
+       sys-apps/util-linux"
+REQUIRED_USE="infiniband? ( rdma ) || ( rdma tcp )"
+
+pkg_setup() {
+       linux-info_pkg_setup
+
+       if kernel_is -lt 2 6 16; then
+               die "Sorry, your kernel must be 2.6.16-rc5 or newer!"
+       fi
+
+       # Needs to be done, as iscsid currently only starts, when having the 
iSCSI
+       # support loaded as module. Kernel builtin options don't work. See this 
for
+       # more information:
+       # 
https://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966
+       # If there's a new release, check whether this is still valid!
+       TCP_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP"
+       RDMA_MODULES="INFINIBAND_ISER"
+       INFINIBAND_MODULES="INFINIBAND_IPOIB INIBAND_USER_MAD 
INFINIBAND_USER_ACCESS"
+       CONFIG_CHECK_MODULES="tcp? ( ${TCP_MODULES} ) rdma? ( ${RDMA_MODULES} ) 
infiniband? ( ${INFINIBAND_MODULES} )"
+       if linux_config_exists; then
+               if use tcp; then
+                       for module in ${TCP_MODULES}; do
+                               linux_chkconfig_module ${module} || ewarn 
"${module} needs to be built as module (builtin doesn't work)"
+               done
+               fi
+               if use infiniband; then
+                       for module in ${INFINIBAND_MODULES}; do
+                               linux_chkconfig_module ${module} || ewarn 
"${module} needs to be built as module (builtin doesn't work)"
+               done
+               fi
+               if use rdma; then
+                       for module in ${RDMA_MODULES}; do
+                               linux_chkconfig_module ${module} || ewarn 
"${module} needs to be built as module (builtin doesn't work)"$
+                       done
+               fi
+       fi
+}
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-Makefiles.patch
+       epatch "${FILESDIR}"/${P}-musl-fixes.patch
+       eapply_user
+
+       sed -i -e 's:^\(iscsid.startup\)\s*=.*:\1 = /usr/sbin/iscsid:' 
etc/iscsid.conf || die
+}
+
+src_configure() {
+       use debug && append-cppflags -DDEBUG_TCP -DDEBUG_SCSI
+       append-lfs-flags
+}
+
+src_compile() {
+       # Stuffing CPPFLAGS into CFLAGS isn't entirely correct, but the build
+       # is messed up already here, so it's not making it that much worse.
+       KSRC="${KV_DIR}" CFLAGS="" \
+       emake \
+               OPTFLAGS="${CFLAGS} ${CPPFLAGS}" \
+               AR="$(tc-getAR)" CC="$(tc-getCC)" \
+               user
+}
+
+src_install() {
+       emake DESTDIR="${ED}" sbindir="/usr/sbin" install
+
+       dodoc README THANKS
+
+       docinto test/
+       dodoc test/*
+
+       insinto /etc/iscsi
+       newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example
+
+       # udev pieces
+       udev_dorules "${FILESDIR}"/99-iscsi.rules
+       exeinto /etc/udev/scripts
+       doexe "${FILESDIR}"/iscsidev.sh
+
+       newconfd "${FILESDIR}"/iscsid-conf.d iscsid
+       newinitd "${FILESDIR}"/iscsid-init.d iscsid
+
+       keepdir /var/db/iscsi
+       fperms 700 /var/db/iscsi
+       fperms 600 /etc/iscsi/iscsid.conf
+}

Reply via email to