]>
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 |
82ce20ba | 14 | Release: 7 |
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 | |
e1b3f161 JB |
38 | %if %{with doc} |
39 | BuildRequires: sphinx-pdg-2 | |
40 | %endif | |
e88f3cee | 41 | Requires: python-modules >= 1:2.7 |
44af3ef0 MK |
42 | BuildArch: noarch |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
44 | ||
45 | %description | |
46 | Flask-Login provides user session management for Flask. It handles the | |
47 | common tasks of logging in, logging out, and remembering your users' | |
48 | sessions over extended periods of time. | |
49 | ||
50 | %description -l pl.UTF-8 | |
e88f3cee JB |
51 | Obsługa zarządzania sesją użytkownika w aplikacjach Flask. Wtyczka |
52 | obsługuje najpopularniejsze przypadki użycia: logowanie, wylogowanie, | |
53 | zapamiętywanie sesji użytkowników przez określony czas. | |
44af3ef0 MK |
54 | |
55 | %package -n python3-%{module} | |
56 | Summary: Flask-Login provides user session management for Flask | |
e88f3cee | 57 | Summary(pl.UTF-8): Obsługa zarządzania sesją użytkownika w aplikacjach Flask |
44af3ef0 | 58 | Group: Libraries/Python |
e88f3cee | 59 | Requires: python3-modules >= 1:3.5 |
44af3ef0 MK |
60 | |
61 | %description -n python3-%{module} | |
62 | Flask-Login provides user session management for Flask. It handles the | |
63 | common tasks of logging in, logging out, and remembering your users' | |
64 | sessions over extended periods of time. | |
65 | ||
66 | %description -n python3-%{module} -l pl.UTF-8 | |
e88f3cee JB |
67 | Obsługa zarządzania sesją użytkownika w aplikacjach Flask. Wtyczka |
68 | obsługuje najpopularniejsze przypadki użycia: logowanie, wylogowanie, | |
69 | zapamiętywanie sesji użytkowników przez określony czas. | |
70 | ||
71 | %package apidocs | |
72 | Summary: API documentation for Python Flask-Login module | |
73 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona Flask-Login | |
74 | Group: Documentation | |
75 | ||
76 | %description apidocs | |
77 | API documentation for Python Flask-Login module. | |
78 | ||
79 | %description apidocs -l pl.UTF-8 | |
80 | Dokumentacja API modułu Pythona Flask-Login. | |
44af3ef0 MK |
81 | |
82 | %prep | |
83 | %setup -q -n Flask-Login-%{version} | |
84 | ||
85 | %build | |
86 | %if %{with python2} | |
38d6fd04 | 87 | %py_build |
e88f3cee JB |
88 | |
89 | %if %{with tests} | |
90 | %{__python} -m unittest test_login | |
91 | %endif | |
44af3ef0 MK |
92 | %endif |
93 | ||
94 | %if %{with python3} | |
38d6fd04 | 95 | %py3_build |
e88f3cee JB |
96 | |
97 | %if %{with tests} | |
98 | %{__python3} -m unittest test_login | |
99 | %endif | |
100 | %endif | |
101 | ||
102 | %if %{with doc} | |
103 | PYTHONPATH=$(pwd) \ | |
104 | %{__make} -C docs html \ | |
105 | SPHINXBUILD=sphinx-build-2 | |
44af3ef0 MK |
106 | %endif |
107 | ||
108 | %install | |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | ||
111 | %if %{with python2} | |
38d6fd04 | 112 | %py_install |
44af3ef0 MK |
113 | |
114 | %py_postclean | |
115 | %endif | |
116 | ||
117 | %if %{with python3} | |
38d6fd04 | 118 | %py3_install |
44af3ef0 MK |
119 | %endif |
120 | ||
121 | %clean | |
122 | rm -rf $RPM_BUILD_ROOT | |
123 | ||
124 | %if %{with python2} | |
125 | %files | |
126 | %defattr(644,root,root,755) | |
8d90d76c AM |
127 | %doc README.md LICENSE |
128 | %{py_sitescriptdir}/flask_login | |
44af3ef0 MK |
129 | %{py_sitescriptdir}/Flask_Login-%{version}-py*.egg-info |
130 | %endif | |
44af3ef0 MK |
131 | |
132 | %if %{with python3} | |
133 | %files -n python3-%{module} | |
134 | %defattr(644,root,root,755) | |
8d90d76c AM |
135 | %doc README.md LICENSE |
136 | %{py3_sitescriptdir}/flask_login | |
44af3ef0 MK |
137 | %{py3_sitescriptdir}/Flask_Login-%{version}-py*.egg-info |
138 | %endif | |
139 | ||
e88f3cee JB |
140 | %if %{with doc} |
141 | %files apidocs | |
142 | %defattr(644,root,root,755) | |
143 | %doc docs/_build/html/{_static,*.html,*.js} | |
144 | %endif |