]>
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} |
6b608f6c | 9 | Version: 1.8.15 |
99a17499 | 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 |
6b608f6c | 14 | # Source0-md5: d24c3c5fc6d784296693659b05efa70f |
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 |
c738773c SP |
27 | Suggests: python-MySQLdb |
28 | Suggests: python-PyGreSQL | |
99a17499 | 29 | Suggests: python-devel-tools |
c053fa9c AM |
30 | BuildArch: noarch |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | Django is a high-level Python Web framework that encourages rapid | |
35 | development and clean, pragmatic design. | |
36 | ||
dff19739 JR |
37 | %description -l pl.UTF-8 |
38 | Django to wysokopoziomowy szkielet dla serwisów WWW w Pythonie | |
39 | wspierający szybkie tworzenie i czysty, pragmatyczny projekt. | |
f14ec3a7 | 40 | |
d2a760e3 JK |
41 | %package -n python3-%{module} |
42 | Summary: The web framework for perfectionists with deadlines | |
43 | Summary(pl.UTF-8): Szkielet WWW dla perfekcjonistów z ograniczeniami czasowymi | |
44 | Group: Libraries/Python | |
39cf8c36 | 45 | Suggests: python3-MySQLdb |
99a17499 | 46 | Suggests: python3-devel-tools |
d2a760e3 JK |
47 | Suggests: python3-psycopg2 |
48 | ||
49 | %description -n python3-%{module} | |
50 | Django is a high-level Python Web framework that encourages rapid | |
51 | development and clean, pragmatic design. | |
52 | ||
53 | %description -n python3-%{module} -l pl.UTF-8 | |
54 | Django to wysokopoziomowy szkielet dla serwisów WWW w Pythonie | |
55 | wspierający szybkie tworzenie i czysty, pragmatyczny projekt. | |
56 | ||
36477d4b | 57 | %package doc |
58 | Summary: Documentation on Django | |
59 | Summary(de.UTF-8): Dokumentation zu Django | |
60 | Summary(es.UTF-8): Documentación para Django | |
61 | Summary(fr.UTF-8): Documentation sur Django | |
62 | Summary(pl.UTF-8): Dokumentacja do Django | |
63 | Group: Documentation | |
64 | ||
65 | %description doc | |
66 | Documentation on Django. | |
67 | ||
68 | %description doc -l pl.UTF-8 | |
69 | Dokumentacja do Django. | |
70 | ||
c053fa9c | 71 | %prep |
d4aa0cb9 | 72 | %setup -q -n Django-%{version} |
05e71f33 | 73 | |
c053fa9c | 74 | %build |
e9a6c497 JK |
75 | %if %{with python2} |
76 | %py_build | |
77 | %endif | |
755530bf | 78 | |
36477d4b | 79 | %{__make} -C docs html |
755530bf ER |
80 | rm -r docs/_build/html/_sources |
81 | ||
e9a6c497 JK |
82 | %if %{with python3} |
83 | %py3_build | |
84 | %endif | |
36477d4b | 85 | |
c053fa9c AM |
86 | %install |
87 | rm -rf $RPM_BUILD_ROOT | |
d2a760e3 | 88 | %if %{with python2} |
e9a6c497 | 89 | %py_install |
755530bf ER |
90 | %py_postclean |
91 | find $RPM_BUILD_ROOT%{py_sitescriptdir} -type f -path '*_template*' -a -name '*.py[oc]' | xargs rm | |
92 | ||
795498e1 ER |
93 | mv $RPM_BUILD_ROOT%{_bindir}/{django-admin.py,django-admin-2} |
94 | ln -s django-admin-2 $RPM_BUILD_ROOT%{_bindir}/py2-django-admin | |
d2a760e3 JK |
95 | %endif |
96 | ||
97 | %if %{with python3} | |
e9a6c497 | 98 | %py3_install |
76025b57 ER |
99 | find $RPM_BUILD_ROOT%{py3_sitescriptdir}/django/conf/*_template -name __pycache__ | xargs rm -r |
100 | ||
795498e1 ER |
101 | mv $RPM_BUILD_ROOT%{_bindir}/{django-admin.py,django-admin-3} |
102 | ln -s django-admin-3 $RPM_BUILD_ROOT%{_bindir}/py3-django-admin | |
0b2875fc ER |
103 | %endif |
104 | ||
105 | # setup "django-admin" global alias | |
106 | # this needs to be done after both Python versions are installed | |
107 | # otherwise file contents would be overwritten via symlink | |
108 | %if %{with python2} | |
109 | # default to python2 if built | |
110 | ln -sf py2-django-admin $RPM_BUILD_ROOT%{_bindir}/django-admin | |
d2a760e3 | 111 | # default to python2 if built |
0b2875fc ER |
112 | %else |
113 | %if %{with python3} | |
9749628d | 114 | ln -sf py3-django-admin $RPM_BUILD_ROOT%{_bindir}/django-admin |
d2a760e3 JK |
115 | %endif |
116 | %endif | |
c053fa9c | 117 | |
755530bf | 118 | install -d $RPM_BUILD_ROOT%{_docdir} |
36477d4b | 119 | ln -sf python-django-doc-%{version} $RPM_BUILD_ROOT%{_docdir}/python-django-doc |
36477d4b | 120 | |
c053fa9c AM |
121 | %clean |
122 | rm -rf $RPM_BUILD_ROOT | |
123 | ||
d2a760e3 | 124 | %if %{with python2} |
c053fa9c AM |
125 | %files |
126 | %defattr(644,root,root,755) | |
d2a760e3 | 127 | %doc README.rst |
9749628d | 128 | %attr(755,root,root) %{_bindir}/django-admin |
d2a760e3 | 129 | %attr(755,root,root) %{_bindir}/py2-django-admin |
795498e1 | 130 | %attr(755,root,root) %{_bindir}/django-admin-2 |
c053fa9c | 131 | %{py_sitescriptdir}/%{module}* |
85ac776c | 132 | %{py_sitescriptdir}/Django-*.egg-info |
d3df6894 | 133 | %endif |
36477d4b | 134 | |
d2a760e3 JK |
135 | %if %{with python3} |
136 | %files -n python3-%{module} | |
137 | %defattr(644,root,root,755) | |
138 | %doc README.rst | |
139 | %if %{without python2} | |
9749628d | 140 | %attr(755,root,root) %{_bindir}/django-admin |
d2a760e3 JK |
141 | %endif |
142 | %attr(755,root,root) %{_bindir}/py3-django-admin | |
795498e1 | 143 | %attr(755,root,root) %{_bindir}/django-admin-3 |
d2a760e3 JK |
144 | %{py3_sitescriptdir}/%{module}* |
145 | %{py3_sitescriptdir}/Django-*.egg-info | |
146 | %endif | |
147 | ||
36477d4b | 148 | %files doc |
149 | %defattr(644,root,root,755) | |
755530bf | 150 | %doc docs/_build/html/* |
36477d4b | 151 | %{_docdir}/python-django-doc |