File open-iscsi.spec of Package open-iscsi.14634

# spec file for package open-iscsi
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via
# NOTE: do NOT make changes to this file directly in the build service,
# as this file is auto-generated from sources at:
# So changes here will be overwritten. Instead, submit issues or pull
# requests there.

%define iscsi_release 876-suse
Name:           open-iscsi
Version:        2.0.876
Release:        0
Summary:        Linux Open-iSCSI Software Initiator
License:        GPL-2.0-or-later
Group:          Productivity/Networking/Other
Source:         %{name}-2.0.%{iscsi_release}.tar.bz2
Patch1:         %{name}-SUSE-latest.diff.bz2
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  bison
BuildRequires:  db-devel < 5
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  libkmod-devel
BuildRequires:  libmount-devel
BuildRequires:  libtool
BuildRequires:  make
BuildRequires:  open-isns-devel
BuildRequires:  openssl-devel
BuildRequires:  pkg-config
BuildRequires:  suse-module-tools
BuildRequires:  systemd-devel
Requires(post): coreutils
Requires:       libopeniscsiusr0_2_0 = %{version}

Open-iSCSI is a transport independent implementation of RFC 3720
iSCSI. It is partitioned into user and kernel parts.

The kernel portion of Open-iSCSI implements the iSCSI data path (that
is, iSCSI Read and iSCSI Write), and consists of two loadable
modules: iscsi_if.ko and iscsi_tcp.ko.

The user space part contains the entire control plane: configuration
manager, iSCSI Discovery, Login and Logout processing,
connection-level error processing, Nop-In and Nop-Out handling. It
comes with a daemon process called iscsid, and a management utility,

%package -n libopeniscsiusr0_2_0
Version:        2.0.876
Release:        0
Summary:        Userspace iSCSI API
Group:          System/Libraries
Obsoletes:      libopeniscsiusr0_1_0

%description -n libopeniscsiusr0_2_0
The iSCSI userspace API from the open-iscsi project.

%package -n iscsiuio
Release:        0
Summary:        Linux Broadcom NetXtremem II iscsi server
Group:          Productivity/Networking/Other
Requires:       logrotate

%description -n iscsiuio
This tool is to be used in conjunction with the Broadcom NetXtreme II Linux
driver (Kernel module name: "bnx2" and "bnx2x"), Broadcom CNIC driver,
and the Broadcom iSCSI driver (Kernel module name: "bnx2i").
This user space tool is used in conjunction with the following
Broadcom Network Controllers:

* bnx2:  BCM5706, BCM5708, BCM5709 devices
* bnx2x: BCM57710, BCM57711, BCM57711E, BCM57712, BCM57712E,
         BCM57800, BCM57810, BCM57840 devices

This utility will provide the ARP and DHCP functionality for the iSCSI offload.
The communication to the driver is done via Userspace I/O (Kernel module name

%package devel
Version:        2.0.876
Release:        0
Summary:        Linux open-iscsi user-level library and include files
Group:          Development/Libraries/C and C++
Requires:       %{name}

%description devel
This development package contains the open-iscsi user-level library
include files and documentation. These are used to compile against
the libopeniscsiusr library.

%setup -q -n %{name}-2.0.%{iscsi_release}
%patch1 -p1

make %{?_smp_mflags} OPTFLAGS="%{optflags} -fno-strict-aliasing -DOFFLOAD_BOOT_SUPPORTED -DUSE_KMOD -I/usr/include/kmod -DLOCK_DIR=\\\"%{_sysconfdir}/iscsi\\\"" user
cd iscsiuio
autoreconf --install
%configure --sbindir=/sbin
make %{?_smp_mflags} CFLAGS="%{optflags}"

make DESTDIR=%{buildroot} install_user
# install service files
make DESTDIR=%{buildroot} install_service_suse
# create rc symlinks
[ -d %{buildroot}%{_sbindir} ] || mkdir -p %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rciscsi
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rciscsid
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rciscsiuio
(cd %{buildroot}/etc; ln -sf iscsi/iscsid.conf iscsid.conf)
touch %{buildroot}%{_sysconfdir}/iscsi/initiatorname.iscsi
install -m 0755 usr/iscsistart %{buildroot}/sbin
%make_install -C iscsiuio
%fdupes %{buildroot}/%{_prefix}

if [ ! -f %{_sysconfdir}/iscsi/initiatorname.iscsi ] ; then
%{service_add_post iscsid.socket iscsid.service iscsi.service}


%{service_del_postun iscsid.socket iscsid.service iscsi.service}

%{service_add_pre iscsid.socket iscsid.service iscsi.service}

%{service_del_preun iscsid.socket iscsid.service iscsi.service}

%post   -n libopeniscsiusr0_2_0 -p /sbin/ldconfig
%postun -n libopeniscsiusr0_2_0 -p /sbin/ldconfig

%post -n iscsiuio
%{service_add_post iscsiuio.socket iscsiuio.service}

%postun -n iscsiuio
%{service_del_postun iscsiuio.socket iscsiuio.service}

%pre -n iscsiuio
%{service_add_pre iscsiuio.socket iscsiuio.service}

%preun -n iscsiuio
%{service_del_preun iscsiuio.socket iscsiuio.service}

%dir %{_sysconfdir}/iscsi
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/iscsi/iscsid.conf
%ghost %{_sysconfdir}/iscsi/initiatorname.iscsi
%dir %{_sysconfdir}/iscsi/ifaces
%config %{_sysconfdir}/iscsi/ifaces/iface.example
%license COPYING

%files -n libopeniscsiusr0_2_0

%files -n iscsiuio
%config %{_sysconfdir}/logrotate.d/iscsiuiolog

%files devel

openSUSE Build Service is sponsored by