1 |
%define module django |
2 |
%define tarname Django |
3 |
%define name python-%{module} |
4 |
%define version 1.6.2 |
5 |
%define release %mkrel 1 |
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 |
License: BSD |
14 |
Group: Development/Python |
15 |
Url: http://www.djangoproject.com |
16 |
BuildArch: noarch |
17 |
BuildRequires: python-setuptools |
18 |
BuildRequires: python-sphinx |
19 |
BuildRequires: python-devel |
20 |
BuildRequires: python3-devel |
21 |
BuildRequires: python3-setuptools |
22 |
Requires: %{name}-bash-completion = %{version}-%{release} |
23 |
|
24 |
%description |
25 |
Django is a high-level Python Web framework that encourages rapid development |
26 |
and clean, pragmatic design. |
27 |
|
28 |
Developed and used over the past two years by a fast-moving online-news |
29 |
operation, Django was designed from scratch to handle two challenges: the |
30 |
intensive deadlines of a newsroom and the stringent requirements of experienced |
31 |
Web developers. It has convenient niceties for developing content-management |
32 |
systems, but it's an excellent tool for building any Web site. |
33 |
|
34 |
Django focuses on automating as much as possible and adhering to the |
35 |
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} |
47 |
Summary: A high-level Python Web framework |
48 |
Group: Development/Python |
49 |
Requires: %{name}-bash-completion = %{version}-%{release} |
50 |
|
51 |
%description -n python3-%{module} |
52 |
|
53 |
Django is a high-level Python Web framework that encourages rapid development |
54 |
and clean, pragmatic design. |
55 |
|
56 |
Developed and used over the past two years by a fast-moving online-news |
57 |
operation, Django was designed from scratch to handle two challenges: the |
58 |
intensive deadlines of a newsroom and the stringent requirements of experienced |
59 |
Web developers. It has convenient niceties for developing content-management |
60 |
systems, but it's an excellent tool for building any Web site. |
61 |
|
62 |
Django focuses on automating as much as possible and adhering to the |
63 |
DRY principle. |
64 |
|
65 |
%package doc |
66 |
Summary: Documentation for django |
67 |
Group: Development/Python |
68 |
Provides: python3-%{module}-doc = %{version}-%{release} |
69 |
|
70 |
%description doc |
71 |
This package contains documentation for Django, |
72 |
a high-level Python Web framework. |
73 |
|
74 |
%prep |
75 |
%setup -q -n %{tarname}-%{version} |
76 |
%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} |
87 |
|
88 |
%build |
89 |
%{__python} setup.py build |
90 |
pushd %{py3dir} |
91 |
%{__python3} setup.py 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 |
%{__python3} setup.py install --skip-build --root %{buildroot} |
99 |
mv %{buildroot}%{_bindir}/django-admin.py %{buildroot}%{_bindir}/python3-django-admin |
100 |
popd |
101 |
|
102 |
%{__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 |
124 |
%doc AUTHORS LICENSE README.rst |
125 |
%{_mandir}/man1/* |
126 |
# except the python3 prefix |
127 |
%exclude %{_mandir}/man1/python3-* |
128 |
%{_bindir}/django-admin |
129 |
%{python_sitelib}/%{module} |
130 |
%{python_sitelib}/%{tarname}-*.egg-info |
131 |
|
132 |
%files -n python3-%{module} |
133 |
%doc AUTHORS LICENSE README.rst |
134 |
%{_mandir}/man1/python3-* |
135 |
%{_bindir}/python3-django-admin |
136 |
%{python3_sitelib}/%{module} |
137 |
%{python3_sitelib}/%{tarname}-*.egg-info |
138 |
|
139 |
%files doc |
140 |
%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 |
|