ab652b
%global srcname gntp
ab652b
ab652b
Name:           python-%{srcname}
ab652b
Version:        1.0.3
d975c4
Release:        10%{?dist}
25ce4a
Summary:        Growl Notification Transport Protocol for Python
25ce4a
License:        MIT
ab652b
URL:            https://pypi.python.org/pypi/%{srcname}
ab652b
Source0:        https://github.com/kfdm/%{srcname}/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz
25ce4a
BuildArch:      noarch
ab652b
25ce4a
BuildRequires:  python2-devel
ab652b
BuildRequires:  python2-setuptools
ab652b
ab652b
BuildRequires:  python3-devel
ab652b
BuildRequires:  python3-setuptools
25ce4a
25ce4a
25ce4a
%description
25ce4a
This is a Python library for working with the Growl Notification Transport
25ce4a
Protocol.
25ce4a
25ce4a
It should work as a drop-in replacement for the older Python bindings.
25ce4a
25ce4a
ab652b
%package -n python2-%{srcname}
ab652b
Summary:  %{summary}
ab652b
%{?python_provide:%python_provide python2-%{srcname}}
ab652b
ab652b
%description -n python2-%{srcname}
ab652b
This is a Python2 library for working with the Growl Notification Transport
ab652b
Protocol.
ab652b
ab652b
It should work as a drop-in replacement for the older Python bindings.
ab652b
ab652b
ab652b
%package -n python3-%{srcname}
ab652b
Summary:  %{summary}
ab652b
%{?python_provide:%python_provide python3-%{srcname}}
ab652b
ab652b
%description -n python3-%{srcname}
ab652b
This is a Python3 library for working with the Growl Notification Transport
ab652b
Protocol.
ab652b
ab652b
It should work as a drop-in replacement for the older Python bindings.
ab652b
ab652b
25ce4a
%prep
ab652b
%setup -q -n %{srcname}-%{version}
25ce4a
25ce4a
# Remove executable bit, shabang line from library source:
ab652b
chmod -x %{srcname}/cli.py
25ce4a
sed -i '/#!\/usr\/bin\/env python/,/^$/d' gntp/cli.py
25ce4a
25ce4a
# Remove bundled egg-info
ab652b
rm -rf %{srcname}.egg-info
25ce4a
25ce4a
25ce4a
%build
ab652b
%py2_build
ab652b
%py3_build
25ce4a
25ce4a
25ce4a
%install
ab652b
%py3_install
ab652b
ab652b
# Now /usr/bin/gntp is Python 3, so we move it away
ab652b
mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_bindir}/%{srcname}-%{python3_version}
ab652b
ab652b
%py2_install
25ce4a
ab652b
# Now /usr/bin/gntp is Python 2, and we move it away anyway
ab652b
mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_bindir}/%{srcname}-%{python2_version}
25ce4a
ab652b
# The guidelines also specify we must provide symlinks with a '-X' suffix.
ab652b
ln -s ./%{srcname}-%{python2_version} %{buildroot}%{_bindir}/%{srcname}-2
ab652b
ln -s ./%{srcname}-%{python3_version} %{buildroot}%{_bindir}/%{srcname}-3
ab652b
ab652b
# Finally, we provide /usr/bin/gntp as a link to /usr/bin/gntp-2
ab652b
ln -s ./%{srcname}-2 %{buildroot}%{_bindir}/%{srcname}
ab652b
ab652b
ab652b
%files -n python2-%{srcname}
25ce4a
%doc README.rst
ab652b
%license LICENSE
ab652b
%{python2_sitelib}/%{srcname}/
ab652b
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info/
ab652b
%{_bindir}/%{srcname}
ab652b
%{_bindir}/%{srcname}-2
ab652b
%{_bindir}/%{srcname}-%{python2_version}
ab652b
ab652b
%files -n python3-%{srcname}
ab652b
%doc README.rst
ab652b
%license LICENSE
ab652b
%{python3_sitelib}/%{srcname}/
ab652b
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/
ab652b
%{_bindir}/%{srcname}-3
ab652b
%{_bindir}/%{srcname}-%{python3_version}
25ce4a
25ce4a
25ce4a
%changelog
d975c4
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.3-10
d975c4
- Rebuilt for Python 3.8
d975c4
19a3a5
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-9
19a3a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
19a3a5
8f41e8
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-8
8f41e8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
8f41e8
b7a341
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-7
b7a341
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
b7a341
f80ed1
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.3-6
f80ed1
- Rebuilt for Python 3.7
f80ed1
a2b0ee
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-5
a2b0ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
a2b0ee
e7984c
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-4
e7984c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
e7984c
1b2206
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-3
1b2206
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
1b2206
7b5d1d
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.0.3-2
7b5d1d
- Rebuild for Python 3.6
7b5d1d
ab652b
* Mon Aug 08 2016 Dominika Krejci <dkrejci@redhat.com> - 1.0.3-1
ab652b
- Update to 1.0.3
ab652b
- Add Python 3
ab652b
e64540
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-8
e64540
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
e64540
ab7c46
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-7
ab7c46
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
ab7c46
2c9dde
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-6
2c9dde
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2c9dde
f948ab
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-5
f948ab
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f948ab
fc1ccf
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-4
fc1ccf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
fc1ccf
25ce4a
* Sat Jun 15 2013 Conrad Meyer <cemeyer@uw.edu> - 1.0.1-3
25ce4a
- Remove bundled egg (as per rh #917328 review)
25ce4a
25ce4a
* Sat Jun 15 2013 Conrad Meyer <cemeyer@uw.edu> - 1.0.1-2
25ce4a
- Add dependency on python-setuptools to avoid buggy python-distutils fallback
25ce4a
25ce4a
* Mon Apr 29 2013 Conrad Meyer <cemeyer@uw.edu> - 1.0.1-1
25ce4a
- Bump to latest upstream
25ce4a
25ce4a
* Mon Apr 29 2013 Conrad Meyer <cemeyer@uw.edu> - 0.9-2
25ce4a
- New-world spec cleanups (python_sitelib is already defined, don't need to
25ce4a
  nuke buildroot during install)
25ce4a
- BR python2-devel, not python-devel
25ce4a
25ce4a
* Sat Mar 2 2013 Conrad Meyer <cemeyer@uw.edu> - 0.9-1
25ce4a
- Initial package