python-rtslib-fb/python-rtslib-fb.spec

94 lines
3.1 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-rtslib-fb
#
# 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/
#
%define oname rtslib-fb
%define realver 2.1.fb60
Name: python-%{oname}
Version: 2.1.60
Release: 1%{?dist}
Url: http://github.com/agrover/rtslib-fb
Summary: API for Linux kernel SCSI target (aka LIO)
License: Apache-2.0
Group: Development/Languages/Python
Source: %{oname}-%{realver}.tar.gz
Provides: python-rtslib = %{version}
Obsoletes: python-rtslib < %{version}
BuildRequires: fdupes
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
rtslib-fb is an object-based Python library for configuring the LIO generic
SCSI target, present in 3.x Linux kernel versions. rtslib-fb is licensed under
the Apache 2.0 license. Contributions are welcome
%package doc
Summary: Documentatoin for Python rtslib-fb
Group: Documentation/HTML
BuildArch: noarch
BuildRequires: epydoc
BuildRequires: pyudev
%description doc
rtslib-fb is an object-based Python library for configuring the LIO generic
SCSI target, present in 3.x Linux kernel versions. rtslib-fb is licensed under
the Apache 2.0 license. Contributions are welcome
%prep
%setup -q -n %{oname}-%{realver}
%build
%__python setup.py build
%__mkdir_p doc/
epydoc --no-sourcecode --html -n %{oname} --exclude configobj rtslib_fb/*.py
%__mv html doc/
%install
[ "%{buildroot}" != "/" ] && %__rm -rf %{buildroot}
%__python setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot}
%fdupes %{buildroot}%{python_sitelib}
%__install -d -m755 %{buildroot}%{_defaultdocdir}/python-rtslib-doc-%{version}
%__cp -r doc/* %{buildroot}%{_defaultdocdir}/python-rtslib-doc-%{version}/
%fdupes %{buildroot}%{_defaultdocdir}
%__install -d -m755 %{buildroot}%{_sysconfdir}/target
%__install -d -m755 %{buildroot}%{_mandir}/man5
%__install -m644 doc/saveconfig.json.5 %{buildroot}%{_mandir}/man5
%__install -d -m755 %{buildroot}%{_mandir}/man8
%__install -m644 doc/targetctl.8 %{buildroot}%{_mandir}/man8
%clean
[ "%{buildroot}" != "/" ] && %__rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_bindir}/targetctl
%{python_sitelib}/*
%doc COPYING README.md
%dir %{_sysconfdir}/target
%doc %{_mandir}/man5/saveconfig.json.5.gz
%doc %{_mandir}/man8/targetctl.8.gz
%files doc
%defattr(-,root,root,-)
%{_defaultdocdir}/python-rtslib-doc-%{version}
%changelog