Update to 1.6.8

Remove patch as it has been merged upstream.

Remove the python3 conditionals.

Changed the sources URL to point to the correct one for pypi.

Modernize SPEC and use the python_provide macro.

Do not remove egg-info during %install, in order for
the python provides to be generated correctly.
This commit is contained in:
Charalampos Stratakis 2016-11-23 12:03:24 +01:00
parent b295df84ed
commit e7efc935cc
4 changed files with 79 additions and 118 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
pyenchant-1.3.1.tar.gz pyenchant-1.3.1.tar.gz
/pyenchant-1.6.5.tar.gz /pyenchant-1.6.5.tar.gz
/pyenchant-1.6.6.tar.gz /pyenchant-1.6.6.tar.gz
/pyenchant-1.6.8.tar.gz

View File

@ -1,29 +0,0 @@
From ab4930e371ab168b74d8becdac0517c369931a88 Mon Sep 17 00:00:00 2001
From: six <brbsix@gmail.com>
Date: Sun, 3 May 2015 07:54:40 -0700
Subject: [PATCH] Fix TypeError at shutdown.
---
enchant/__init__.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/enchant/__init__.py b/enchant/__init__.py
index cc77eba..eb8079c 100644
--- a/enchant/__init__.py
+++ b/enchant/__init__.py
@@ -240,8 +240,11 @@ class Broker(_EnchantObject):
def __del__(self):
"""Broker object destructor."""
- if _e is not None:
+ # Calling free() might fail if python is shutting down
+ try:
self._free()
+ except (AttributeError, TypeError):
+ pass
def __getstate__(self):
state = super(Broker,self).__getstate__()
--
2.5.0

View File

