]> git.pld-linux.org Git - packages/python3-django.git/blob - python-django.spec
distribute is obsolete, BR: python3-setuptools instead
[packages/python3-django.git] / python-django.spec
1 # Conditional build:
2 %bcond_without  python2 # CPython 2.x module
3 %bcond_without  python3 # CPython 3.x module
4
5 %define         module  django
6 Summary:        The web framework for perfectionists with deadlines
7 Summary(pl.UTF-8):      Szkielet WWW dla perfekcjonistów z ograniczeniami czasowymi
8 Name:           python-%{module}
9 Version:        1.8.6
10 Release:        1
11 License:        BSD
12 Group:          Libraries/Python
13 Source0:        http://www.djangoproject.com/m/releases/1.8/Django-%{version}.tar.gz
14 # Source0-md5:  12ba7b57a1f5268f6e8ba555628c0657
15 URL:            http://www.djangoproject.com/
16 %if %{with python2}
17 BuildRequires:  python-devel >= 1:2.7
18 BuildRequires:  python-setuptools
19 %endif
20 %if %{with python3}
21 BuildRequires:  python3-devel >= 1:3.3
22 BuildRequires:  python3-setuptools
23 %endif
24 BuildRequires:  rpm-pythonprov
25 BuildRequires:  sphinx-pdg
26 %pyrequires_eq  python
27 Requires:       python-modules
28 Suggests:       python-devel-tools
29 Suggests:       python-MySQLdb
30 Suggests:       python-PyGreSQL
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
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.
41
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
47 Requires:       python3-modules
48 Suggests:       python3-devel-tools
49 Suggests:       python3-MySQLdb
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
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
74 %prep
75 %setup -q -n Django-%{version}
76
77 %build
78 %{__python} setup.py build
79 %{__make} -C docs html
80
81 %install
82 rm -rf $RPM_BUILD_ROOT
83 install -d $RPM_BUILD_ROOT%{_docdir}
84
85 %if %{with python2}
86 %{__python} setup.py install \
87         --optimize 2 \
88         --root=$RPM_BUILD_ROOT
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
102
103 find $RPM_BUILD_ROOT -type f -name '*.py[co]' | xargs rm
104 find $RPM_BUILD_ROOT -type f -exec sed -i -e "s#$RPM_BUILD_ROOT##g" "{}" ";"
105
106 %if %{with python2}
107 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
108 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
109
110 # %%py_postclean (only for python2!)
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
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
119
120 ln -sf python-django-doc-%{version} $RPM_BUILD_ROOT%{_docdir}/python-django-doc
121 rm -rf docs/_build/html/_sources
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %if %{with python2}
127 %files
128 %defattr(644,root,root,755)
129 %doc README.rst
130 %attr(755,root,root) %{_bindir}/django-admin.py
131 %attr(755,root,root) %{_bindir}/py2-django-admin
132 %{py_sitescriptdir}/%{module}*
133 %{py_sitescriptdir}/Django-*.egg-info
134 %endif
135
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
148 %files doc
149 %defattr(644,root,root,755)
150 %doc docs/_build/html
151 %{_docdir}/python-django-doc
This page took 0.478004 seconds and 3 git commands to generate.