1 |
%define module django |
2 |
%define tarname Django |
3 |
|
4 |
Summary: A high-level Python Web framework |
5 |
Name: python-%{module} |
6 |
Version: 1.8.14 |
7 |
Release: %mkrel 1 |
8 |
Source0: https://pypi.io/packages/source/D/%{tarname}/%{tarname}-%{version}.tar.gz |
9 |
Patch0: python-django-1.7-py3-admin-completion |
10 |
License: BSD |
11 |
Group: Development/Python |
12 |
Url: http://www.djangoproject.com |
13 |
BuildArch: noarch |
14 |
BuildRequires: python-setuptools |
15 |
BuildRequires: python-sphinx |
16 |
BuildRequires: python-sphinx_rtd_theme |
17 |
BuildRequires: python-devel |
18 |
BuildRequires: python3-devel |
19 |
BuildRequires: python3-setuptools |
20 |
BuildRequires: python3-sphinx_rtd_theme |
21 |
Requires: %{name}-bash-completion = %{version}-%{release} |
22 |
|
23 |
%description |
24 |
Django is a high-level Python Web framework that encourages rapid development |
25 |
and clean, pragmatic design. |
26 |
|
27 |
Developed and used over the past two years by a fast-moving online-news |
28 |
operation, Django was designed from scratch to handle two challenges: the |
29 |
intensive deadlines of a newsroom and the stringent requirements of experienced |
30 |
Web developers. It has convenient niceties for developing content-management |
31 |
systems, but it's an excellent tool for building any Web site. |
32 |
|
33 |
Django focuses on automating as much as possible and adhering to the |
34 |
DRY principle. |
35 |
|
36 |
%package bash-completion |
37 |
Group: Development/Python |
38 |
Summary: bash completion files for Django |
39 |
|
40 |
|
41 |
%description bash-completion |
42 |
This package contains the bash completion files form Django high-level |
43 |
Python Web framework. |
44 |
|
45 |
%package -n python3-%{module} |
46 |
Summary: A high-level Python Web framework |
47 |
Group: Development/Python |
48 |
Requires: %{name}-bash-completion = %{version}-%{release} |
49 |
|
50 |
%description -n python3-%{module} |
51 |
|
52 |
Django is a high-level Python Web framework that encourages rapid development |
53 |
and clean, pragmatic design. |
54 |
|
55 |
Developed and used over the past two years by a fast-moving online-news |
56 |
operation, Django was designed from scratch to handle two challenges: the |
57 |
intensive deadlines of a newsroom and the stringent requirements of experienced |
58 |
Web developers. It has convenient niceties for developing content-management |
59 |
systems, but it's an excellent tool for building any Web site. |
60 |
|
61 |
Django focuses on automating as much as possible and adhering to the |
62 |
DRY principle. |
63 |
|
64 |
%package doc |
65 |
Summary: Documentation for django |
66 |
Group: Development/Python |
67 |
Provides: python3-%{module}-doc = %{version}-%{release} |
68 |
|
69 |
%description doc |
70 |
This package contains documentation for Django, |
71 |
a high-level Python Web framework. |
72 |
|
73 |
%prep |
74 |
%setup -q -n %{tarname}-%{version} |
75 |
%patch0 |
76 |
|
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 |
cp -a . %{py3dir} |
86 |
|
87 |
%build |
88 |
%py2_build |
89 |
|
90 |
pushd %{py3dir} |
91 |
%py3_build |
92 |
popd |
93 |
|
94 |
%install |
95 |
# must do install of python 3 subpackage first, so that we don't |
96 |
# overwrite django-admin script with the python 3 version |
97 |
pushd %{py3dir} |
98 |
%py3_install |
99 |
mv %{buildroot}%{_bindir}/django-admin.py %{buildroot}%{_bindir}/python3-django-admin |
100 |
popd |
101 |
|
102 |
%py2_install |
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 |
|
113 |
# install bash completion script |
114 |
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ |
115 |
install -m 0644 -p extras/django_bash_completion \ |
116 |
%{buildroot}%{_sysconfdir}/bash_completion.d/ |
117 |
|
118 |
# Fix items in %%{_bindir} |
119 |
mv %{buildroot}%{_bindir}/django-admin.py %{buildroot}%{_bindir}/django-admin |
120 |
|
121 |
|
122 |
%files |
123 |
%doc AUTHORS LICENSE README.rst |
124 |
%{_mandir}/man1/* |
125 |
# except the python3 prefix |
126 |
%exclude %{_mandir}/man1/python3-* |
127 |
%{_bindir}/django-admin |
128 |
%{python2_sitelib}/%{module} |
129 |
%{python2_sitelib}/%{tarname}-*.egg-info |
130 |
|
131 |
%files -n python3-%{module} |
132 |
%doc AUTHORS LICENSE README.rst |
133 |
%{_mandir}/man1/python3-* |
134 |
%{_bindir}/python3-django-admin |
135 |
%{python3_sitelib}/%{module} |
136 |
%{python3_sitelib}/%{tarname}-*.egg-info |
137 |
|
138 |
%files doc |
139 |
%doc docs/_build/html |
140 |
|
141 |
%files bash-completion |
142 |
%dir %{_sysconfdir}/bash_completion.d/ |
143 |
%config(noreplace) %{_sysconfdir}/bash_completion.d/django_bash_completion |
144 |
|