diff --git a/0000-signed-char.patch b/0000-signed-char.patch new file mode 100644 index 0000000000000000000000000000000000000000..b75a1b617b3552a7e08d2a8c92db03d1b925756d --- /dev/null +++ b/0000-signed-char.patch @@ -0,0 +1,21 @@ +commit ed5ff9b9505e50b545e86dfbdd32077f0ddda0cb +Author: Taylor Jakobson +Date: Thu Feb 1 14:44:32 2018 -0600 + + Use signed char instead of char + + Python3 does not have the "character" type, use signed char instead. + +diff --git a/targetcli/ui_backstore.py b/targetcli/ui_backstore.py +index 3a2db10..5af448f 100644 +--- a/targetcli/ui_backstore.py ++++ b/targetcli/ui_backstore.py +@@ -536,7 +536,7 @@ class UIBlockBackstore(UIBackstore): + except (OSError, IOError): + raise ExecutionError("Could not open %s" % dev) + # ioctl returns an int. Provision a buffer for it +- buf = array.array('c', [chr(0)] * 4) ++ buf = array.array('b', [0] * 4) + try: + fcntl.ioctl(f, BLKROGET, buf) + except (OSError, IOError): diff --git a/targetcli.spec b/targetcli.spec new file mode 100644 index 0000000000000000000000000000000000000000..0247d4f9469195fff70f1574662559aa92a73698 --- /dev/null +++ b/targetcli.spec @@ -0,0 +1,47 @@ +Name: targetcli +Version: 2.1.fb48 +Release: 9 +License: ASL 2.0 +Summary: Generic SCSI target CLI shell +URL: https://github.com/open-iscsi/targetcli-fb +Source: https://github.com/open-iscsi/targetcli-fb/archive/v2.1.fb48.tar.gz +Patch0000: 0000-signed-char.patch +BuildArch: noarch +BuildRequires: python3-devel python3-setuptools +Requires: python3-rtslib target-restore python3-configshell python3-six python3-dbus python3-gobject + +%description +Targetcli is an administration tool for managing storage targets +using the kernel LIO core target and compatible target fabric modules. + +%package help +Summary: Help document for the %{name} package + +%description help +Help document for the %{name} package. + +%prep +%autosetup -n targetcli-fb-%{version} -p1 + +%build +%{__python3} setup.py build +gzip --stdout targetcli.8 > targetcli.8.gz + +%install +%{__python3} setup.py install --skip-build --root %{buildroot} +install -d %{buildroot}%{_sysconfdir}/target/backup +install -D -m 644 targetcli.8.gz %{buildroot}%{_mandir}/man8/targetcli.8.gz + +%files +%doc COPYING README.md +%{python3_sitelib}/* +%{_bindir}/targetcli +%dir %{_sysconfdir}/target +%dir %{_sysconfdir}/target/backup + +%files help +%{_mandir}/man8/targetcli.8.gz + +%changelog +* Fri Feb 14 2020 lingsheng - 2.1.fb48-9 +- Package int diff --git a/v2.1.fb48.tar.gz b/v2.1.fb48.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..db003ac38050b9163fa38bac32da918eb1cb7b99 Binary files /dev/null and b/v2.1.fb48.tar.gz differ