File linstor-client.spec of Package linstor-client

#
# spec file for package linstor-client
#
# 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 http://bugs.opensuse.org/
#


Name:           linstor-client
Version:        0.9.5
Release:        0
Summary:        DRBD distributed resource management utility
License:        GPL-3.0
Group:          Productivity/Clustering/HA
Url:            https://github.com/LINBIT/linstor-client
Source:         http://www.linbit.com/www.linbit.com/downloads/linstor/%{name}-%{version}.tar.gz
Patch1:         change-location-of-bash-completion.patch
BuildRequires:  fdupes
BuildRequires:  python-devel
BuildRequires:  python-linstor >= 0.9.5
BuildRequires:  python2-setuptools
Requires:       python-linstor >= 0.9.5
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This client program communicates to a linstor controller node which manages the DRBD9 resources.

%prep
%setup -q
%patch1 -p1

sed -i '/^#!/d' linstor_client_main.py \
                linstor_client/consts.py \
                linstor_client/utils.py

%build
python setup.py build_man
python setup.py build

%install
python setup.py install --single-version-externally-managed -O1 --root=%{buildroot} --prefix=%{_prefix} --record=INSTALLED_FILES
cat INSTALLED_FILES
%fdupes -s %{buildroot}

#Or using files -f INSTALLED_FILES with python_sitelib only

%files
%defattr(-,root,root)
%{python_sitelib}
%{_bindir}/linstor
%{_mandir}/man8/linstor*
%{_datadir}/bash-completion/completions/linstor

%changelog
openSUSE Build Service is sponsored by