Accepting request 391476 from home:lee_duncan

New package, possible replacement for targetcli.

Requires the newly-added python-configshell-fb
package, as well as the newly-updated python-
rtslib-fb package.

OBS-URL: https://build.opensuse.org/request/show/391476
OBS-URL: https://build.opensuse.org/package/show/Base:System/targetcli-fb?expand=0&rev=1
This commit is contained in:
Dirk Mueller 2016-04-26 14:17:33 +00:00 committed by Git OBS Bridge
commit 024ddec874
6 changed files with 152 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:63e7c85df26ffd2b1ef34e9113585d7eb8b3fd8d4bf84ebe025a14bf518e7459
size 34207

6
targetcli-fb.changes Normal file
View File

@ -0,0 +1,6 @@
-------------------------------------------------------------------
Tue Apr 19 22:03:07 UTC 2016 - lduncan@suse.com
- Creating from latest upstream version 2.1.fb43
-------------------------------------------------------------------

17
targetcli-fb.service Normal file
View File

@ -0,0 +1,17 @@
[Unit]
Description="Generic Target-Mode Service (fb)"
DefaultDependencies=No
After=network.target target.service
Before=remote-fs-pre.target
[Service]
Type=oneshot
Environment=CONFIG_FILE=/etc/target/saveconfig.json
EnvironmentFile=-/etc/sysconfig/targetcli
ExecStart=-/usr/bin/targetcli restoreconfig $CONFIG_FILE
RemainAfterExit=true
ExecStop=/usr/bin/targetcli clearconfig confirm=True
ExecReload=/usr/bin/targetcli restoreconfig $CONFIG_FILE clearexisting
[Install]
WantedBy=remote-fs.target

102
targetcli-fb.spec Normal file
View File

@ -0,0 +1,102 @@
#
# spec file for package targetcli-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 targetcli-fb
%define realver 2.1.fb43
Name: %{oname}
Version: 2.1.43
Release: 1%{?dist}
License: Apache-2.0
Group: System/Management
URL: http://github.com/agrover/%{oname}
Summary: A command shell for managing the Linux LIO kernel target
Source: %{oname}-%{realver}.tar.gz
Source1: %{oname}.service
Provides: targetcli = %{version}
Obsoletes: targetcli < %{version}
Provides: python-targetcli = %{version}
Obsoletes: python-targetcli < %{version}
Requires: python-configshell-fb >= 1.20
Requires: python-rtslib-fb >= 2.1.60
Requires: python-six
BuildArch: noarch
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: python-configshell-fb
BuildRequires: python-rtslib-fb
BuildRequires: python-pyparsing
BuildRequires: fdupes
BuildRequires: systemd
%{?systemd_requires}
BuildRoot: %{_tmppath}/%{name}-root
%description
targetcli-fb is a command-line interface for configuring the LIO generic
SCSI target, present in 3.x Linux kernel versions.
targetcli-fb is a fork of the "targetcli" code written by RisingTide Systems.
The "-fb" differentiates between the original and this version. Please ensure
to use either all "fb" versions of the targetcli components -- targetcli,
rtslib, and configshell, or stick with all non-fb versions, since they are
no longer strictly compatible.
%prep
%setup -q -n %{oname}-%{realver}%{?extraver}
%build
%__python setup.py build
%install
%__python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%__install -d -m755 %{buildroot}%{_sysconfdir}/target
%__install -d -m755 %{buildroot}%{_sysconfdir}/target/backup
%__install -d -m755 %{buildroot}%{_sbindir}
%fdupes %{buildroot}%{python_sitelib}
%__install -D -m644 targetcli.8 %{buildroot}%{_mandir}/man8/targetcli.8
%__install -D -m644 %{S:1} %{buildroot}%{_unitdir}/targetcli.service
%__ln_s %{_sbindir}/service %{buildroot}/%{_sbindir}/rctargetcli
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%post
%{service_add_post targetcli.service}
%postun
%{service_del_postun targetcli.service}
%pre
%{service_add_pre targetcli.service}
%preun
%{stop_on_removal targetcli}
%{service_del_preun targetcli.service}
%files
%defattr(-,root,root)
%doc COPYING README.md THANKS
%dir %{_sysconfdir}/target
%dir %{_sysconfdir}/target/backup
%{_bindir}/targetcli
%{python_sitelib}/*
%doc %{_mandir}/man8/targetcli.8.gz
%{_unitdir}/targetcli.service
%{_sbindir}/rctargetcli
%changelog