]>
Commit | Line | Data |
---|---|---|
541670cc MK |
1 | # |
2 | # Conditional build: | |
3 | # %bcond_without doc # don't build doc | |
4 | %bcond_without tests # do not perform "make test" | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module speaklater | |
9 | Summary: Implements a lazy string for python | |
10 | Summary(pl.UTF-8): Implementacja wartościowania leniwego dla Pythona | |
11 | # Name must match the python module/package name (as in 'import' statement) | |
12 | Name: python-%{module} | |
13 | Version: 1.3 | |
e3bc9b07 | 14 | Release: 11 |
541670cc MK |
15 | License: BSD-like |
16 | Group: Libraries/Python | |
17 | Source0: https://pypi.python.org/packages/source/s/%{module}/%{module}-%{version}.tar.gz | |
18 | # Source0-md5: e8d5dbe36e53d5a35cff227e795e8bbf | |
19 | URL: http://github.com/mitsuhiko/speaklater | |
387aff4d | 20 | BuildRequires: rpmbuild(macros) >= 1.710 |
541670cc MK |
21 | BuildRequires: rpm-pythonprov |
22 | %if %{with python2} | |
23 | BuildRequires: python-distribute | |
24 | %endif | |
25 | %if %{with python3} | |
541670cc MK |
26 | BuildRequires: python3-modules |
27 | %endif | |
28 | Requires: python-modules | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | A module that provides lazy strings for translations. Basically you | |
34 | get an object that appears to be a string but changes the value every | |
35 | time the value is evaluated based on a callable you provide. | |
36 | ||
37 | # %description -l pl.UTF-8 | |
38 | ||
39 | %package -n python3-%{module} | |
40 | Summary: - | |
41 | Summary(pl.UTF-8): - | |
42 | Group: Libraries/Python | |
43 | Requires: python3-modules | |
44 | ||
45 | %description -n python3-%{module} | |
46 | ||
47 | %description -n python3-%{module} -l pl.UTF-8 | |
48 | ||
49 | %package apidocs | |
50 | Summary: %{module} API documentation | |
51 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
52 | Group: Documentation | |
53 | ||
54 | %description apidocs | |
55 | API documentation for %{module}. | |
56 | ||
57 | %description apidocs -l pl.UTF-8 | |
58 | Dokumentacja API %{module}. | |
59 | ||
60 | %prep | |
61 | %setup -q -n %{module}-%{version} | |
62 | ||
63 | %build | |
64 | %if %{with python2} | |
e5360f83 | 65 | %py_build %{?with_tests:test} |
541670cc MK |
66 | %endif |
67 | ||
68 | %if %{with python3} | |
e5360f83 | 69 | %py3_build %{?with_tests:test} |
541670cc MK |
70 | %endif |
71 | ||
72 | %install | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %if %{with python2} | |
e5360f83 | 76 | %py_install |
541670cc MK |
77 | |
78 | %py_postclean | |
79 | %endif | |
80 | ||
81 | %if %{with python3} | |
e5360f83 | 82 | %py3_install |
541670cc MK |
83 | %endif |
84 | ||
85 | %clean | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %if %{with python2} | |
89 | %files | |
90 | %defattr(644,root,root,755) | |
91 | %doc LICENSE README | |
92 | %{py_sitescriptdir}/*.py[co] | |
93 | %if "%{py_ver}" > "2.4" | |
94 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
95 | %endif | |
96 | %endif | |
97 | ||
98 | %if %{with python3} | |
99 | %files -n python3-%{module} | |
100 | %defattr(644,root,root,755) | |
101 | %doc LICENSE README | |
102 | %{py3_sitescriptdir}/%{module}.py | |
103 | %{py3_sitescriptdir}/__pycache__/*.py[co] | |
104 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
105 | %endif | |
106 | ||
107 |