%global _hardened_build 1 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %define open_iscsi_version 2.0 %define open_iscsi_build 873 %define iscsiuio_version 0.7.2.1 Summary: iSCSI daemon and utility programs Name: iscsi-initiator-utils Version: 6.%{open_iscsi_version}.%{open_iscsi_build} Release: 9%{?dist} Group: System Environment/Daemons License: GPLv2+ URL: http://www.open-iscsi.org Source0: http://www.open-iscsi.org/bits/open-iscsi-%{open_iscsi_version}-%{open_iscsi_build}.tar.gz Source1: iscsiuio-%{iscsiuio_version}.tar.gz Source4: 04-iscsi Source5: iscsi-tmpfiles.conf # upstream patches, post last tagged version Patch1: 0001-iscsid-fix-iscsid-segfault-during-qla4xxx-login.patch Patch2: 0002-ISCSISTART-Bring-up-the-corresponding-network-interf.patch Patch3: 0003-iscsi-tools-fix-compile-error-when-OFFLOAD_BOOT_SUPP.patch Patch4: 0004-ISCSID-Passing-more-net-params-from-ibft-to-iface.patch Patch5: 0005-iscsi-tools-Convert-r-argument-to-an-integer-before-.patch Patch6: 0006-Update-README-for-removal-of-DBM-requirement.patch Patch7: 0007-iscsid-iscsiadm-fix-abstract-socket-length-in-bind-c.patch Patch8: 0008-iscsid-implement-systemd-compatible-socket-activatio.patch Patch9: 0009-iscsid-add-example-unit-files-for-systemd.patch Patch10: 0010-iscsi-tools-fix-get_random_bytes-error-handling.patch # pending upstream merge Patch31: 0031-iscsid-add-initrd-option-to-set-run-from-initrd-hint.patch Patch32: 0032-iscsiadm-iscsid-newroot-command-to-survive-switch_ro.patch Patch33: 0033-iscsiadm-param-parsing-for-advanced-node-creation.patch Patch34: 0034-update-systemd-service-files-add-iscsi.service-for-s.patch # distro specific modifications Patch51: 0051-update-initscripts-and-docs.patch Patch52: 0052-use-var-for-config.patch Patch53: 0053-use-red-hat-for-name.patch Patch54: 0054-add-libiscsi.patch Patch55: 0055-dont-use-static.patch Patch56: 0056-remove-the-offload-boot-supported-ifdef.patch Patch57: 0057-iscsid-iscsiuio-ipc-interface.patch Patch58: 0058-iscsiuio-IPC-newroot-command.patch Patch59: 0059-iscsiuio-systemd-unit-files.patch Patch60: 0060-use-systemctl-to-start-iscsid.patch Patch61: 0061-resolve-565245-multilib-issues-caused-by-doxygen.patch Patch62: 0062-Don-t-check-for-autostart-sessions-if-iscsi-is-not-u.patch Patch63: 0063-fix-order-of-setting-uid-gid-and-drop-supplementary-.patch # iscsiuio patches Patch71: 0071-iscsiuio-0.7.4.3.patch Patch72: 0072-iscsiuio-0.7.6.1.patch Patch73: 0073-iscsiuio-fix-long-options.patch Patch74: 0074-iscsiuio-add-initrd-option-to-set-run-from-initrd-hi.patch Patch75: 0075-iscsiuio-systemd-socket-activation-support.patch Patch76: 0076-iscsiuio-iscsid-IPC-newroot-command.patch Patch77: 0077-iscsiuio-document-pidfile-option.patch # version string, needs to be updated with each build Patch99: 0099-use-Red-Hat-version-string-to-match-RPM-package-vers.patch BuildRequires: openssl-devel flex bison python-devel doxygen glibc-static kmod-devel systemd-devel # For dir ownership Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %description The iscsi package provides the server daemon for the iSCSI protocol, as well as the utility programs used to manage it. iSCSI is a protocol for distributed disk access using SCSI commands sent over Internet Protocol networks. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep %setup -q -n open-iscsi-%{open_iscsi_version}-%{open_iscsi_build} -a 1 mv iscsiuio-%{iscsiuio_version} iscsiuio # upstream patches %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 # pending upstream merge %patch31 -p1 %patch32 -p1 %patch33 -p1 %patch34 -p1 # distro specific modifications %patch51 -p1 %patch52 -p1 %patch53 -p1 %patch54 -p1 %patch55 -p1 %patch56 -p1 %patch57 -p1 %patch58 -p1 %patch59 -p1 %patch60 -p1 %patch61 -p1 %patch62 -p1 %patch63 -p1 # iscsiuio patches cd iscsiuio %patch71 -p1 %patch72 -p1 %patch73 -p1 %patch74 -p1 %patch75 -p1 %patch76 -p1 %patch77 -p1 cd .. # version string %patch99 -p1 %build make OPTFLAGS="%{optflags} %{?__global_ldflags} -DUSE_KMOD -lkmod" cd iscsiuio chmod u+x configure ./configure --enable-debug make OPTFLAGS="%{optflags}" LDFLAGS="%{?__global_ldflags}" CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" cd .. pushd libiscsi python setup.py build touch -r libiscsi.doxy html/* popd %install mkdir -p $RPM_BUILD_ROOT/sbin mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8 mkdir -p $RPM_BUILD_ROOT/etc/iscsi mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d mkdir -p $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/nodes mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/send_targets mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/static mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/isns mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/slp mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/ifaces mkdir -p $RPM_BUILD_ROOT/var/lock/iscsi mkdir -p $RPM_BUILD_ROOT%{_libdir} mkdir -p $RPM_BUILD_ROOT%{_includedir} mkdir -p $RPM_BUILD_ROOT%{python_sitearch} install -p -m 755 usr/iscsid usr/iscsiadm utils/iscsi-iname usr/iscsistart $RPM_BUILD_ROOT/sbin install -p -m 644 doc/iscsiadm.8 $RPM_BUILD_ROOT/%{_mandir}/man8 install -p -m 644 doc/iscsid.8 $RPM_BUILD_ROOT/%{_mandir}/man8 install -p -m 644 etc/iscsid.conf $RPM_BUILD_ROOT%{_sysconfdir}/iscsi install -p -m 644 doc/iscsistart.8 $RPM_BUILD_ROOT/%{_mandir}/man8 install -p -m 644 doc/iscsi-iname.8 $RPM_BUILD_ROOT/%{_mandir}/man8 install -p -m 644 iscsiuio/docs/iscsiuio.8 $RPM_BUILD_ROOT/%{_mandir}/man8 install -p -m 644 iscsiuio/iscsiuiolog $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d install -p -m 755 iscsiuio/src/unix/iscsiuio $RPM_BUILD_ROOT/sbin install -p -D -m 644 etc/systemd/iscsi.service $RPM_BUILD_ROOT%{_unitdir}/iscsi.service install -p -D -m 644 etc/systemd/iscsid.service $RPM_BUILD_ROOT%{_unitdir}/iscsid.service install -p -D -m 644 etc/systemd/iscsid.socket $RPM_BUILD_ROOT%{_unitdir}/iscsid.socket install -p -D -m 644 etc/systemd/iscsiuio.service $RPM_BUILD_ROOT%{_unitdir}/iscsiuio.service install -p -D -m 644 etc/systemd/iscsiuio.socket $RPM_BUILD_ROOT%{_unitdir}/iscsiuio.socket install -p -D -m 755 etc/systemd/iscsi_mark_root_nodes $RPM_BUILD_ROOT/usr/libexec/iscsi_mark_root_nodes install -p -m 755 %{SOURCE4} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d install -p -D -m 644 %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/iscsi.conf install -p -m 755 libiscsi/libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir} ln -s libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}/libiscsi.so install -p -m 644 libiscsi/libiscsi.h $RPM_BUILD_ROOT%{_includedir} install -p -m 755 libiscsi/build/lib.linux-*/libiscsimodule.so \ $RPM_BUILD_ROOT%{python_sitearch} # for %%ghost touch $RPM_BUILD_ROOT/var/lock/iscsi/lock %post /sbin/ldconfig %systemd_post iscsi.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket if [ $1 -eq 1 ]; then if [ ! -f %{_sysconfdir}/iscsi/initiatorname.iscsi ]; then echo "InitiatorName=`/sbin/iscsi-iname`" > %{_sysconfdir}/iscsi/initiatorname.iscsi fi # enable socket activation and persistant session startup by default /bin/systemctl enable iscsi.service >/dev/null 2>&1 || : /bin/systemctl enable iscsid.socket >/dev/null 2>&1 || : /bin/systemctl enable iscsiuio.socket >/dev/null 2>&1 || : fi %preun %systemd_preun iscsi.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket %postun /sbin/ldconfig %systemd_postun %triggerun -- iscsi-initiator-utils < 6.2.0.873-1 # Save the current service runlevel info # User must manually run systemd-sysv-convert --apply iscsid # and systemd-sysv-convert --apply iscsi # to migrate them to systemd targets /usr/bin/systemd-sysv-convert --save iscsi >/dev/null 2>&1 ||: /usr/bin/systemd-sysv-convert --save iscsid >/dev/null 2>&1 ||: # enable socket activation /bin/systemctl enable iscsid.socket >/dev/null 2>&1 || : /bin/systemctl enable iscsiuio.socket >/dev/null 2>&1 || : # Run these because the SysV package being removed won't do them /sbin/chkconfig --del iscsid >/dev/null 2>&1 || : /sbin/chkconfig --del iscsi >/dev/null 2>&1 || : /bin/systemctl try-restart iscsid.service >/dev/null 2>&1 || : /bin/systemctl try-restart iscsi.service >/dev/null 1>&1 || : %files %doc README %dir %{_var}/lib/iscsi %dir %{_var}/lib/iscsi/nodes %dir %{_var}/lib/iscsi/isns %dir %{_var}/lib/iscsi/static %dir %{_var}/lib/iscsi/slp %dir %{_var}/lib/iscsi/ifaces %dir %{_var}/lib/iscsi/send_targets %ghost %{_var}/lock/iscsi %ghost %{_var}/lock/iscsi/lock %{_unitdir}/iscsi.service %{_unitdir}/iscsid.service %{_unitdir}/iscsid.socket %{_unitdir}/iscsiuio.service %{_unitdir}/iscsiuio.socket /usr/libexec/iscsi_mark_root_nodes %{_sysconfdir}/NetworkManager/dispatcher.d/04-iscsi /usr/lib/tmpfiles.d/iscsi.conf %dir %{_sysconfdir}/iscsi %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/iscsi/iscsid.conf /sbin/* %{_libdir}/libiscsi.so.0 %{python_sitearch}/libiscsimodule.so %{_mandir}/man8/* %{_sysconfdir}/logrotate.d/iscsiuiolog %files devel %doc libiscsi/html %{_libdir}/libiscsi.so %{_includedir}/libiscsi.h %changelog * Sun Aug 4 2013 Peter Robinson 6.2.0.873-9 - Fix FTBFS, cleanup spec * Sat Aug 03 2013 Fedora Release Engineering - 6.2.0.873-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Tue Jun 11 2013 Chris Leech - 6.2.0.873-7 - Use the systemd tmpfiles service to recreate lockfiles in /var/lock - 955167 build as a position independent executable - 894576 fix order of setuid/setgid and drop additional groups * Tue May 28 2013 Chris Leech - 6.2.0.873-6 - Don't have iscsiadm scan for autostart record if node db is empty (bug #951951) * Tue Apr 30 2013 Orion Poplawski - 6.2.0.873-5 - Fix typo in NM dispatcher script (bug #917058) * Thu Feb 21 2013 Chris Leech - 6.2.0.873-4 - build with libkmod support, instead of calling out to modprobe - enable socket activation by default * Thu Jan 24 2013 Kalev Lember - 6.2.0.873-3 - Fix the postun script to not use ldconfig as the interpreter * Wed Jan 23 2013 Chris Leech - 6.2.0.873-2 - package iscsi_mark_root_nodes script, it's being referenced by the unit files * Tue Jan 22 2013 Chris Leech - 6.2.0.873-1 - rebase to new upstream code - systemd conversion - 565245 Fix multilib issues caused by timestamp in doxygen footers * Thu Jul 19 2012 Fedora Release Engineering - 6.2.0.872-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Tue Feb 14 2012 Mike Christie 6.2.0.872.18 - 789683 Fix boot slow down when the iscsi service is started (regression added in 6.2.0.872.16 when the nm wait was added). * Mon Feb 6 2012 Mike Christie 6.2.0.872.17 - 786174 Change iscsid/iscsi service startup, so it always starts when called. * Sat Feb 4 2012 Mike Christie 6.2.0.872.16 - 747479 Fix iscsidevs handling of network requirement * Fri Jan 13 2012 Fedora Release Engineering - 6.2.0.872-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Wed Nov 30 2011 Mike Christie 6.2.0.872.14 - Fix version string to reflect fedora and not rhel. * Tue Oct 18 2011 Mike Christie 6.2.0.872.13 - Update iscsi tools. * Sat Apr 30 2011 Hans de Goede - 6.2.0.872-12 - Change iscsi init scripts to check for networking being actually up, rather then for NetworkManager being started (#692230) * Tue Apr 26 2011 Hans de Goede - 6.2.0.872-11 - Fix iscsid autostarting when upgrading from an older version (add iscsid.startup key to iscsid.conf on upgrade) - Fix printing of [ OK ] when successfully stopping iscsid - systemd related fixes: - Add Should-Start/Stop tgtd to iscsi init script to fix (re)boot from hanging when using locally hosted targets - %%ghost /var/lock/iscsi and contents (#656605) * Mon Apr 25 2011 Mike Christie 6.2.0.872-10 - Fix iscsi init scripts check for networking being up (#692230) * Wed Feb 09 2011 Fedora Release Engineering - 6.2.0.872-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild