%global pypi_name port-for
%global name_with_underscore port_for
%global sum Utility that helps with local TCP ports management
Name: python-%{pypi_name}
Version: 0.3.1
Release: 4%{?dist}
Summary: %{sum}
License: MIT
URL: https://pypi.python.org/pypi/%{pypi_name}
Source0: https://pypi.python.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel python3-devel
%description
It can find an unused TCP local host port and remember the association.
%package -n python2-%{pypi_name}
Summary: %{sum}
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name}
It can find an unused TCP local host port and remember the association.
%package -n python3-%{pypi_name}
Summary: %{sum}
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name}
It can find an unused TCP local host port and remember the association.
%prep
%autosetup -n %{pypi_name}-%{version}
%build
%py2_build
%py3_build
%install
%py3_install
mv %{buildroot}%{_bindir}/%{pypi_name} %{buildroot}%{_bindir}/%{pypi_name}-3
%py2_install
%files -n python-%{pypi_name}
%doc README.rst
%license LICENSE.txt
%{python2_sitelib}/%{name_with_underscore}
%{python2_sitelib}/%{name_with_underscore}-%{version}-py?.?.egg-info
%{_bindir}/%{pypi_name}
%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE.txt
%{python3_sitelib}/%{name_with_underscore}
%{python3_sitelib}/%{name_with_underscore}-%{version}-py?.?.egg-info
%{_bindir}/%{pypi_name}-3
%changelog
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jan 27 2016 Sundeep Anand <suanand@redhat.com> - 0.3.1-2
- Fix binary shebang in python3 package
* Fri Jan 22 2016 Sundeep Anand <suanand@redhat.com> - 0.3.1-1
- Initial RPM Package