]>
Commit | Line | Data |
---|---|---|
17e76f5a | 1 | # |
3de50fc5 JB |
2 | # Conditional build: |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
7b7e198b | 6 | Summary: iSCSI - SCSI over IP |
eb81d565 | 7 | Summary(pl.UTF-8): iSCSI - SCSI po IP |
7b7e198b | 8 | Name: open-iscsi |
e621921b | 9 | Version: 2.1.7 |
3de50fc5 | 10 | Release: 1 |
4109f740 | 11 | License: GPL v2 |
eff6dc5c | 12 | Group: Networking/Daemons |
3de50fc5 JB |
13 | #Source0Download: https://github.com/open-iscsi/open-iscsi/releases |
14 | Source0: https://github.com/open-iscsi/open-iscsi/archive/%{version}/%{name}-%{version}.tar.gz | |
e621921b | 15 | # Source0-md5: 87f37b0968ff91ed0253d53d497da4cb |
7b7e198b AM |
16 | Source1: %{name}.init |
17 | Source2: %{name}.sysconfig | |
08d3794f | 18 | Source3: %{name}-devices.init |
12da3c75 | 19 | Source4: iscsiuio.logrotate |
3de50fc5 JB |
20 | # Fedora patches |
21 | Patch1: 0001-unit-file-tweaks.patch | |
22 | # idmb_rec_write refactoring skipped, see 75c46b011d7485a4b5676d824c7f3cdea2076f49 | |
23 | Patch5: 0005-update-initscripts-and-docs.patch | |
24 | # use-var-for-config, use-red-hat-for-name skipped | |
25 | Patch8: 0008-libiscsi.patch | |
26 | Patch9: 0009-Add-macros-to-release-GIL-lock.patch | |
27 | Patch10: 0010-libiscsi-introduce-sessions-API.patch | |
28 | Patch11: 0011-libiscsi-fix-discovery-request-timeout-regression.patch | |
29 | Patch12: 0012-libiscsi-format-security-build-errors.patch | |
30 | Patch13: 0013-libiscsi-fix-build-to-use-libopeniscsiusr.patch | |
31 | Patch14: 0014-libiscsi-fix-build-against-latest-upstream-again.patch | |
32 | Patch15: 0015-remove-the-offload-boot-supported-ifdef.patch | |
33 | Patch16: 0016-Revert-iscsiadm-return-error-when-login-fails.patch | |
34 | # dont-install-scripts, use-var-lib-iscsi-in-libopeniscsiusr skipped | |
35 | Patch19: 0019-Coverity-scan-fixes.patch | |
e621921b | 36 | # fix-upstream-build-breakage-of-iscsiuio-LDFLAGS obsolete in 2.1.7 |
3de50fc5 JB |
37 | # use-Red-Hat-version-string-to-match-RPM-package-vers skipped |
38 | Patch22: 0022-iscsi_if.h-replace-zero-length-array-with-flexible-a.patch | |
39 | Patch23: 0023-stop-using-Werror-for-now.patch | |
40 | Patch24: 0024-minor-service-file-updates.patch | |
e621921b | 41 | # Remove-dependences-from-iscsi-init.service obsolete in 2.1.7 |
3de50fc5 JB |
42 | # PLD specific |
43 | Patch100: %{name}-systemd.patch | |
44 | Patch101: %{name}-libiscsi.patch | |
45 | URL: https://www.open-iscsi.com/ | |
12da3c75 | 46 | BuildRequires: kmod-devel |
3de50fc5 | 47 | BuildRequires: open-isns-devel |
4109f740 | 48 | BuildRequires: openssl-devel |
3de50fc5 JB |
49 | %{?with_python2:BuildRequires: python-devel >= 1:2.5} |
50 | %{?with_python3:BuildRequires: python3-devel >= 1:3.2} | |
51 | BuildRequires: rpm-pythonprov | |
52 | BuildRequires: rpmbuild(macros) >= 1.714 | |
ac619853 | 53 | Requires(post,preun): /sbin/chkconfig |
73d24d5e | 54 | Requires(post,preun,postun): systemd-units >= 38 |
3de50fc5 | 55 | Requires: %{name}-libs = %{version}-%{release} |
ac619853 | 56 | Requires: rc-scripts |
73d24d5e | 57 | Requires: systemd-units >= 38 |
08d3794f | 58 | Suggests: multipath-tools |
00f0e5ad | 59 | Provides: group(iscsi) |
60 | Provides: user(iscsi) | |
7b7e198b AM |
61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
62 | ||
63 | %define _sbindir /sbin | |
64 | ||
65 | %description | |
66 | The Linux iSCSI driver acts as an iSCSI protocol initiator to | |
67 | transport SCSI requests and responses over an IP network between the | |
68 | client and an iSCSI-enabled target device such as a Cisco SN 5420 | |
69 | storage router. The iSCSI protocol is an IETF-defined protocol for IP | |
70 | storage. For more information about the iSCSI protocol, refer to the | |
71 | IETF standards for IP storage at <http://www.ietf.org/>. | |
72 | ||
b6d977e4 JR |
73 | %description -l pl.UTF-8 |
74 | Sterownik Linux iSCSI zachowuje się jak inicjator protokołu iSCSI do | |
75 | transportu zleceń SCSI i odpowiedzi po sieci IP między klientem a | |
76 | urządzeniem docelowym obsługującym iSCSI, takim jak Cisco SN 5420. | |
77 | Protokół iSCSI jest zdefiniowany przez IETF do składowania IP. Więcej | |
78 | informacji o protokole iSCSI znajduje się w standardach IETF na | |
7b7e198b AM |
79 | <http://www.ietf.org/>. |
80 | ||
3de50fc5 JB |
81 | %package libs |
82 | Summary: Open-iSCSI shared libraries | |
83 | Summary(pl.UTF-8): Biblioteki współdzielone Open-iSCSI | |
84 | Group: Libraries | |
85 | ||
86 | %description libs | |
87 | Open-iSCSI shared libraries. | |
88 | ||
89 | %description libs -l pl.UTF-8 | |
90 | Biblioteki współdzielone Open-iSCSI. | |
91 | ||
92 | %package devel | |
93 | Summary: Header files for Open-iSCSI libraries | |
94 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek Open-iSCSI | |
95 | Group: Development/Libraries | |
96 | Requires: %{name}-libs = %{version}-%{release} | |
97 | ||
98 | %description devel | |
99 | Header files for Open-iSCSI libraries. | |
100 | ||
101 | %description devel -l pl.UTF-8 | |
102 | Pliki nagłówkowe bibliotek Open-iSCSI. | |
103 | ||
104 | %package -n python-pyiscsi | |
105 | Summary: Python 2 interface to Open-iSCSI library | |
106 | Summary(pl.UTF-8): Interfejs Pythona 2 do biblioteki Open-iSCSI | |
107 | Group: Libraries/Python | |
108 | Requires: %{name}-libs = %{version}-%{release} | |
109 | ||
110 | %description -n python-pyiscsi | |
111 | Python 2 interface to Open-iSCSI library. | |
112 | ||
113 | %description -n python-pyiscsi -l pl.UTF-8 | |
114 | Interfejs Pythona 2 do biblioteki Open-iSCSI. | |
115 | ||
116 | %package -n python3-pyiscsi | |
117 | Summary: Python 3 interface to Open-iSCSI library | |
118 | Summary(pl.UTF-8): Interfejs Pythona 3 do biblioteki Open-iSCSI | |
119 | Group: Libraries/Python | |
120 | Requires: %{name}-libs = %{version}-%{release} | |
121 | ||
122 | %description -n python3-pyiscsi | |
123 | Python 3 interface to Open-iSCSI library. | |
124 | ||
125 | %description -n python3-pyiscsi -l pl.UTF-8 | |
126 | Interfejs Pythona 3 do biblioteki Open-iSCSI. | |
127 | ||
7b7e198b | 128 | %prep |
3de50fc5 | 129 | %setup -q |
0db1e35b | 130 | %patch1 -p1 |
3de50fc5 JB |
131 | %patch5 -p1 |
132 | %patch8 -p1 | |
133 | %patch9 -p1 | |
134 | %patch10 -p1 | |
135 | %patch11 -p1 | |
136 | %patch12 -p1 | |
137 | %patch13 -p1 | |
138 | %patch14 -p1 | |
139 | %patch15 -p1 | |
140 | %patch16 -p1 | |
141 | %patch19 -p1 | |
3de50fc5 JB |
142 | %patch22 -p1 |
143 | %patch23 -p1 | |
144 | %patch24 -p1 | |
3de50fc5 JB |
145 | %patch100 -p1 |
146 | %patch101 -p1 | |
4109f740 | 147 | |
7b7e198b | 148 | %build |
12da3c75 JR |
149 | cd iscsiuio |
150 | %{__libtoolize} | |
151 | %{__aclocal} | |
152 | %{__autoconf} | |
153 | %{__autoheader} | |
154 | %{__automake} | |
155 | %configure | |
3de50fc5 | 156 | cd .. |
12da3c75 | 157 | |
12da3c75 JR |
158 | %{__make} \ |
159 | CC="%{__cc}" \ | |
3de50fc5 JB |
160 | OPTFLAGS="%{rpmcflags} %{rpmcppflags}" \ |
161 | SED=sed \ | |
12da3c75 | 162 | KSUBLEVEL=0 |
7b7e198b | 163 | |
3de50fc5 JB |
164 | cd libiscsi |
165 | %if %{with python2} | |
166 | %py_build | |
167 | %endif | |
168 | %if %{with python3} | |
169 | %py3_build | |
170 | %endif | |
171 | ||
7b7e198b AM |
172 | %install |
173 | rm -rf $RPM_BUILD_ROOT | |
12da3c75 JR |
174 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/iscsi/{nodes,send_targets,static,isns,slp,ifaces} \ |
175 | $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d} \ | |
176 | $RPM_BUILD_ROOT%{systemdunitdir} \ | |
3de50fc5 | 177 | $RPM_BUILD_ROOT{/sbin,/lib/systemd/pld-helpers.d} |
12da3c75 | 178 | |
e621921b JB |
179 | %{__make} -j1 install_programs install_doc install_etc install_libopeniscsiusr install_iscsiuio \ |
180 | DESTDIR=$RPM_BUILD_ROOT \ | |
e3eac6b0 | 181 | LIB_DIR=%{_libdir} \ |
e621921b | 182 | RULESDIR=/lib/udev/rules.d |
12da3c75 JR |
183 | |
184 | :> $RPM_BUILD_ROOT%{_sysconfdir}/iscsi/initiatorname.iscsi | |
7b7e198b | 185 | |
5a75338d | 186 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/iscsid |
3de50fc5 | 187 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/iscsi |
5a75338d | 188 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/iscsi |
e621921b | 189 | # or use upstream file instead? |
3de50fc5 | 190 | cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/iscsiuio |
e621921b | 191 | %{__rm} $RPM_BUILD_ROOT/etc/logrotate.d/iscsiuiolog |
7b7e198b | 192 | |
12da3c75 | 193 | install usr/iscsistart $RPM_BUILD_ROOT%{_sbindir} |
3de50fc5 JB |
194 | cp -p doc/iscsistart.8 $RPM_BUILD_ROOT%{_mandir}/man8 |
195 | #install doc/iscsi-iname.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
7b7e198b | 196 | |
3de50fc5 JB |
197 | cp -p etc/systemd/iscsi.service $RPM_BUILD_ROOT%{systemdunitdir} |
198 | cp -p etc/systemd/iscsi-init.service $RPM_BUILD_ROOT%{systemdunitdir} | |
199 | cp -p etc/systemd/iscsi-onboot.service $RPM_BUILD_ROOT%{systemdunitdir} | |
200 | cp -p etc/systemd/iscsi-shutdown.service $RPM_BUILD_ROOT%{systemdunitdir} | |
201 | cp -p etc/systemd/iscsid.service $RPM_BUILD_ROOT%{systemdunitdir} | |
202 | cp -p etc/systemd/iscsid.socket $RPM_BUILD_ROOT%{systemdunitdir} | |
203 | cp -p etc/systemd/iscsiuio.service $RPM_BUILD_ROOT%{systemdunitdir} | |
204 | cp -p etc/systemd/iscsiuio.socket $RPM_BUILD_ROOT%{systemdunitdir} | |
6ae08450 JR |
205 | |
206 | install etc/systemd/iscsi-mark-root-nodes $RPM_BUILD_ROOT/lib/systemd/pld-helpers.d | |
00f0e5ad | 207 | |
3de50fc5 JB |
208 | # rename to resolve conflict with already existing libiscsi from libiscsi.spec |
209 | install -p libiscsi/libopeniscsi.so.0 $RPM_BUILD_ROOT%{_libdir} | |
210 | ln -sf libopeniscsi.so.0 $RPM_BUILD_ROOT%{_libdir}/libopeniscsi.so | |
211 | cp -p libiscsi/libiscsi.h $RPM_BUILD_ROOT%{_includedir}/libopeniscsi.h | |
212 | ||
213 | cd libiscsi | |
214 | %if %{with python2} | |
215 | %py_install | |
216 | %endif | |
217 | %if %{with python3} | |
218 | %py3_install | |
219 | %endif | |
220 | ||
7b7e198b AM |
221 | %clean |
222 | rm -rf $RPM_BUILD_ROOT | |
223 | ||
00f0e5ad | 224 | %pre |
225 | %groupadd -g 223 iscsi | |
226 | %useradd -u 223 -d /tmp -s /bin/false -c "iSCSI Daemon" -g iscsi iscsi | |
227 | ||
7b7e198b | 228 | %post |
a898f784 AM |
229 | if ! grep -q "^InitiatorName=[^ \t\n]" %{_sysconfdir}/iscsi/initiatorname.iscsi 2>/dev/null; then |
230 | echo "InitiatorName=$(iscsi-iname)" >> %{_sysconfdir}/iscsi/initiatorname.iscsi | |
7b7e198b | 231 | fi |
ac619853 | 232 | /sbin/chkconfig --add iscsi |
5a75338d | 233 | /sbin/chkconfig --add iscsid |
73d24d5e | 234 | NORESTART=1 |
3de50fc5 | 235 | %systemd_post iscsi.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket iscsi-onboot.service iscsi-init.service iscsi-shutdown.service |
ac619853 | 236 | |
7b7e198b AM |
237 | %preun |
238 | if [ "$1" = "0" ]; then | |
5a75338d | 239 | %service iscsid stop |
ac619853 | 240 | %service iscsi stop |
5a75338d | 241 | /sbin/chkconfig --del iscsid |
7b7e198b AM |
242 | /sbin/chkconfig --del iscsi |
243 | fi | |
3de50fc5 | 244 | %systemd_preun iscsi.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket iscsi-onboot.service iscsi-init.service iscsi-shutdown.service |
7b7e198b | 245 | |
00f0e5ad | 246 | %postun |
247 | if [ "$1" = "0" ]; then | |
248 | %userremove iscsi | |
249 | %groupremove iscsi | |
250 | fi | |
73d24d5e JR |
251 | %systemd_reload |
252 | ||
253 | %triggerpostun -- %{name} < 2.0.873-1 | |
254 | %systemd_trigger iscsi.service iscsid.service iscsiuio.service | |
255 | /bin/systemctl --quiet enable iscsid.socket || : | |
256 | /bin/systemctl --quiet enable iscsiuio.socket || : | |
00f0e5ad | 257 | |
3de50fc5 JB |
258 | %post libs -p /sbin/ldconfig |
259 | %postun libs -p /sbin/ldconfig | |
260 | ||
7b7e198b AM |
261 | %files |
262 | %defattr(644,root,root,755) | |
3de50fc5 | 263 | %doc Changelog README THANKS TODO |
00f0e5ad | 264 | %dir %{_sysconfdir}/iscsi |
265 | %dir %{_sysconfdir}/iscsi/ifaces | |
12da3c75 | 266 | %dir %{_sysconfdir}/iscsi/isns |
00f0e5ad | 267 | %dir %{_sysconfdir}/iscsi/nodes |
268 | %dir %{_sysconfdir}/iscsi/send_targets | |
12da3c75 JR |
269 | %dir %{_sysconfdir}/iscsi/slp |
270 | %dir %{_sysconfdir}/iscsi/static | |
00f0e5ad | 271 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/iscsi/iscsid.conf |
272 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/iscsi/initiatorname.iscsi | |
7b7e198b | 273 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/iscsi |
12da3c75 | 274 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/iscsiuio |
00f0e5ad | 275 | %attr(754,root,root) /etc/rc.d/init.d/iscsi |
5a75338d | 276 | %attr(754,root,root) /etc/rc.d/init.d/iscsid |
e621921b | 277 | /lib/udev/rules.d/50-iscsi-firmware-login.rules |
6ae08450 | 278 | %{systemdunitdir}/iscsi.service |
3de50fc5 JB |
279 | %{systemdunitdir}/iscsi-init.service |
280 | %{systemdunitdir}/iscsi-onboot.service | |
281 | %{systemdunitdir}/iscsi-shutdown.service | |
12da3c75 JR |
282 | %{systemdunitdir}/iscsid.service |
283 | %{systemdunitdir}/iscsid.socket | |
6ae08450 JR |
284 | %{systemdunitdir}/iscsiuio.service |
285 | %{systemdunitdir}/iscsiuio.socket | |
286 | %attr(755,root,root) /lib/systemd/pld-helpers.d/iscsi-mark-root-nodes | |
e621921b | 287 | %attr(755,root,root) %{_sbindir}/brcm_iscsiuio |
3de50fc5 | 288 | %attr(755,root,root) %{_sbindir}/iscsi-gen-initiatorname |
2e832026 | 289 | %attr(755,root,root) %{_sbindir}/iscsi-iname |
3de50fc5 JB |
290 | %attr(755,root,root) %{_sbindir}/iscsi_discovery |
291 | %attr(755,root,root) %{_sbindir}/iscsi_fw_login | |
292 | %attr(755,root,root) %{_sbindir}/iscsi_offload | |
2e832026 ER |
293 | %attr(755,root,root) %{_sbindir}/iscsiadm |
294 | %attr(755,root,root) %{_sbindir}/iscsid | |
295 | %attr(755,root,root) %{_sbindir}/iscsistart | |
12da3c75 | 296 | %attr(755,root,root) %{_sbindir}/iscsiuio |
e621921b | 297 | %{_mandir}/man8/iscsi-gen-initiatorname.8* |
4109f740 JB |
298 | %{_mandir}/man8/iscsi-iname.8* |
299 | %{_mandir}/man8/iscsi_discovery.8* | |
3de50fc5 | 300 | %{_mandir}/man8/iscsi_fw_login.8* |
4109f740 JB |
301 | %{_mandir}/man8/iscsiadm.8* |
302 | %{_mandir}/man8/iscsid.8* | |
303 | %{_mandir}/man8/iscsistart.8* | |
12da3c75 | 304 | %{_mandir}/man8/iscsiuio.8* |
3de50fc5 JB |
305 | |
306 | %files libs | |
307 | %defattr(644,root,root,755) | |
308 | %attr(755,root,root) %{_libdir}/libopeniscsi.so.0 | |
309 | %attr(755,root,root) %{_libdir}/libopeniscsiusr.so.*.*.* | |
310 | %attr(755,root,root) %ghost %{_libdir}/libopeniscsiusr.so.0 | |
311 | ||
312 | %files devel | |
313 | %defattr(644,root,root,755) | |
314 | %attr(755,root,root) %{_libdir}/libopeniscsi.so | |
315 | %attr(755,root,root) %{_libdir}/libopeniscsiusr.so | |
316 | %{_includedir}/libopeniscsi.h | |
317 | %{_includedir}/libopeniscsiusr*.h | |
318 | %{_pkgconfigdir}/libopeniscsiusr.pc | |
e621921b JB |
319 | %{_mandir}/man3/iscsi_*.3* |
320 | %{_mandir}/man3/libopeniscsiusr.h.3* | |
3de50fc5 JB |
321 | |
322 | %if %{with python2} | |
323 | %files -n python-pyiscsi | |
324 | %defattr(644,root,root,755) | |
325 | %attr(755,root,root) %{py_sitedir}/libiscsi.so | |
326 | %{py_sitedir}/PyIscsi-1.0-py*.egg-info | |
327 | %endif | |
328 | ||
329 | %if %{with python3} | |
330 | %files -n python3-pyiscsi | |
331 | %defattr(644,root,root,755) | |
332 | %attr(755,root,root) %{py3_sitedir}/libiscsi.cpython-*.so | |
333 | %{py3_sitedir}/PyIscsi-1.0-py*.egg-info | |
334 | %endif |