c141b25
%if 0%{?fedora} > 12
3f58ab2
%global with_python3 1
3f58ab2
%else
3f58ab2
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
3f58ab2
%endif
3f58ab2
3f58ab2
Name:           python-pyphen
91ab0fa
Version:        0.9.1
5fdfbf2
Release:        8%{?dist}
3f58ab2
Group:          Development/Libraries
3f58ab2
Summary:        Pure Python module to hyphenate text
3f58ab2
License:        LGPLv2+
3f58ab2
URL:            https://pypi.python.org/pypi/Pyphen/
3f58ab2
Source0:        https://github.com/Kozea/Pyphen/archive/%{version}.tar.gz
3f58ab2
BuildArch:      noarch
3f58ab2
3f58ab2
BuildRequires:  python2-devel python-setuptools
3f58ab2
%if 0%{?with_python3}
3f58ab2
BuildRequires:  python3-devel python3-setuptools
3f58ab2
%endif # if with_python3
3f58ab2
3f58ab2
# Fedora-specific patch to use hyphenation dictionaries in /usr/share/hyphen
3f58ab2
# Desktop users will likely have hyphenation dictionaries installed
3f58ab2
# for the languages they use, as part of the Libreoffice language
3f58ab2
# packs, but if not, they can be installed separately.
91ab0fa
Patch0:         pyphen-0.9.1-shared-dicts.patch
3f58ab2
3f58ab2
%description
3f58ab2
Pyphen is a pure Python module to hyphenate text using existing
3f58ab2
hyphenation dictionaries, e.g., from Libreoffice language packs.
3f58ab2
3f58ab2
%if 0%{?with_python3}
3f58ab2
%package -n python3-pyphen
3f58ab2
Summary:        Pure Python module to hyphenate text
3f58ab2
Group:          Development/Libraries
3f58ab2
3f58ab2
%description -n python3-pyphen
3f58ab2
Pyphen is a pure Python module to hyphenate text using existing
3f58ab2
hyphenation dictionaries, e.g., from Libreoffice language packs.
3f58ab2
%endif # if with_python3
3f58ab2
3f58ab2
%prep
3f58ab2
%setup -q -n Pyphen-%{version}
3f58ab2
%patch0 -p1 -b .shared-dict
3f58ab2
rm -rf pyphen/dictionaries
3f58ab2
3f58ab2
%if 0%{?with_python3}
3f58ab2
rm -rf %{py3dir}
3f58ab2
cp -a . %{py3dir}
3f58ab2
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
3f58ab2
%endif # with_python3
3f58ab2
3f58ab2
%build
3f58ab2
%{__python} setup.py build
3f58ab2
%if 0%{?with_python3}
3f58ab2
pushd %{py3dir}
3f58ab2
%{__python3} setup.py build
3f58ab2
popd
3f58ab2
%endif # with_python3
3f58ab2
3f58ab2
# I'd like to have a test section, but the provided tests would require
3f58ab2
# hyphenation dictionaries for many languages to be installed.
3f58ab2
3f58ab2
%install
91ab0fa
rm -rf dictionaries
3f58ab2
%{__python} setup.py install --skip-build --prefix=%{_prefix} --root %{buildroot}
3f58ab2
%if 0%{?with_python3}
3f58ab2
pushd %{py3dir}
3f58ab2
%{__python3} setup.py install --skip-build --prefix=%{_prefix} --root %{buildroot}
3f58ab2
popd
3f58ab2
%endif # with_python3
3f58ab2
3f58ab2
%files
3f58ab2
%doc COPYING README
3f58ab2
%{python_sitelib}/*
3f58ab2
3f58ab2
%if 0%{?with_python3}
3f58ab2
%files -n python3-pyphen
3f58ab2
%doc COPYING README
3f58ab2
%{python3_sitelib}/*
3f58ab2
%endif # with_python3
3f58ab2
3f58ab2
%changelog
5fdfbf2
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-8
5fdfbf2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
5fdfbf2
f0b64e7
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.9.1-7
f0b64e7
- Rebuild for Python 3.6
f0b64e7
2eb4725
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-6
2eb4725
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
2eb4725
fb0c829
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-5
fb0c829
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
fb0c829
3be1681
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-4
3be1681
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
3be1681
b9785fc
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-3
b9785fc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
b9785fc
c141b25
* Tue Aug 26 2014 Eric Smith <brouhaha@fedoraproject.org> 0.9.1-2
c141b25
- No Python 3 in EL7.
c141b25
91ab0fa
* Thu Aug 07 2014 Alon Levy <alon@pobox.com> - 0.9.1-1
91ab0fa
- Update to latest release, fixes bz 1127837 (for weasyprint 1127836)
91ab0fa
c4a9a2b
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-5
c4a9a2b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
c4a9a2b
29bfce8
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 0.7-4
29bfce8
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
29bfce8
3f58ab2
* Tue Jul 23 2013 Eric Smith <brouhaha@fedoraproject.org> 0.7-3
3f58ab2
- Added Python 3 support.
3f58ab2
3f58ab2
* Mon Jul 22 2013 Eric Smith <brouhaha@fedoraproject.org> 0.7-2
3f58ab2
- Removed requirement for hyphen-en.
3f58ab2
- Changed files section based on review request.
3f58ab2
3f58ab2
* Sun Jul 21 2013 Eric Smith <brouhaha@fedoraproject.org> 0.7-1
3f58ab2
- initial version