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