]> git.pld-linux.org Git - packages/python-django.git/blob - python-django.spec
Up to 1.8.15
[packages/python-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.15
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:  d24c3c5fc6d784296693659b05efa70f
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:  rpmbuild(macros) >= 1.710
26 BuildRequires:  sphinx-pdg
27 Suggests:       python-MySQLdb
28 Suggests:       python-PyGreSQL
29 Suggests:       python-devel-tools
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
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.
40
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
45 Suggests:       python3-MySQLdb
46 Suggests:       python3-devel-tools
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
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
71 %prep
72 %setup -q -n Django-%{version}
73
74 %build
75 %if %{with python2}
76 %py_build
77 %endif
78
79 %{__make} -C docs html
80 rm -r docs/_build/html/_sources
81
82 %if %{with python3}
83 %py3_build
84 %endif
85
86 %install
87 rm -rf $RPM_BUILD_ROOT
88 %if %{with python2}
89 %py_install
90 %py_postclean
91 find $RPM_BUILD_ROOT%{py_sitescriptdir} -type f -path '*_template*' -a -name '*.py[oc]' | xargs rm
92
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
95 %endif
96
97 %if %{with python3}
98 %py3_install
99 find $RPM_BUILD_ROOT%{py3_sitescriptdir}/django/conf/*_template -name __pycache__ | xargs rm -r
100
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
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
111 # default to python2 if built
112 %else
113 %if %{with python3}
114 ln -sf py3-django-admin $RPM_BUILD_ROOT%{_bindir}/django-admin
115 %endif
116 %endif
117
118 install -d $RPM_BUILD_ROOT%{_docdir}
119 ln -sf python-django-doc-%{version} $RPM_BUILD_ROOT%{_docdir}/python-django-doc
120
121 %clean
122 rm -rf $RPM_BUILD_ROOT
123
124 %if %{with python2}
125 %files
126 %defattr(644,root,root,755)
127 %doc README.rst
128 %attr(755,root,root) %{_bindir}/django-admin
129 %attr(755,root,root) %{_bindir}/py2-django-admin
130 %attr(755,root,root) %{_bindir}/django-admin-2
131 %{py_sitescriptdir}/%{module}*
132 %{py_sitescriptdir}/Django-*.egg-info
133 %endif
134
135 %if %{with python3}
136 %files -n python3-%{module}
137 %defattr(644,root,root,755)
138 %doc README.rst
139 %if %{without python2}
140 %attr(755,root,root) %{_bindir}/django-admin
141 %endif
142 %attr(755,root,root) %{_bindir}/py3-django-admin
143 %attr(755,root,root) %{_bindir}/django-admin-3
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.072324 seconds and 3 git commands to generate.