From 0f739a65f3b70ba1aae66345fcc9bcef86de23ebd7b9afb78987bbdab6c0ce2f Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Thu, 23 Feb 2017 13:10:56 +0000 Subject: [PATCH 1/3] - update for single-spec - desetuptoolize.patch : switch from setuptools to distutils.core for installation, as this is now a setuptools dependency - ensure egg-info is a directory (distutils would install it as file) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyparsing?expand=0&rev=35 --- desetuptoolize.patch | 13 ++++++++++++ python-pyparsing.changes | 8 ++++++++ python-pyparsing.spec | 43 ++++++++++++++++++++++++---------------- 3 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 desetuptoolize.patch diff --git a/desetuptoolize.patch b/desetuptoolize.patch new file mode 100644 index 0000000..8c45fde --- /dev/null +++ b/desetuptoolize.patch @@ -0,0 +1,13 @@ +Index: pyparsing-2.1.10/setup.py +=================================================================== +--- pyparsing-2.1.10.orig/setup.py ++++ pyparsing-2.1.10/setup.py +@@ -1,7 +1,7 @@ + #!/usr/bin/env python + + """Setup script for the pyparsing module distribution.""" +-from setuptools import setup ++from distutils.core import setup + + import sys + import os diff --git a/python-pyparsing.changes b/python-pyparsing.changes index f8a42a8..5cad9dc 100644 --- a/python-pyparsing.changes +++ b/python-pyparsing.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Feb 23 11:45:52 UTC 2017 - jmatejek@suse.com + +- update for single-spec +- desetuptoolize.patch : switch from setuptools to distutils.core + for installation, as this is now a setuptools dependency +- ensure egg-info is a directory (distutils would install it as file) + ------------------------------------------------------------------- Fri Dec 2 16:32:17 UTC 2016 - toddrme2178@gmail.com diff --git a/python-pyparsing.spec b/python-pyparsing.spec index 140202e..3ba0135 100644 --- a/python-pyparsing.spec +++ b/python-pyparsing.spec @@ -1,7 +1,7 @@ # # spec file for package python-pyparsing # -# 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 @@ -16,26 +16,28 @@ # +%define oldpython python +%{?!python_module:%define python_module() python-%{1} python3-%{1}} Name: python-pyparsing Version: 2.1.10 Release: 0 -Url: http://pyparsing.wikispaces.com/ Summary: Grammar Parser Library for Python License: MIT and GPL-2.0+ and GPL-3.0+ Group: Development/Languages/Python +Url: http://pyparsing.wikispaces.com/ Source: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%{version}.tar.gz +Patch0: desetuptoolize.patch +BuildRequires: %{python_module base} +# do not add dependencies on setuptools and ideally not even full "python"; +# this is now a dependency of setuptools +Requires: python-base BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: python -BuildRequires: python-devel -BuildRequires: python-setuptools -Requires: python -Provides: python-parsing = %{version} -Obsoletes: python-parsing < %{version} -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else BuildArch: noarch +%ifpython2 +Provides: %{oldpython}-parsing = %{version} +Obsoletes: %{oldpython}-parsing < %{version} %endif +%python_subpackages %description The pyparsing module is an alternative approach to creating and executing @@ -58,21 +60,28 @@ This package contains the documentation of %{name} %prep %setup -q -n pyparsing-%{version} +%patch0 -p1 %build -python setup.py build +%python_build # Fix wrong EOL encoding: -sed -i 's/\r$//' CHANGES LICENSE README examples/*py +sed -i 's/\r$//' CHANGES LICENSE README examples/* %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install +# ensure egg-info is a directory +%{python_expand rm %{buildroot}%{$python_sitelib}/*.egg-info +cp -r pyparsing.egg-info %{buildroot}%{$python_sitelib}/pyparsing-%{version}-py%{$python_version}.egg-info +} -%files +%files %{python_files} %defattr(-,root,root,-) %doc CHANGES LICENSE README -%{python_sitelib}/* +%{python_sitelib}/pyparsing.py* +%pycache_only %{python_sitelib}/__pycache__/* +%{python_sitelib}/pyparsing-%{version}-py*.egg-info/ -%files doc +%files %{python_files doc} %defattr(-,root,root,-) %doc docs/* examples From 20a122e7299ea0b18386cdab2ba442113e83cf39c12613aee7a9ea94ae9dd3bf Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Thu, 23 Feb 2017 13:53:31 +0000 Subject: [PATCH 2/3] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyparsing?expand=0&rev=36 --- python-pyparsing.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/python-pyparsing.spec b/python-pyparsing.spec index 3ba0135..0579dbc 100644 --- a/python-pyparsing.spec +++ b/python-pyparsing.spec @@ -28,6 +28,7 @@ Url: http://pyparsing.wikispaces.com/ Source: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%{version}.tar.gz Patch0: desetuptoolize.patch BuildRequires: %{python_module base} +BuildRequires: python-rpm-macros # do not add dependencies on setuptools and ideally not even full "python"; # this is now a dependency of setuptools Requires: python-base From 170ad64d71347a9bb92fa8c7395799d73af6a4ad5d8a74497b53ddc60533e36f Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Fri, 24 Feb 2017 14:34:29 +0000 Subject: [PATCH 3/3] Accepting request 460227 from devel:languages:python:singlespec OBS-URL: https://build.opensuse.org/request/show/460227 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyparsing?expand=0&rev=37 --- python-pyparsing.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pyparsing.spec b/python-pyparsing.spec index 0579dbc..3821de4 100644 --- a/python-pyparsing.spec +++ b/python-pyparsing.spec @@ -17,7 +17,7 @@ %define oldpython python -%{?!python_module:%define python_module() python-%{1} python3-%{1}} +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pyparsing Version: 2.1.10 Release: 0