File python-rtslib.spec of Package python-rtslib

# spec file for package python-rtslib
# Copyright (c) 2014 SUSE LINUX Products 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

Name:           python-rtslib
Version:        2.2
Release:        0
Summary:        API for Linux kernel SCSI target (aka LIO)
License:        Apache-2.0
Group:          Development/Languages/Python
%define oname rtslib
# Source:{oname}/archive/%{version}.tar.gz
Source:         %{oname}-%{version}.tar.bz2
Patch0:         %{oname}-git-update.patch
Patch1:         %{oname}-set-git-version-for-sle12.patch
Patch2:         %{oname}-add-prot-info-attributes.patch
Patch3:         %{oname}-add-iblock-backstore-policy.patch
Requires:       python-configobj
Requires:       python-ipaddr
Requires:       python-netifaces
Requires:       python-pyparsing
BuildRequires:  python-configobj
BuildRequires:  python-devel
BuildRequires:  python-ipaddr
BuildRequires:  python-netifaces
BuildRequires:  python-pyparsing
BuildRequires:  python-setuptools
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Provides:       %{name}-doc = %{version}
Obsoletes:      %{name}-doc < %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
BuildArch:      noarch

RTSlib is a Python library that provides an API to the LIO Linux SCSI Target,
and its third-party target fabric modules and backend storage objects.

RTSlib was developed by Datera, Inc. ( It is useful for
developing 3rd-party applications, and as a foundation for the Datera
userspace tools.

For more information, please see the targetcli User's Guide at:

and the RTSlib API Reference Guide at:

%setup -q -n %{oname}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

python build

python install --prefix=%{_prefix} --root=%{buildroot}

%if 0%{?suse_version} > 1130 || 0%{?suse_version} == 0
%define _vardir /var/target

install -vd -m 755 $RPM_BUILD_ROOT%{_vardir}
install -vd -m 755 $RPM_BUILD_ROOT%{_vardir}/pr
install -vd -m 755 $RPM_BUILD_ROOT%{_vardir}/alua
install -vd -m 755 $RPM_BUILD_ROOT%{_vardir}/fabric
install -v -m 644 specs/*.spec $RPM_BUILD_ROOT%{_vardir}/fabric/
install -vd -m 755 $RPM_BUILD_ROOT%{_vardir}/policy
install -v -m 644 policy/*.lio $RPM_BUILD_ROOT%{_vardir}/policy/

%if 0%{?suse_version} > 1130 || 0%{?suse_version} == 0
%dir %{_vardir}
%dir %{_vardir}/pr
%dir %{_vardir}/alua
%dir %{_vardir}/fabric
%dir %{_vardir}/policy

openSUSE Build Service is sponsored by