Blob Blame History Raw
%global pypi_name ModulemdTranslationHelpers

Name:           python-%{pypi_name}
Version:        0.5
Release:        1%{?dist}
Summary:        Tools for working with translations of modulemd

License:        MIT
URL:            https://github.com/fedora-modularity/ModulemdTranslationHelpers
Source0:        https://files.pythonhosted.org/packages/source/M/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python2-devel
BuildRequires:  python2dist(setuptools)

BuildRequires:  python3-devel
BuildRequires:  python3dist(setuptools)

# The following are needed for generating the manpages which are only produced
# for the python3 package.
BuildRequires:  python3dist(babel)
BuildRequires:  python3dist(click)
BuildRequires:  python3dist(click-man)
BuildRequires:  python3dist(pygobject)
BuildRequires:  python3dist(requests)

BuildRequires:  koji
BuildRequires:  libmodulemd

%{?python_enable_dependency_generator}

%description
Provides a library and tools for dealing with translatable strings in modulemd
documents.


%package -n     python2-%{pypi_name}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{pypi_name}}
 

Requires:       koji
Requires:       libmodulemd
Requires:       python2dist(pygobject)

Obsoletes:      python2-mmdzanata < 0.7-3

%description -n python2-%{pypi_name}
Provides a library and tools for dealing with translatable strings in modulemd
documents.


%package -n     python3-%{pypi_name}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
 

Requires:       koji
Requires:       libmodulemd
Requires:       python3dist(pygobject)

Obsoletes:      python3-mmdzanata < 0.7-3

%description -n python3-%{pypi_name}
Provides a library and tools for dealing with translatable strings in modulemd
documents.


%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

%build
# Must do the default python version install last because
# the scripts in /usr/bin are overwritten with every setup.py install.
%py2_install
rm -rf %{buildroot}%{_bindir}/*

%py3_build

%install
%py2_install

%py3_install
%{__python3} setup.py --command-packages=click_man.commands man_pages --target=%{buildroot}/%{_mandir}/man1

%files -n python2-%{pypi_name}
%doc README.md
%license LICENSE
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%files -n python3-%{pypi_name}
%doc README.md
%doc %{_mandir}/man1/*
%license LICENSE
%{_bindir}/ModulemdTranslationHelpers
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%changelog
* Tue Sep 25 2018 Stephen Gallagher <sgallagh@redhat.com> - 0.5-1
- Fixes from code review

* Fri Sep 25 2018 Stephen Gallagher <sgallagh@redhat.com> - 0.3-1
- Initial package