File target-isns.spec of Package target-isns.3375
#
# spec file for package target-isns
#
# Copyright (c) 2016 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 http://bugs.opensuse.org/
#
Name: target-isns
Summary: Supplies iSNS support for Linux kernel target
License: GPL-2.0+
Group: System Environment/Kernel
Version: 0.3
Release: 0
Source: https://github.com/cvubrugier/%{name}/archive/v%{version}.tar.gz
ExclusiveOS: linux
Url: https://github.com/cvubrugier/target-isns
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: cmake
BuildRequires: flex
BuildRequires: gcc
BuildRequires: glibc-devel
BuildRequires: make
BuildRequires: systemd
%{?systemd_requires}
Patch1: %{name}-changes-since-v0.3.diff.bz2
Patch2: %{name}-add-systemd-support.patch
Patch3: %{name}-dont-ignore-read-return-value.patch
Patch4: %{name}-handle-big-endian-arch.patch
Patch5: %{name}-fix-remaining-little-endian-IP-addr.patch
Patch6: add-posix_c_source-define-for-getaddrinfo3
%description
Target-isns is an Internet Storage Name Service (iSNS) client for the
Linux LIO iSCSI target. It allows to register LIO iSCSI targets to an
iSNS server.
The iSNS protocol is specified in
[RFC 4171](http://tools.ietf.org/html/rfc4171) and its purpose is to
make easier to discover, manage, and configure iSCSI devices. With
iSNS, iSCSI targets can be registered to a central iSNS server and
initiators can be configured to discover the targets by asking the
iSNS server.
%prep
%setup -n %{name}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%build
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="${RPM_OPT_FLAGS}" ..
%{__make}
%install
cd build
%{__make} DESTDIR=${RPM_BUILD_ROOT} install
if [ ! -d ${RPM_BUILD_ROOT}/usr/sbin ] ; then
mkdir -p ${RPM_BUILD_ROOT}/usr/sbin
fi
ln -sf /usr/sbin/service ${RPM_BUILD_ROOT}/usr/sbin/rc%{name}
%clean
[ "${RPM_BUILD_ROOT}" != "/" -a -d ${RPM_BUILD_ROOT} ] && \
rm -rf ${RPM_BUILD_ROOT}
%post
%{service_add_post target-isns.service}
%postun
%{service_del_postun target-isns.service}
%pre
%{service_add_pre target-isns.service}
%preun
%{service_del_preun target-isns.service}
%files
%defattr(-,root,root)
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/target-isns.conf
%{_bindir}/target-isns
%{_sbindir}/rctarget-isns
%doc COPYING README.md THANKS
%doc %{_mandir}/man8/target-isns.8%{?ext_man}
%{_unitdir}/target-isns.service
%changelog