%global pypi_name django-countries %global obs_ver 1.0.5-6 Name: python-%{pypi_name} Version: 1.2 Release: 2%{?dist} Summary: Provides a country field for Django models Group: Development/Languages License: MIT URL: http://pypi.python.org/pypi/django-countries Source0: http://pypi.python.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz # Steps to generate the test project: https://bitbucket.org/smileychris/django-countries/issue/18/#comment-1807293 Source1: %{pypi_name}-%{version}-test_proj.tgz BuildArch: noarch BuildRequires: python-setuptools BuildRequires: python-devel BuildRequires: python-django Requires: python-django Provides: django-countries = %{version-release} Obsoletes: django-countries < %{obs_ver} %description Django application which provides country choices for use with forms, and a country field for models. %prep %setup -q -n %{pypi_name}-%{version} # drop empty file rm -rf django_countries/models.py %build %{__python} setup.py build %install %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT chmod +x $RPM_BUILD_ROOT%{python_sitelib}/django_countries/bin/titlecase.py %find_lang django #delete the unnecessary *.po files pushd $RPM_BUILD_ROOT find -type f -name '*.po' -exec rm {} \; popd %check tar xzf %{SOURCE1} pushd test_proj # django apps are not testable without models.py file # this is created in setup.py install, but not present in upstream source, so create it here for tests touch ../django_countries/models.py PYTHONPATH=.. %{__python} manage.py test django_countries popd %files -f django.lang %doc LICENSE README %exclude %{python_sitelib}/django_countries/tests %dir %{python_sitelib}/django_countries/ %{python_sitelib}/django_countries/*.py* %{python_sitelib}/django_countries/bin # own all the locale directories %dir %{python_sitelib}/django_countries/locale/ %dir %{python_sitelib}/django_countries/locale/*/ %dir %{python_sitelib}/django_countries/locale/*/*/ %{python_sitelib}/django_countries/static %{python_sitelib}/*.egg-info %changelog * Tue Aug 14 2012 Bohuslav Kabrda - 1.2-2 - Add proper Provides and Obsoletes tags. * Mon Aug 13 2012 Bohuslav Kabrda - 1.2-1 - Renamed to python-django-countries. - Updated to latest upstream. - Introduced %%check section. - Handle locale files. * Wed Jul 18 2012 Fedora Release Engineering - 1.0.5-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Fri Jan 13 2012 Fedora Release Engineering - 1.0.5-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Tue Jul 12 2011 Rahul Sundaram - 1.0.5-3 - Use macros more. Drop defattr * Sun May 08 2011 Rahul Sundaram - 1.0.5-2 - Remove empty file * Thu Apr 14 2011 Rahul Sundaram - 1.0.5-1 - initial spec