]>
Commit | Line | Data |
---|---|---|
0c5794b0 MK |
1 | # |
2 | # Conditional build: | |
2622f07e JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
0c5794b0 MK |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module itsdangerous | |
9 | Summary: Various helpers to pass trusted data to untrusted environments and back | |
2622f07e | 10 | Summary(pl.UTF-8): Wspomaganie przekazywania danych do i z niezaufanych środowisk |
0c5794b0 MK |
11 | Name: python-%{module} |
12 | Version: 0.24 | |
39352019 | 13 | Release: 8 |
0c5794b0 MK |
14 | License: BSD |
15 | Group: Libraries/Python | |
2622f07e JB |
16 | #Source0Download: https://pypi.python.org/simple/itsdangerous |
17 | Source0: http://pypi.python.org/packages/source/i/itsdangerous/%{module}-%{version}.tar.gz | |
0c5794b0 MK |
18 | # Source0-md5: a3d55aa79369aef5345c036a8a26307f |
19 | URL: http://github.com/mitsuhiko/itsdangerous | |
20 | BuildRequires: rpm-pythonprov | |
15ee3af6 | 21 | BuildRequires: rpmbuild(macros) >= 1.710 |
0c5794b0 | 22 | %if %{with python2} |
2622f07e JB |
23 | BuildRequires: python-devel >= 2 |
24 | BuildRequires: python-setuptools | |
0c5794b0 MK |
25 | %endif |
26 | %if %{with python3} | |
2622f07e JB |
27 | BuildRequires: python3-devel >= 1:3.2 |
28 | BuildRequires: python3-modules >= 1:3.2 | |
29 | BuildRequires: python3-setuptools | |
0c5794b0 | 30 | %endif |
2622f07e | 31 | Requires: python-modules >= 2 |
0c5794b0 MK |
32 | BuildArch: noarch |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | Various helpers to pass data to untrusted environments and to get it | |
37 | back safe and sound. | |
38 | ||
2622f07e JB |
39 | %description -l pl.UTF-8 |
40 | Funkcje pomocnicze do przekazywania danych do niezaufanych środowisk i | |
41 | pobierania ich w sposób bezpieczny. | |
0c5794b0 MK |
42 | |
43 | %package -n python3-%{module} | |
44 | Summary: Various helpers to pass data to untrusted environments and to get it back safe and sound | |
45 | Summary(pl.UTF-8): Wspomaganie przekazywania danych do i z niebezpiecznych środowisk | |
46 | Group: Libraries/Python | |
2622f07e | 47 | Requires: python3-modules >= 1:3.2 |
0c5794b0 MK |
48 | |
49 | %description -n python3-%{module} | |
2622f07e JB |
50 | Various helpers to pass data to untrusted environments and to get it |
51 | back safe and sound. | |
0c5794b0 MK |
52 | |
53 | %description -n python3-%{module} -l pl.UTF-8 | |
2622f07e JB |
54 | Funkcje pomocnicze do przekazywania danych do niezaufanych środowisk i |
55 | pobierania ich w sposób bezpieczny. | |
0c5794b0 MK |
56 | |
57 | %package apidocs | |
2622f07e JB |
58 | Summary: Documentation for Python itsdangerous module |
59 | Summary(pl.UTF-8): Dokumentacja do moduły Pythona itsdangerous | |
0c5794b0 MK |
60 | Group: Documentation |
61 | ||
62 | %description apidocs | |
2622f07e | 63 | Documentation for Python itsdangerous module. |
0c5794b0 MK |
64 | |
65 | %description apidocs -l pl.UTF-8 | |
2622f07e | 66 | Dokumentacja do moduły Pythona itsdangerous. |
0c5794b0 MK |
67 | |
68 | %prep | |
69 | %setup -q -n %{module}-%{version} | |
70 | ||
0c5794b0 MK |
71 | %build |
72 | %if %{with python2} | |
defb94e4 | 73 | %py_build %{?with_tests:test} |
0c5794b0 MK |
74 | %endif |
75 | ||
76 | %if %{with python3} | |
defb94e4 | 77 | %py3_build %{?with_tests:test} |
0c5794b0 MK |
78 | %endif |
79 | ||
80 | %if %{with doc} | |
2622f07e | 81 | %{__make} -C docs html |
0c5794b0 MK |
82 | %endif |
83 | ||
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
87 | %if %{with python2} | |
defb94e4 | 88 | %py_install |
0c5794b0 MK |
89 | |
90 | %py_postclean | |
91 | %endif | |
92 | ||
93 | %if %{with python3} | |
defb94e4 | 94 | %py3_install |
0c5794b0 MK |
95 | %endif |
96 | ||
97 | %clean | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
100 | %if %{with python2} | |
101 | %files | |
102 | %defattr(644,root,root,755) | |
2622f07e JB |
103 | %doc CHANGES LICENSE README |
104 | %{py_sitescriptdir}/itsdangerous.py[co] | |
0c5794b0 | 105 | %if "%{py_ver}" > "2.4" |
2622f07e | 106 | %{py_sitescriptdir}/itsdangerous-%{version}-py*.egg-info |
0c5794b0 MK |
107 | %endif |
108 | %endif | |
109 | ||
110 | %if %{with python3} | |
111 | %files -n python3-%{module} | |
112 | %defattr(644,root,root,755) | |
2622f07e JB |
113 | %doc CHANGES LICENSE README |
114 | %{py3_sitescriptdir}/itsdangerous.py | |
115 | %{py3_sitescriptdir}/__pycache__/itsdangerous.cpython-*.py[co] | |
116 | %{py3_sitescriptdir}/itsdangerous-%{version}-py*.egg-info | |
0c5794b0 MK |
117 | %endif |
118 | ||
119 | %if %{with doc} | |
120 | %files apidocs | |
121 | %defattr(644,root,root,755) | |
2622f07e | 122 | %doc docs/_build/html/{_static,*.html,*.js} |
0c5794b0 | 123 | %endif |