]>
Commit | Line | Data |
---|---|---|
f3362331 | 1 | # TODO: fix tests |
06942a5c MB |
2 | # |
3 | # Conditional build: | |
4 | %bcond_without python2 # build python 2 module | |
5 | %bcond_without python3 # build python 3 module | |
ce76f618 | 6 | %bcond_with tests # unit/functional tests [one fails on py3 as of 0.12.18, probably network is used] |
06942a5c | 7 | # |
d9d42a70 | 8 | %define module bottle |
06942a5c | 9 | # |
d9d42a70 MK |
10 | Summary: Fast and simple WSGI-framework for small web-applications |
11 | Summary(pl.UTF-8): Szybki i prosty szkielet WSGI dla małych aplikacji sieciowych | |
12 | Name: python-%{module} | |
ce76f618 | 13 | Version: 0.12.18 |
7677d578 | 14 | Release: 4 |
d9d42a70 MK |
15 | License: MIT |
16 | Group: Development/Languages/Python | |
f3362331 JB |
17 | #Source0Download: https://pypi.org/simple/bottle/ |
18 | Source0: https://files.pythonhosted.org/packages/source/b/bottle/%{module}-%{version}.tar.gz | |
ce76f618 | 19 | # Source0-md5: a00b7e9a1ab3be7c19c1235fea2ccb40 |
f3362331 | 20 | URL: http://bottlepy.org/ |
06942a5c MB |
21 | %if %{with python2} |
22 | BuildRequires: python-modules >= 1:2.5 | |
f3362331 | 23 | BuildRequires: python-setuptools |
06942a5c MB |
24 | %endif |
25 | %if %{with python3} | |
f3362331 JB |
26 | BuildRequires: python3-devel >= 1:3.2 |
27 | BuildRequires: python3-modules >= 1:3.2 | |
28 | BuildRequires: python3-setuptools | |
06942a5c | 29 | %endif |
d9d42a70 | 30 | BuildRequires: rpm-pythonprov |
f3362331 | 31 | BuildRequires: rpmbuild(macros) >= 1.714 |
06942a5c | 32 | Requires: python-modules >= 1:2.5 |
d9d42a70 MK |
33 | BuildArch: noarch |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | Bottle is a fast and simple micro-framework for small | |
38 | web-applications. It offers request dispatching (Routes) with url | |
39 | parameter support, Templates, a build-in HTTP Server and adapters for | |
40 | many third party WSGI/HTTP-server and template engines. All in a | |
41 | single file and with no dependencies other than the Python Standard | |
42 | Library. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | Bottle jest szybkim i prostym szkieletem dla małych aplikcaji WSGI. | |
46 | Oferuje mapowanie urli poprzez Routes wspierając urle z parametrami, | |
47 | wzroce, wbudowany serwer HTTP i wtyczki dla wielu serwerów WSGI/HTTP i | |
48 | silników wzorców. Wszystko w jednym pliku bez zalezności innych niż | |
49 | standardowej biblioteki Pythona. | |
50 | ||
06942a5c MB |
51 | %package -n python3-%{module} |
52 | Summary: Fast and simple WSGI-framework for small web-applications | |
53 | Summary(pl.UTF-8): Szybki i prosty szkielet WSGI dla małych aplikacji sieciowych | |
54 | Group: Development/Languages/Python | |
55 | Requires: python3-modules | |
56 | ||
57 | %description -n python3-%{module} | |
58 | Bottle is a fast and simple micro-framework for small | |
59 | web-applications. It offers request dispatching (Routes) with url | |
60 | parameter support, Templates, a build-in HTTP Server and adapters for | |
61 | many third party WSGI/HTTP-server and template engines. All in a | |
62 | single file and with no dependencies other than the Python Standard | |
63 | Library. | |
64 | ||
65 | %description -n python3-%{module} -l pl.UTF-8 | |
66 | Bottle jest szybkim i prostym szkieletem dla małych aplikcaji WSGI. | |
67 | Oferuje mapowanie urli poprzez Routes wspierając urle z parametrami, | |
68 | wzroce, wbudowany serwer HTTP i wtyczki dla wielu serwerów WSGI/HTTP i | |
69 | silników wzorców. Wszystko w jednym pliku bez zalezności innych niż | |
70 | standardowej biblioteki Pythona. | |
71 | ||
d9d42a70 MK |
72 | %prep |
73 | %setup -q -n %{module}-%{version} | |
74 | ||
4c21fd30 | 75 | %build |
06942a5c | 76 | %if %{with python2} |
1dac93d3 | 77 | %py_build |
f3362331 JB |
78 | |
79 | %if %{with tests} | |
ce76f618 | 80 | %{__python} test/testall.py |
f3362331 | 81 | %endif |
06942a5c MB |
82 | %endif |
83 | ||
84 | %if %{with python3} | |
1dac93d3 | 85 | %py3_build |
f3362331 JB |
86 | |
87 | %if %{with tests} | |
ce76f618 | 88 | %{__python3} test/testall.py |
f3362331 | 89 | %endif |
06942a5c | 90 | %endif |
d9d42a70 MK |
91 | |
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
06942a5c MB |
94 | |
95 | %if %{with python2} | |
1dac93d3 | 96 | %py_install |
d9d42a70 | 97 | |
f3362331 JB |
98 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{bottle.py,bottle-2} |
99 | ||
d9d42a70 | 100 | %py_postclean |
06942a5c MB |
101 | %endif |
102 | ||
103 | %if %{with python3} | |
1dac93d3 | 104 | %py3_install |
f3362331 JB |
105 | |
106 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{bottle.py,bottle-3} | |
107 | ln -s bootle-3 $RPM_BUILD_ROOT%{_bindir}/bottle | |
06942a5c | 108 | %endif |
d9d42a70 MK |
109 | |
110 | %clean | |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | ||
06942a5c | 113 | %if %{with python2} |
d9d42a70 MK |
114 | %files |
115 | %defattr(644,root,root,755) | |
f3362331 JB |
116 | %doc README.rst |
117 | %attr(755,root,root) %{_bindir}/bottle-2 | |
118 | %{py_sitescriptdir}/bottle.py[co] | |
ce76f618 | 119 | %{py_sitescriptdir}/bottle-%{version}-py*.egg-info |
06942a5c MB |
120 | %endif |
121 | ||
122 | %if %{with python3} | |
123 | %files -n python3-%{module} | |
124 | %defattr(644,root,root,755) | |
f3362331 JB |
125 | %doc README.rst |
126 | %attr(755,root,root) %{_bindir}/bottle | |
127 | %attr(755,root,root) %{_bindir}/bottle-3 | |
128 | %{py3_sitescriptdir}/bottle.py | |
129 | %{py3_sitescriptdir}/__pycache__/bottle.cpython-*.py[co] | |
ce76f618 | 130 | %{py3_sitescriptdir}/bottle-%{version}-py*.egg-info |
06942a5c | 131 | %endif |