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.6.5.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
# (python-enchant-1.3.1 failed to work with enchant-1.4.2-2.fc10)
%global enchant_dep enchant >= 1.5.0
%global srcname enchant
Name: python-enchant
Version: 1.6.6
Release: 8%{?dist}
Version: 1.6.8
Release: 1%{?dist}
Summary: Python bindings for Enchant spellchecking library
Group: Development/Languages
License: LGPLv2+
URL: http://packages.python.org/pyenchant/
Source0: http://pypi.python.org/packages/source/p/pyenchant/pyenchant-%{version}.tar.gz
Patch0: 0001-Fix-TypeError-at-shutdown.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0: https://files.pythonhosted.org/packages/source/p/py%{srcname}/py%{srcname}-%{version}.tar.gz
BuildArch: noarch
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
PyEnchant is a spellchecking library for Python, based on the Enchant
library by Dom Lachowicz.
%if 0%{?with_python3}
%package -n python3-enchant
Summary: Python 3 bindings for Enchant spellchecking library
Group: Development/Languages
%package -n python2-%{srcname}
Summary: Python 2 bindings for Enchant spellchecking library
BuildRequires: python2-devel
BuildRequires: python2-setuptools
# For running tests
BuildRequires: python2-nose
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
library by Dom Lachowicz.
%endif # with_python3
%prep
%setup -q -n pyenchant-%{version}
%patch0 -p1
%setup -q -n py%{srcname}-%{version}
# Remove bundled egg-info
rm -rf py%{srcname}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
CFLAGS="$RPM_OPT_FLAGS" %py2_build
%if 0%{?with_python3}
pushd %{py3dir}
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
CFLAGS="$RPM_OPT_FLAGS" %py3_build
popd
%endif # with_python3
%install
rm -rf $RPM_BUILD_ROOT
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT --single-version-externally-managed
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/*.egg-info
%py3_install \
--single-version-externally-managed
# Directories used in windows build
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/enchant/lib
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/enchant/share
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/%{srcname}/lib
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/%{srcname}/share
popd
%endif # with_python3
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT --single-version-externally-managed
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/*.egg-info
%py2_install \
--single-version-externally-managed
# Directories used in windows build
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/enchant/lib
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/enchant/share
rm -rf $RPM_BUILD_ROOT/%{python2_sitelib}/%{srcname}/lib
rm -rf $RPM_BUILD_ROOT/%{python2_sitelib}/%{srcname}/share
%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
LANG=en_US.UTF-8 /usr/bin/nosetests-2.*
popd
@ -104,41 +94,40 @@ pushd $RPM_BUILD_ROOT/%{python3_sitelib}
LANG=en_US.UTF-8 /usr/bin/nosetests-3.*
popd
%clean
rm -rf $RPM_BUILD_ROOT
%files -n python2-%{srcname}
%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
%defattr(-,root,root,-)
%doc LICENSE.txt README.txt TODO.txt
%dir %{python_sitelib}/enchant
%dir %{python_sitelib}/enchant/checker
%dir %{python_sitelib}/enchant/tokenize
%{python_sitelib}/enchant/*.py
%{python_sitelib}/enchant/*.py[co]
%{python_sitelib}/enchant/*/*.py
%{python_sitelib}/enchant/*/*.py[co]
%if 0%{?with_python3}
%files -n python3-enchant
%defattr(-,root,root,-)
%doc LICENSE.txt README.txt TODO.txt
%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
%files -n python3-%{srcname}
%doc README.txt TODO.txt
%license LICENSE.txt
%dir %{python3_sitelib}/%{srcname}
%dir %{python3_sitelib}/%{srcname}/__pycache__
%dir %{python3_sitelib}/%{srcname}/checker
%dir %{python3_sitelib}/%{srcname}/checker/__pycache__
%dir %{python3_sitelib}/%{srcname}/tokenize
%dir %{python3_sitelib}/%{srcname}/tokenize/__pycache__
%{python3_sitelib}/%{srcname}/*.py
%{python3_sitelib}/%{srcname}/__pycache__/*.py[co]
%{python3_sitelib}/%{srcname}/checker/*.py
%{python3_sitelib}/%{srcname}/checker/__pycache__/*.py[co]
%{python3_sitelib}/%{srcname}/tokenize/*.py
%{python3_sitelib}/%{srcname}/tokenize/__pycache__/*.py[co]
%{python3_sitelib}/py%{srcname}-%{version}-py?.?.egg-info
%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
- 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