]>
Commit | Line | Data |
---|---|---|
44af3ef0 MK |
1 | # |
2 | # Conditional build: | |
e88f3cee JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_with python3 # CPython 3.x module | |
44af3ef0 | 7 | |
e88f3cee | 8 | %define module flask-login |
44af3ef0 | 9 | Summary: Flask-Login provides user session management for Flask |
e88f3cee | 10 | Summary(pl.UTF-8): Obsługa zarządzania sesją użytkownika w aplikacjach Flask |
44af3ef0 | 11 | Name: python-%{module} |
e88f3cee | 12 | # keep python2 compatible version (0.5.x) here |
662a3fd3 | 13 | Version: 0.5.0 |
f0c1e36b | 14 | Release: 6 |
44af3ef0 MK |
15 | License: MIT |
16 | Group: Libraries/Python | |
e88f3cee | 17 | Source0: https://files.pythonhosted.org/packages/source/F/Flask-Login/Flask-Login-%{version}.tar.gz |
662a3fd3 | 18 | # Source0-md5: a2d94aa6ae935345ebc68eb3cbb5fccd |
44af3ef0 | 19 | URL: https://github.com/maxcountryman/flask-login/ |
44af3ef0 | 20 | %if %{with python2} |
e88f3cee JB |
21 | BuildRequires: python-modules >= 1:2.7 |
22 | BuildRequires: python-setuptools | |
23 | %if %{with tests} | |
24 | BuildRequires: python-flask | |
25 | BuildRequires: python-semantic_version | |
26 | %endif | |
44af3ef0 MK |
27 | %endif |
28 | %if %{with python3} | |
e88f3cee JB |
29 | BuildRequires: python3-modules >= 1:3.5 |
30 | BuildRequires: python3-setuptools | |
31 | %if %{with tests} | |
32 | BuildRequires: python3-flask | |
33 | BuildRequires: python3-semantic_version | |
44af3ef0 | 34 | %endif |
e88f3cee JB |
35 | %endif |
36 | BuildRequires: rpm-pythonprov | |
37 | BuildRequires: rpmbuild(macros) >= 1.714 | |
38 | Requires: python-modules >= 1:2.7 | |
44af3ef0 MK |
39 | BuildArch: noarch |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | Flask-Login provides user session management for Flask. It handles the | |
44 | common tasks of logging in, logging out, and remembering your users' | |
45 | sessions over extended periods of time. | |
46 | ||
47 | %description -l pl.UTF-8 | |
e88f3cee JB |
48 | Obsługa zarządzania sesją użytkownika w aplikacjach Flask. Wtyczka |
49 | obsługuje najpopularniejsze przypadki użycia: logowanie, wylogowanie, | |
50 | zapamiętywanie sesji użytkowników przez określony czas. | |
44af3ef0 MK |
51 | |
52 | %package -n python3-%{module} | |
53 | Summary: Flask-Login provides user session management for Flask | |
e88f3cee | 54 | Summary(pl.UTF-8): Obsługa zarządzania sesją użytkownika w aplikacjach Flask |
44af3ef0 | 55 | Group: Libraries/Python |
e88f3cee | 56 | Requires: python3-modules >= 1:3.5 |
44af3ef0 MK |
57 | |
58 | %description -n python3-%{module} | |
59 | Flask-Login provides user session management for Flask. It handles the | |
60 | common tasks of logging in, logging out, and remembering your users' | |
61 | sessions over extended periods of time. | |
62 | ||
63 | %description -n python3-%{module} -l pl.UTF-8 | |
e88f3cee JB |
64 | Obsługa zarządzania sesją użytkownika w aplikacjach Flask. Wtyczka |
65 | obsługuje najpopularniejsze przypadki użycia: logowanie, wylogowanie, | |
66 | zapamiętywanie sesji użytkowników przez określony czas. | |
67 | ||
68 | %package apidocs | |
69 | Summary: API documentation for Python Flask-Login module | |
70 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona Flask-Login | |
71 | Group: Documentation | |
72 | ||
73 | %description apidocs | |
74 | API documentation for Python Flask-Login module. | |
75 | ||
76 | %description apidocs -l pl.UTF-8 | |
77 | Dokumentacja API modułu Pythona Flask-Login. | |
44af3ef0 MK |
78 | |
79 | %prep | |
80 | %setup -q -n Flask-Login-%{version} | |
81 | ||
82 | %build | |
83 | %if %{with python2} | |
38d6fd04 | 84 | %py_build |
e88f3cee JB |
85 | |
86 | %if %{with tests} | |
87 | %{__python} -m unittest test_login | |
88 | %endif | |
44af3ef0 MK |
89 | %endif |
90 | ||
91 | %if %{with python3} | |
38d6fd04 | 92 | %py3_build |
e88f3cee JB |
93 | |
94 | %if %{with tests} | |
95 | %{__python3} -m unittest test_login | |
96 | %endif | |
97 | %endif | |
98 | ||
99 | %if %{with doc} | |
100 | PYTHONPATH=$(pwd) \ | |
101 | %{__make} -C docs html \ | |
102 | SPHINXBUILD=sphinx-build-2 | |
44af3ef0 MK |
103 | %endif |
104 | ||
105 | %install | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %if %{with python2} | |
38d6fd04 | 109 | %py_install |
44af3ef0 MK |
110 | |
111 | %py_postclean | |
112 | %endif | |
113 | ||
114 | %if %{with python3} | |
38d6fd04 | 115 | %py3_install |
44af3ef0 MK |
116 | %endif |
117 | ||
118 | %clean | |
119 | rm -rf $RPM_BUILD_ROOT | |
120 | ||
121 | %if %{with python2} | |
122 | %files | |
123 | %defattr(644,root,root,755) | |
8d90d76c AM |
124 | %doc README.md LICENSE |
125 | %{py_sitescriptdir}/flask_login | |
44af3ef0 MK |
126 | %{py_sitescriptdir}/Flask_Login-%{version}-py*.egg-info |
127 | %endif | |
44af3ef0 MK |
128 | |
129 | %if %{with python3} | |
130 | %files -n python3-%{module} | |
131 | %defattr(644,root,root,755) | |
8d90d76c AM |
132 | %doc README.md LICENSE |
133 | %{py3_sitescriptdir}/flask_login | |
44af3ef0 MK |
134 | %{py3_sitescriptdir}/Flask_Login-%{version}-py*.egg-info |
135 | %endif | |
136 | ||
e88f3cee JB |
137 | %if %{with doc} |
138 | %files apidocs | |
139 | %defattr(644,root,root,755) | |
140 | %doc docs/_build/html/{_static,*.html,*.js} | |
141 | %endif |