commit targetcli-fb for openSUSE:Factory

2020-07-01 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2020-07-01 14:26:55

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new.3060 (New)


Package is "targetcli-fb"

Wed Jul  1 14:26:55 2020 rev:20 rq:817944 version:2.1.53

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2020-06-11 10:11:37.232494115 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new.3060/targetcli-fb.changes  
2020-07-01 14:26:59.666823293 +0200
@@ -1,0 +2,16 @@
+Tue Jun 30 20:54:28 UTC 2020 - ldun...@suse.com
+
+- Update to version 2.1.53:
+  * version 2.1.53
+  * saveconfig: set right perms on /etc/target/ dir
+  * saveconfig: set right perms on backup dir
+  * saveconfig: set 0o600 perms on backupfiles
+  * uds: set right permissions at bind() time
+  This removed patches which are included upstream:
+  * 0001-uds-set-right-permissions-at-bind-time.patch
+  * 0002-saveconfig-set-0o600-perms-on-backupfiles.patch
+  * 0003-saveconfig-set-right-perms-on-backup-dir.patch
+  * 0004-saveconfig-set-right-perms-on-etc-target-dir.patch
+  And replaced the tarball with targetcli-fb-2.1.53.tar.xz
+
+---

Old:

  0001-uds-set-right-permissions-at-bind-time.patch
  0002-saveconfig-set-0o600-perms-on-backupfiles.patch
  0003-saveconfig-set-right-perms-on-backup-dir.patch
  0004-saveconfig-set-right-perms-on-etc-target-dir.patch
  targetcli-fb-2.1.52.tar.xz

New:

  targetcli-fb-2.1.53.tar.xz



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.AYqAty/_old  2020-07-01 14:27:00.346825401 +0200
+++ /var/tmp/diff_new_pack.AYqAty/_new  2020-07-01 14:27:00.346825401 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:   targetcli-fb
-Version:2.1.52
+Version:2.1.53
 Release:0
 Summary:A command shell for managing the Linux LIO kernel target
 License:Apache-2.0
@@ -60,12 +60,6 @@
 Patch2: rbd-support.patch
 Patch3: fix-setup-install.patch
 
-# upstreamed patches
-Patch11:0001-uds-set-right-permissions-at-bind-time.patch
-Patch12:0002-saveconfig-set-0o600-perms-on-backupfiles.patch
-Patch13:0003-saveconfig-set-right-perms-on-backup-dir.patch
-Patch14:0004-saveconfig-set-right-perms-on-etc-target-dir.patch
-
 %python_subpackages
 
 %description
@@ -95,10 +89,6 @@
 %patch2 -p1
 %endif
 %patch3 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
 
 %build
 %python_build

++ _service ++
--- /var/tmp/diff_new_pack.AYqAty/_old  2020-07-01 14:27:00.378825501 +0200
+++ /var/tmp/diff_new_pack.AYqAty/_new  2020-07-01 14:27:00.378825501 +0200
@@ -7,7 +7,7 @@
 @PARENT_TAG@
 v(\d*\.\d*\.)(\d*)
 \1\2
-v2.1.52
+v2.1.53
 enable
   
   

++ _servicedata ++
--- /var/tmp/diff_new_pack.AYqAty/_old  2020-07-01 14:27:00.394825550 +0200
+++ /var/tmp/diff_new_pack.AYqAty/_new  2020-07-01 14:27:00.394825550 +0200
@@ -1,4 +1,4 @@
 
 
 https://github.com/open-iscsi/targetcli-fb.git
-  bab9fc16236c4aceade31e95327bc7b493bb157a
\ No newline at end of file
+  ff7766b737c0868ae2579da49f2e8304f40767ee
\ No newline at end of file

++ targetcli-fb-2.1.52.tar.xz -> targetcli-fb-2.1.53.tar.xz ++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/targetcli-fb-2.1.52/daemon/targetclid 
new/targetcli-fb-2.1.53/daemon/targetclid
--- old/targetcli-fb-2.1.52/daemon/targetclid   2020-05-11 13:14:43.0 
+0200
+++ new/targetcli-fb-2.1.53/daemon/targetclid   2020-06-24 10:14:04.0 
+0200
@@ -28,6 +28,7 @@
 
 import os
 import sys
+import stat
 import socket
 import struct
 import fcntl
@@ -238,12 +239,17 @@
 # save socket so a signal can clea it up
 to.sock = sock
 
+mode = stat.S_IRUSR | stat.S_IWUSR # 0o600
+umask = 0o777 ^ mode  # Prevents always downgrading umask to 0
+umask_original = os.umask(umask)
 # Bind the socket path
 try:
 sock.bind(to.socket_path)
 except socket.error as err:
 to.display(to.render(err.strerror, 'red'))
 sys.exit(1)
+finally:
+os.umask(umask_original)
 
 # Listen for incoming connections
 try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/targetcli-fb-2.1.52/targetcli/ui_root.py 
new/targetcli-fb-2.1.53/targetcli/ui_root.py
--- old/targetcli-fb-2.1.52/targetcli/ui_root.py2020-05-11 

commit targetcli-fb for openSUSE:Factory

2020-06-11 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2020-06-11 10:09:30

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new.3606 (New)


Package is "targetcli-fb"

