summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-block/open-iscsi
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-block/open-iscsi')
-rw-r--r--sys-block/open-iscsi/Manifest2
-rw-r--r--sys-block/open-iscsi/files/99-iscsi.rules1
-rw-r--r--sys-block/open-iscsi/files/initiatorname.iscsi31
-rw-r--r--sys-block/open-iscsi/files/iscsid-conf.d18
-rw-r--r--sys-block/open-iscsi/files/iscsid-init.d107
-rw-r--r--sys-block/open-iscsi/files/iscsidev.sh78
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.872-conf.d18
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.872-dont-call-configure.patch11
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.872-glibc212.patch10
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.872-init.d-r1131
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.872-isns-slp.patch16
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.872-ldflags.patch11
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.872-makefile-cleanup-pass2.patch55
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.872-makefile-cleanup.patch20
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.873-Makefiles.patch161
-rw-r--r--sys-block/open-iscsi/metadata.xml5
-rw-r--r--sys-block/open-iscsi/open-iscsi-2.0.872-r2.ebuild105
-rw-r--r--sys-block/open-iscsi/open-iscsi-2.0.872-r3.ebuild113
-rw-r--r--sys-block/open-iscsi/open-iscsi-2.0.873.ebuild94
19 files changed, 987 insertions, 0 deletions
diff --git a/sys-block/open-iscsi/Manifest b/sys-block/open-iscsi/Manifest
new file mode 100644
index 000000000000..10492fa68361
--- /dev/null
+++ b/sys-block/open-iscsi/Manifest
@@ -0,0 +1,2 @@
+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
diff --git a/sys-block/open-iscsi/files/99-iscsi.rules b/sys-block/open-iscsi/files/99-iscsi.rules
new file mode 100644
index 000000000000..74c8e14bc540
--- /dev/null
+++ b/sys-block/open-iscsi/files/99-iscsi.rules
@@ -0,0 +1 @@
+KERNEL=="sd*", SUBSYSTEMS=="block", RUN{program}="/etc/udev/scripts/iscsidev.sh"
diff --git a/sys-block/open-iscsi/files/initiatorname.iscsi b/sys-block/open-iscsi/files/initiatorname.iscsi
new file mode 100644
index 000000000000..9a80438ee9d4
--- /dev/null
+++ b/sys-block/open-iscsi/files/initiatorname.iscsi
@@ -0,0 +1,31 @@
+# Copyright 1999-2005 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+#
+# This file must contain a InitiatorName entry!
+# white space is significent here!
+#InitiatorName=iqn.2005-09.tld.domain.hostname:openiscsi-initiator
+#InitiatorAlias=foobar
+
+# Sample documentation follows:
+
+# The InitiatorName should take the following format
+# iqn.${YEAR}-${MONTH}-${DOMAIN_REVERSED}.${HOSTNAME}:${UNIQUE_STRING}
+# Where YEAR and MONTH are the dates that your domain was registered.
+# You can use WHOIS to find when your domain was registered.
+# If you don't have a real domain in the outside world, invent one, but use
+# .local for your top-level.
+
+# Example case #1:
+# This assumes you own foobar.co.uk.
+# Domain name: foobar.co.uk.
+# Registration date: March 2001
+# Hostname: linux
+# InitiatorName=iqn.2001-03.uk.co.foobar.linux:openiscsi-29b48ad602d5f83dd9cd9aa3ef741216
+
+# Example case #2:
+# This assumes you don't have a domain of your own.
+# Domain name: foobar.local
+# Registration date: March 2001
+# Hostname: linux
+# InitiatorName=iqn.2001-03.local.foobar.linux:openiscsi-29b48ad602d5f83dd9cd9aa3ef741216
diff --git a/sys-block/open-iscsi/files/iscsid-conf.d b/sys-block/open-iscsi/files/iscsid-conf.d
new file mode 100644
index 000000000000..02e584fbce52
--- /dev/null
+++ b/sys-block/open-iscsi/files/iscsid-conf.d
@@ -0,0 +1,18 @@
+# /etc/conf.d/iscsid
+
+# config file to use
+CONFIG_FILE=/etc/iscsi/iscsid.conf
+
+# you need to specify an initiatorname in the file
+INITIATORNAME_FILE=/etc/iscsi/initiatorname.iscsi
+
+# options to pass to iscsid
+OPTS="-i ${INITIATORNAME_FILE}"
+
+# Start automatic targets when iscsid is started
+AUTOSTARTTARGETS="yes"
+
+# if set to "strict", iscsid will stop, if connecting the
+# autostart targets failed
+# AUTOSTART="strict"
+
diff --git a/sys-block/open-iscsi/files/iscsid-init.d b/sys-block/open-iscsi/files/iscsid-init.d
new file mode 100644
index 000000000000..6bd49ab09afe
--- /dev/null
+++ b/sys-block/open-iscsi/files/iscsid-init.d
@@ -0,0 +1,107 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+command="/usr/sbin/iscsid"
+command_args="${OPTS}"
+start_stop_daemon_args="-w 100" # iscsid might fail e.g. when the iSCSI kernel modules aren't available
+pidfile=${PIDFILE:-/var/run/${SVCNAME}.pid}
+
+extra_started_commands="starttargets stoptargets"
+extra_commands="restarttargets"
+
+ISCSIADM=/usr/sbin/iscsiadm
+
+depend() {
+ after modules multipath
+ use net
+}
+
+checkconfig() {
+ if [ ! -e /etc/conf.d/${SVCNAME} ]; then
+ eerror "Config file /etc/conf.d/${SVCNAME} does not exist!"
+ return 1
+ fi
+ if [ ! -e "${CONFIG_FILE}" ]; then
+ eerror "Config file ${CONFIG_FILE} does not exist!"
+ return 1
+ fi
+
+ if [ -e ${INITIATORNAME_FILE} ]; then
+ . ${INITIATORNAME_FILE}
+ fi
+ if [ ! -e ${INITIATORNAME_FILE} -o -z "${InitiatorName}" ]; then
+ ewarn "${INITIATORNAME_FILE} should contain a string with your initiatior name."
+ local IQN=$(/usr/sbin/iscsi-iname)
+ ebegin "Creating InitiatorName ${IQN} in ${INITIATORNAME_FILE}"
+ echo "InitiatorName=${IQN}" >> "${INITIATORNAME_FILE}"
+ eend $?
+ fi
+}
+
+starttargets() {
+ ebegin "Setting up iSCSI targets"
+ $ISCSIADM -m node --loginall=automatic
+ local ret=$?
+ eend $ret
+ return $ret
+}
+
+stoptargets() {
+ ebegin "Disconnecting iSCSI targets"
+ sync
+ $ISCSIADM -m node --logoutall=all
+ local ret=$?
+
+ if [ $ret -eq 21 ]; then
+ # See man iscsiadm(8)
+ einfo "No active sessions to disconnect"
+ eend 0
+ return 0
+ fi
+
+ eend $ret
+ return $ret
+}
+
+restarttargets() {
+ stoptargets
+ starttargets
+}
+
+status() {
+ ebegin "Showing current active iSCSI sessions"
+ $ISCSIADM -m session
+}
+
+
+start_pre() {
+ local ret=1
+
+ ebegin "Checking Open-iSCSI configuration"
+ checkconfig
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eend 1
+ return 1
+ fi
+ eend 0
+}
+
+start_post() {
+ # Start automatic targets when iscsid is started
+ if [ "${AUTOSTARTTARGETS}" = "yes" ]; then
+ starttargets
+ local ret=$?
+ if [ "${AUTOSTART}" = "strict" -a $ret -ne 0 ]; then
+ stop
+ return $ret
+ fi
+ fi
+ return 0
+}
+
+stop_pre() {
+ stoptargets
+}
diff --git a/sys-block/open-iscsi/files/iscsidev.sh b/sys-block/open-iscsi/files/iscsidev.sh
new file mode 100644
index 000000000000..d045fae570fc
--- /dev/null
+++ b/sys-block/open-iscsi/files/iscsidev.sh
@@ -0,0 +1,78 @@
+#!/usr/bin/env bash
+
+# KERNEL=="sd*", SUBSYSTEMS=="block", RUN{program}="/etc/udev/scripts/iscsidev.sh"
+
+# we only care about iscsi devices
+[[ $ID_VENDOR = "IET" ]] || exit 1
+
+# don't care about partitions either
+echo $DEVNAME | egrep -q "[0-9]$"
+status=$?
+[[ $status != 0 ]] || exit 1
+
+#ID_MODEL=VIRTUAL-DISK
+#ID_MODEL_ENC=VIRTUAL-DISK
+#ID_REVISION=0001
+#DEVTYPE=disk
+#ID_BUS=scsi
+#SUBSYSTEM=block
+#ID_SERIAL=1IET_00010001
+#DEVPATH=/devices/platform/host74/session68/target74:0:0/74:0:0:1/block/sde
+#ID_VENDOR_ENC=IET\x20\x20\x20\x20\x20
+#MINOR=64
+#ID_SCSI=1
+#ACTION=add
+#PWD=/
+#ID_PART_TABLE_UUID=54f71c65-a5d5-45cd-8915-5ffd5ff4fea6
+#ID_FS_TYPE=
+#USEC_INITIALIZED=999037905
+#MAJOR=8
+#ID_SCSI_SERIAL=beaf11
+#DEVLINKS=/dev/disk/by-id/scsi-1IET_00010001
+#DEVNAME=/dev/sde
+#SHLVL=1
+#ID_TYPE=disk
+#ID_PART_TABLE_TYPE=gpt
+#ID_VENDOR=IET
+#ID_SERIAL_SHORT=IET_00010001
+#SEQNUM=25775
+
+# do the removal
+if [[ $ACTION = 'remove' ]]; then
+ # nohup needed so this isn't constantly run...
+ nohup find -L /dev/disk/by-path/ -type l -lname ${DEVNAME} -exec rm "{}" + 2>/dev/null &
+ exit 0
+fi
+
+TARGET_NAME=$(lsscsi -t | grep "${DEVNAME}" | awk '{print $3}' | awk -F, '{print $1}')
+[[ $TARGET_NAME = '' ]] && exit 1
+
+# we don't know which host is correct
+declare -a POSSIBLE_HOSTS
+declare -a POSSIBLE_PORTS
+for item in $(cat /sys/class/iscsi_connection/connection*/address); do
+ POSSIBLE_HOSTS+=("${item}")
+done
+for item in $(cat /sys/class/iscsi_connection/connection*/port); do
+ POSSIBLE_PORTS+=("${item}")
+done
+
+#get correct ip and port
+for ((i=0;i<${#POSSIBLE_HOSTS[@]};++i)); do
+ printf "%s is in %s\n" "$POSSIBLE_HOSTS[i]}" "${POSSIBLE_PORTS[i]}"
+ iscsiadm --mode node --targetname "${TARGET_NAME}" -p "${POSSIBLE_HOSTS[i]}":"${POSSIBLE_PORTS[i]}"
+ status=$?
+ if [[ $status = 0 ]]; then
+ TARGET_IP="${POSSIBLE_HOSTS[i]}"
+ TARGET_PORT="${POSSIBLE_PORTS[i]}"
+ break
+ fi
+done
+
+# exit if not found
+[[ -z $TARGET_IP ]] && exit 1
+[[ -z $TARGET_PORT ]] && exit 1
+
+# actually create the link
+mkdir -p /dev/disk/by-path/
+ln -s "${DEVNAME}" "/dev/disk/by-path/ip-${TARGET_IP}:${TARGET_PORT}-iscsi-${TARGET_NAME}-lun-1"
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.872-conf.d b/sys-block/open-iscsi/files/open-iscsi-2.0.872-conf.d
new file mode 100644
index 000000000000..02e584fbce52
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.872-conf.d
@@ -0,0 +1,18 @@
+# /etc/conf.d/iscsid
+
+# config file to use
+CONFIG_FILE=/etc/iscsi/iscsid.conf
+
+# you need to specify an initiatorname in the file
+INITIATORNAME_FILE=/etc/iscsi/initiatorname.iscsi
+
+# options to pass to iscsid
+OPTS="-i ${INITIATORNAME_FILE}"
+
+# Start automatic targets when iscsid is started
+AUTOSTARTTARGETS="yes"
+
+# if set to "strict", iscsid will stop, if connecting the
+# autostart targets failed
+# AUTOSTART="strict"
+
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.872-dont-call-configure.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.872-dont-call-configure.patch
new file mode 100644
index 000000000000..185f1acd8373
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.872-dont-call-configure.patch
@@ -0,0 +1,11 @@
+--- open-iscsi-2.0-872.orig/Makefile
++++ open-iscsi-2.0-872/Makefile
+@@ -27,7 +27,7 @@ IFACEFILES = etc/iface.example
+ all: user kernel
+
+ user: ;
+- cd utils/open-isns; ./configure; $(MAKE)
++ cd utils/open-isns; $(MAKE)
+ $(MAKE) -C utils/sysdeps
+ $(MAKE) -C utils/fwparam_ibft
+ $(MAKE) -C usr
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.872-glibc212.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.872-glibc212.patch
new file mode 100644
index 000000000000..61717032940a
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.872-glibc212.patch
@@ -0,0 +1,10 @@
+--- usr/iscsid.c 2010-10-10 23:06:37.000000000 +0200
++++ usr/iscsid.c 2010-10-10 23:07:55.000000000 +0200
+@@ -31,6 +31,7 @@
+ #include <sys/utsname.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
++#include <sys/stat.h>
+
+ #include "iscsid.h"
+ #include "mgmt_ipc.h"
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.872-init.d-r1 b/sys-block/open-iscsi/files/open-iscsi-2.0.872-init.d-r1
new file mode 100644
index 000000000000..aa6cebf690e6
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.872-init.d-r1
@@ -0,0 +1,131 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+opts="${opts} starttargets stoptargets restarttargets"
+
+depend() {
+ after modules
+ use net
+}
+
+PIDFILE=${PIDFILE:-/var/run/${SVCNAME}.pid}
+BINARY="/usr/sbin/iscsid"
+
+checkconfig() {
+ if [ ! -e /etc/conf.d/${SVCNAME} ]; then
+ eerror "Config file /etc/conf.d/${SVCNAME} does not exist!"
+ return 1
+ fi
+ if [ ! -e "${CONFIG_FILE}" ]; then
+ eerror "Config file ${CONFIG_FILE} does not exist!"
+ return 1
+ fi
+ if [ ! -e ${INITIATORNAME_FILE} ] || [ ! "$(grep "^InitiatorName=iqn\." ${INITIATORNAME_FILE})" ]; then
+ ewarn "${INITIATORNAME_FILE} should contain a string with your initiatior name."
+ IQN=iqn.$(date +%Y-%m).$(hostname -f | awk 'BEGIN { FS=".";}{x=NF; while (x>0) {printf $x ;x--; if (x>0) printf ".";} print ""}'):openiscsi
+ IQN=${IQN}-$(echo ${RANDOM}${RANDOM}${RANDOM}${RANDOM}${RANDOM} | md5sum | sed -e "s/\(.*\) -/\1/g" -e 's/ //g')
+ ebegin "Creating InitiatorName ${IQN} in ${INITIATORNAME_FILE}"
+ echo "InitiatorName=${IQN}" >> "${INITIATORNAME_FILE}"
+ eend $?
+ fi
+}
+
+do_modules() {
+ msg="$1"
+ shift
+ modules="${1}"
+ shift
+ modopts="$@"
+ for m in ${modules}
+ do
+ if modprobe --show --quiet "${m}"
+ then
+ ebegin "${msg} ${m}"
+ modprobe ${modopts} ${m}
+ ret=$?
+ eend ${ret}
+ if [ ${ret} -ne 0 ]; then
+ return ${ret}
+ fi
+ else
+ ebegin "${msg} ${m}: not found"
+ return 1
+ fi
+ done
+ return 0
+}
+
+start() {
+ ebegin "Checking open-iSCSI configuration"
+ checkconfig
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eend 1
+ return 1
+ fi
+ ebegin "Loading iSCSI modules"
+ do_modules 'Loading' 'libiscsi scsi_transport_iscsi iscsi_tcp'
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eend 1
+ return 1
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --quiet --exec ${BINARY} -- ${OPTS}
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eend $?
+ return $?
+ fi
+
+ # Start automatic targets when iscsid is started
+ if [ "${AUTOSTARTTARGETS}" = "yes" ]; then
+ starttargets
+ ret=$?
+ if [ "${AUTOSTART}" = "strict" ] && [ $ret -ne 0 ]; then
+ stop
+ return $ret
+ fi
+ fi
+ return 0
+}
+
+stop() {
+ stoptargets
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet --exec ${BINARY} --pidfile ${PIDFILE}
+ eend $?
+
+ do_modules 'Removing iSCSI modules' 'iscsi_tcp scsi_transport_iscsi libiscsi' '-r'
+ eend $?
+}
+
+starttargets() {
+ ebegin "Setting up iSCSI targets"
+ /usr/sbin/iscsiadm -m node --loginall=automatic
+ ret=$?
+ eend $ret
+ return $ret
+}
+
+stoptargets() {
+ ebegin "Disconnecting iSCSI targets"
+ sync
+ /usr/sbin/iscsiadm -m node --logoutall=all
+ ret=$?
+ eend $ret
+ return $ret
+}
+
+restarttargets() {
+ stoptargets
+ starttargets
+}
+
+status() {
+ ebegin "Showing current active iSCSI sessions"
+ /usr/sbin/iscsiadm -m session
+}
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.872-isns-slp.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.872-isns-slp.patch
new file mode 100644
index 000000000000..db280a3dd862
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.872-isns-slp.patch
@@ -0,0 +1,16 @@
+diff -Nuar open-iscsi-2.0-872.orig/usr/Makefile open-iscsi-2.0-872/usr/Makefile
+--- open-iscsi-2.0-872.orig/usr/Makefile 2012-02-09 08:25:13.656604152 +0000
++++ open-iscsi-2.0-872/usr/Makefile 2012-02-09 08:26:28.960171260 +0000
+@@ -53,10 +53,10 @@
+
+ iscsid: $(ISCSI_LIB_SRCS) $(IPC_OBJ) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
+ iscsid.o session_mgmt.o discoveryd.o
+- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns $(SLP_LIBS) -lcrypto
+
+ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
+- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns $(SLP_LIBS) -lcrypto
+
+ iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
+ iscsistart.o statics.o
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.872-ldflags.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.872-ldflags.patch
new file mode 100644
index 000000000000..fc02cbcc1ec4
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.872-ldflags.patch
@@ -0,0 +1,11 @@
+--- utils/Makefile 2011-05-31 01:30:27.302609540 +0200
++++ utils/Makefile 2011-05-31 01:32:50.229602790 +0200
+@@ -6,7 +6,7 @@
+ all: $(PROGRAMS)
+
+ iscsi-iname: md5.o iscsi-iname.o
+- $(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(DBM_LIB) -o $@
+
+ clean:
+ rm -f *.o $(PROGRAMS) .depend
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.872-makefile-cleanup-pass2.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.872-makefile-cleanup-pass2.patch
new file mode 100644
index 000000000000..fb563d10e1bc
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.872-makefile-cleanup-pass2.patch
@@ -0,0 +1,55 @@
+diff -NuarwbB open-iscsi-2.0-872/usr/Makefile open-iscsi-2.0-872.orig/usr/Makefile
+--- open-iscsi-2.0-872.orig/usr/Makefile 2012-02-09 08:58:04.402623915 +0000
++++ open-iscsi-2.0-872/usr/Makefile 2012-02-09 08:56:51.159070006 +0000
+@@ -65,6 +65,6 @@
+ rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
+
+ depend:
++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
+- gcc $(CFLAGS) -M `ls *.c` > .depend
+
+ -include .depend
+diff -NuarwbB open-iscsi-2.0-872/utils/fwparam_ibft/Makefile open-iscsi-2.0-872.orig/utils/fwparam_ibft/Makefile
+--- open-iscsi-2.0-872.orig/utils/fwparam_ibft/Makefile 2012-02-09 08:57:58.579273051 +0000
++++ open-iscsi-2.0-872/utils/fwparam_ibft/Makefile 2010-08-11 15:27:07.000000000 +0000
+@@ -38,6 +38,6 @@
+ $(OBJS): prom_parse.tab.h prom_parse.h fwparam_ibft.h
+
+ depend:
++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
+- gcc $(CFLAGS) -M `ls *.c` > .depend
+
+ -include .depend
+diff -NuarwbB open-iscsi-2.0-872/utils/Makefile open-iscsi-2.0-872.orig/utils/Makefile
+--- open-iscsi-2.0-872.orig/utils/Makefile 2012-02-09 08:57:37.825877235 +0000
++++ open-iscsi-2.0-872/utils/Makefile 2012-02-09 08:56:51.145736633 +0000
+@@ -12,6 +12,6 @@
+ rm -f *.o $(PROGRAMS) .depend
+
+ depend:
++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
+- gcc $(CFLAGS) -M `ls *.c` > .depend
+
+ -include .depend
+diff -NuarwbB open-iscsi-2.0-872/utils/open-isns/Makefile.in open-iscsi-2.0-872.orig/utils/open-isns/Makefile.in
+--- open-iscsi-2.0-872.orig/utils/open-isns/Makefile.in 2012-02-09 08:57:47.812573971 +0000
++++ open-iscsi-2.0-872/utils/open-isns/Makefile.in 2010-08-11 15:27:07.000000000 +0000
+@@ -77,6 +77,6 @@
+ ar cr $@ $(LIBOBJS)
+
+ depend:
++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
+- gcc $(CFLAGS) -M `ls *.c` > .depend
+
+ -include .depend
+diff -NuarwbB open-iscsi-2.0-872/utils/sysdeps/Makefile open-iscsi-2.0-872.orig/utils/sysdeps/Makefile
+--- open-iscsi-2.0-872.orig/utils/sysdeps/Makefile 2012-02-09 08:57:43.459227530 +0000
++++ open-iscsi-2.0-872/utils/sysdeps/Makefile 2010-08-11 15:27:07.000000000 +0000
+@@ -10,6 +10,6 @@
+ rm -f *.o .depend
+
+ depend:
++ $(CC) $(CFLAGS) -M `ls *.c` > .depend
+- gcc $(CFLAGS) -M `ls *.c` > .depend
+
+ -include .depend
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.872-makefile-cleanup.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.872-makefile-cleanup.patch
new file mode 100644
index 000000000000..b3e93f459fc2
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.872-makefile-cleanup.patch
@@ -0,0 +1,20 @@
+--- usr/Makefile 2010-10-10 22:48:04.000000000 +0200
++++ usr/Makefile.ori 2010-10-10 22:48:34.000000000 +0200
+@@ -53,14 +53,14 @@
+
+ iscsid: $(ISCSI_LIB_SRCS) $(IPC_OBJ) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
+ iscsid.o session_mgmt.o discoveryd.o
+- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
+
+ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
+- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
+
+ iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
+ iscsistart.o statics.o
+- $(CC) $(CFLAGS) -static $^ -o $@
++ $(CC) $(CFLAGS) -static $(LDFLAGS) $^ -o $@
+ clean:
+ rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
+
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.873-Makefiles.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.873-Makefiles.patch
new file mode 100644
index 000000000000..db5d6d14ec5a
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.873-Makefiles.patch
@@ -0,0 +1,161 @@
+diff --git a/Makefile b/Makefile
+index c5d9700..4dbff18 100644
+--- a/Makefile
++++ b/Makefile
+@@ -14,8 +14,8 @@ mandir = $(prefix)/share/man
+ etcdir = /etc
+ initddir = $(etcdir)/init.d
+
+-MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8
+-PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname
++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
+@@ -84,11 +84,11 @@ install_programs: $(PROGRAMS)
+ # 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
+
+@@ -115,7 +115,7 @@ install_iface: $(IFACEFILES)
+ $(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi/ifaces
+
+ install_etc: $(ETCFILES)
+- if [ ! -f /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
+@@ -128,11 +128,11 @@ install_kernel:
+ $(MAKE) -C kernel install_kernel
+
+ install_iname:
+- if [ ! -f /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 /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 --git a/usr/Makefile b/usr/Makefile
+index 673b7f1..83507f3 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -54,18 +54,18 @@ all: $(PROGRAMS)
+
+ iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
+ iscsid.o session_mgmt.o discoveryd.o
+- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns
+
+ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
+- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns
+
+ iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
+ iscsistart.o statics.o
+- $(CC) $(CFLAGS) -static $^ -o $@
++ $(CC) $(CFLAGS) -static $(LDFLAGS) $^ -o $@
+ 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 --git a/utils/Makefile b/utils/Makefile
+index 2c7e891..62c49fa 100644
+--- a/utils/Makefile
++++ b/utils/Makefile
+@@ -1,17 +1,18 @@
+ # This Makefile will work only with GNU make.
+
+-CFLAGS += $(OPTFLAGS) -O2 -fno-inline -Wall -Wstrict-prototypes -g
++OPTFLAGS ?= -O2 -g
++CFLAGS += $(OPTFLAGS) -fno-inline -Wall -Wstrict-prototypes
+ PROGRAMS = iscsi-iname
+
+ all: $(PROGRAMS)
+
+ iscsi-iname: md5.o iscsi-iname.o
+- $(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@
++ $(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 --git a/utils/fwparam_ibft/Makefile b/utils/fwparam_ibft/Makefile
+index c72bb7f..a36c2d2 100644
+--- a/utils/fwparam_ibft/Makefile
++++ b/utils/fwparam_ibft/Makefile
+@@ -26,18 +26,18 @@ OBJS := fw_entry.o fwparam_sysfs.o $(SYSDEPS_OBJS) ../../usr/iscsi_net_util.o
+ OBJS += prom_lex.o prom_parse.tab.o fwparam_ppc.o
+ CLEANFILES = $(OBJS) *.output *~
+
+-OPTFLAGS ?= -O2 -g -fPIC
++OPTFLAGS ?= -O2 -g
+ WARNFLAGS ?= -Wall -Wstrict-prototypes
+-CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -I../../include -I../../usr -D_GNU_SOURCE
++CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -fPIC -I../../include -I../../usr -D_GNU_SOURCE
+
+ 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 --git a/utils/sysdeps/Makefile b/utils/sysdeps/Makefile
+index 53c10e5..19cfe19 100644
+--- a/utils/sysdeps/Makefile
++++ b/utils/sysdeps/Makefile
+@@ -1,15 +1,16 @@
+ # This Makefile will work only with GNU make.
+
+-CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -O2 -fno-inline -Wall -Wstrict-prototypes -g
++OPTFLAGS ?= -O2 -g
++CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -fno-inline -Wall -Wstrict-prototypes
+
+ SYSDEPS_OBJS=sysdeps.o
+
+ 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/metadata.xml b/sys-block/open-iscsi/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-block/open-iscsi/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-block/open-iscsi/open-iscsi-2.0.872-r2.ebuild b/sys-block/open-iscsi/open-iscsi-2.0.872-r2.ebuild
new file mode 100644
index 000000000000..a4244e993024
--- /dev/null
+++ b/sys-block/open-iscsi/open-iscsi-2.0.872-r2.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit versionator linux-info eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Open-iSCSI is a high performance, transport independent, multi-platform implementation of RFC3720"
+HOMEPAGE="http://www.open-iscsi.org/"
+MY_PV="${PN}-$(replace_version_separator 2 "-" $MY_PV)"
+SRC_URI="http://www.open-iscsi.org/bits/${MY_PV}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ~mips ppc ppc64 sparc x86"
+IUSE="debug slp"
+DEPEND="slp? ( net-libs/openslp )"
+RDEPEND="${DEPEND}
+ sys-apps/util-linux"
+
+S="${WORKDIR}/${MY_PV}"
+
+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 builtion options don't work. See this for
+ # more information:
+ # http://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966
+ # If there's a new release, check whether this is still valid!
+ CONFIG_CHECK_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP"
+ if linux_config_exists; then
+ for module in ${CONFIG_CHECK_MODULES}; do
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"
+ done
+ fi
+}
+
+src_prepare() {
+ export EPATCH_OPTS="-d${S}"
+ epatch "${FILESDIR}"/${PN}-2.0.872-makefile-cleanup.patch
+ epatch "${FILESDIR}"/${P}-glibc212.patch
+ epatch "${FILESDIR}"/${P}-dont-call-configure.patch
+ epatch "${FILESDIR}"/${P}-ldflags.patch
+ epatch "${FILESDIR}"/${P}-isns-slp.patch
+ epatch "${FILESDIR}"/${PN}-2.0.872-makefile-cleanup-pass2.patch
+}
+
+src_configure() {
+ cd utils/open-isns || die
+ econf $(use_with slp)
+}
+
+src_compile() {
+ use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI
+
+ einfo "Building userspace"
+ local SLP_LIBS
+ use slp && SLP_LIBS="-lslp"
+ cd "${S}" && \
+ KSRC="${KV_DIR}" CFLAGS="" \
+ emake \
+ OPTFLAGS="${CFLAGS}" SLP_LIBS="${SLP_LIBS}" \
+ AR="$(tc-getAR)" CC="$(tc-getCC)" \
+ user \
+ || die "emake failed"
+}
+
+src_install() {
+ einfo "Installing userspace"
+ dosbin usr/iscsid usr/iscsiadm usr/iscsistart || die
+
+ einfo "Installing utilities"
+ dosbin utils/iscsi-iname utils/iscsi_discovery || die
+
+ einfo "Installing docs"
+ doman doc/*[1-8] || die
+ dodoc README THANKS || die
+ docinto test || die
+ dodoc test/* || die
+
+ einfo "Installing configuration"
+ insinto /etc/iscsi
+ doins etc/iscsid.conf || die
+ newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example || die
+ insinto /etc/iscsi/ifaces
+ doins etc/iface.example || die
+
+ newconfd "${FILESDIR}"/${P}-conf.d iscsid || die
+ newinitd "${FILESDIR}"/${P}-init.d-r1 iscsid || die
+
+ keepdir /var/db/iscsi
+ fperms 700 /var/db/iscsi || die
+ fperms 600 /etc/iscsi/iscsid.conf || die
+}
+
+pkg_postinst() {
+ in='/etc/iscsi/initiatorname.iscsi'
+ if [ ! -f "${ROOT}${in}" -a -f "${ROOT}${in}.example" ]; then
+ cp -f "${ROOT}${in}.example" "${ROOT}${in}"
+ fi
+}
diff --git a/sys-block/open-iscsi/open-iscsi-2.0.872-r3.ebuild b/sys-block/open-iscsi/open-iscsi-2.0.872-r3.ebuild
new file mode 100644
index 000000000000..f711d80bef50
--- /dev/null
+++ b/sys-block/open-iscsi/open-iscsi-2.0.872-r3.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit versionator linux-info eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Open-iSCSI is a high performance, transport independent, multi-platform implementation of RFC3720"
+HOMEPAGE="http://www.open-iscsi.org/"
+MY_PV="${PN}-$(replace_version_separator 2 "-" $MY_PV)"
+SRC_URI="http://www.open-iscsi.org/bits/${MY_PV}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug slp"
+DEPEND="slp? ( net-libs/openslp )"
+RDEPEND="${DEPEND}
+ virtual/udev
+ sys-fs/lsscsi
+ sys-apps/util-linux"
+
+S="${WORKDIR}/${MY_PV}"
+
+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 builtion options don't work. See this for
+ # more information:
+ # http://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966
+ # If there's a new release, check whether this is still valid!
+ CONFIG_CHECK_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP"
+ if linux_config_exists; then
+ for module in ${CONFIG_CHECK_MODULES}; do
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"
+ done
+ fi
+}
+
+src_prepare() {
+ export EPATCH_OPTS="-d${S}"
+ epatch "${FILESDIR}"/${PN}-2.0.872-makefile-cleanup.patch
+ epatch "${FILESDIR}"/${P}-glibc212.patch
+ epatch "${FILESDIR}"/${P}-dont-call-configure.patch
+ epatch "${FILESDIR}"/${P}-ldflags.patch
+ epatch "${FILESDIR}"/${P}-isns-slp.patch
+ epatch "${FILESDIR}"/${PN}-2.0.872-makefile-cleanup-pass2.patch
+}
+
+src_configure() {
+ cd utils/open-isns || die
+ econf $(use_with slp)
+}
+
+src_compile() {
+ use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI
+
+ einfo "Building userspace"
+ local SLP_LIBS
+ use slp && SLP_LIBS="-lslp"
+ cd "${S}" && \
+ KSRC="${KV_DIR}" CFLAGS="" \
+ emake \
+ OPTFLAGS="${CFLAGS}" SLP_LIBS="${SLP_LIBS}" \
+ AR="$(tc-getAR)" CC="$(tc-getCC)" \
+ user \
+ || die "emake failed"
+}
+
+src_install() {
+ einfo "Installing userspace"
+ dosbin usr/iscsid usr/iscsiadm usr/iscsistart || die
+
+ einfo "Installing utilities"
+ dosbin utils/iscsi-iname utils/iscsi_discovery || die
+
+ einfo "Installing docs"
+ doman doc/*[1-8] || die
+ dodoc README THANKS || die
+ docinto test || die
+ dodoc test/* || die
+
+ einfo "Installing configuration"
+ insinto /etc/iscsi
+ doins etc/iscsid.conf || die
+ newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example || die
+ insinto /etc/iscsi/ifaces
+ doins etc/iface.example || die
+
+ newconfd "${FILESDIR}"/${P}-conf.d iscsid || die
+ newinitd "${FILESDIR}"/${P}-init.d-r1 iscsid || die
+
+ # udev pieces
+ insinto /etc/udev/scripts
+ doins "${FILESDIR}"/iscsidev.sh
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/99-iscsi.rules
+
+ keepdir /var/db/iscsi
+ fperms 700 /var/db/iscsi || die
+ fperms 600 /etc/iscsi/iscsid.conf || die
+}
+
+pkg_postinst() {
+ in='/etc/iscsi/initiatorname.iscsi'
+ if [ ! -f "${ROOT}${in}" -a -f "${ROOT}${in}.example" ]; then
+ cp -f "${ROOT}${in}.example" "${ROOT}${in}"
+ fi
+}
diff --git a/sys-block/open-iscsi/open-iscsi-2.0.873.ebuild b/sys-block/open-iscsi/open-iscsi-2.0.873.ebuild
new file mode 100644
index 000000000000..b0502a974ac8
--- /dev/null
+++ b/sys-block/open-iscsi/open-iscsi-2.0.873.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit versionator linux-info eutils flag-o-matic toolchain-funcs
+
+MY_PV="${PN}-$(replace_version_separator 2 "-" $MY_PV)"
+
+DESCRIPTION="Open-iSCSI is a high performance, transport independent, multi-platform implementation of RFC3720"
+HOMEPAGE="http://www.open-iscsi.org/"
+SRC_URI="http://www.open-iscsi.org/bits/${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug slp"
+
+DEPEND="slp? ( net-libs/openslp )"
+RDEPEND="${DEPEND}
+ virtual/udev
+ sys-fs/lsscsi
+ sys-apps/util-linux"
+
+S="${WORKDIR}/${MY_PV}"
+
+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 builtion options don't work. See this for
+ # more information:
+ # http://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966
+ # If there's a new release, check whether this is still valid!
+ CONFIG_CHECK_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP"
+ if linux_config_exists; then
+ for module in ${CONFIG_CHECK_MODULES}; do
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"
+ done
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-Makefiles.patch
+
+ sed -i -e 's:^\(iscsid.startup\)\s*=.*:\1 = /usr/sbin/iscsid:' etc/iscsid.conf || die
+}
+
+src_configure() {
+ cd utils/open-isns || die
+
+ # SSL (--with-security) is broken
+ econf $(use_with slp) \
+ --without-security
+}
+
+src_compile() {
+ use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI
+
+ KSRC="${KV_DIR}" CFLAGS="" \
+ emake \
+ OPTFLAGS="${CFLAGS}" \
+ AR="$(tc-getAR)" CC="$(tc-getCC)" \
+ user
+}
+
+src_install() {
+ emake DESTDIR="${D}" sbindir="${ROOT}usr/sbin/" install
+
+ dodoc README THANKS
+
+ docinto test/
+ dodoc test/*
+
+ insinto /etc/iscsi
+ newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example
+ # udev pieces
+ insinto /etc/udev/scripts
+ doins "${FILESDIR}"/iscsidev.sh
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/99-iscsi.rules
+
+ 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
+}