1
0
forked from pool/python-Django

Accepting request 493461 from devel:languages:python

1

OBS-URL: https://build.opensuse.org/request/show/493461
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Django?expand=0&rev=30
This commit is contained in:
Dominique Leuenberger 2017-05-09 15:59:50 +00:00 committed by Git OBS Bridge
parent b117e80f51
commit 3a62b6a6bc
2 changed files with 57 additions and 48 deletions

View File

@ -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 Tue Apr 4 14:38:13 UTC 2017 - appleonkel@opensuse.org

View File

@ -16,6 +16,8 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
Name: python-Django Name: python-Django
Version: 1.10.7 Version: 1.10.7
Release: 0 Release: 0
@ -28,23 +30,29 @@ Source1: https://www.djangoproject.com/m/pgp/Django-%{version}.checksum.t
Source2: %{name}.keyring Source2: %{name}.keyring
Source99: python-Django-rpmlintrc Source99: python-Django-rpmlintrc
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-devel BuildRequires: python-rpm-macros
BuildRequires: python-setuptools BuildRequires: %{python_module devel}
Requires: python-imaging BuildRequires: %{python_module setuptools}
Requires: python-Pillow
Requires: python-setuptools Requires: python-setuptools
Requires: python-xml Requires: python-xml
Requires(post): update-alternatives %ifpython2
Requires(postun): update-alternatives Obsoletes: %{oldpython}-django < %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build Provides: %{oldpython}-django = %{version}
Provides: python-django = %{version} Obsoletes: %{oldpython}-South < %{version}
Obsoletes: python-django < %{version} Provides: %{oldpython}-South = %{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
%endif %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 %description
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. 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 echo "`grep -e '^[0-9a-f]\{64\} Django-%{version}.tar.gz' %{SOURCE1} | cut -c1-64` %{SOURCE0}" | sha256sum -c
%setup -q -n Django-%{version} %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 %build
python setup.py build %python_build
%install %install
python setup.py install --prefix=%{_prefix} --root=%{buildroot} %python_install
install -D -m 0644 extras/django_bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/django_bash_completion-%{py_ver}.sh %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 %python_clone -a %{buildroot}%{_bindir}/django-admin.py
touch %{buildroot}%{_sysconfdir}/alternatives/django-admin.py %python_clone -a %{buildroot}%{_bindir}/django-admin
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
%fdupes %{buildroot}%{python_sitelib} %{python_expand %fdupes %{buildroot}%{$python_sitelib}
# Deduplicating files can generate a RPMLINT warning for pyc mtime # Deduplicating files can generate a RPMLINT warning for pyc mtime
cd %{buildroot}%{python_sitelib} pushd %{buildroot}%{$python_sitelib}
python -m compileall -d %{python_sitelib} django/conf/locale/ $python -m compileall -d %{$python_sitelib} django/conf/locale/
$python -m compileall -d %{$python_sitelib} django/conf/locale/ru/
popd
}
%post %post
update-alternatives \ %{python_install_alternative django-admin.py django-admin}
--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
%preun %preun
if [ $1 -eq 0 ] ; then %python_uninstall_alternative django-admin
update-alternatives --remove django-admin.py %{_bindir}/django-admin.py-%{py_ver}
fi
%files %files %{python_files}
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc AUTHORS LICENSE README.rst %doc AUTHORS LICENSE README.rst
%{_bindir}/django-admin %python_alternative %{_bindir}/django-admin
%{_bindir}/django-admin-%{py_ver} %python_alternative %{_bindir}/django-admin.py
%{_bindir}/django-admin.py %{_sysconfdir}/bash_completion.d/django_bash_completion-%{python_bin_suffix}.sh
%{_bindir}/django-admin.py-%{py_ver}
%ghost %{_sysconfdir}/alternatives/django-admin
%ghost %{_sysconfdir}/alternatives/django-admin.py
%{python_sitelib}/django %{python_sitelib}/django
%{python_sitelib}/Django-%{version}-py%{py_ver}.egg-info %{python_sitelib}/Django-%{version}-py*.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
%changelog %changelog