diff --git a/_service b/_service
new file mode 100644
index 0000000..d6ea1d6
--- /dev/null
+++ b/_service
@@ -0,0 +1,16 @@
+
+
+ git
+ https://github.com/open-iscsi/configshell-fb.git
+
+ configshell-fb
+ 1.1.fb23
+ v1.1.fb23
+ enable
+
+
+ *configshell-fb*.tar
+ xz
+
+
+
diff --git a/_servicedata b/_servicedata
new file mode 100644
index 0000000..d1c1e08
--- /dev/null
+++ b/_servicedata
@@ -0,0 +1,4 @@
+
+
+ https://github.com/open-iscsi/configshell-fb.git
+ 1299055734eeaf849cc7d3227731626bcf127e02
\ No newline at end of file
diff --git a/configshell-fb-1.1.fb23.tar.xz b/configshell-fb-1.1.fb23.tar.xz
new file mode 100644
index 0000000..b870753
--- /dev/null
+++ b/configshell-fb-1.1.fb23.tar.xz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c4ddace5093088809d2fade0f99b217fb2736993a1fc0cc3497a9dd1c26377dd
+size 29632
diff --git a/configshell-fb-Handle-if-TERM-is-not-set.patch b/configshell-fb-Handle-if-TERM-is-not-set.patch
new file mode 100644
index 0000000..67733fa
--- /dev/null
+++ b/configshell-fb-Handle-if-TERM-is-not-set.patch
@@ -0,0 +1,36 @@
+From daa66bc6acd2430cdd05e9883dd1eab69b698252 Mon Sep 17 00:00:00 2001
+From: Andy Grover
+Date: Tue, 23 May 2017 12:00:10 -0700
+Subject: [PATCH] Handle if TERM is not set
+
+Previous patch causes problems otherwise in some cases.
+
+Signed-off-by: Andy Grover
+---
+ configshell/shell.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/configshell/shell.py b/configshell/shell.py
+index c916366..e029c76 100644
+--- a/configshell/shell.py
++++ b/configshell/shell.py
+@@ -50,13 +50,14 @@ else:
+ tty=False
+
+ # remember the original setting
+- oldTerm = os.environ['TERM']
++ oldTerm = os.environ.get('TERM')
+ os.environ['TERM'] = ''
+
+ import readline
+
+ # restore the orignal TERM setting
+- os.environ['TERM'] = oldTerm
++ if oldTerm != None:
++ os.environ['TERM'] = oldTerm
+ del oldTerm
+
+ # Pyparsing helper to group the location of a token and its value
+--
+2.15.1
+
diff --git a/configshell-fb-example-should-not-specify-path.patch b/configshell-fb-example-should-not-specify-path.patch
new file mode 100644
index 0000000..88b8fed
--- /dev/null
+++ b/configshell-fb-example-should-not-specify-path.patch
@@ -0,0 +1,19 @@
+From: Lee Duncan
+Date: Fri Dec 8 15:38:50 PST 2017
+Subject: remove example dependency on /usr/bin/python
+
+All of the code works with python2 or python3, so remove
+the use of the full /usr/bin/python path in the example
+script so building is easier.
+
+Signed-off-by: Lee Duncan
+---
+diff -aurp a/examples/myshell b/examples/myshell
+--- a/examples/myshell 2017-03-01 15:21:57.000000000 -0800
++++ b/examples/myshell 2017-12-08 15:33:29.672794872 -0800
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ '''
+ This file is part of ConfigShell.
+ Copyright (c) 2011-2013 by Datera, Inc
diff --git a/python-configshell-fb.changes b/python-configshell-fb.changes
index 8ee691c..6800b66 100644
--- a/python-configshell-fb.changes
+++ b/python-configshell-fb.changes
@@ -1,3 +1,19 @@
+-------------------------------------------------------------------
+Fri Dec 8 19:34:23 UTC 2017 - lduncan@suse.com
+
+- Converting RPM SPEC file to singlespec format (bsc#1045332),
+ adding patch:
+ * configshell-fb-example-should-not-specify-path.patch
+- Fix targetcli.service problem when TERM not set (bsc#1071194),
+ adding patch (from LSZhu):
+ * configshell-fb-Handle-if-TERM-is-not-set.patch
+- Moved build requirement on urwid to runtime requirement,
+ as suggested by scarabeus_iv
+- ran spec-cleaner to clean up SPEC file
+- Converted from manually-added configshell-fb tar file to
+ tar_scm service-generated file by adding _service and
+ _servicedata
+
-------------------------------------------------------------------
Thu Aug 17 06:11:22 UTC 2017 - lszhu@suse.com
diff --git a/python-configshell-fb.spec b/python-configshell-fb.spec
index 04408d0..dc4092c 100644
--- a/python-configshell-fb.spec
+++ b/python-configshell-fb.spec
@@ -18,27 +18,30 @@
%define oname configshell-fb
%define realver 1.1.fb23
-
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-%{oname}
-Version: 1.23
-Release: 1%{?dist}
-Url: http://github.com/open-iscsi/configshell-fb
+Version: 1.1.fb23
+Release: 0%{?dist}
Summary: A Python library for building configuration shells
License: Apache-2.0
Group: Development/Libraries/Python
-Source: https://github.com/open-iscsi/%{oname}/archive/v%{realver}.tar.gz
-Requires: /usr/bin/python
+Url: http://github.com/open-iscsi/configshell-fb
+Source: %{oname}-%{realver}.tar.xz
+Patch1: %{oname}-example-should-not-specify-path.patch
+Patch2: %{oname}-Handle-if-TERM-is-not-set.patch
+BuildRequires: %{python_module devel}
+BuildRequires: %{python_module pyparsing}
+BuildRequires: %{python_module setuptools}
+BuildRequires: %{python_module six}
+BuildRequires: fdupes
+BuildRequires: python-rpm-macros
+Requires: %{_bindir}/env
Requires: python-pyparsing
Requires: python-six
-BuildArch: noarch
+Requires: python-urwid
Conflicts: python-configshell
-BuildRequires: fdupes
-BuildRequires: python-devel
-BuildRequires: python-pyparsing
-BuildRequires: python-setuptools
-BuildRequires: python-six
-BuildRequires: python-urwid
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildArch: noarch
+%python_subpackages
%description
configshell-fb is a Python library that provides a framework for building simple
@@ -53,7 +56,6 @@ no longer strictly compatible.
%package doc
Summary: Documentation for Python configshell-fb
Group: Documentation/HTML
-BuildArch: noarch
BuildRequires: epydoc
%description doc
@@ -67,28 +69,26 @@ rtslib, and configshell, or stick with all non-fb versions, since they are
no longer strictly compatible.
%prep
-%setup -q -n %{oname}-%{realver}%{?extraver}
+%setup -q -n %{oname}-%{realver}
+%patch1 -p1
+%patch2 -p1
%build
-%__python setup.py build
-%__mkdir_p doc/
+%python_build
+mkdir -p doc/
epydoc --no-sourcecode --html -n %{oname} --exclude configobj configshell/*.py
-%__mv html doc/
+%fdupes html/
+mv html doc/
%install
-%__python setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot}
-%fdupes %{buildroot}%{python_sitelib}
-%__install -d -m755 %{buildroot}%{_defaultdocdir}/python-configshell-doc-%{version}
-%__cp -r doc/* %{buildroot}%{_defaultdocdir}/python-configshell-doc-%{version}/
-%fdupes %{buildroot}%{_defaultdocdir}
+%python_install --skip-build
+%fdupes %{buildroot}
-%files
-%defattr(-,root,root)
+%files %{python_files}
%{python_sitelib}/*
%doc examples COPYING README.md
-%files doc
-%defattr(-,root,root)
-%{_defaultdocdir}/python-configshell-doc-%{version}
+%files %{python_files doc}
+%doc doc/*
%changelog
diff --git a/v1.1.fb23.tar.gz b/v1.1.fb23.tar.gz
deleted file mode 100644
index 8ec8c09..0000000
--- a/v1.1.fb23.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:63f7f814bf27d6dc5d6b3bbdd1da89a2a250f5662a67eaa781b9599779fdebb9
-size 34458