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