Blob Blame History Raw
%global srcname fontname

Name:           python-fontname
Version:        0.2.0
Release:        6%{?dist}
Summary:        A lib for guessing font name

License:        MIT
URL:            https://github.com/Asvel/fontname
Source0:        https://pypi.python.org/packages/source/f/%{srcname}/%{srcname}-%{version}.zip

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  python-freetype

%description
fontname is a lib for guessing font name, in other words, reading and decoding
quirk encoded raw font name.

It current supports SFNT format fonts, and is adept at dealing with CJK fonts.

%package -n python3-%{srcname}
Summary:        A lib for guessing font name
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-freetype
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
fontname is a lib for guessing font name, in other words, reading and decoding
quirk encoded raw font name.

It current supports SFNT format fonts, and is adept at dealing with CJK fonts.

%prep
%autosetup -n %{srcname}-%{version}

%build
%py2_build
%py3_build

%install
# Must do the python2 install first because the scripts in /usr/bin are
# overwritten with every setup.py install, and in general we want the
# python3 version to be the default.
%py2_install
%py3_install

%check
%{__python2} setup.py test
%{__python3} setup.py test

%files -n python-%{srcname}
%doc PKG-INFO README.rst
%license LICENSE.txt
%{python2_sitelib}/%{srcname}.py*
%{python2_sitelib}/%{srcname}-%{version}-py2.*.egg-info

%files -n python3-%{srcname}
%doc PKG-INFO README.rst
%license LICENSE.txt
%{python3_sitelib}/%{srcname}.py*
%{python3_sitelib}/__pycache__/%{srcname}*
%{python3_sitelib}/%{srcname}-%{version}-py3.*.egg-info

%changelog
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.2.0-6
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-5
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Parag Nemade <pnemade AT redhat DOT com> - 0.2.0-4
- Enabled python3 subpackage and rewrote spec for new python guidelines

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Oct 31 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.2.0-2
- Follow python3 subpackage guidelines
- Add python3-freetype to python3-fontname subpackage

* Mon Sep 22 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.2.0-1
- Initial packaging