61c9020
%if 0%{?fedora}
61c9020
# It looks like pyLibravatar doesn't currently support python3,
61c9020
# but when upstream does, we should be able to flip this bit to
61c9020
# turn on packaging of python3-pylibravatar.
61c9020
%global with_python3 0
61c9020
%endif
61c9020
61c9020
%global eggname pyLibravatar
61c9020
%global modname libravatar
61c9020
61c9020
Name:               python-pylibravatar
61c9020
Version:            1.5
61c9020
Release:            2%{?dist}
61c9020
Summary:            Python module for Libravatar
61c9020
61c9020
Group:              Development/Libraries
61c9020
# The full text of the license isn't shipped
61c9020
# https://bugs.launchpad.net/pylibravatar/+bug/1173603
61c9020
License:            MIT
61c9020
URL:                http://pypi.python.org/pypi/pyLibravatar
61c9020
Source0:            http://pypi.python.org/packages/source/p/%{eggname}/%{eggname}-%{version}.tar.gz
61c9020
61c9020
BuildArch:          noarch
61c9020
61c9020
61c9020
BuildRequires:      python2-devel
61c9020
BuildRequires:      python-pydns
61c9020
61c9020
%if 0%{?with_python3}
61c9020
BuildRequires:      python3-devel
61c9020
BuildRequires:      python3-pydns
61c9020
%endif
61c9020
61c9020
Requires:           python-pydns
61c9020
61c9020
%description
61c9020
PyLibravatar is an easy way to make use of the federated Libravatar
61c9020
avatar hosting service from within your Python applications.
61c9020
61c9020
%if 0%{?with_python3}
61c9020
%package -n python3-pylibravatar
61c9020
Summary:            Python module for Libravatar
61c9020
Group:              Development/Libraries
61c9020
61c9020
Requires:           python3-pydns
61c9020
61c9020
%description -n python3-pylibravatar
61c9020
PyLibravatar is an easy way to make use of the federated Libravatar
61c9020
avatar hosting service from within your Python applications.
61c9020
%endif
61c9020
61c9020
%prep
61c9020
%setup -q -n %{eggname}-%{version}
61c9020
61c9020
# Correct wrong-file-end-of-line-encoding rpmlint issue
61c9020
sed -i 's/\r//' README.txt
61c9020
sed -i 's/\r//' Changelog.txt
61c9020
61c9020
# Remove bundled egg-info in case it exists
61c9020
rm -rf %{eggname}.egg-info
61c9020
%if 0%{?with_python3}
61c9020
rm -rf %{py3dir}
61c9020
cp -a . %{py3dir}
61c9020
%endif
61c9020
61c9020
%build
61c9020
%{__python} setup.py build
61c9020
%if 0%{?with_python3}
61c9020
pushd %{py3dir}
61c9020
%{__python3} setup.py build
61c9020
popd
61c9020
%endif
61c9020
61c9020
%install
61c9020
%if 0%{?with_python3}
61c9020
pushd %{py3dir}
61c9020
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
61c9020
popd
61c9020
%endif
61c9020
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}
61c9020
61c9020
%files
61c9020
# Upstream doesn't ship the license full text
61c9020
# https://bugs.launchpad.net/pylibravatar/+bug/1173603
61c9020
%doc README.txt Changelog.txt
61c9020
%{python_sitelib}/%{modname}.py*
61c9020
%{python_sitelib}/%{eggname}-%{version}*
61c9020
61c9020
%if 0%{?with_python3}
61c9020
%files -n python3-pylibravatar
61c9020
# Upstream doesn't ship the license full text
61c9020
# https://bugs.launchpad.net/pylibravatar/+bug/1173603
61c9020
%doc README.rst LICENSE
61c9020
%{python3_sitelib}/%{modname}.py
61c9020
%{python3_sitelib}/__pycache__/*%{modname}*
61c9020
%{python3_sitelib}/%{eggname}-%{version}-*
61c9020
%endif
61c9020
61c9020
%changelog
61c9020
* Mon Jul 01 2013 Ralph Bean <rbean@redhat.com> - 1.5-2
61c9020
- Correct wrong-file-end-of-line-encoding rpmlint issue.
61c9020
61c9020
* Sat Apr 27 2013 Ralph Bean <rbean@redhat.com> - 1.5-1
61c9020
- Initial packaging for Fedora.
61c9020
- There is no test suite at this point.
61c9020
- Upstream doesn't seem to ship the license full text at this point.