1 |
%define module django |
%define module django |
2 |
%define tarname Django |
%define tarname Django |
3 |
%define name python-%{module} |
%define name python-%{module} |
4 |
%define version 1.5.4 |
%define version 1.6.2 |
5 |
%define release %mkrel 3 |
%define release %mkrel 1 |
6 |
|
|
7 |
Summary: A high-level Python Web framework |
Summary: A high-level Python Web framework |
8 |
Name: %{name} |
Name: %{name} |
9 |
Version: %{version} |
Version: %{version} |
10 |
Release: %{release} |
Release: %{release} |
11 |
Source0: https://pypi.python.org/packages/source/D/%{tarname}/%{tarname}-%{version}.tar.gz |
Source0: https://pypi.python.org/packages/source/D/%{tarname}/%{tarname}-%{version}.tar.gz |
12 |
|
Patch0: python-django-1.6-py3-admin-completion |
13 |
License: BSD |
License: BSD |
14 |
Group: Development/Python |
Group: Development/Python |
15 |
Url: http://www.djangoproject.com |
Url: http://www.djangoproject.com |
19 |
BuildRequires: python-devel |
BuildRequires: python-devel |
20 |
BuildRequires: python3-devel |
BuildRequires: python3-devel |
21 |
BuildRequires: python3-setuptools |
BuildRequires: python3-setuptools |
22 |
|
Requires: %{name}-bash-completion = %{version}-%{release} |
23 |
|
|
24 |
%description |
%description |
25 |
Django is a high-level Python Web framework that encourages rapid development |
Django is a high-level Python Web framework that encourages rapid development |
34 |
Django focuses on automating as much as possible and adhering to the |
Django focuses on automating as much as possible and adhering to the |
35 |
DRY principle. |
DRY principle. |
36 |
|
|
37 |
|
%package bash-completion |
38 |
|
Group: Development/Python |
39 |
|
Summary: bash completion files for Django |
40 |
|
|
41 |
|
|
42 |
|
%description bash-completion |
43 |
|
This package contains the bash completion files form Django high-level |
44 |
|
Python Web framework. |
45 |
|
|
46 |
%package -n python3-%{module} |
%package -n python3-%{module} |
47 |
Summary: A high-level Python Web framework |
Summary: A high-level Python Web framework |
48 |
Group: Development/Python |
Group: Development/Python |
49 |
|
Requires: %{name}-bash-completion = %{version}-%{release} |
50 |
|
|
51 |
%description -n python3-%{module} |
%description -n python3-%{module} |
52 |
|
|
73 |
|
|
74 |
%prep |
%prep |
75 |
%setup -q -n %{tarname}-%{version} |
%setup -q -n %{tarname}-%{version} |
76 |
sed -i 's/^\(ez_setup.use_setuptools\)/#\1/' setup.py |
%patch0 |
77 |
|
# empty files |
78 |
|
for f in \ |
79 |
|
django/contrib/staticfiles/models.py \ |
80 |
|
django/contrib/webdesign/models.py \ |
81 |
|
django/contrib/humanize/models.py \ |
82 |
|
; do |
83 |
|
echo "# just a comment" > $f |
84 |
|
done |
85 |
|
echo "<!-- nothing -->" > django/contrib/flatpages/tests/templates/registration/login.html |
86 |
cp -a . %{py3dir} |
cp -a . %{py3dir} |
87 |
|
|
88 |
%build |
%build |
89 |
%{__python} setup.py build |
%{__python} setup.py build |
|
make -C docs/ html |
|
90 |
pushd %{py3dir} |
pushd %{py3dir} |
91 |
%{__python3} setup.py build |
%{__python3} setup.py build |
92 |
popd |
popd |
96 |
# overwrite django-admin script with the python 3 version |
# overwrite django-admin script with the python 3 version |
97 |
pushd %{py3dir} |
pushd %{py3dir} |
98 |
%{__python3} setup.py install --skip-build --root %{buildroot} |
%{__python3} setup.py install --skip-build --root %{buildroot} |
99 |
mv %{buildroot}%{_bindir}/django-admin.py %{buildroot}%{_bindir}/python3-django-admin.py |
mv %{buildroot}%{_bindir}/django-admin.py %{buildroot}%{_bindir}/python3-django-admin |
100 |
popd |
popd |
101 |
|
|
102 |
%{__python} setup.py install --skip-build --root %{buildroot} |
%{__python} setup.py install --skip-build --root %{buildroot} |
103 |
|
|
104 |
|
# build documentation |
105 |
|
(cd docs && mkdir djangohtml && mkdir -p _build/{doctrees,html} && make html) |
106 |
|
|
107 |
|
|
108 |
|
# install man pages |
109 |
|
mkdir -p %{buildroot}%{_mandir}/man1/ |
110 |
|
cp -p docs/man/* %{buildroot}%{_mandir}/man1/ |
111 |
|
cp -a %{buildroot}%{_mandir}/man1/django-admin.1 %{buildroot}%{_mandir}/man1/python3-django-admin.1 |
112 |
|
cp -a %{buildroot}%{_mandir}/man1/daily_cleanup.1 %{buildroot}%{_mandir}/man1/python3-daily_cleanup.1 |
113 |
|
cp -a %{buildroot}%{_mandir}/man1/gather_profile_stats.1 %{buildroot}%{_mandir}/man1/python3-gather_profile_stats.1 |
114 |
|
|
115 |
|
# install bash completion script |
116 |
|
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ |
117 |
|
install -m 0644 -p extras/django_bash_completion \ |
118 |
|
%{buildroot}%{_sysconfdir}/bash_completion.d/ |
119 |
|
|
120 |
|
# Fix items in %%{_bindir} |
121 |
|
mv %{buildroot}%{_bindir}/django-admin.py %{buildroot}%{_bindir}/django-admin |
122 |
|
|
123 |
%files |
%files |
124 |
%doc README* |
%doc AUTHORS LICENSE README.rst |
125 |
%{_bindir}/django-admin.py |
%{_mandir}/man1/* |
126 |
|
# except the python3 prefix |
127 |
|
%exclude %{_mandir}/man1/python3-* |
128 |
|
%{_bindir}/django-admin |
129 |
%{python_sitelib}/%{module} |
%{python_sitelib}/%{module} |
130 |
%{python_sitelib}/%{tarname}-*.egg-info |
%{python_sitelib}/%{tarname}-*.egg-info |
131 |
|
|
132 |
%files -n python3-%{module} |
%files -n python3-%{module} |
133 |
%doc README* |
%doc AUTHORS LICENSE README.rst |
134 |
%{_bindir}/python3-django-admin.py |
%{_mandir}/man1/python3-* |
135 |
|
%{_bindir}/python3-django-admin |
136 |
%{python3_sitelib}/%{module} |
%{python3_sitelib}/%{module} |
137 |
%{python3_sitelib}/%{tarname}-*.egg-info |
%{python3_sitelib}/%{tarname}-*.egg-info |
138 |
|
|
139 |
%files doc |
%files doc |
140 |
%doc README* docs/_build/html |
%doc docs/_build/html |
141 |
|
|
142 |
|
%files bash-completion |
143 |
|
%dir %{_sysconfdir}/bash_completion.d/ |
144 |
|
%config(noreplace) %{_sysconfdir}/bash_completion.d/django_bash_completion |
145 |
|
|