diff --git a/.gitignore b/.gitignore index 907fdb3..a34d766 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /gntp-1.0.1.tar.gz +/gntp-1.0.3.tar.gz diff --git a/python-gntp.spec b/python-gntp.spec index f537596..e4c34ab 100644 --- a/python-gntp.spec +++ b/python-gntp.spec @@ -1,13 +1,19 @@ -Name: python-gntp -Version: 1.0.1 -Release: 8%{?dist} +%global srcname gntp + +Name: python-%{srcname} +Version: 1.0.3 +Release: 1%{?dist} Summary: Growl Notification Transport Protocol for Python License: MIT -URL: https://pypi.python.org/pypi/gntp -Source0: https://pypi.python.org/packages/source/g/gntp/gntp-%{version}.tar.gz +URL: https://pypi.python.org/pypi/%{srcname} +Source0: https://github.com/kfdm/%{srcname}/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz BuildArch: noarch + BuildRequires: python2-devel -BuildRequires: python-setuptools +BuildRequires: python2-setuptools + +BuildRequires: python3-devel +BuildRequires: python3-setuptools %description @@ -17,32 +23,86 @@ Protocol. It should work as a drop-in replacement for the older Python bindings. +%package -n python2-%{srcname} +Summary: %{summary} +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-%{srcname} +This is a Python2 library for working with the Growl Notification Transport +Protocol. + +It should work as a drop-in replacement for the older Python bindings. + + +%package -n python3-%{srcname} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} +This is a Python3 library for working with the Growl Notification Transport +Protocol. + +It should work as a drop-in replacement for the older Python bindings. + + %prep -%setup -q -n gntp-%{version} +%setup -q -n %{srcname}-%{version} # Remove executable bit, shabang line from library source: -chmod -x gntp/cli.py +chmod -x %{srcname}/cli.py sed -i '/#!\/usr\/bin\/env python/,/^$/d' gntp/cli.py # Remove bundled egg-info -rm -rf gntp.egg-info +rm -rf %{srcname}.egg-info %build -python setup.py build +%py2_build +%py3_build %install -python setup.py install -O1 --skip-build --root %{buildroot} +%py3_install + +# Now /usr/bin/gntp is Python 3, so we move it away +mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_bindir}/%{srcname}-%{python3_version} + +%py2_install +# Now /usr/bin/gntp is Python 2, and we move it away anyway +mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_bindir}/%{srcname}-%{python2_version} -%files +# The guidelines also specify we must provide symlinks with a '-X' suffix. +ln -s ./%{srcname}-%{python2_version} %{buildroot}%{_bindir}/%{srcname}-2 +ln -s ./%{srcname}-%{python3_version} %{buildroot}%{_bindir}/%{srcname}-3 + +# Finally, we provide /usr/bin/gntp as a link to /usr/bin/gntp-2 +ln -s ./%{srcname}-2 %{buildroot}%{_bindir}/%{srcname} + + +%files -n python2-%{srcname} %doc README.rst -%{python_sitelib}/gntp* -%{_bindir}/gntp +%license LICENSE +%{python2_sitelib}/%{srcname}/ +%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info/ +%{_bindir}/%{srcname} +%{_bindir}/%{srcname}-2 +%{_bindir}/%{srcname}-%{python2_version} + +%files -n python3-%{srcname} +%doc README.rst +%license LICENSE +%{python3_sitelib}/%{srcname}/ +%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/ +%{_bindir}/%{srcname}-3 +%{_bindir}/%{srcname}-%{python3_version} %changelog +* Mon Aug 08 2016 Dominika Krejci - 1.0.3-1 +- Update to 1.0.3 +- Add Python 3 + * Tue Jul 19 2016 Fedora Release Engineering - 1.0.1-8 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages diff --git a/sources b/sources index f44e400..c50ab42 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1876dbf458f5619e41c7cea1e437e6d6 gntp-1.0.1.tar.gz +f18bcff3cddcba9f38f00941d6a29e94 gntp-1.0.3.tar.gz