diff --git a/python-Django.changes b/python-Django.changes index e8f5a80..8640ebd 100644 --- a/python-Django.changes +++ b/python-Django.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Mon May 8 14:32:03 UTC 2017 - toddrme2178@gmail.com + +- django-admin.py should be the master, not django-admin. + +------------------------------------------------------------------- +Sat May 6 03:31:54 UTC 2017 - toddrme2178@gmail.com + +- Don't provide python2-django or python2-South, singlespec + packages should use correct name. + +------------------------------------------------------------------- +Thu May 4 15:33:21 UTC 2017 - toddrme2178@gmail.com + +- Implement single-spec version. + ------------------------------------------------------------------- Tue Apr 4 14:38:13 UTC 2017 - appleonkel@opensuse.org diff --git a/python-Django.spec b/python-Django.spec index ffaccbb..dea59c6 100644 --- a/python-Django.spec +++ b/python-Django.spec @@ -16,6 +16,8 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define oldpython python Name: python-Django Version: 1.10.7 Release: 0 @@ -28,23 +30,29 @@ Source1: https://www.djangoproject.com/m/pgp/Django-%{version}.checksum.t Source2: %{name}.keyring Source99: python-Django-rpmlintrc BuildRequires: fdupes -BuildRequires: python-devel -BuildRequires: python-setuptools -Requires: python-imaging +BuildRequires: python-rpm-macros +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +Requires: python-Pillow Requires: python-setuptools Requires: python-xml -Requires(post): update-alternatives -Requires(postun): update-alternatives -BuildRoot: %{_tmppath}/%{name}-%{version}-build -Provides: python-django = %{version} -Obsoletes: python-django < %{version} -Provides: python-South = %{version} -Obsoletes: python-South < %{version} -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else -BuildArch: noarch +%ifpython2 +Obsoletes: %{oldpython}-django < %{version} +Provides: %{oldpython}-django = %{version} +Obsoletes: %{oldpython}-South < %{version} +Provides: %{oldpython}-South = %{version} %endif +%ifpython3 +Provides: python3-django = %{version} +Obsoletes: python3-django < %{version} +Provides: python3-South = %{version} +Obsoletes: python3-South < %{version} +%endif +Requires(post): update-alternatives +Requires(preun): update-alternatives +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch +%python_subpackages %description Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. @@ -57,55 +65,40 @@ echo "`grep -e '^[0-9a-f]\{40\} Django-%{version}.tar.gz' %{SOURCE1} | cut -c1- echo "`grep -e '^[0-9a-f]\{64\} Django-%{version}.tar.gz' %{SOURCE1} | cut -c1-64` %{SOURCE0}" | sha256sum -c %setup -q -n Django-%{version} -sed -i "s|\(django/bin/django-admin.py\)|\1-%{py_ver}|" setup.py -mv django/bin/django-admin.py{,-%{py_ver}} %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} -install -D -m 0644 extras/django_bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/django_bash_completion-%{py_ver}.sh +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} -mv %{buildroot}/%{_bindir}/django-admin{,-%{py_ver}} +%python_expand install -D -m 0644 extras/django_bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/django_bash_completion-%{$python_bin_suffix}.sh -mkdir -p %{buildroot}%{_sysconfdir}/alternatives -touch %{buildroot}%{_sysconfdir}/alternatives/django-admin.py -ln -sf %{_sysconfdir}/alternatives/django-admin.py %{buildroot}/%{_bindir}/django-admin.py -touch %{buildroot}%{_sysconfdir}/alternatives/django-admin -ln -sf %{_sysconfdir}/alternatives/django-admin %{buildroot}/%{_bindir}/django-admin -touch %{buildroot}%{_sysconfdir}/alternatives/django_bash_completion.sh -ln -sf %{_sysconfdir}/alternatives/django_bash_completion.sh %{buildroot}%{_sysconfdir}/bash_completion.d/django_bash_completion.sh +%python_clone -a %{buildroot}%{_bindir}/django-admin.py +%python_clone -a %{buildroot}%{_bindir}/django-admin -%fdupes %{buildroot}%{python_sitelib} +%{python_expand %fdupes %{buildroot}%{$python_sitelib} # Deduplicating files can generate a RPMLINT warning for pyc mtime -cd %{buildroot}%{python_sitelib} -python -m compileall -d %{python_sitelib} django/conf/locale/ +pushd %{buildroot}%{$python_sitelib} +$python -m compileall -d %{$python_sitelib} django/conf/locale/ +$python -m compileall -d %{$python_sitelib} django/conf/locale/ru/ +popd +} %post -update-alternatives \ - --install %{_bindir}/django-admin.py django-admin.py %{_bindir}/django-admin.py-%{py_ver} 20 \ - --slave %{_bindir}/django-admin django-admin %{_bindir}/django-admin-%{py_ver} \ - --slave %{_sysconfdir}/bash_completion.d/django_bash_completion.sh django_bash_completion.sh %{_sysconfdir}/bash_completion.d/django_bash_completion-%{py_ver}.sh +%{python_install_alternative django-admin.py django-admin} %preun -if [ $1 -eq 0 ] ; then - update-alternatives --remove django-admin.py %{_bindir}/django-admin.py-%{py_ver} -fi +%python_uninstall_alternative django-admin -%files +%files %{python_files} %defattr(-,root,root,-) %doc AUTHORS LICENSE README.rst -%{_bindir}/django-admin -%{_bindir}/django-admin-%{py_ver} -%{_bindir}/django-admin.py -%{_bindir}/django-admin.py-%{py_ver} -%ghost %{_sysconfdir}/alternatives/django-admin -%ghost %{_sysconfdir}/alternatives/django-admin.py +%python_alternative %{_bindir}/django-admin +%python_alternative %{_bindir}/django-admin.py +%{_sysconfdir}/bash_completion.d/django_bash_completion-%{python_bin_suffix}.sh %{python_sitelib}/django -%{python_sitelib}/Django-%{version}-py%{py_ver}.egg-info -%{_sysconfdir}/bash_completion.d/django_bash_completion.sh -%{_sysconfdir}/bash_completion.d/django_bash_completion-%{py_ver}.sh -%ghost %{_sysconfdir}/alternatives/django_bash_completion.sh +%{python_sitelib}/Django-%{version}-py*.egg-info %changelog