diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..fcc7b97
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,3 @@
+
+ test
+
diff --git a/pyparsing-2.2.0.tar.gz b/pyparsing-2.2.0.tar.gz
deleted file mode 100644
index f979ca6..0000000
--- a/pyparsing-2.2.0.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04
-size 1232522
diff --git a/pyparsing-2.3.1~test5.tar.gz b/pyparsing-2.3.1~test5.tar.gz
new file mode 100644
index 0000000..3998389
--- /dev/null
+++ b/pyparsing-2.3.1~test5.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0f671df9146dbf152a8475cd1703d89909d8e70ad7c33eb706c0dfd7f498e668
+size 590351
diff --git a/python-pyparsing-doc.changes b/python-pyparsing-doc.changes
deleted file mode 100644
index 70e8bd6..0000000
--- a/python-pyparsing-doc.changes
+++ /dev/null
@@ -1,5 +0,0 @@
--------------------------------------------------------------------
-Sat Aug 18 09:41:30 UTC 2018 - Matěj Cepl
-
-- Separate python-pyparsing-doc package so that tests can be run
- without introducing circular dependency.
diff --git a/python-pyparsing-doc.spec b/python-pyparsing-doc.spec
deleted file mode 100644
index 24b6b63..0000000
--- a/python-pyparsing-doc.spec
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# spec file for package python-pyparsing-doc
-#
-# 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
-# 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 basename python-parsing
-%define oldpython python
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-Name: python-pyparsing-doc
-Version: 2.2.0
-Release: 0
-Summary: Grammar Parser Library for Python - Documentation
-License: MIT AND GPL-2.0-or-later AND GPL-3.0-or-later
-Group: Development/Libraries/Python
-URL: http://pyparsing.wikispaces.com/
-Source: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%{version}.tar.gz
-BuildRequires: %{python_module base}
-BuildRequires: %{python_module nose}
-Requires: %{basename} = %{version}
-BuildArch: noarch
-%python_subpackages
-
-%description
-The pyparsing module is an alternative approach to creating and executing
-simple grammars, vs. the traditional lex/yacc approach, or the use of regular
-expressions. The pyparsing module provides a library of classes that client
-code uses to construct the grammar directly in Python code.
-
-This package contains the documentation of %{basename}
-
-%prep
-%setup -q -n pyparsing-%{version}
-
-%build
-sed -i 's/\r$//' LICENSE examples/*
-
-%install
-:
-
-%check
-%python_expand nosetests-%{$python_bin_suffix} -v
-
-%files %{python_files}
-%license LICENSE
-%doc docs/* examples
-
-%changelog
diff --git a/python-pyparsing.changes b/python-pyparsing.changes
index b6cd5df..c2def46 100644
--- a/python-pyparsing.changes
+++ b/python-pyparsing.changes
@@ -1,3 +1,37 @@
+-------------------------------------------------------------------
+Thu Nov 22 17:53:10 UTC 2018 - Jan Engelhardt
+
+- Use more specific RPM group.
+
+-------------------------------------------------------------------
+Wed Nov 21 17:48:41 CET 2018 - mcepl@suse.com
+
+- Upgrade to the current upstrem master with additional patches
+ to make the test suite pass.
+
+-------------------------------------------------------------------
+Sat Nov 17 22:59:29 CET 2018 - mcepl@suse.com
+
+- Add all tests.
+
+-------------------------------------------------------------------
+Thu Nov 15 08:46:10 UTC 2018 - Tomáš Chvátal
+
+- Update to 2.3.0:
+ * Updates to migrate source repo to GitHub
+ * Fix deprecation warning in Python 3.7 re: importing collections.abc
+ * Fix Literal/Keyword bug raising IndexError instead of ParseException
+ * Added simple_unit_tests.py, as a collection of easy-to-follow unit
+ * tests for various classes and features of the pyparsing library.
+ * Primary intent is more to be instructional than actually rigorous
+ * testing. Complex tests can still be added in the unitTests.py file.
+ * New features added to the Regex class
+
+-------------------------------------------------------------------
+Thu Nov 15 08:45:05 UTC 2018 - Tomáš Chvátal
+
+- Fix URL to point to existing github
+
-------------------------------------------------------------------
Sat Aug 18 09:41:30 UTC 2018 - Matěj Cepl
diff --git a/python-pyparsing.spec b/python-pyparsing.spec
index 0b47875..03e376d 100644
--- a/python-pyparsing.spec
+++ b/python-pyparsing.spec
@@ -12,23 +12,41 @@
# 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/
#
%define oldpython python
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
+
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%bcond_without test
+%else
+%bcond_with test
+%endif
+%if %{with test}
+Name: python-pyparsing-%{flavor}
+%else
Name: python-pyparsing
-Version: 2.2.0
+%endif
+Version: 2.3.1~test5
Release: 0
Summary: Grammar Parser Library for Python
License: MIT AND GPL-2.0-or-later AND GPL-3.0-or-later
Group: Development/Languages/Python
-URL: http://pyparsing.wikispaces.com/
-Source: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%{version}.tar.gz
+URL: https://github.com/pyparsing/pyparsing/
+# Upstream tarball from the master branch with gh#pyparsing/pyparsing#47
+Source: pyparsing-%{version}.tar.gz
+# Source: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%%{version}.tar.gz
BuildRequires: %{python_module base}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
+BuildRequires: python2-unittest2
+BuildRequires: python3-Sphinx
+%if %{with test}
+BuildRequires: %{python_module nose}
+%endif
# do not add dependencies on setuptools and ideally not even full "python";
# this is now a dependency of setuptools
Requires: python-base
@@ -45,27 +63,49 @@ simple grammars, vs. the traditional lex/yacc approach, or the use of regular
expressions. The pyparsing module provides a library of classes that client
code uses to construct the grammar directly in Python code.
+%package -n %{name}-docs
+Summary: Documentation files for %name
+Group: Documentation/HTML
+
+%description -n %{name}-docs
+HTML Documentation and examples for %name.
+
%prep
-%setup -q -n pyparsing-%{version}
+%setup -q -n pyparsing-2.3.1
%build
%python_build
-# Fix wrong EOL encoding:
-sed -i 's/\r$//' CHANGES LICENSE README examples/*
+# export PYTHONPATH=..:../examples
+python3 setup.py build_sphinx -v
%install
+%if ! %{with test}
%python_install
# ensure egg-info is a directory
-%{python_expand rm %{buildroot}%{$python_sitelib}/*.egg-info
+%{python_expand rm -rf %{buildroot}%{$python_sitelib}/*.egg-info
cp -r pyparsing.egg-info %{buildroot}%{$python_sitelib}/pyparsing-%{version}-py%{$python_version}.egg-info
}
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
+
+%check
+%if %{with test}
+export PYTHONPATH=.:example
+%python_exec setup.py nosetests -v
+%endif
%files %{python_files}
+%if ! %{with test}
%license LICENSE
-%doc CHANGES README
+%doc CHANGES README.rst
%{python_sitelib}/pyparsing.py*
%pycache_only %{python_sitelib}/__pycache__/*
%{python_sitelib}/pyparsing-%{version}-py*.egg-info/
+%endif
+
+%files -n %{name}-docs
+%if ! %{with test}
+%doc examples build/sphinx/html
+%endif
%changelog