diff --git a/.gitignore b/.gitignore index e69de29..ba8d854 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/configshell-1.99.1.git987b63b.tar.gz diff --git a/python-configshell-git-version.patch b/python-configshell-git-version.patch new file mode 100644 index 0000000..ca9b275 --- /dev/null +++ b/python-configshell-git-version.patch @@ -0,0 +1,13 @@ +diff --git a/configshell/__init__.py b/configshell/__init__.py +index 9bfcdb3..1614267 100644 +--- a/configshell/__init__.py ++++ b/configshell/__init__.py +@@ -21,7 +21,7 @@ from shell import ConfigShell + from node import ConfigNode, ExecutionError + from prefs import Prefs + +-__version__ = 'GIT_VERSION' ++__version__ = '987b63b' + __author__ = "Jerome Martin " + __url__ = "http://www.risingtidesystems.com" + __description__ = "A framework to implement simple but nice CLIs." diff --git a/python-configshell-remove-epydoc-dep.patch b/python-configshell-remove-epydoc-dep.patch new file mode 100644 index 0000000..86a7dc3 --- /dev/null +++ b/python-configshell-remove-epydoc-dep.patch @@ -0,0 +1,50 @@ +From 06b7577eec64de5cca72496127fc0cdde4195c7a Mon Sep 17 00:00:00 2001 +From: Andy Grover +Date: Thu, 25 Aug 2011 13:39:15 -0700 +Subject: [PATCH] Do not require epydoc at runtime + +It's a little excessive to require the entire epydoc package so that +configshell can output italic/bold help text. If it's present, use it, +but otherwise just print plaintext. + +Signed-off-by: Andy Grover +--- + configshell/console.py | 15 ++++++++++++++- + 1 files changed, 14 insertions(+), 1 deletions(-) + +diff --git a/configshell/console.py b/configshell/console.py +index 52558dd..a6871e1 100644 +--- a/configshell/console.py ++++ b/configshell/console.py +@@ -23,7 +23,12 @@ import prefs + import struct + import termios + import textwrap +-import epydoc.markup.epytext ++ ++# avoid requiring epydoc at runtime ++try: ++ import epydoc.markup.epytext ++except ImportError: ++ pass + + class Console(object): + ''' +@@ -150,6 +155,14 @@ class Console(object): + text = self.dedent(text) + try: + dom_tree = epydoc.markup.epytext.parse(text, None) ++ except NameError: ++ # epydoc not installed, strip markup ++ dom_tree = text ++ dom_tree = dom_tree.replace("B{", "") ++ dom_tree = dom_tree.replace("I{", "") ++ dom_tree = dom_tree.replace("C{", "") ++ dom_tree = dom_tree.replace("}", "") ++ dom_tree += "\n" + except: + self.display(text) + raise +-- +1.7.1 + diff --git a/python-configshell.spec b/python-configshell.spec new file mode 100644 index 0000000..0b2c14e --- /dev/null +++ b/python-configshell.spec @@ -0,0 +1,70 @@ +# Copyright 2011, Red Hat + +%define oname configshell + +Name: python-configshell +License: AGPLv3 +Group: System Environment/Libraries +Summary: A framework to implement simple but nice CLIs +Version: 1.99.1.git987b63b +Release: 5%{?dist} +# placeholder URL and source entries +# archive created using: +# git clone git://risingtidesystems.com/configshell.git +# cd configshell +# git archive 987b63b --prefix configshell-%{version}/ | gzip > configshell-%{version}.tar.gz +URL: http://www.risingtidesystems.com/git/ +Source: %{oname}-%{version}.tar.gz +Patch1: %{name}-git-version.patch +Patch2: %{name}-remove-epydoc-dep.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch +BuildRequires: python-devel epydoc python-simpleparse python-urwid +Requires: python-simpleparse python-urwid + +%description +A framework to implement simple but nice configuration-oriented +command-line interfaces. + +%prep +%setup -q -n %{oname}-%{version} +%patch1 -p1 +%patch2 -p1 + +%build +%{__python} setup.py build + +%install +rm -rf %{buildroot} +%{__python} setup.py install --skip-build --root %{buildroot} + + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%{python_sitelib} +%doc COPYING README + +%changelog +* Fri Sep 23 2011 Andy Grover - 1.99.1.git987b63b-5 +* Rebuild + +* Thu Aug 25 2011 Andy Grover - 1.99.1.git987b63b-4 +- Add patch + - python-configshell-remove-epydoc-dep.patch + +* Wed Aug 17 2011 Andy Grover - 1.99.1.git987b63b-3 +- Address comments from spec review + - drop examples/myshell from doc, it hasn't been updated for API change + - Fully document procedure to generate source .tar.gz + - Remove "." from summary + - Remove commented-out spec todos and other cruft + +* Mon Aug 1 2011 Andy Grover - 1.99.1.git987b63b-2 +- Update to latest git version +- Add urwid builddep + +* Tue May 10 2011 Andy Grover - 1.99.1.git987b63b-1 +- Initial packaging diff --git a/sources b/sources index e69de29..b11558a 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +93eba365d2a455a0cec166e323a2b215 configshell-1.99.1.git987b63b.tar.gz