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