1 |
commit: abe6e227aa073188478e4ef0f767be978d94cc38 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 3 02:38:41 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 3 02:40:29 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=abe6e227 |
7 |
|
8 |
sys-block/open-iscsi: add 2.1.6 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
sys-block/open-iscsi/Manifest | 1 + |
13 |
.../files/open-iscsi-2.1.6-Makefiles.patch | 81 ++++++++++++ |
14 |
sys-block/open-iscsi/open-iscsi-2.1.6.ebuild | 141 +++++++++++++++++++++ |
15 |
3 files changed, 223 insertions(+) |
16 |
|
17 |
diff --git a/sys-block/open-iscsi/Manifest b/sys-block/open-iscsi/Manifest |
18 |
index 27e0fa000d2b..29d5b970a89c 100644 |
19 |
--- a/sys-block/open-iscsi/Manifest |
20 |
+++ b/sys-block/open-iscsi/Manifest |
21 |
@@ -1 +1,2 @@ |
22 |
DIST open-iscsi-2.1.4.tar.gz 621247 BLAKE2B 043a999b2f397a6c740d61654079d7ab966caee6cf6cfb244ddd70eae4f5201045b371ce5fbe244216a2a210a5379c92e8c3fbe62d33707cf05e7a4a20a13a91 SHA512 ae0663a964d86e6a4c19203598b859173c93ecce550f9bc9855ff735dd51a3c45822f2bc1cc99e6891c56ef1d16c42223803f07a961558fe6e38ead2164faef3 |
23 |
+DIST open-iscsi-2.1.6.tar.gz 623721 BLAKE2B c7c09e38fd10bd5c2a5e8ad8030cf2338de3382fe4acae0e3c1bf3cacb6e244e411b7556403e0c43fd03035836f46cc4836683188e2f159cd7fc066aef78a868 SHA512 4a32a76c1c32d7d1a01fe3a0f88ce9616a54323ec043757be73051eb41ebae8de90ce057acce72fb6fe07aa47e814c9bc6ee88b13fa7d7769ca10c5175974f1d |
24 |
|
25 |
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.1.6-Makefiles.patch b/sys-block/open-iscsi/files/open-iscsi-2.1.6-Makefiles.patch |
26 |
new file mode 100644 |
27 |
index 000000000000..a25acc0c85db |
28 |
--- /dev/null |
29 |
+++ b/sys-block/open-iscsi/files/open-iscsi-2.1.6-Makefiles.patch |
30 |
@@ -0,0 +1,81 @@ |
31 |
+https://github.com/open-iscsi/open-iscsi/pull/333 |
32 |
+ |
33 |
+It's not the full series from that PR yet because |
34 |
+our previous patch handles some of it (the most important bits) |
35 |
+and some layout changed upstream pre-next release. |
36 |
+ |
37 |
+From 96667e0e06a65c94fd875db048776aad29eea829 Mon Sep 17 00:00:00 2001 |
38 |
+From: Sam James <sam@g.o> |
39 |
+Date: Sun, 3 Apr 2022 03:22:32 +0100 |
40 |
+Subject: [PATCH] iscsiuio: don't clobber LDFLAGS in configure.ac |
41 |
+ |
42 |
+The systemd check currently clobbers LDFLAGS from the environment |
43 |
+rather than appending to it. |
44 |
+ |
45 |
+But we actually want LIBS here anyway, rather than LDFLAGS. |
46 |
+ |
47 |
+Signed-off-by: Sam James <sam@g.o> |
48 |
+--- a/iscsiuio/configure.ac |
49 |
++++ b/iscsiuio/configure.ac |
50 |
+@@ -72,7 +72,7 @@ AC_ARG_WITH([systemd], |
51 |
+ *) AC_MSG_ERROR([bad value $withval for --with-systemd]) ;; |
52 |
+ esac],[with_libsystemd=auto]) |
53 |
+ AS_IF([test "$with_libsystemd" != no],[ |
54 |
+- PKG_CHECK_MODULES([LIBSYSTEMD],[libsystemd],[LDFLAGS=$LIBSYSTEMD_LIBS],[ |
55 |
++ PKG_CHECK_MODULES([LIBSYSTEMD],[libsystemd],[LIBS="${LIBS} $LIBSYSTEMD_LIBS"],[ |
56 |
+ if test "$with_libsystemd" = yes; then |
57 |
+ AC_MSG_ERROR([could not find libsystemd using pkg-config]) |
58 |
+ else |
59 |
+From 9fbd6009cd917f1152a367fa7e5ae3993133c1e4 Mon Sep 17 00:00:00 2001 |
60 |
+From: Sam James <sam@g.o> |
61 |
+Date: Sun, 3 Apr 2022 03:23:28 +0100 |
62 |
+Subject: [PATCH] iscsiuio: respect LDFLAGS fully |
63 |
+ |
64 |
+Use LIBS rather than LDFLAGS which ensures automake gets the ordering |
65 |
+right (some LDFLAGS values won't work correctly if not placed exactly before |
66 |
+libraries). |
67 |
+ |
68 |
+This should functionally work the same as before, just improve compatibility |
69 |
+with bits like -Wl,--as-needed. |
70 |
+ |
71 |
+Signed-off-by: Sam James <sam@g.o> |
72 |
+--- a/iscsiuio/src/unix/Makefile.am |
73 |
++++ b/iscsiuio/src/unix/Makefile.am |
74 |
+@@ -27,13 +27,14 @@ iscsiuio_CFLAGS = $(AM_CFLAGS) \ |
75 |
+ $(LIBNL_CFLAGS) \ |
76 |
+ -DBYTE_ORDER=@ENDIAN@ |
77 |
+ |
78 |
+-iscsiuio_LDFLAGS= $(AM_LDADD) \ |
79 |
++iscsiuio_LIBS = $(AM_LIBS) \ |
80 |
+ -ldl \ |
81 |
+ -rdynamic \ |
82 |
+ $(LIBNL_LIBS) \ |
83 |
+ -lpthread |
84 |
+ |
85 |
+-iscsiuio_LDADD = ${top_srcdir}/src/uip/lib_iscsi_uip.a \ |
86 |
++iscsiuio_LDADD = $(AM_LDADD) \ |
87 |
++ ${top_srcdir}/src/uip/lib_iscsi_uip.a \ |
88 |
+ ${top_srcdir}/src/apps/dhcpc/lib_apps_dhcpc.a\ |
89 |
+ ${top_srcdir}/src/apps/brcm-iscsi/lib_apps_brcm_iscsi.a \ |
90 |
+ ${top_srcdir}/src/unix/libs/lib_iscsiuio_hw_cnic.a |
91 |
+From 980b1d36e1f5f38c6b33fe3b68a2cb89e4a77b90 Mon Sep 17 00:00:00 2001 |
92 |
+From: Sam James <sam@g.o> |
93 |
+Date: Sun, 3 Apr 2022 03:34:48 +0100 |
94 |
+Subject: [PATCH] libopeniscsiusr: fix version in installed pkgconfig (.pc) |
95 |
+ file |
96 |
+ |
97 |
+Looks like a typo from libnvme. Previously, the installed |
98 |
+.pc file had a blank Version field. |
99 |
+ |
100 |
+Signed-off-by: Sam James <sam@g.o> |
101 |
+--- a/libopeniscsiusr/Makefile |
102 |
++++ b/libopeniscsiusr/Makefile |
103 |
+@@ -89,7 +89,7 @@ install: $(LIBS) $(LIBS_MAJOR) |
104 |
+ ln -sf $(LIBS) $(DESTDIR)/$(LIB_DIR)/$(LIBS_MAJOR) |
105 |
+ $(INSTALL) $(HEADERS) $(DESTDIR)$(INCLUDE_DIR)/ |
106 |
+ $(INSTALL) -m 644 -D $(PKGFILE).in $(DESTDIR)$(PKGCONF_DIR)/$(PKGFILE) |
107 |
+- perl -i -pe 's|__VERSION__|$(LIBNVME_VERSION)|g' \ |
108 |
++ perl -i -pe 's|__VERSION__|$(LIBISCSI_USR_VERSION)|g' \ |
109 |
+ $(DESTDIR)$(PKGCONF_DIR)/$(PKGFILE) |
110 |
+ perl -i -pe 's|__LIB_DIR__|$(LIB_DIR)|g' \ |
111 |
+ $(DESTDIR)$(PKGCONF_DIR)/$(PKGFILE) |
112 |
|
113 |
diff --git a/sys-block/open-iscsi/open-iscsi-2.1.6.ebuild b/sys-block/open-iscsi/open-iscsi-2.1.6.ebuild |
114 |
new file mode 100644 |
115 |
index 000000000000..bcda02c039ab |
116 |
--- /dev/null |
117 |
+++ b/sys-block/open-iscsi/open-iscsi-2.1.6.ebuild |
118 |
@@ -0,0 +1,141 @@ |
119 |
+# Copyright 1999-2022 Gentoo Authors |
120 |
+# Distributed under the terms of the GNU General Public License v2 |
121 |
+ |
122 |
+EAPI=7 |
123 |
+ |
124 |
+inherit autotools linux-info flag-o-matic toolchain-funcs systemd |
125 |
+ |
126 |
+DESCRIPTION="A performant, transport independent, multi-platform implementation of RFC3720" |
127 |
+HOMEPAGE="https://www.open-iscsi.com/" |
128 |
+SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
129 |
+ |
130 |
+LICENSE="GPL-2" |
131 |
+SLOT="0/0.2" |
132 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" |
133 |
+IUSE="debug infiniband +tcp rdma systemd" |
134 |
+REQUIRED_USE="infiniband? ( rdma ) || ( rdma tcp )" |
135 |
+ |
136 |
+DEPEND=" |
137 |
+ sys-apps/kmod |
138 |
+ sys-block/open-isns:= |
139 |
+ sys-kernel/linux-headers |
140 |
+ infiniband? ( sys-cluster/rdma-core ) |
141 |
+ dev-libs/openssl:0= |
142 |
+ systemd? ( sys-apps/systemd ) |
143 |
+" |
144 |
+RDEPEND="${DEPEND} |
145 |
+ sys-fs/lsscsi |
146 |
+ sys-apps/util-linux" |
147 |
+BDEPEND="virtual/pkgconfig" |
148 |
+ |
149 |
+PATCHES=( |
150 |
+ "${FILESDIR}"/${PN}-2.1.1-Makefiles.patch |
151 |
+ "${FILESDIR}"/open-iscsi-2.1.6-Makefiles.patch |
152 |
+) |
153 |
+ |
154 |
+pkg_setup() { |
155 |
+ linux-info_pkg_setup |
156 |
+ |
157 |
+ if kernel_is -lt 2 6 16; then |
158 |
+ die "Sorry, your kernel must be 2.6.16-rc5 or newer!" |
159 |
+ fi |
160 |
+ |
161 |
+ # Needs to be done, as iscsid currently only starts, when having the iSCSI |
162 |
+ # support loaded as module. Kernel builtin options don't work. See this for |
163 |
+ # more information: |
164 |
+ # https://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966 |
165 |
+ # If there's a new release, check whether this is still valid! |
166 |
+ TCP_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP" |
167 |
+ RDMA_MODULES="INFINIBAND_ISER" |
168 |
+ INFINIBAND_MODULES="INFINIBAND_IPOIB INIBAND_USER_MAD INFINIBAND_USER_ACCESS" |
169 |
+ CONFIG_CHECK_MODULES="tcp? ( ${TCP_MODULES} ) rdma? ( ${RDMA_MODULES} ) infiniband? ( ${INFINIBAND_MODULES} )" |
170 |
+ if linux_config_exists; then |
171 |
+ if use tcp; then |
172 |
+ for module in ${TCP_MODULES}; do |
173 |
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)" |
174 |
+ done |
175 |
+ fi |
176 |
+ if use infiniband; then |
177 |
+ for module in ${INFINIBAND_MODULES}; do |
178 |
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)" |
179 |
+ done |
180 |
+ fi |
181 |
+ if use rdma; then |
182 |
+ for module in ${RDMA_MODULES}; do |
183 |
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"$ |
184 |
+ done |
185 |
+ fi |
186 |
+ fi |
187 |
+} |
188 |
+ |
189 |
+src_prepare() { |
190 |
+ sed -e 's:^\(iscsid.startup\)\s*=.*:\1 = /usr/sbin/iscsid:' \ |
191 |
+ -i etc/iscsid.conf || die |
192 |
+ sed -e '/[^usr]\/sbin/s@\(/sbin/\)@/usr\1@' \ |
193 |
+ -i etc/systemd/iscsi* || die |
194 |
+ default |
195 |
+ |
196 |
+ pushd iscsiuio >/dev/null || die |
197 |
+ eautoreconf |
198 |
+ popd >/dev/null || die |
199 |
+} |
200 |
+ |
201 |
+src_configure() { |
202 |
+ use debug && append-cppflags -DDEBUG_TCP -DDEBUG_SCSI |
203 |
+ |
204 |
+ append-lfs-flags |
205 |
+} |
206 |
+ |
207 |
+src_compile() { |
208 |
+ # Stuffing CPPFLAGS into CFLAGS isn't entirely correct, but the build |
209 |
+ # is messed up already here, so it's not making it that much worse. |
210 |
+ KSRC="${KV_DIR}" CFLAGS="" \ |
211 |
+ emake \ |
212 |
+ OPTFLAGS="${CFLAGS} ${CPPFLAGS} $(usex systemd '' -DNO_SYSTEMD)" \ |
213 |
+ AR="$(tc-getAR)" CC="$(tc-getCC)" \ |
214 |
+ $(usex systemd '' NO_SYSTEMD=1) \ |
215 |
+ user |
216 |
+} |
217 |
+ |
218 |
+src_install() { |
219 |
+ emake DESTDIR="${ED}" sbindir="/usr/sbin" SED="${EPREFIX}/bin/sed" install |
220 |
+ |
221 |
+ # Upstream make is not deterministic, per bug #601514 |
222 |
+ rm -f "${ED}"/etc/initiatorname.iscsi |
223 |
+ |
224 |
+ dodoc README THANKS |
225 |
+ |
226 |
+ docinto test/ |
227 |
+ dodoc $(find test -maxdepth 1 -type f ! -name ".*") |
228 |
+ |
229 |
+ insinto /etc/iscsi |
230 |
+ newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example |
231 |
+ |
232 |
+ newconfd "${FILESDIR}"/iscsid-conf.d iscsid |
233 |
+ newinitd "${FILESDIR}"/iscsid-init.d iscsid |
234 |
+ |
235 |
+ local unit |
236 |
+ local units=( |
237 |
+ iscsi{,-init}.service |
238 |
+ iscsid.{service,socket} |
239 |
+ iscsiuio.{service,socket} |
240 |
+ ) |
241 |
+ for unit in ${units[@]} ; do |
242 |
+ systemd_dounit etc/systemd/${unit} |
243 |
+ done |
244 |
+ |
245 |
+ keepdir /var/db/iscsi |
246 |
+ fperms 700 /var/db/iscsi |
247 |
+ fperms 600 /etc/iscsi/iscsid.conf |
248 |
+} |
249 |
+ |
250 |
+pkg_postinst() { |
251 |
+ in='/etc/iscsi/initiatorname.iscsi' |
252 |
+ if [[ ! -f "${EROOT}${in}" ]] && [[ -f "${EROOT}${in}.example" ]] ; then |
253 |
+ { |
254 |
+ cat "${EROOT}${in}.example" |
255 |
+ echo "# InitiatorName generated by ${CATEGORY}/${PF} at $(date -uR)" |
256 |
+ echo "InitiatorName=$(${ROOT}/usr/sbin/iscsi-iname)" |
257 |
+ } >> "${EROOT}${in}.tmp" && mv -f "${EROOT}${in}.tmp" "${EROOT}${in}" |
258 |
+ fi |
259 |
+} |