Thu Jun 11 10:09:30 2020 rev:19 rq:813264 version:2.1.52

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2020-05-26 17:19:19.911976292 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new.3606/targetcli-fb.changes  
2020-06-11 10:11:37.232494115 +0200
@@ -1,0 +2,10 @@
+Wed Jun 10 01:25:12 UTC 2020 - Lee Duncan 
+
+- Added 4 upstream commits for CVE-2020-13867 (bsc#1172743),
+  adding patches:
+  * 0001-uds-set-right-permissions-at-bind-time.patch
+  * 0002-saveconfig-set-0o600-perms-on-backupfiles.patch
+  * 0003-saveconfig-set-right-perms-on-backup-dir.patch
+  * 0004-saveconfig-set-right-perms-on-etc-target-dir.patch
+
+---

New:

  0001-uds-set-right-permissions-at-bind-time.patch
  0002-saveconfig-set-0o600-perms-on-backupfiles.patch
  0003-saveconfig-set-right-perms-on-backup-dir.patch
  0004-saveconfig-set-right-perms-on-etc-target-dir.patch



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.j3C0IU/_old  2020-06-11 10:11:38.784499082 +0200
+++ /var/tmp/diff_new_pack.j3C0IU/_new  2020-06-11 10:11:38.784499082 +0200
@@ -54,10 +54,18 @@
 Obsoletes:  targetcli-rbd < %{version}
 %endif
 %{?systemd_ordering}
+
+# SUSE-specific patches
 Patch1: Split-out-blockdev-readonly-state-detection-helper.patch
 Patch2: rbd-support.patch
 Patch3: fix-setup-install.patch
 
+# upstreamed patches
+Patch11:0001-uds-set-right-permissions-at-bind-time.patch
+Patch12:0002-saveconfig-set-0o600-perms-on-backupfiles.patch
+Patch13:0003-saveconfig-set-right-perms-on-backup-dir.patch
+Patch14:0004-saveconfig-set-right-perms-on-etc-target-dir.patch
+
 %python_subpackages
 
 %description
@@ -87,6 +95,10 @@
 %patch2 -p1
 %endif
 %patch3 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
 
 %build
 %python_build

++ 0001-uds-set-right-permissions-at-bind-time.patch ++
>From e347f7ea20547052e8fc1b65cba5e3f3ef2bf3d8 Mon Sep 17 00:00:00 2001
From: Prasanna Kumar Kalever 
Date: Fri, 29 May 2020 18:31:21 +0530
Subject: [PATCH 1/4] uds: set right permissions at bind() time

We fixed it earlier with commit 6e4f39357a90a914d11bac21cc2d2b52c07c213d
but that fixes the issue when someone run the targetclid with systemd
only.

If we don't use targetclid.socket and want to run `targetclid` from
command line, then socket.bind() will create the file with default
permissions.

Hence its good if we can guard the permissions right at the time of .bind()

Signed-off-by: Prasanna Kumar Kalever 
---
 daemon/targetclid | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/daemon/targetclid b/daemon/targetclid
index 329cede5da87..9bf8ae7ed14e 100755
--- a/daemon/targetclid
+++ b/daemon/targetclid
@@ -28,6 +28,7 @@ from threading import Thread
 
 import os
 import sys
+import stat
 import socket
 import struct
 import fcntl
@@ -238,12 +239,17 @@ def main():
 # save socket so a signal can clea it up
 to.sock = sock
 
+mode = stat.S_IRUSR | stat.S_IWUSR # 0o600
+umask = 0o777 ^ mode  # Prevents always downgrading umask to 0
+umask_original = os.umask(umask)
 # Bind the socket path
 try:
 sock.bind(to.socket_path)
 except socket.error as err:
 to.display(to.render(err.strerror, 'red'))
 sys.exit(1)
+finally:
+os.umask(umask_original)
 
 # Listen for incoming connections
 try:
-- 
2.26.2

++ 0002-saveconfig-set-0o600-perms-on-backupfiles.patch ++
>From 1940a17986deaab92e6be395f20ee55dac0ac2bd Mon Sep 17 00:00:00 2001
From: Prasanna Kumar Kalever 
Date: Fri, 29 May 2020 14:51:28 +0530
Subject: [PATCH 2/4] saveconfig: set 0o600 perms on backupfiles

Signed-off-by: Prasanna Kumar Kalever 
---
 targetcli/ui_root.py | 5 +
 1 file changed, 5 insertions(+)

diff --git a/targetcli/ui_root.py b/targetcli/ui_root.py
index 26815bd2b8fa..6e99b8cfcb78 100644
--- a/targetcli/ui_root.py
+++ b/targetcli/ui_root.py
@@ -125,12 +125,17 @@ class UIRoot(UINode):
 
 # Save backup if backup dir is empty, or savefile is differnt from 
recent backup copy
 if not backed_files_list or not 
self._compare_files(backed_files_list[-1], savefile):
+mode = stat.S_IRUSR | stat.S_IWUSR # 0o600
+umask = 0o777 ^ mode  # Prevents always downgrading umask to 0
+

commit targetcli-fb for openSUSE:Factory

2020-05-26 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2020-05-26 17:19:09

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new.2738 (New)


Package is "targetcli-fb"

Tue May 26 17:19:09 2020 rev:18 rq:808062 version:2.1.52

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2020-02-19 12:41:23.783723502 +0100
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new.2738/targetcli-fb.changes  
2020-05-26 17:19:19.911976292 +0200
@@ -1,0 +2,18 @@
+Thu May 21 17:38:48 UTC 2020 - ldun...@suse.com
+
+- Update to version 2.1.52:
+  * version 2.1.52
+  * daemon-interactive: do not allow clearing the prompt
+  * daemon-interactive: show path on prompt
+  * daemonized-mode: add interactive shell support
+  * Use temp file objects for temporary storage area
+  * Fix StringIO/BytesIO stuck issue
+  * Fix targetclid daemon infinite stuck
+  * targetclid.sock: change SocketMode to 0600
+(bsc#1168415 CVE-2020-10699)
+  * setup.py: add the socket and service files to the data_files section
+  * Use StringIO as a buffer instead of a file
+  Also, add a patch to move systemd unit files to /usr/lib/systemd/system:
+  * fix-setup-install.patch
+
+---

Old:

  targetcli-fb-2.1.51.tar.xz
  targetclid.service
  targetclid.socket

New:

  fix-setup-install.patch
  targetcli-fb-2.1.52.tar.xz



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.qoX1GW/_old  2020-05-26 17:19:21.031978700 +0200
+++ /var/tmp/diff_new_pack.qoX1GW/_new  2020-05-26 17:19:21.035978708 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:   targetcli-fb
-Version:2.1.51
+Version:2.1.52
 Release:0
 Summary:A command shell for managing the Linux LIO kernel target
 License:Apache-2.0
@@ -26,8 +26,6 @@
 URL:https://github.com/open-iscsi/%{name}
 Source: %{name}-%{version}.tar.xz
 Source1:%{name}.service
-Source2:targetclid.socket
-Source3:targetclid.service
 BuildRequires:  %{python_module configshell-fb}
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module pyparsing}
@@ -58,6 +56,7 @@
 %{?systemd_ordering}
 Patch1: Split-out-blockdev-readonly-state-detection-helper.patch
 Patch2: rbd-support.patch
+Patch3: fix-setup-install.patch
 
 %python_subpackages
 
@@ -87,6 +86,7 @@
 # RBD support is dependent on LIO changes present in the SLE/Leap kernel
 %patch2 -p1
 %endif
+%patch3 -p1
 
 %build
 %python_build
@@ -101,8 +101,6 @@
 install -D -m644 targetcli.8 %{buildroot}%{_mandir}/man8/targetcli.8
 install -D -m644 targetclid.8 %{buildroot}%{_mandir}/man8/targetclid.8
 install -D -m644 %{S:1} %{buildroot}%{_unitdir}/targetcli.service
-install -D -m644 %{S:2} %{buildroot}%{_unitdir}/targetclid.socket
-install -D -m644 %{S:3} %{buildroot}%{_unitdir}/targetclid.service
 %fdupes %{buildroot}
 ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rctargetcli
 ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rctargetclid

++ _service ++
--- /var/tmp/diff_new_pack.qoX1GW/_old  2020-05-26 17:19:21.067978777 +0200
+++ /var/tmp/diff_new_pack.qoX1GW/_new  2020-05-26 17:19:21.071978786 +0200
@@ -7,7 +7,7 @@
 @PARENT_TAG@
 v(\d*\.\d*\.)(\d*)
 \1\2
-v2.1.51
+v2.1.52
 enable
   
   

++ _servicedata ++
--- /var/tmp/diff_new_pack.qoX1GW/_old  2020-05-26 17:19:21.087978820 +0200
+++ /var/tmp/diff_new_pack.qoX1GW/_new  2020-05-26 17:19:21.087978820 +0200
@@ -1,4 +1,4 @@
 
 
 https://github.com/open-iscsi/targetcli-fb.git
-  06076aba7e9e9bd4a1e84bac61e85265e8075b8e
\ No newline at end of file
+  bab9fc16236c4aceade31e95327bc7b493bb157a
\ No newline at end of file

++ fix-setup-install.patch ++
From: Lee Duncan 
Date: Thu May 21 11:32:02 PDT 2020
Subject: [PATCH] fix setup install patch

Fix the setup.py install script to install systemd
files in /usr/lib/systemd/system instead of /lib/systemd/system
---
diff --git a/setup.py b/setup.py
index 4518165c57a6..2ebfc04605c0 100755
--- a/setup.py
+++ b/setup.py
@@ -34,7 +34,7 @@ setup(
'scripts/targetcli',
'daemon/targetclid'
   ],
-data_files = [('/lib/systemd/system', ['systemd/targetclid.socket', 
'systemd/targetclid.service'])],
+data_files = [('/usr/lib/systemd/system', ['systemd/targetclid.socket', 
'systemd/targetclid.service'])],
 classifiers = [
 "Programming Language :: Python",
 "Programming Language :: Python 

commit targetcli-fb for openSUSE:Factory

2020-02-19 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2020-02-19 12:41:23

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new.26092 (New)


Package is "targetcli-fb"

Wed Feb 19 12:41:23 2020 rev:17 rq:775445 version:2.1.51

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2020-02-04 19:58:05.393487358 +0100
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new.26092/targetcli-fb.changes 
2020-02-19 12:41:23.783723502 +0100
@@ -1,0 +2,48 @@
+Wed Feb 12 17:58:15 UTC 2020 - ldun...@suse.com
+
+- Update to version 2.1.51 from 2.1.49, which includes
+  the addition of a targetcli daemon, which can be used
+  to speed up batch processing. With patches:
+  * version 2.1.51
+  * targetcli: depreciate the redundant '--tcp' option
+  * man: add daemon intro at targetcli(8) man page
+  * systemd-units: fix documentation
+  * targetclid: add man page entry
+  * daemon: load the prefs on every new connection
+  * cli: show useful hint in header area of shell in daemonized mode
+  * cli: provide a way to disable using daemon
+  * cli: show better error msg when daemon is not running
+  * Do not print err msg when signal closes socket.
+  * Handle systemd socket activation, when present.
+  * Close socket when receiving a signal to interrupt connection.
+  * Exit with success when getting a signal.
+  * Only return response to targetcli when bytes present
+  * Removed useless semicolons, as they're ignored
+  * Handle OSError correctly: use strerror to get string
+  * Tweak systemd socket-activation settings for daemon
+  * Handle Python 3.7 stricter binary vs. string rules.
+  * Fix indention for targetclid when processing output.
+  * version 2.1.50
+  * iscsi discovery_auth enable is a number not a string
+  * restoreconfig: add ability to restore/reload single target or 
storage_object
+  * Fix a syntax error in some except clauses
+  * Remove Epydoc markup from command messages
+  * targetcli: serialize multiple requests
+  * targetcli: way to enable targetclid as default choice
+  * targetclid: enable socket based activation
+  * targetclid: add daemonize component for targetcli
+  * Do not remove the first digit when auto-completing the TPG tag
+  * Remove the extra semicolon in _save_backups
+  * Add emulate_pr backstore attribute
+  * targetcli-fb: Fix raise exception error in _save_backups
+  * saveconfig: compress the backup config files
+  This replaces targetcli-fb-2.1.49.tar.xz with
+  targetcli-fb-2.1.51.tar.xz, and removes the following patches,
+  which area already upstream:
+  * Add-emulate_pr-backstore-attribute.patch
+  * do-not-remove-the-first-digit-when-auto-completing-the-tpg-tag
+  * iscsi-discovery_auth-enable-is-a-number-not-a-string
+  * saveconfig-compress-the-backup-config-files
+  * targetcli-fb-fix-raise-exception-error-in-save_backups
+
+---

Old:

  Add-emulate_pr-backstore-attribute.patch
  do-not-remove-the-first-digit-when-auto-completing-the-tpg-tag
  iscsi-discovery_auth-enable-is-a-number-not-a-string
  saveconfig-compress-the-backup-config-files
  targetcli-fb-2.1.49.tar.xz
  targetcli-fb-fix-raise-exception-error-in-save_backups

New:

  targetcli-fb-2.1.51.tar.xz
  targetclid.service
  targetclid.socket



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.fBnxH7/_old  2020-02-19 12:41:24.959725766 +0100
+++ /var/tmp/diff_new_pack.fBnxH7/_new  2020-02-19 12:41:24.963725774 +0100
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:   targetcli-fb
-Version:2.1.49
+Version:2.1.51
 Release:0
 Summary:A command shell for managing the Linux LIO kernel target
 License:Apache-2.0
@@ -26,6 +26,8 @@
 URL:https://github.com/open-iscsi/%{name}
 Source: %{name}-%{version}.tar.xz
 Source1:%{name}.service
+Source2:targetclid.socket
+Source3:targetclid.service
 BuildRequires:  %{python_module configshell-fb}
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module pyparsing}
@@ -45,8 +47,8 @@
 Provides:   targetcli= %{version}-%{release}
 Provides:   targetcli-fb = %{version}-%{release}
 %endif
-Obsoletes:  targetcli
-Obsoletes:  targetcli-fb
+Obsoletes:  targetcli < %{version}-%{release}
+Obsoletes:  targetcli-fb < %{version}-%{release}
 BuildArch:  noarch
 %if 0%{?sle_version} >= 15
 # explicit Provides advertising RBD support
@@ -56,11 +58,6 @@
 %{?systemd_ordering}
 Patch1: 

commit targetcli-fb for openSUSE:Factory

2020-02-04 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2020-02-04 19:58:00

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new.26092 (New)


Package is "targetcli-fb"

Tue Feb  4 19:58:00 2020 rev:16 rq:770062 version:2.1.49

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2019-08-22 10:53:18.437692358 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new.26092/targetcli-fb.changes 
2020-02-04 19:58:05.393487358 +0100
@@ -1,0 +2,6 @@
+Mon Feb  3 16:38:45 UTC 2020 - Dominique Leuenberger 
+
+- BuildRequire pkgconfig(systemd) instead of systemd: allow OBS to
+  shortcut through the -mini flavors.
+
+---



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.C3kaEb/_old  2020-02-04 19:58:06.645488088 +0100
+++ /var/tmp/diff_new_pack.C3kaEb/_new  2020-02-04 19:58:06.649488091 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package targetcli-fb
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -23,7 +23,7 @@
 Summary:A command shell for managing the Linux LIO kernel target
 License:Apache-2.0
 Group:  System/Management
-Url:https://github.com/open-iscsi/%{name}
+URL:https://github.com/open-iscsi/%{name}
 Source: %{name}-%{version}.tar.xz
 Source1:%{name}.service
 BuildRequires:  %{python_module configshell-fb}
@@ -33,7 +33,7 @@
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
-BuildRequires:  systemd
+BuildRequires:  pkgconfig(systemd)
 Requires:   python-configshell-fb
 Requires:   python-dbus-python
 Requires:   python-rtslib-fb
@@ -53,7 +53,7 @@
 Provides:   targetcli-rbd = %{version}
 Obsoletes:  targetcli-rbd < %{version}
 %endif
-%{?systemd_requires}
+%{?systemd_ordering}
 Patch1: Split-out-blockdev-readonly-state-detection-helper.patch
 Patch2: rbd-support.patch
 Patch3: saveconfig-compress-the-backup-config-files




commit targetcli-fb for openSUSE:Factory

2019-08-22 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2019-08-22 10:53:11

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new.22127 (New)


Package is "targetcli-fb"

Thu Aug 22 10:53:11 2019 rev:15 rq:724877 version:2.1.49

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2019-08-20 10:59:37.368653367 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new.22127/targetcli-fb.changes 
2019-08-22 10:53:18.437692358 +0200
@@ -9 +8,0 @@
-  * add-emulate_pr-backstore-attribute



Other differences:
--



commit targetcli-fb for openSUSE:Factory

2019-08-20 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2019-08-20 10:59:30

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new.22127 (New)


Package is "targetcli-fb"

Tue Aug 20 10:59:30 2019 rev:14 rq:724620 version:2.1.49

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2019-05-22 11:16:23.142516090 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new.22127/targetcli-fb.changes 
2019-08-20 10:59:37.368653367 +0200
@@ -1,0 +2,10 @@
+Mon Aug 19 15:32:55 UTC 2019 - Lee Duncan 
+
+- Added the following upstream patches:
+  * targetcli-fb-fix-raise-exception-error-in-save_backups
+  * iscsi-discovery_auth-enable-is-a-number-not-a-string (bsc#1145685)
+  * saveconfig-compress-the-backup-config-files
+  * do-not-remove-the-first-digit-when-auto-completing-the-tpg-tag
+  * add-emulate_pr-backstore-attribute
+
+---

New:

  do-not-remove-the-first-digit-when-auto-completing-the-tpg-tag
  iscsi-discovery_auth-enable-is-a-number-not-a-string
  saveconfig-compress-the-backup-config-files
  targetcli-fb-fix-raise-exception-error-in-save_backups



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.5rQXBX/_old  2019-08-20 10:59:38.080653219 +0200
+++ /var/tmp/diff_new_pack.5rQXBX/_new  2019-08-20 10:59:38.080653219 +0200
@@ -56,7 +56,11 @@
 %{?systemd_requires}
 Patch1: Split-out-blockdev-readonly-state-detection-helper.patch
 Patch2: rbd-support.patch
-Patch3: Add-emulate_pr-backstore-attribute.patch
+Patch3: saveconfig-compress-the-backup-config-files
+Patch4: targetcli-fb-fix-raise-exception-error-in-save_backups
+Patch5: Add-emulate_pr-backstore-attribute.patch
+Patch6: do-not-remove-the-first-digit-when-auto-completing-the-tpg-tag
+Patch7: iscsi-discovery_auth-enable-is-a-number-not-a-string
 
 %python_subpackages
 
@@ -87,6 +91,10 @@
 %patch2 -p1
 %endif
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
 %python_build

++ do-not-remove-the-first-digit-when-auto-completing-the-tpg-tag ++
From: Christophe Vu-Brugier 
Date: Sat, 11 May 2019 15:15:16 +0200
Subject: Do not remove the first digit when auto-completing the TPG tag
Git-commit: 311ae0fc49174316c991dd3800c12549632e2c64

Instead of removing the first three characters of the "tpg" prefix to
get matches for the TPG tag number, the code removes four characters,
thus erasing the first digit of the TPG tag number.

This patches fixes issue #134.

Signed-off-by: Christophe Vu-Brugier 
Acked-by: Lee Duncan 
---
 targetcli/ui_target.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/targetcli/ui_target.py b/targetcli/ui_target.py
index 6895b38e62b8..0c3fe1b708db 100644
--- a/targetcli/ui_target.py
+++ b/targetcli/ui_target.py
@@ -384,7 +384,7 @@ class UIMultiTPGTarget(UIRTSLibNode):
 @rtype: list of str
 '''
 if current_param == 'tag':
-tags = [child.name[4:] for child in self.children]
+tags = [child.name[3:] for child in self.children]
 completions = [tag for tag in tags if tag.startswith(text)]
 else:
 completions = []

++ iscsi-discovery_auth-enable-is-a-number-not-a-string ++
From: Lee Duncan 
Date: Thu, 15 Aug 2019 08:38:35 -0700
Subject: iscsi discovery_auth enable is a number not a string
Git-commit: dc8d9d83cef8489f3b6aec1609299cdba70eda34

The discovery_auth attribute group in the /iscsi node
has several attributes, and all area treated like strings,
even though "enable" is a number in sysfs, accepting either
zero or one. It would break backwards compatability to
convert this attribute to be a boolean, so at least
treat it like a proper number instead of a string.

This avoids stack dumps like the following when trying
to set this attribute to 'true' or 'false':

> /iscsi> set discovery_auth enable=false
> Traceback (most recent call last):
>   File "/usr/bin/targetcli", line 122, in 
> main()
>   File "/usr/bin/targetcli", line 112, in main
> shell.run_interactive()
>   File "/usr/lib/python3.6/site-packages/configshell_fb/shell.py", line 905, 
> in run_interactive
> self._cli_loop()
>   File "/usr/lib/python3.6/site-packages/configshell_fb/shell.py", line 734, 
> in _cli_loop
> self.run_cmdline(cmdline)
>   File "/usr/lib/python3.6/site-packages/configshell_fb/shell.py", line 848, 
> in run_cmdline
> self._execute_command(path, command, pparams, kparams)
>   File "/usr/lib/python3.6/site-packages/configshell_fb/shell.py", line 823, 
> in 

commit targetcli-fb for openSUSE:Factory

2019-05-22 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2019-05-22 11:16:19

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new.5148 (New)


Package is "targetcli-fb"

Wed May 22 11:16:19 2019 rev:13 rq:704410 version:2.1.49

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2019-02-08 12:15:14.301428037 +0100
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new.5148/targetcli-fb.changes  
2019-05-22 11:16:23.142516090 +0200
@@ -1,0 +2,6 @@
+Wed Apr  3 03:14:10 UTC 2019 - dd...@suse.com
+
+- support emulate_pr attribute changes (bsc#1121998)
+  + Add-emulate_pr-backstore-attribute.patch
+
+---
@@ -5 +11 @@
-  do not run at the same time, in a sane way (bsc#11234233),
+  do not run at the same time, in a sane way (bsc#1123423),

New:

  Add-emulate_pr-backstore-attribute.patch



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.FXcjIw/_old  2019-05-22 11:16:24.134515396 +0200
+++ /var/tmp/diff_new_pack.FXcjIw/_new  2019-05-22 11:16:24.138515393 +0200
@@ -12,7 +12,7 @@
 # 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/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
@@ -56,6 +56,7 @@
 %{?systemd_requires}
 Patch1: Split-out-blockdev-readonly-state-detection-helper.patch
 Patch2: rbd-support.patch
+Patch3: Add-emulate_pr-backstore-attribute.patch
 
 %python_subpackages
 
@@ -85,6 +86,7 @@
 # RBD support is dependent on LIO changes present in the SLE/Leap kernel
 %patch2 -p1
 %endif
+%patch3 -p1
 
 %build
 %python_build

++ Add-emulate_pr-backstore-attribute.patch ++
>From fa71860b0d819a691683c1fdcb70c255653b5851 Mon Sep 17 00:00:00 2001
From: David Disseldorp 
Date: Tue, 15 Jan 2019 12:04:49 +0100
Subject: [PATCH] Add emulate_pr backstore attribute

Added to the kernel via b49d6f7885306ee636d5c1af52170f3069ccf5f7, the
emulate_pr attribute can be used to disable support for SCSI-2
(RESERVE/RELEASE) and Persistent Reservations.

Signed-off-by: David Disseldorp 
---
 targetcli/ui_backstore.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/targetcli/ui_backstore.py b/targetcli/ui_backstore.py
index efa532f..cc2cf2b 100644
--- a/targetcli/ui_backstore.py
+++ b/targetcli/ui_backstore.py
@@ -670,6 +670,7 @@ class UIStorageObject(UIRTSLibNode):
 'emulate_tpws': ('number', 'If set to 1, enable Thin Provisioning 
Write Same.'),
 'emulate_ua_intlck_ctrl': ('number', 'If set to 1, enable Unit 
Attention Interlock.'),
 'emulate_write_cache': ('number', 'If set to 1, turn on Write Cache 
Enable.'),
+'emulate_pr': ('number', 'If set to 1, enable SCSI Reservations.'),
 'enforce_pr_isids': ('number', 'If set to 1, enforce persistent 
reservation ISIDs.'),
 'force_pr_aptpl': ('number', 'If set to 1, force SPC-3 PR Activate 
Persistence across Target Power Loss operation.'),
 'fabric_max_sectors': ('number', 'Maximum number of sectors the fabric 
can transfer at once.'),
-- 
2.16.4




commit targetcli-fb for openSUSE:Factory

2019-02-08 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2019-02-08 12:14:58

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new.28833 (New)


Package is "targetcli-fb"

Fri Feb  8 12:14:58 2019 rev:12 rq:672535 version:2.1.49

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2018-12-08 11:22:04.166741838 +0100
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new.28833/targetcli-fb.changes 
2019-02-08 12:15:14.301428037 +0100
@@ -1,0 +2,8 @@
+Thu Feb  7 17:26:52 UTC 2019 - ldun...@suse.com
+
+- Ensure this package and the deprecated lio-utils package
+  do not run at the same time, in a sane way (bsc#11234233),
+  updating the source file targetcli-fb.service. Also, updated
+  the SPEC file with new year, updated URL, and http->https.
+
+---



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.jTrgXk/_old  2019-02-08 12:15:17.409426873 +0100
+++ /var/tmp/diff_new_pack.jTrgXk/_new  2019-02-08 12:15:17.409426873 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package targetcli-fb
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# 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
@@ -12,7 +12,7 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via https://bugs.opensuse.org/
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
 
@@ -23,7 +23,7 @@
 Summary:A command shell for managing the Linux LIO kernel target
 License:Apache-2.0
 Group:  System/Management
-Url:http://github.com/agrover/%{name}
+Url:https://github.com/open-iscsi/%{name}
 Source: %{name}-%{version}.tar.xz
 Source1:%{name}.service
 BuildRequires:  %{python_module configshell-fb}

++ targetcli-fb.service ++
--- /var/tmp/diff_new_pack.jTrgXk/_old  2019-02-08 12:15:17.501426839 +0100
+++ /var/tmp/diff_new_pack.jTrgXk/_new  2019-02-08 12:15:17.501426839 +0100
@@ -3,6 +3,7 @@
 DefaultDependencies=No
 After=network.target target.service
 Before=remote-fs-pre.target
+Conflicts=target.service
 
 [Service]
 Type=oneshot




commit targetcli-fb for openSUSE:Factory

2018-12-08 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2018-12-08 11:22:02

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new.19453 (New)


Package is "targetcli-fb"

Sat Dec  8 11:22:02 2018 rev:11 rq:656081 version:2.1.49

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2018-10-22 11:23:14.883161582 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new.19453/targetcli-fb.changes 
2018-12-08 11:22:04.166741838 +0100
@@ -1,0 +2,5 @@
+Fri Dec  7 09:40:19 UTC 2018 - dd...@suse.com
+
+- Enable RBD support for SLE/Leap 15+ (bsc#1118516)
+
+---



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.3eQ2zk/_old  2018-12-08 11:22:04.698741329 +0100
+++ /var/tmp/diff_new_pack.3eQ2zk/_new  2018-12-08 11:22:04.702741325 +0100
@@ -12,7 +12,7 @@
 # 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/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
@@ -48,7 +48,7 @@
 Obsoletes:  targetcli
 Obsoletes:  targetcli-fb
 BuildArch:  noarch
-%if 0%{?sle_version} == 15
+%if 0%{?sle_version} >= 15
 # explicit Provides advertising RBD support
 Provides:   targetcli-rbd = %{version}
 Obsoletes:  targetcli-rbd < %{version}
@@ -81,7 +81,7 @@
 %prep
 %setup -q
 %patch1 -p1
-%if 0%{?sle_version} == 15
+%if 0%{?sle_version} >= 15
 # RBD support is dependent on LIO changes present in the SLE/Leap kernel
 %patch2 -p1
 %endif




commit targetcli-fb for openSUSE:Factory

2018-10-22 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2018-10-22 11:23:11

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new (New)


Package is "targetcli-fb"

Mon Oct 22 11:23:11 2018 rev:10 rq:643051 version:2.1.49

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2018-04-22 14:40:49.226404083 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new/targetcli-fb.changes   
2018-10-22 11:23:14.883161582 +0200
@@ -1,0 +2,33 @@
+Thu Oct 18 19:50:11 UTC 2018 - opensuse-packag...@opensuse.org
+
+- Update to version 2.1.49:
+  * version 2.1.fb49
+  * targetcli-fb: Add support for media change
+  * fix the parameter of define_config_group_param
+  * saveconfig: handle backups with block-level delete
+  * saveconfig: way for block-level save with delete command
+  * create: add a way to set control string
+  * fix amount of backup files in backup dir
+  * config: add saveconfig command to StorageObject level
+  * Allow to customize a home directory
+  * Fix default max_backup_files in ui_command_saveconfig
+  * MappedLuns and Luns max number is not the same anymore
+  * Use signed char instead of char
+  * version 2.1.fb48
+  * remove wrong exit code from targetcli --version
+  * backup: global option to tune max no. of backup conf files
+  * config: rename key 'kept_backups' as 'max_backup_files'
+  * config: backup when current config is different from recent backup copy
+  * config: defend on '/etc/target/backup' directory
+  * Auto-detect readonly state for iblock devices
+  * Read number of backup files to keep from file
+  * skip refreshing user backed storage object when it is null
+  * Replace dbus-python with GObject Introspection
+ This replaces targetcli-fb-2.1.47.tar.xz with targetcli-fb-2.1.49.tar.xz,
+ and removes the following patches:
+ * Auto-detect-readonly-state-for-iblock-devices.patch
+ * Use-signed-char-instead-of-char.patch
+ * targetcli-only-save-old-config-if-present.patch
+ and updates the SPEC file.
+
+---

Old:

  Auto-detect-readonly-state-for-iblock-devices.patch
  Use-signed-char-instead-of-char.patch
  targetcli-fb-2.1.47.tar.xz
  targetcli-only-save-old-config-if-present.patch

New:

  targetcli-fb-2.1.49.tar.xz



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.WQ4ImA/_old  2018-10-22 11:23:15.455161007 +0200
+++ /var/tmp/diff_new_pack.WQ4ImA/_new  2018-10-22 11:23:15.455161007 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:   targetcli-fb
-Version:2.1.47
+Version:2.1.49
 Release:0
 Summary:A command shell for managing the Linux LIO kernel target
 License:Apache-2.0
@@ -54,11 +54,8 @@
 Obsoletes:  targetcli-rbd < %{version}
 %endif
 %{?systemd_requires}
-Patch1: Auto-detect-readonly-state-for-iblock-devices.patch
-Patch2: Use-signed-char-instead-of-char.patch
-Patch3: Split-out-blockdev-readonly-state-detection-helper.patch
-Patch4: rbd-support.patch
-Patch5: targetcli-only-save-old-config-if-present.patch
+Patch1: Split-out-blockdev-readonly-state-detection-helper.patch
+Patch2: rbd-support.patch
 
 %python_subpackages
 
@@ -84,13 +81,10 @@
 %prep
 %setup -q
 %patch1 -p1
-%patch2 -p1
-%patch3 -p1
 %if 0%{?sle_version} == 15
 # RBD support is dependent on LIO changes present in the SLE/Leap kernel
-%patch4 -p1
+%patch2 -p1
 %endif
-%patch5 -p1
 
 %build
 %python_build

++ _service ++
--- /var/tmp/diff_new_pack.WQ4ImA/_old  2018-10-22 11:23:15.483160979 +0200
+++ /var/tmp/diff_new_pack.WQ4ImA/_new  2018-10-22 11:23:15.483160979 +0200
@@ -7,7 +7,7 @@
 @PARENT_TAG@
 v(\d*\.\d*\.)fb(\d*)
 \1\2
-v2.1.fb47
+v2.1.fb49
 enable
   
   

++ _servicedata ++
--- /var/tmp/diff_new_pack.WQ4ImA/_old  2018-10-22 11:23:15.499160963 +0200
+++ /var/tmp/diff_new_pack.WQ4ImA/_new  2018-10-22 11:23:15.499160963 +0200
@@ -1,4 +1,4 @@
 
 
 https://github.com/open-iscsi/targetcli-fb.git
-  ee32a2493eaccd9352cc596b9e3387960cca48fc
\ No newline at end of file
+  4d08771c0e6bf3cacba2ed3d3127dd10a86a7847
\ No newline at end of file

++ rbd-support.patch ++
--- /var/tmp/diff_new_pack.WQ4ImA/_old  2018-10-22 11:23:15.511160951 +0200
+++ /var/tmp/diff_new_pack.WQ4ImA/_new  2018-10-22 11:23:15.511160951 +0200
@@ -9,14 +9,12 @@
 [dd...@suse.de: accept and propagate wwn parameter]
 Reviewed-by: David Disseldorp 
 ---
- targetcli/ui_backstore.py | 59 

commit targetcli-fb for openSUSE:Factory

2018-04-22 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2018-04-22 14:40:48

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new (New)


Package is "targetcli-fb"

Sun Apr 22 14:40:48 2018 rev:9 rq:599503 version:2.1.47

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2018-04-19 15:29:22.611329779 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new/targetcli-fb.changes   
2018-04-22 14:40:49.226404083 +0200
@@ -1,0 +2,7 @@
+Fri Apr 20 19:13:39 UTC 2018 - ldun...@suse.com
+
+- Only save current config to backup if current
+  config exists (bsc#1090424), adding patch:
+  * targetcli-only-save-old-config-if-present.patch
+
+---

New:

  targetcli-only-save-old-config-if-present.patch



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.yIOy4P/_old  2018-04-22 14:40:50.378362401 +0200
+++ /var/tmp/diff_new_pack.yIOy4P/_new  2018-04-22 14:40:50.382362256 +0200
@@ -58,6 +58,7 @@
 Patch2: Use-signed-char-instead-of-char.patch
 Patch3: Split-out-blockdev-readonly-state-detection-helper.patch
 Patch4: rbd-support.patch
+Patch5: targetcli-only-save-old-config-if-present.patch
 
 %python_subpackages
 
@@ -89,6 +90,7 @@
 # RBD support is dependent on LIO changes present in the SLE/Leap kernel
 %patch4 -p1
 %endif
+%patch5 -p1
 
 %build
 %python_build

++ targetcli-only-save-old-config-if-present.patch ++
From: Lee Duncan 
Date: Fri Apr 20 12:07:30 PDT 2018
Subject: [PATCH] targetcli: only save old config if present

There is no reason to copy the current configuration to the
backup directory if there is no current configuration.

Already fixed upstream, but the code is totally different
there.

Signed-off-by: Lee Duncan 
--- 
--- a/targetcli/ui_root.py  2018-04-20 11:53:58.987907240 -0700
+++ b/targetcli/ui_root.py  2018-04-20 11:56:35.231375345 -0700
@@ -70,7 +70,7 @@ class UIRoot(UINode):
 savefile = os.path.expanduser(savefile)
 
 # Only save backups if saving to default location
-if savefile == default_save_file:
+if (savefile == default_save_file) and os.path.exists(savefile):
 backup_dir = os.path.dirname(savefile) + "/backup"
 backup_name = "saveconfig-" + \
 datetime.now().strftime("%Y%m%d-%H:%M:%S") + ".json"



commit targetcli-fb for openSUSE:Factory

2018-04-19 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2018-04-19 15:29:20

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new (New)


Package is "targetcli-fb"

Thu Apr 19 15:29:20 2018 rev:8 rq:597223 version:2.1.47

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2018-02-26 23:25:33.201467961 +0100
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new/targetcli-fb.changes   
2018-04-19 15:29:22.611329779 +0200
@@ -1,0 +2,19 @@
+Wed Apr 11 00:00:54 UTC 2018 - dd...@suse.com
+
+- Merge RBD support from non-fb version (bsc#1079329)
+  + Split-out-blockdev-readonly-state-detection-helper.patch
+  + rbd-support.patch (SLE/Leap only, due to LIO kernel dependency)
+  + Add explicit Provides for "python-rtslib-rbd"
+- Detect write-protected block devices (bsc#1070815)
+  + Auto-detect-readonly-state-for-iblock-devices.patch
+  + Use-signed-char-instead-of-char.patch
+
+---
+Tue Apr 10 13:32:56 UTC 2018 - dd...@suse.com
+
+- Automatically generate version string from upstream tag
+  + Retain current fb-removed version format used
+  + Rename targetcli-fb-2.1.fb47.tar.xz to targetcli-fb-2.1.47.tar.xzar.xz
+and cleanup hardcoded duplicate name/version values in spec
+
+---

Old:

  targetcli-fb-2.1.fb47.tar.xz

New:

  Auto-detect-readonly-state-for-iblock-devices.patch
  Split-out-blockdev-readonly-state-detection-helper.patch
  Use-signed-char-instead-of-char.patch
  rbd-support.patch
  targetcli-fb-2.1.47.tar.xz



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.Kecj6q/_old  2018-04-19 15:29:23.111309312 +0200
+++ /var/tmp/diff_new_pack.Kecj6q/_new  2018-04-19 15:29:23.115309147 +0200
@@ -16,18 +16,16 @@
 #
 
 
-%define oname targetcli-fb
-%define realver  2.1.fb47
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
-Name:   %{oname}
+Name:   targetcli-fb
 Version:2.1.47
 Release:0
 Summary:A command shell for managing the Linux LIO kernel target
 License:Apache-2.0
 Group:  System/Management
-Url:http://github.com/agrover/%{oname}
-Source: %{oname}-%{realver}.tar.xz
-Source1:%{oname}.service
+Url:http://github.com/agrover/%{name}
+Source: %{name}-%{version}.tar.xz
+Source1:%{name}.service
 BuildRequires:  %{python_module configshell-fb}
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module pyparsing}
@@ -44,13 +42,22 @@
 Requires(post): update-alternatives
 Requires(postun): update-alternatives
 %ifpython3
-Provides:   targetcli-fb = %{version}-%{release}
 Provides:   targetcli= %{version}-%{release}
+Provides:   targetcli-fb = %{version}-%{release}
 %endif
-Obsoletes:  targetcli-fb
 Obsoletes:  targetcli
+Obsoletes:  targetcli-fb
 BuildArch:  noarch
+%if 0%{?sle_version} == 15
+# explicit Provides advertising RBD support
+Provides:   targetcli-rbd = %{version}
+Obsoletes:  targetcli-rbd < %{version}
+%endif
 %{?systemd_requires}
+Patch1: Auto-detect-readonly-state-for-iblock-devices.patch
+Patch2: Use-signed-char-instead-of-char.patch
+Patch3: Split-out-blockdev-readonly-state-detection-helper.patch
+Patch4: rbd-support.patch
 
 %python_subpackages
 
@@ -74,7 +81,14 @@
 python2-targetcli-fb and python3-targetcli-fb.
 
 %prep
-%setup -q -n %{oname}-%{realver}%{?extraver}
+%setup -q
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%if 0%{?sle_version} == 15
+# RBD support is dependent on LIO changes present in the SLE/Leap kernel
+%patch4 -p1
+%endif
 
 %build
 %python_build

++ Auto-detect-readonly-state-for-iblock-devices.patch ++
>From 5d1abab36be9375f46210dd19d5293cf73433681 Mon Sep 17 00:00:00 2001
From: David Disseldorp 
Date: Thu, 7 Dec 2017 15:25:35 +0100
Subject: [PATCH 1/4] Auto-detect readonly state for iblock devices

Configuring a read-only block device as read-write currently results in
a backstore->enable configfs I/O error, as documented in:
http://www.spinics.net/lists/target-devel/msg16310.html

This change sees targetcli check the read-only status of the underlying
block device via ioctl(BLKROGET). If a readonly= parameter isn't
provided, then the backstore will use the ioctl(BLKROGET) value as the
default.

Signed-off-by: David Disseldorp 
(cherry picked from commit 1a0886ecbcba6d5b2d9756ecadb3e2eaab99d29e)
---
 targetcli/ui_backstore.py | 30 +-
 1 file changed, 

commit targetcli-fb for openSUSE:Factory

2018-02-26 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2018-02-26 23:25:32

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new (New)


Package is "targetcli-fb"

Mon Feb 26 23:25:32 2018 rev:7 rq:579974 version:2.1.47

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2018-02-06 16:49:16.663721432 +0100
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new/targetcli-fb.changes   
2018-02-26 23:25:33.201467961 +0100
@@ -1,0 +2,5 @@
+Sun Feb 25 08:09:45 UTC 2018 - o...@aepfle.de
+
+- Fix upgrade path by provide/obsolete targetcli/targetcli-fb (bsc#1082693)
+
+---



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.8xN47v/_old  2018-02-26 23:25:34.517420634 +0100
+++ /var/tmp/diff_new_pack.8xN47v/_new  2018-02-26 23:25:34.521420490 +0100
@@ -45,9 +45,10 @@
 Requires(postun): update-alternatives
 %ifpython3
 Provides:   targetcli-fb = %{version}-%{release}
+Provides:   targetcli= %{version}-%{release}
 %endif
-Obsoletes:  targetcli-fb < %{version}-%{release}
-Conflicts:  targetcli
+Obsoletes:  targetcli-fb
+Obsoletes:  targetcli
 BuildArch:  noarch
 %{?systemd_requires}
 
@@ -67,7 +68,6 @@
 Summary:Common targetcli-fb subpackage for either flavor of Python
 Group:  System/Management
 Provides:   %{python_module targetcli-fb-common}
-Conflicts:  targetcli
 
 %description -n %{name}-common
 targetcli-fb-common is the invariant base package needed by both




commit targetcli-fb for openSUSE:Factory

2018-02-06 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2018-02-06 16:49:14

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new (New)


Package is "targetcli-fb"

Tue Feb  6 16:49:14 2018 rev:6 rq:573103 version:2.1.47

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2018-01-16 09:42:57.384043807 +0100
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new/targetcli-fb.changes   
2018-02-06 16:49:16.663721432 +0100
@@ -1,0 +2,5 @@
+Mon Feb  5 10:44:30 UTC 2018 - o...@aepfle.de
+
+- Fix upgrade path by provide/obsolete version-release
+
+---



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.VeEjwv/_old  2018-02-06 16:49:17.383687744 +0100
+++ /var/tmp/diff_new_pack.VeEjwv/_new  2018-02-06 16:49:17.387687556 +0100
@@ -44,9 +44,9 @@
 Requires(post): update-alternatives
 Requires(postun): update-alternatives
 %ifpython3
-Provides:   targetcli-fb = %{version}
+Provides:   targetcli-fb = %{version}-%{release}
 %endif
-Obsoletes:  targetcli-fb < %{version}
+Obsoletes:  targetcli-fb < %{version}-%{release}
 Conflicts:  targetcli
 BuildArch:  noarch
 %{?systemd_requires}




commit targetcli-fb for openSUSE:Factory

2018-01-16 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2018-01-16 09:42:55

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new (New)


Package is "targetcli-fb"

Tue Jan 16 09:42:55 2018 rev:5 rq:564462 version:2.1.47

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2017-08-23 11:55:07.247124640 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new/targetcli-fb.changes   
2018-01-16 09:42:57.384043807 +0100
@@ -1,0 +2,35 @@
+Mon Jan 15 02:32:27 UTC 2018 - ldun...@suse.com
+
+- Removed duplicate BuildRequires line, and add Conflicts for
+  sub-package
+
+---
+Thu Jan  4 22:14:36 UTC 2018 - ldun...@suse.com
+
+- Added dependency on dbus package to SPEC file (bsc#1073913)
+
+---
+Thu Jan  4 21:54:00 UTC 2018 - ldun...@suse.com
+
+- Converted RPM SPEC file to singlepsec format (bsc#1045332),
+  updating SPEC file only. This breaks this package into two
+  packages. The new base package is called targetcli-fb-common,
+  and does not depend on the python version. The other package
+  is python-version dependent, and is called either
+  python2-targetcli-fb or python3-targetcli-fb, dpending on
+  which version of Python you wish to use.
+
+---
+Fri Dec 15 22:03:58 UTC 2017 - ldun...@suse.com
+
+- Ran "spec-cleaner" over the SPEC file, to clean it up, before
+  support for Python3 is added.
+
+---
+Fri Dec 15 21:43:06 UTC 2017 - ldun...@suse.com
+
+- Moved targetcli-fb-2.1.fb47.tar.gz to targetcli-fb-2.1.fb47.tar.xz,
+  after appropriate decompression/compression, to match SPEC and
+  _service file. Updated _servicedata to match.
+
+---

Old:

  targetcli-fb-2.1.fb47.tar.gz

New:

  targetcli-fb-2.1.fb47.tar.xz



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.yAHKUC/_old  2018-01-16 09:42:58.072011604 +0100
+++ /var/tmp/diff_new_pack.yAHKUC/_new  2018-01-16 09:42:58.072011604 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package targetcli-fb
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 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
@@ -18,30 +18,40 @@
 
 %define oname targetcli-fb
 %define realver  2.1.fb47
-
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:   %{oname}
 Version:2.1.47
 Release:0
-Url:http://github.com/agrover/%{oname}
 Summary:A command shell for managing the Linux LIO kernel target
 License:Apache-2.0
 Group:  System/Management
-Source: %{oname}-%{realver}.tar.gz
+Url:http://github.com/agrover/%{oname}
+Source: %{oname}-%{realver}.tar.xz
 Source1:%{oname}.service
-Conflicts:  targetcli
+BuildRequires:  %{python_module configshell-fb}
+BuildRequires:  %{python_module devel}
+BuildRequires:  %{python_module pyparsing}
+BuildRequires:  %{python_module rtslib-fb}
+BuildRequires:  %{python_module setuptools}
+BuildRequires:  fdupes
+BuildRequires:  python-rpm-macros
+BuildRequires:  systemd
 Requires:   python-configshell-fb
+Requires:   python-dbus-python
 Requires:   python-rtslib-fb
 Requires:   python-six
+Requires:   targetcli-fb-common
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+%ifpython3
+Provides:   targetcli-fb = %{version}
+%endif
+Obsoletes:  targetcli-fb < %{version}
+Conflicts:  targetcli
 BuildArch:  noarch
-BuildRequires:  fdupes
-BuildRequires:  python-configshell-fb
-BuildRequires:  python-devel
-BuildRequires:  python-pyparsing
-BuildRequires:  python-rtslib-fb
-BuildRequires:  python-setuptools
-BuildRequires:  systemd
 %{?systemd_requires}
-BuildRoot:  %{_tmppath}/%{name}-%{version}-build
+
+%python_subpackages
 
 %description
 targetcli-fb is a command-line interface for configuring the LIO generic
@@ -53,43 +63,66 @@
 rtslib, and configshell, or stick with all non-fb versions, since they are
 no longer strictly compatible.
 
+%package -n %{name}-common
+Summary:Common targetcli-fb subpackage for either flavor of Python
+Group:  System/Management
+Provides:   %{python_module targetcli-fb-common}
+Conflicts:  targetcli
+
+%description -n 

commit targetcli-fb for openSUSE:Factory

2017-08-23 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2017-08-23 11:55:04

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new (New)


Package is "targetcli-fb"

Wed Aug 23 11:55:04 2017 rev:4 rq:518172 version:2.1.47

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2017-04-28 09:13:48.657787372 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new/targetcli-fb.changes   
2017-08-23 11:55:07.247124640 +0200
@@ -1,0 +2,8 @@
+Thu Aug 17 09:34:08 UTC 2017 - ls...@suse.com
+
+- Update to version 2.1.fb47
+  *Improving ALUA and TCMU support, as well as moving the default
+   directory for APTPL files from /var/target to /etc/target, 
+   for better FHS compliance. 
+
+---

Old:

  targetcli-fb-2.1.fb46.tar.xz

New:

  targetcli-fb-2.1.fb47.tar.gz



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.Am921I/_old  2017-08-23 11:55:08.162995712 +0200
+++ /var/tmp/diff_new_pack.Am921I/_new  2017-08-23 11:55:08.174994023 +0200
@@ -17,16 +17,16 @@
 
 
 %define oname targetcli-fb
-%define realver  2.1.fb46
+%define realver  2.1.fb47
 
 Name:   %{oname}
-Version:2.1.43
+Version:2.1.47
 Release:0
 Url:http://github.com/agrover/%{oname}
 Summary:A command shell for managing the Linux LIO kernel target
 License:Apache-2.0
 Group:  System/Management
-Source: %{oname}-%{realver}.tar.xz
+Source: %{oname}-%{realver}.tar.gz
 Source1:%{oname}.service
 Conflicts:  targetcli
 Requires:   python-configshell-fb




commit targetcli-fb for openSUSE:Factory

2017-04-28 Thread root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2017-04-28 09:13:38

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new (New)


Package is "targetcli-fb"

Fri Apr 28 09:13:38 2017 rev:3 rq:491077 version:2.1.43

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2016-11-05 21:25:36.0 +0100
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new/targetcli-fb.changes   
2017-04-28 09:13:48.657787372 +0200
@@ -1,0 +2,14 @@
+Thu Apr 13 07:40:01 UTC 2017 - h...@suse.com
+
+- Update to version 2.1.fb46 (bsc#1032833):
+  * version 2.1.fb44
+  * Remove build scripts for RPM and Debian packages
+  * Add Gentoo to the list of distributions that ship targetcli-fb
+  * Add support to create/delete ALUA groups on a storage object
+  * Add support to set/get a LUN's ALUA group
+  * version 2.1.fb45
+  * Create ALUA dir and def group in UI with storage object
+  * Clear backstore cache on refresh
+  * version 2.1.fb46
+
+---

Old:

  targetcli-fb-2.1.fb43.tar.gz

New:

  _service
  _servicedata
  targetcli-fb-2.1.fb46.tar.xz



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.NlBl8O/_old  2017-04-28 09:13:49.329692623 +0200
+++ /var/tmp/diff_new_pack.NlBl8O/_new  2017-04-28 09:13:49.333692058 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package targetcli-fb
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 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
@@ -17,7 +17,7 @@
 
 
 %define oname targetcli-fb
-%define realver  2.1.fb43
+%define realver  2.1.fb46
 
 Name:   %{oname}
 Version:2.1.43
@@ -26,7 +26,7 @@
 Summary:A command shell for managing the Linux LIO kernel target
 License:Apache-2.0
 Group:  System/Management
-Source: %{oname}-%{realver}.tar.gz
+Source: %{oname}-%{realver}.tar.xz
 Source1:%{oname}.service
 Conflicts:  targetcli
 Requires:   python-configshell-fb

++ _service ++

  
git
https://github.com/open-iscsi/targetcli-fb.git

targetcli-fb
2.1.fb46
v2.1.fb46
enable
  
  
*targetcli-fb*.tar
xz
  
  

++ _servicedata ++


https://github.com/open-iscsi/targetcli-fb.git
  f632f38264edc5a620ed5cd0f506d8dc205efce3


commit targetcli-fb for openSUSE:Factory

2016-11-05 Thread h_root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2016-11-05 21:25:23

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new (New)


Package is "targetcli-fb"

Changes:

--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes
2016-10-18 10:40:14.0 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new/targetcli-fb.changes   
2016-11-05 21:25:36.0 +0100
@@ -1,0 +2,5 @@
+Sun Oct 30 23:51:52 UTC 2016 - jeng...@inai.de
+
+- Trim macro indirections and empty macros
+
+---



Other differences:
--
++ targetcli-fb.spec ++
--- /var/tmp/diff_new_pack.R5DZiz/_old  2016-11-05 21:25:38.0 +0100
+++ /var/tmp/diff_new_pack.R5DZiz/_new  2016-11-05 21:25:38.0 +0100
@@ -21,7 +21,7 @@
 
 Name:   %{oname}
 Version:2.1.43
-Release:1%{?dist}
+Release:0
 Url:http://github.com/agrover/%{oname}
 Summary:A command shell for managing the Linux LIO kernel target
 License:Apache-2.0
@@ -57,20 +57,17 @@
 %setup -q -n %{oname}-%{realver}%{?extraver}
 
 %build
-%__python setup.py 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}
+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}
+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
 
 %post
 %{service_add_post targetcli.service}




commit targetcli-fb for openSUSE:Factory

2016-10-18 Thread h_root
Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2016-10-18 10:40:13

Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and  /work/SRC/openSUSE:Factory/.targetcli-fb.new (New)


Package is "targetcli-fb"

Changes:

New Changes file:

--- /dev/null   2016-09-15 12:42:18.240042505 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new/targetcli-fb.changes   
2016-10-18 10:40:14.0 +0200
@@ -0,0 +1,13 @@
+---
+Mon Jul 25 22:28:04 UTC 2016 - ldun...@suse.com
+
+-  updated spec file: removed Provides/Obsoletes of
+   targetcli and python-targetcli, and added
+   Conflicts with targetcli (bsc#986475)
+
+---
+Tue Apr 19 22:03:07 UTC 2016 - ldun...@suse.com
+
+- Creating from latest upstream version 2.1.fb43
+
+---

New:

  targetcli-fb-2.1.fb43.tar.gz
  targetcli-fb.changes
  targetcli-fb.service
  targetcli-fb.spec



Other differences:
--
++ targetcli-fb.spec ++
#
# 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}
Url:http://github.com/agrover/%{oname}
Summary:A command shell for managing the Linux LIO kernel target
License:Apache-2.0
Group:  System/Management
Source: %{oname}-%{realver}.tar.gz
Source1:%{oname}.service
Conflicts:  targetcli
Requires:   python-configshell-fb
Requires:   python-rtslib-fb
Requires:   python-six
BuildArch:  noarch
BuildRequires:  fdupes
BuildRequires:  python-configshell-fb
BuildRequires:  python-devel
BuildRequires:  python-pyparsing
BuildRequires:  python-rtslib-fb
BuildRequires:  python-setuptools
BuildRequires:  systemd
%{?systemd_requires}
BuildRoot:  %{_tmppath}/%{name}-%{version}-build

%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
++ targetcli-fb.service ++
[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