diff --git a/Django-4.1.7.tar.gz b/Django-4.1.7.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..aa48080fa2353f33627f929c08a78f77949859b3 Binary files /dev/null and b/Django-4.1.7.tar.gz differ diff --git a/python-django.spec b/python-django.spec new file mode 100644 index 0000000000000000000000000000000000000000..6838cdc664efef73ae1954da26cebf33f0382451 --- /dev/null +++ b/python-django.spec @@ -0,0 +1,135 @@ +%define anolis_release 1 +%global pkgname Django + +Name: python-django +Version: 4.1.7 +Release: %{anolis_release}%{?dist} +Summary: A high-level Python Web framework + +License: BSD +URL: https://www.djangoproject.com/ +Source0: %{pypi_source %{pkgname} %{version}} + +BuildArch: noarch + +%global _description %{expand: +Django is a high-level Python Web framework that encourages rapid +development and a clean, pragmatic design. It focuses on automating as +much as possible and adhering to the DRY (Don't Repeat Yourself) +principle.} + +%description %_description + + +%package -n python3-django-bash-completion +Summary: Bash completion files for Django +BuildRequires: bash-completion +Requires: bash-completion + +%description -n python3-django-bash-completion +This package contains the Bash completion files form Django high-level +Python Web framework. + + +%package -n python3-django-doc +Summary: Documentation for Django +Suggests: python3-django = %{version}-%{release} +BuildRequires: make + +%description -n python3-django-doc +This package contains the documentation for the Django high-level +Python Web framework. + + +%package -n python3-django +Summary: A high-level Python Web framework + +Recommends: (python3-django-bash-completion = %{version}-%{release} if bash) + +BuildRequires: python3-devel +BuildRequires: python3-asgiref + +Provides: bundled(jquery) = 2.2.3 +Provides: bundled(xregexp) = 2.0.0 + +%description -n python3-django %_description + +%prep +%autosetup -p1 -n %{pkgname}-%{version} + +# hard-code python3 in django-admin +pushd django +for file in conf/project_template/manage.py-tpl ; do + sed -i "s/\/env python/\/python3/" $file ; +done +popd + +# Remove unnecessary test BRs +sed -i '/^pywatchman\b/d' tests/requirements/py3.txt +sed -i '/^tzdata$/d' tests/requirements/py3.txt + +%generate_buildrequires +%pyproject_buildrequires -r tests/requirements/{py3,postgres,mysql}.txt docs/requirements.txt + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files django + + +# build documentation +(cd docs && mkdir djangohtml && mkdir -p _build/{doctrees,html} && make html) +cp -ar docs .. + +# install man pages (for the main executable only) +mkdir -p %{buildroot}%{_mandir}/man1/ +cp -p docs/man/* %{buildroot}%{_mandir}/man1/ + +# install bash completion script +bashcompdir=$(pkg-config --variable=completionsdir bash-completion) +mkdir -p %{buildroot}$bashcompdir +install -m 0644 -p extras/django_bash_completion \ + %{buildroot}$bashcompdir/django-admin.py + +for file in django-admin django-admin-3 django-admin-%{python3_version} python3-django-admin manage.py ; do + ln -s django-admin.py %{buildroot}$bashcompdir/$file +done + +# Add backward compatible links to %%{_bindir} +ln -s ./django-admin %{buildroot}%{_bindir}/django-admin-3 +ln -s ./django-admin %{buildroot}%{_bindir}/django-admin-%{python3_version} +ln -s ./django-admin %{buildroot}%{_bindir}/python3-django-admin + +# remove .po files +find %{buildroot} -name "*.po" | xargs rm -f +sed -i '/.po$/d' %{pyproject_files} + +%check +cd %{_builddir}/%{pkgname}-%{version} +export PYTHONPATH=$(pwd) +cd tests + +%{python3} runtests.py --settings=test_sqlite --verbosity=2 --parallel 1 + + +%files -n python3-django-bash-completion +%{_datadir}/bash-completion + +%files -n python3-django-doc +%doc AUTHORS README.rst +%doc docs/_build/html/* + +%files -n python3-django -f %{pyproject_files} +%license LICENSE +%{_bindir}/django-admin +%{_bindir}/django-admin-3 +%{_bindir}/django-admin-%{python3_version} +%{_bindir}/python3-django-admin +%{_mandir}/man1/django-admin.1* + +%changelog +* Sat May 06 2023 Funda Wang - 4.1.7-1 +- Import package for anolis 23