@ -1,100 +1,90 @@
%global with_python3 1
# Work around a problem with libenchant versioning # Work around a problem with libenchant versioning
# (python-enchant-1.3.1 failed to work with enchant-1.4.2-2.fc10) # (python-enchant-1.3.1 failed to work with enchant-1.4.2-2.fc10)
%global enchant_dep enchant >= 1.5.0 %global enchant_dep enchant >= 1.5.0
%global srcname enchant
Name: python-enchant Name: python-enchant
Version: 1.6.6 Version: 1.6.8
Release: 8%{?dist} Release: 1%{?dist}
Summary: Python bindings for Enchant spellchecking library Summary: Python bindings for Enchant spellchecking library
Group: Development/Languages
License: LGPLv2+ License: LGPLv2+
URL: http://packages.python.org/pyenchant/ URL: http://packages.python.org/pyenchant/
Source0: http://pypi.python.org/packages/source/p/pyenchant/pyenchant-%{version}.tar.gz Source0: https://files.pythonhosted.org/packages/source/p/py%{srcname}/py%{srcname}-%{version}.tar.gz
Patch0: 0001-Fix-TypeError-at-shutdown.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
BuildRequires: enchant-devel BuildRequires: enchant-devel
# Python 2 build requirements:
BuildRequires: python2-devel
BuildRequires: python-setuptools >= 0:0.6a9
# For running tests
BuildRequires: python-nose
# Python 3 build requirements:
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools >= 0:0.6a9
# For running tests
BuildRequires: python3-nose
%endif # if with_python3
Requires: %{enchant_dep}
# Package was arch specific before
Obsoletes: python-enchant < 1.6.5
Provides: PyEnchant
%description %description
PyEnchant is a spellchecking library for Python, based on the Enchant PyEnchant is a spellchecking library for Python, based on the Enchant
library by Dom Lachowicz. library by Dom Lachowicz.
%if 0%{?with_python3} %package -n python2-%{srcname}
%package -n python3-enchant Summary: Python 2 bindings for Enchant spellchecking library
Summary: Python 3 bindings for Enchant spellchecking library
Group: Development/Languages BuildRequires: python2-devel
BuildRequires: python2-setuptools
# For running tests
BuildRequires: python2-nose
Requires: %{enchant_dep} Requires: %{enchant_dep}
%description -n python3-enchant Provides: PyEnchant
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
PyEnchant is a spellchecking library for Python 2, based on the Enchant
library by Dom Lachowicz.
%package -n python3-%{srcname}
Summary: Python 3 bindings for Enchant spellchecking library
BuildRequires: python3-devel
BuildRequires: python3-setuptools
# For running tests
BuildRequires: python3-nose
Requires: %{enchant_dep}
%{?python_provide:%python_provide python3-%{srcname}}
%description -n python3-%{srcname}
PyEnchant is a spellchecking library for Python 3, based on the Enchant PyEnchant is a spellchecking library for Python 3, based on the Enchant
library by Dom Lachowicz. library by Dom Lachowicz.
%endif # with_python3
%prep %prep
%setup -q -n pyenchant-%{version} %setup -q -n py%{srcname}-%{version}
%patch0 -p1 # Remove bundled egg-info
rm -rf py%{srcname}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir} rm -rf %{py3dir}
cp -a . %{py3dir} cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3
%build %build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build CFLAGS="$RPM_OPT_FLAGS" %py2_build
%if 0%{?with_python3}
pushd %{py3dir} pushd %{py3dir}
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build CFLAGS="$RPM_OPT_FLAGS" %py3_build
popd popd
%endif # with_python3
%install %install
rm -rf $RPM_BUILD_ROOT
%if 0%{?with_python3}
pushd %{py3dir} pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT --single-version-externally-managed %py3_install \
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/*.egg-info --single-version-externally-managed
# Directories used in windows build # Directories used in windows build
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/enchant/lib rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/%{srcname}/lib
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/enchant/share rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/%{srcname}/share
popd popd
%endif # with_python3 %py2_install \
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT --single-version-externally-managed --single-version-externally-managed
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/*.egg-info
# Directories used in windows build # Directories used in windows build
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/enchant/lib rm -rf $RPM_BUILD_ROOT/%{python2_sitelib}/%{srcname}/lib
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/enchant/share rm -rf $RPM_BUILD_ROOT/%{python2_sitelib}/%{srcname}/share
%check %check
pushd $RPM_BUILD_ROOT/%{python_sitelib} pushd $RPM_BUILD_ROOT/%{python2_sitelib}
# There is no dictionary for language C, need to use en_US # There is no dictionary for language C, need to use en_US
LANG=en_US.UTF-8 /usr/bin/nosetests-2.* LANG=en_US.UTF-8 /usr/bin/nosetests-2.*
popd popd
@ -104,41 +94,40 @@ pushd $RPM_BUILD_ROOT/%{python3_sitelib}
LANG=en_US.UTF-8 /usr/bin/nosetests-3.* LANG=en_US.UTF-8 /usr/bin/nosetests-3.*
popd popd
%clean %files -n python2-%{srcname}
rm -rf $RPM_BUILD_ROOT %doc README.txt TODO.txt
%license LICENSE.txt
%dir %{python2_sitelib}/%{srcname}
%dir %{python2_sitelib}/%{srcname}/checker
%dir %{python2_sitelib}/%{srcname}/tokenize
%{python2_sitelib}/%{srcname}/*.py
%{python2_sitelib}/%{srcname}/*.py[co]
%{python2_sitelib}/%{srcname}/*/*.py
%{python2_sitelib}/%{srcname}/*/*.py[co]
%{python2_sitelib}/py%{srcname}-%{version}-py?.?.egg-info
%files -n python3-%{srcname}
%files %doc README.txt TODO.txt
%defattr(-,root,root,-) %license LICENSE.txt
%doc LICENSE.txt README.txt TODO.txt %dir %{python3_sitelib}/%{srcname}
%dir %{python_sitelib}/enchant %dir %{python3_sitelib}/%{srcname}/__pycache__
%dir %{python_sitelib}/enchant/checker %dir %{python3_sitelib}/%{srcname}/checker
%dir %{python_sitelib}/enchant/tokenize %dir %{python3_sitelib}/%{srcname}/checker/__pycache__
%{python_sitelib}/enchant/*.py %dir %{python3_sitelib}/%{srcname}/tokenize
%{python_sitelib}/enchant/*.py[co] %dir %{python3_sitelib}/%{srcname}/tokenize/__pycache__
%{python_sitelib}/enchant/*/*.py %{python3_sitelib}/%{srcname}/*.py
%{python_sitelib}/enchant/*/*.py[co] %{python3_sitelib}/%{srcname}/__pycache__/*.py[co]
%{python3_sitelib}/%{srcname}/checker/*.py
%if 0%{?with_python3} %{python3_sitelib}/%{srcname}/checker/__pycache__/*.py[co]
%files -n python3-enchant %{python3_sitelib}/%{srcname}/tokenize/*.py
%defattr(-,root,root,-) %{python3_sitelib}/%{srcname}/tokenize/__pycache__/*.py[co]
%doc LICENSE.txt README.txt TODO.txt %{python3_sitelib}/py%{srcname}-%{version}-py?.?.egg-info
%dir %{python3_sitelib}/enchant
%dir %{python3_sitelib}/enchant/__pycache__
%dir %{python3_sitelib}/enchant/checker
%dir %{python3_sitelib}/enchant/checker/__pycache__
%dir %{python3_sitelib}/enchant/tokenize
%dir %{python3_sitelib}/enchant/tokenize/__pycache__
%{python3_sitelib}/enchant/*.py
%{python3_sitelib}/enchant/__pycache__/*.py[co]
%{python3_sitelib}/enchant/checker/*.py
%{python3_sitelib}/enchant/checker/__pycache__/*.py[co]
%{python3_sitelib}/enchant/tokenize/*.py
%{python3_sitelib}/enchant/tokenize/__pycache__/*.py[co]
%endif # with_python3
%changelog %changelog
* Tue Nov 22 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.6.8-1
- Update to 1.6.8
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.6-8 * Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.6-8
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

View File

@ -1 +1 @@
9f5acfd87d04432bf8df5f9710a17358 pyenchant-1.6.6.tar.gz b59c06be2d6c7f79f521b569ee0e441b pyenchant-1.6.8.tar.gz