]> git.pld-linux.org Git - packages/python-django.git/blame - python-django.spec
Up to 1.8.15
[packages/python-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}
6b608f6c 9Version: 1.8.15
99a17499 10Release: 1
c053fa9c 11License: BSD
70ed983d 12Group: Libraries/Python
39cf8c36 13Source0: http://www.djangoproject.com/m/releases/1.8/Django-%{version}.tar.gz
6b608f6c 14# Source0-md5: d24c3c5fc6d784296693659b05efa70f
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
e9a6c497 25BuildRequires: rpmbuild(macros) >= 1.710
36477d4b 26BuildRequires: sphinx-pdg
c738773c
SP
27Suggests: python-MySQLdb
28Suggests: python-PyGreSQL
99a17499 29Suggests: python-devel-tools
c053fa9c
AM
30BuildArch: noarch
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
34Django is a high-level Python Web framework that encourages rapid
35development and clean, pragmatic design.
36
dff19739
JR
37%description -l pl.UTF-8
38Django to wysokopoziomowy szkielet dla serwisów WWW w Pythonie
39wspierający szybkie tworzenie i czysty, pragmatyczny projekt.
f14ec3a7 40
d2a760e3
JK
41%package -n python3-%{module}
42Summary: The web framework for perfectionists with deadlines
43Summary(pl.UTF-8): Szkielet WWW dla perfekcjonistów z ograniczeniami czasowymi
44Group: Libraries/Python
39cf8c36 45Suggests: python3-MySQLdb
99a17499 46Suggests: python3-devel-tools
d2a760e3
JK
47Suggests: python3-psycopg2
48
49%description -n python3-%{module}
50Django is a high-level Python Web framework that encourages rapid
51development and clean, pragmatic design.
52
53%description -n python3-%{module} -l pl.UTF-8
54Django to wysokopoziomowy szkielet dla serwisów WWW w Pythonie
55wspierający szybkie tworzenie i czysty, pragmatyczny projekt.
56
36477d4b 57%package doc
58Summary: Documentation on Django
59Summary(de.UTF-8): Dokumentation zu Django
60Summary(es.UTF-8): Documentación para Django
61Summary(fr.UTF-8): Documentation sur Django
62Summary(pl.UTF-8): Dokumentacja do Django
63Group: Documentation
64
65%description doc
66Documentation on Django.
67
68%description doc -l pl.UTF-8
69Dokumentacja 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
80rm -r docs/_build/html/_sources
81
e9a6c497
JK
82%if %{with python3}
83%py3_build
84%endif
36477d4b 85
c053fa9c
AM
86%install
87rm -rf $RPM_BUILD_ROOT
d2a760e3 88%if %{with python2}
e9a6c497 89%py_install
755530bf
ER
90%py_postclean
91find $RPM_BUILD_ROOT%{py_sitescriptdir} -type f -path '*_template*' -a -name '*.py[oc]' | xargs rm
92
795498e1
ER
93mv $RPM_BUILD_ROOT%{_bindir}/{django-admin.py,django-admin-2}
94ln -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
99find $RPM_BUILD_ROOT%{py3_sitescriptdir}/django/conf/*_template -name __pycache__ | xargs rm -r
100
795498e1
ER
101mv $RPM_BUILD_ROOT%{_bindir}/{django-admin.py,django-admin-3}
102ln -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
110ln -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 114ln -sf py3-django-admin $RPM_BUILD_ROOT%{_bindir}/django-admin
d2a760e3
JK
115%endif
116%endif
c053fa9c 117
755530bf 118install -d $RPM_BUILD_ROOT%{_docdir}
36477d4b 119ln -sf python-django-doc-%{version} $RPM_BUILD_ROOT%{_docdir}/python-django-doc
36477d4b 120
c053fa9c
AM
121%clean
122rm -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
This page took 0.171238 seconds and 4 git commands to generate.