]>
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} |
e9a6c497 | 9 | Version: 1.8.7 |
f49525f0 | 10 | Release: 4 |
c053fa9c | 11 | License: BSD |
70ed983d | 12 | Group: Libraries/Python |
39cf8c36 | 13 | Source0: http://www.djangoproject.com/m/releases/1.8/Django-%{version}.tar.gz |
e9a6c497 | 14 | # Source0-md5: 44c01355b5efa01938a89b8bd798b1ed |
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 |
e9a6c497 | 25 | BuildRequires: rpmbuild(macros) >= 1.710 |
36477d4b | 26 | BuildRequires: sphinx-pdg |
af0bb85a | 27 | %pyrequires_eq python |
a0fa853e | 28 | Requires: python-modules |
acf565b6 | 29 | Suggests: python-devel-tools |
c738773c SP |
30 | Suggests: python-MySQLdb |
31 | Suggests: python-PyGreSQL | |
c053fa9c AM |
32 | BuildArch: noarch |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | Django is a high-level Python Web framework that encourages rapid | |
37 | development and clean, pragmatic design. | |
38 | ||
dff19739 JR |
39 | %description -l pl.UTF-8 |
40 | Django to wysokopoziomowy szkielet dla serwisów WWW w Pythonie | |
41 | wspierający szybkie tworzenie i czysty, pragmatyczny projekt. | |
f14ec3a7 | 42 | |
d2a760e3 JK |
43 | %package -n python3-%{module} |
44 | Summary: The web framework for perfectionists with deadlines | |
45 | Summary(pl.UTF-8): Szkielet WWW dla perfekcjonistów z ograniczeniami czasowymi | |
46 | Group: Libraries/Python | |
47 | %pyrequires_eq python3 | |
a0fa853e | 48 | Requires: python3-modules |
acf565b6 | 49 | Suggests: python3-devel-tools |
39cf8c36 | 50 | Suggests: python3-MySQLdb |
d2a760e3 JK |
51 | Suggests: python3-psycopg2 |
52 | ||
53 | %description -n python3-%{module} | |
54 | Django is a high-level Python Web framework that encourages rapid | |
55 | development and clean, pragmatic design. | |
56 | ||
57 | %description -n python3-%{module} -l pl.UTF-8 | |
58 | Django to wysokopoziomowy szkielet dla serwisów WWW w Pythonie | |
59 | wspierający szybkie tworzenie i czysty, pragmatyczny projekt. | |
60 | ||
36477d4b | 61 | %package doc |
62 | Summary: Documentation on Django | |
63 | Summary(de.UTF-8): Dokumentation zu Django | |
64 | Summary(es.UTF-8): Documentación para Django | |
65 | Summary(fr.UTF-8): Documentation sur Django | |
66 | Summary(pl.UTF-8): Dokumentacja do Django | |
67 | Group: Documentation | |
68 | ||
69 | %description doc | |
70 | Documentation on Django. | |
71 | ||
72 | %description doc -l pl.UTF-8 | |
73 | Dokumentacja do Django. | |
74 | ||
c053fa9c | 75 | %prep |
d4aa0cb9 | 76 | %setup -q -n Django-%{version} |
05e71f33 | 77 | |
c053fa9c | 78 | %build |
e9a6c497 JK |
79 | %if %{with python2} |
80 | %py_build | |
81 | %endif | |
36477d4b | 82 | %{__make} -C docs html |
e9a6c497 JK |
83 | %if %{with python3} |
84 | %py3_build | |
85 | %endif | |
36477d4b | 86 | |
c053fa9c AM |
87 | %install |
88 | rm -rf $RPM_BUILD_ROOT | |
36477d4b | 89 | install -d $RPM_BUILD_ROOT%{_docdir} |
d2a760e3 JK |
90 | |
91 | %if %{with python2} | |
e9a6c497 | 92 | %py_install |
d2a760e3 JK |
93 | cp $RPM_BUILD_ROOT%{_bindir}/{django-admin.py,py2-django-admin} |
94 | %endif | |
95 | ||
96 | %if %{with python3} | |
e9a6c497 | 97 | %py3_install |
d2a760e3 JK |
98 | cp $RPM_BUILD_ROOT%{_bindir}/{django-admin.py,py3-django-admin} |
99 | %if %{with python2} | |
100 | # default to python2 if built | |
101 | cp $RPM_BUILD_ROOT%{_bindir}/{py2-django-admin,django-admin.py} | |
102 | %endif | |
103 | %endif | |
c053fa9c | 104 | |
adda894a | 105 | find $RPM_BUILD_ROOT -type f -name '*.py[co]' | xargs rm |
3ef44b33 AM |
106 | find $RPM_BUILD_ROOT -type f -exec sed -i -e "s#$RPM_BUILD_ROOT##g" "{}" ";" |
107 | ||
d2a760e3 | 108 | %if %{with python2} |
c053fa9c AM |
109 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} |
110 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
d2a760e3 | 111 | |
adda894a | 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 |