diff --git a/.gitignore b/.gitignore index f282ddd..601b853 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /django-robots-0.8.1.tar.gz +/django-robots-2.0.tar.gz diff --git a/python-django-robots.spec b/python-django-robots.spec index b1466e9..72298a3 100644 --- a/python-django-robots.spec +++ b/python-django-robots.spec @@ -1,52 +1,112 @@ -%global pkgname django-robots +%global pypi_name django-robots %global obs_ver 0.8.0-3 -Name: python-django-robots -Version: 0.8.1 -Release: 9%{?dist} + +Name: python-%{pypi_name} +Version: 2.0 +Release: 1%{?dist} Summary: Robots exclusion application for Django, complementing Sitemaps Group: Development/Languages License: BSD -URL: http://pypi.python.org/pypi/%{pkgname} -Source0: http://pypi.python.org/packages/source/d/%{pkgname}/%{pkgname}-%{version}.tar.gz +URL: http://pypi.python.org/pypi/%{pypi_name} +Source0: https://files.pythonhosted.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch -BuildRequires: python2-devel -BuildRequires: python-setuptools -BuildRequires: gettext -Requires: python-django -Provides: %{pkgname} = %{version}-%{release} -Obsoletes: %{pkgname} < %{obs_ver} +BuildRequires: gettext %description Django application to manage robots.txt files following the robots exclusion protocol, complementing the Django Sitemap contrib app. +%package -n python2-%{pypi_name} +Summary: Robots exclusion application for Django - Python 2 version + +BuildRequires: python2-devel +BuildRequires: python2-setuptools +BuildRequires: gettext +Requires: python2-django + +Provides: %{pypi_name} = %{version}-%{release} +Obsoletes: %{pypi_name} < %{obs_ver} + +%{?python_provide:%python_provide python2-%{pypi_name}} + +%description -n python2-%{pypi_name} +Django application to manage robots.txt files following the robots exclusion +protocol, complementing the Django Sitemap contrib app. +This package provides Python 2 build of %{pypi_name}. + +%package -n python3-%{pypi_name} +Summary: Robots exclusion application for Django - Python 3 version + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +Requires: python3-django + +%{?python_provide:%python_provide python3-%{pypi_name}} + +%description -n python3-%{pypi_name} +Django application to manage robots.txt files following the robots exclusion +protocol, complementing the Django Sitemap contrib app. +This package provides Python 3 build of %{pypi_name}. + %prep -%setup -q -n %{pkgname}-%{version} -# remove bundled egg-info -rm -rf django_robots.egg-info +%autosetup -n %{pypi_name}-%{version} + %build -%{__python} setup.py build +%py2_build +%py3_build %install -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%py2_install +%py3_install +rm -rf %{buildroot}%{python2_sitelib}/tests +rm -rf %{buildroot}%{python3_sitelib}/tests + # Language files; not under /usr/share, need to be handled manually -(cd $RPM_BUILD_ROOT && find . -name 'django.?o') | sed -e 's|^.||' | sed -e \ +(cd %{buildroot} && find .%{python2_sitelib} -name 'django.?o') | sed -e 's|^.||' | sed -e \ + 's:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' \ + >> python2-%{pypi_name}.lang +(cd %{buildroot} && find .%{python3_sitelib} -name 'django.?o') | sed -e 's|^.||' | sed -e \ 's:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' \ - >> %{name}.lang + >> python3-%{pypi_name}.lang -%files -f %{name}.lang -%doc LICENSE.txt README.rst docs/ +%files -f python2-%{pypi_name}.lang -n python2-%{pypi_name} +%doc README.rst docs/ +%license LICENSE.txt +# list some files explicitly to avoid listing locale files twice +%dir %{python2_sitelib}/robots +%{python2_sitelib}/robots/*.py* +%{python2_sitelib}/robots/migrations +%{python2_sitelib}/robots/south_migrations +%dir %{python2_sitelib}/robots/templates/ +%dir %{python2_sitelib}/robots/templates/robots +%{python2_sitelib}/robots/templates/robots/rule_list.html +%{python2_sitelib}/django_robots*.egg-info + +%files -f python3-%{pypi_name}.lang -n python3-%{pypi_name} +%doc README.rst docs/ +%license LICENSE.txt # list some files explicitly to avoid listing locale files twice -%{python_sitelib}/robots -%{python_sitelib}/robots/templates/robots/rule_list.html -%{python_sitelib}/django_robots*.egg-info +%dir %{python3_sitelib}/robots +%{python3_sitelib}/robots/*.py + +%{python3_sitelib}/robots/__pycache__ +%{python3_sitelib}/robots/migrations +%{python3_sitelib}/robots/south_migrations +%dir %{python3_sitelib}/robots/templates/ +%dir %{python3_sitelib}/robots/templates/robots +%{python3_sitelib}/robots/templates/robots/rule_list.html +%{python3_sitelib}/django_robots*.egg-info %changelog +* Thu Jul 21 2016 Matthias Runge - 2.0-1 +- porting the specfile to Python 3, thanks to Jan Beran +- major spec file cleanup + * Tue Jul 19 2016 Fedora Release Engineering - 0.8.1-9 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages diff --git a/sources b/sources index 7bec668..0184271 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -fce5ea55c3803a0648b21080ab432e32 django-robots-0.8.1.tar.gz +18cdb2bddac8b69e6b99bacc5d1b89d3 django-robots-2.0.tar.gz