Blob Blame Raw
%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:        2%{?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
* 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