]> git.pld-linux.org Git - packages/python3-django.git/blame - python-django.spec
distribute is obsolete, BR: python3-setuptools instead
[packages/python3-django.git] / python-django.spec
CommitLineData
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 6Summary: The web framework for perfectionists with deadlines
0fb0c5e5 7Summary(pl.UTF-8): Szkielet WWW dla perfekcjonistów z ograniczeniami czasowymi
85ac776c 8Name: python-%{module}
4a3d0975 9Version: 1.8.6
39cf8c36 10Release: 1
c053fa9c 11License: BSD
70ed983d 12Group: Libraries/Python
39cf8c36 13Source0: http://www.djangoproject.com/m/releases/1.8/Django-%{version}.tar.gz
4a3d0975 14# Source0-md5: 12ba7b57a1f5268f6e8ba555628c0657
c053fa9c 15URL: http://www.djangoproject.com/
d2a760e3 16%if %{with python2}
39cf8c36 17BuildRequires: python-devel >= 1:2.7
5087193f 18BuildRequires: python-setuptools
d2a760e3
JK
19%endif
20%if %{with python3}
24d19ba3 21BuildRequires: python3-devel >= 1:3.3
cda38c21 22BuildRequires: python3-setuptools
d2a760e3 23%endif
af0bb85a 24BuildRequires: rpm-pythonprov
36477d4b 25BuildRequires: sphinx-pdg
af0bb85a 26%pyrequires_eq python
a0fa853e 27Requires: python-modules
acf565b6 28Suggests: python-devel-tools
c738773c
SP
29Suggests: python-MySQLdb
30Suggests: python-PyGreSQL
c053fa9c
AM
31BuildArch: noarch
32BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34%description
35Django is a high-level Python Web framework that encourages rapid
36development and clean, pragmatic design.
37
dff19739
JR
38%description -l pl.UTF-8
39Django to wysokopoziomowy szkielet dla serwisów WWW w Pythonie
40wspierający szybkie tworzenie i czysty, pragmatyczny projekt.
f14ec3a7 41
d2a760e3
JK
42%package -n python3-%{module}
43Summary: The web framework for perfectionists with deadlines
44Summary(pl.UTF-8): Szkielet WWW dla perfekcjonistów z ograniczeniami czasowymi
45Group: Libraries/Python
46%pyrequires_eq python3
a0fa853e 47Requires: python3-modules
acf565b6 48Suggests: python3-devel-tools
39cf8c36 49Suggests: python3-MySQLdb
d2a760e3
JK
50Suggests: python3-psycopg2
51
52%description -n python3-%{module}
53Django is a high-level Python Web framework that encourages rapid
54development and clean, pragmatic design.
55
56%description -n python3-%{module} -l pl.UTF-8
57Django to wysokopoziomowy szkielet dla serwisów WWW w Pythonie
58wspierający szybkie tworzenie i czysty, pragmatyczny projekt.
59
36477d4b 60%package doc
61Summary: Documentation on Django
62Summary(de.UTF-8): Dokumentation zu Django
63Summary(es.UTF-8): Documentación para Django
64Summary(fr.UTF-8): Documentation sur Django
65Summary(pl.UTF-8): Dokumentacja do Django
66Group: Documentation
67
68%description doc
69Documentation on Django.
70
71%description doc -l pl.UTF-8
72Dokumentacja 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
82rm -rf $RPM_BUILD_ROOT
36477d4b 83install -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
89cp $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
96cp $RPM_BUILD_ROOT%{_bindir}/{django-admin.py,py3-django-admin}
97%if %{with python2}
98# default to python2 if built
99cp $RPM_BUILD_ROOT%{_bindir}/{py2-django-admin,django-admin.py}
100%endif
101%endif
c053fa9c 102
adda894a 103find $RPM_BUILD_ROOT -type f -name '*.py[co]' | xargs rm
3ef44b33
AM
104find $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
111find $RPM_BUILD_ROOT%{py_sitescriptdir} -type f -name '*.py' -a -not -path '*_template*' | xargs rm
112find $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 120ln -sf python-django-doc-%{version} $RPM_BUILD_ROOT%{_docdir}/python-django-doc
121rm -rf docs/_build/html/_sources
122
c053fa9c
AM
123%clean
124rm -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
This page took 0.091751 seconds and 4 git commands to generate.