]>
Commit | Line | Data |
---|---|---|
d2a760e3 JK |
1 | # Conditional build: |
2 | %bcond_without python2 # CPython 2.x module | |
3 | %bcond_without python3 # CPython 3.x module | |
4 | ||
85ac776c | 5 | %define module django |
c053fa9c | 6 | Summary: The web framework for perfectionists with deadlines |
0fb0c5e5 | 7 | Summary(pl.UTF-8): Szkielet WWW dla perfekcjonistów z ograniczeniami czasowymi |
85ac776c | 8 | Name: python-%{module} |
4a3d0975 | 9 | Version: 1.8.6 |
39cf8c36 | 10 | Release: 1 |
c053fa9c | 11 | License: BSD |
70ed983d | 12 | Group: Libraries/Python |
39cf8c36 | 13 | Source0: http://www.djangoproject.com/m/releases/1.8/Django-%{version}.tar.gz |
4a3d0975 | 14 | # Source0-md5: 12ba7b57a1f5268f6e8ba555628c0657 |
c053fa9c | 15 | URL: http://www.djangoproject.com/ |
d2a760e3 | 16 | %if %{with python2} |
39cf8c36 | 17 | BuildRequires: python-devel >= 1:2.7 |
5087193f | 18 | BuildRequires: python-setuptools |
d2a760e3 JK |
19 | %endif |
20 | %if %{with python3} | |
24d19ba3 | 21 | BuildRequires: python3-devel >= 1:3.3 |
cda38c21 | 22 | BuildRequires: python3-setuptools |
d2a760e3 | 23 | %endif |
af0bb85a | 24 | BuildRequires: rpm-pythonprov |
36477d4b | 25 | BuildRequires: sphinx-pdg |
af0bb85a | 26 | %pyrequires_eq python |
a0fa853e | 27 | Requires: python-modules |
acf565b6 | 28 | Suggests: python-devel-tools |
c738773c SP |
29 | Suggests: python-MySQLdb |
30 | Suggests: python-PyGreSQL | |
c053fa9c AM |
31 | BuildArch: noarch |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | Django is a high-level Python Web framework that encourages rapid | |
36 | development and clean, pragmatic design. | |
37 | ||
dff19739 JR |
38 | %description -l pl.UTF-8 |
39 | Django to wysokopoziomowy szkielet dla serwisów WWW w Pythonie | |
40 | wspierający szybkie tworzenie i czysty, pragmatyczny projekt. | |
f14ec3a7 | 41 | |
d2a760e3 JK |
42 | %package -n python3-%{module} |
43 | Summary: The web framework for perfectionists with deadlines | |
44 | Summary(pl.UTF-8): Szkielet WWW dla perfekcjonistów z ograniczeniami czasowymi | |
45 | Group: Libraries/Python | |
46 | %pyrequires_eq python3 | |
a0fa853e | 47 | Requires: python3-modules |
acf565b6 | 48 | Suggests: python3-devel-tools |
39cf8c36 | 49 | Suggests: python3-MySQLdb |
d2a760e3 JK |
50 | Suggests: python3-psycopg2 |
51 | ||
52 | %description -n python3-%{module} | |
53 | Django is a high-level Python Web framework that encourages rapid | |
54 | development and clean, pragmatic design. | |
55 | ||
56 | %description -n python3-%{module} -l pl.UTF-8 | |
57 | Django to wysokopoziomowy szkielet dla serwisów WWW w Pythonie | |
58 | wspierający szybkie tworzenie i czysty, pragmatyczny projekt. | |
59 | ||
36477d4b | 60 | %package doc |
61 | Summary: Documentation on Django | |
62 | Summary(de.UTF-8): Dokumentation zu Django | |
63 | Summary(es.UTF-8): Documentación para Django | |
64 | Summary(fr.UTF-8): Documentation sur Django | |
65 | Summary(pl.UTF-8): Dokumentacja do Django | |
66 | Group: Documentation | |
67 | ||
68 | %description doc | |
69 | Documentation on Django. | |
70 | ||
71 | %description doc -l pl.UTF-8 | |
72 | Dokumentacja do Django. | |
73 | ||
c053fa9c | 74 | %prep |
d4aa0cb9 | 75 | %setup -q -n Django-%{version} |
05e71f33 | 76 | |
c053fa9c | 77 | %build |
adda894a | 78 | %{__python} setup.py build |
36477d4b | 79 | %{__make} -C docs html |
80 | ||
c053fa9c AM |
81 | %install |
82 | rm -rf $RPM_BUILD_ROOT | |
36477d4b | 83 | install -d $RPM_BUILD_ROOT%{_docdir} |
d2a760e3 JK |
84 | |
85 | %if %{with python2} | |
adda894a | 86 | %{__python} setup.py install \ |
c053fa9c AM |
87 | --optimize 2 \ |
88 | --root=$RPM_BUILD_ROOT | |
d2a760e3 JK |
89 | cp $RPM_BUILD_ROOT%{_bindir}/{django-admin.py,py2-django-admin} |
90 | %endif | |
91 | ||
92 | %if %{with python3} | |
93 | %{__python3} setup.py install \ | |
94 | --optimize 2 \ | |
95 | --root=$RPM_BUILD_ROOT | |
96 | cp $RPM_BUILD_ROOT%{_bindir}/{django-admin.py,py3-django-admin} | |
97 | %if %{with python2} | |
98 | # default to python2 if built | |
99 | cp $RPM_BUILD_ROOT%{_bindir}/{py2-django-admin,django-admin.py} | |
100 | %endif | |
101 | %endif | |
c053fa9c | 102 | |
adda894a | 103 | find $RPM_BUILD_ROOT -type f -name '*.py[co]' | xargs rm |
3ef44b33 AM |
104 | find $RPM_BUILD_ROOT -type f -exec sed -i -e "s#$RPM_BUILD_ROOT##g" "{}" ";" |
105 | ||
d2a760e3 | 106 | %if %{with python2} |
c053fa9c AM |
107 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} |
108 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
d2a760e3 JK |
109 | |
110 | # %%py_postclean (only for python2!) | |
adda894a ER |
111 | find $RPM_BUILD_ROOT%{py_sitescriptdir} -type f -name '*.py' -a -not -path '*_template*' | xargs rm |
112 | find $RPM_BUILD_ROOT%{py_sitescriptdir} -type f -path '*_template*' -a -name '*.py[oc]' | xargs rm | |
d2a760e3 JK |
113 | %endif |
114 | ||
115 | %if %{with python3} | |
116 | %py3_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
117 | %py3_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
118 | %endif | |
c053fa9c | 119 | |
36477d4b | 120 | ln -sf python-django-doc-%{version} $RPM_BUILD_ROOT%{_docdir}/python-django-doc |
121 | rm -rf docs/_build/html/_sources | |
122 | ||
c053fa9c AM |
123 | %clean |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
d2a760e3 | 126 | %if %{with python2} |
c053fa9c AM |
127 | %files |
128 | %defattr(644,root,root,755) | |
d2a760e3 | 129 | %doc README.rst |
adda894a | 130 | %attr(755,root,root) %{_bindir}/django-admin.py |
d2a760e3 | 131 | %attr(755,root,root) %{_bindir}/py2-django-admin |
c053fa9c | 132 | %{py_sitescriptdir}/%{module}* |
85ac776c | 133 | %{py_sitescriptdir}/Django-*.egg-info |
d3df6894 | 134 | %endif |
36477d4b | 135 | |
d2a760e3 JK |
136 | %if %{with python3} |
137 | %files -n python3-%{module} | |
138 | %defattr(644,root,root,755) | |
139 | %doc README.rst | |
140 | %if %{without python2} | |
141 | %attr(755,root,root) %{_bindir}/django-admin.py | |
142 | %endif | |
143 | %attr(755,root,root) %{_bindir}/py3-django-admin | |
144 | %{py3_sitescriptdir}/%{module}* | |
145 | %{py3_sitescriptdir}/Django-*.egg-info | |
146 | %endif | |
147 | ||
36477d4b | 148 | %files doc |
149 | %defattr(644,root,root,755) | |
150 | %doc docs/_build/html | |
151 | %{_docdir}/python-django-doc |