1 |
%define pypi_name Django |
2 |
%define pkg_name django |
3 |
|
4 |
Name: python-%{pkg_name} |
5 |
Version: 3.1.14 |
6 |
Release: %mkrel 1 |
7 |
Summary: A high-level Python Web framework |
8 |
License: BSD |
9 |
Group: Development/Python |
10 |
Url: https://pypi.org/project/Django |
11 |
Source0: %{pypi_source} |
12 |
BuildArch: noarch |
13 |
BuildRequires: pkgconfig(python3) |
14 |
BuildRequires: python3dist(setuptools) |
15 |
|
16 |
# for docs |
17 |
BuildRequires: python3dist(sphinx) |
18 |
BuildRequires: python3dist(sphinx-rtd-theme) |
19 |
|
20 |
%description |
21 |
Django is a high-level Python Web framework that encourages rapid development |
22 |
and clean, pragmatic design. |
23 |
|
24 |
Developed and used over the past two years by a fast-moving online-news |
25 |
operation, Django was designed from scratch to handle two challenges: the |
26 |
intensive deadlines of a newsroom and the stringent requirements of experienced |
27 |
Web developers. It has convenient niceties for developing content-management |
28 |
systems, but it's an excellent tool for building any Web site. |
29 |
|
30 |
Django focuses on automating as much as possible and adhering to the |
31 |
DRY principle. |
32 |
|
33 |
%package -n python3-%{pkg_name} |
34 |
Summary: %{summary} |
35 |
Group: Development/Python |
36 |
%{?python_provide:%python_provide python3-%{pkg_name}} |
37 |
Obsoletes: %{name}-bash-completion < 2.2.4 |
38 |
Obsoletes: python2-django < 2.2.4 |
39 |
|
40 |
%description -n python3-%{pkg_name} |
41 |
Django is a high-level Python Web framework that encourages rapid development |
42 |
and clean, pragmatic design. |
43 |
|
44 |
Developed and used over the past two years by a fast-moving online-news |
45 |
operation, Django was designed from scratch to handle two challenges: the |
46 |
intensive deadlines of a newsroom and the stringent requirements of experienced |
47 |
Web developers. It has convenient niceties for developing content-management |
48 |
systems, but it's an excellent tool for building any Web site. |
49 |
|
50 |
Django focuses on automating as much as possible and adhering to the |
51 |
DRY principle. |
52 |
|
53 |
%prep |
54 |
%setup -q -n %{pypi_name}-%{version} |
55 |
|
56 |
# drop bundled egg-info |
57 |
rm -rf Django.egg-info/ |
58 |
|
59 |
# fix shebangs |
60 |
find . \( -name "*.py" -o -name "*.py-tpl" \) -exec sed -i -e '1s|#!.*python[2,3]\?|#!%{__python3}|' {} \; |
61 |
|
62 |
# empty files |
63 |
for f in \ |
64 |
django/contrib/staticfiles/models.py \ |
65 |
django/contrib/humanize/models.py \ |
66 |
; do |
67 |
echo "# just a comment" > $f |
68 |
done |
69 |
|
70 |
%build |
71 |
%py3_build |
72 |
|
73 |
%install |
74 |
%py3_install |
75 |
|
76 |
# build documentation |
77 |
rm -rf docs/{html,man}/* |
78 |
make -C docs man |
79 |
make -C docs html |
80 |
rm -rf docs/_build/html/.{buildinfo,doctrees} |
81 |
|
82 |
# install man pages |
83 |
mkdir -p %{buildroot}%{_mandir}/man1/ |
84 |
cp -a docs/_build/man/* %{buildroot}%{_mandir}/man1/ |
85 |
|
86 |
# install bash completion script |
87 |
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ |
88 |
install -m 0644 -p extras/django_bash_completion \ |
89 |
%{buildroot}%{_sysconfdir}/bash_completion.d/ |
90 |
|
91 |
# Fix items in %%{_bindir} |
92 |
mv %{buildroot}%{_bindir}/django-admin{.py,} |
93 |
|
94 |
%files -n python3-%{pkg_name} |
95 |
%doc AUTHORS LICENSE README.rst |
96 |
%doc docs/_build/html |
97 |
%{_mandir}/man1/* |
98 |
%{_bindir}/django-admin |
99 |
%{_sysconfdir}/bash_completion.d/django_bash_completion |
100 |
%{python3_sitelib}/django |
101 |
%{python3_sitelib}/%{pypi_name}-*.egg-info |