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