]>
Commit | Line | Data |
---|---|---|
2a13e954 MK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with doc # don't build doc (not provided by package) | |
4 | %bcond_with tests # do not perform "make test" (not provided by package) | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module blinker | |
9 | Summary: Fast, simple object-to-object and broadcast signaling | |
10 | Summary(pl.UTF-8): Szybkie, proste przesyłanie sygnałów pomiędzy obiektami | |
11 | # Name must match the python module/package name (as in 'import' statement) | |
12 | Name: python-%{module} | |
13 | Version: 1.3 | |
b68a014d | 14 | Release: 2 |
2a13e954 MK |
15 | License: MIT |
16 | Group: Libraries/Python | |
17 | Source0: https://pypi.python.org/packages/source/b/%{module}/%{module}-%{version}.tar.gz | |
18 | # Source0-md5: 66e9688f2d287593a0e698cd8a5fbc57 | |
19 | URL: http://pythonhosted.org/blinker/ | |
20 | BuildRequires: rpm-pythonprov | |
21 | # if py_postclean is used | |
22 | BuildRequires: rpmbuild(macros) >= 1.219 | |
23 | # when using /usr/bin/env or other in-place substitutions | |
24 | #BuildRequires: sed >= 4.0 | |
25 | %if %{with python2} | |
26 | BuildRequires: python-distribute | |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3-distribute | |
30 | BuildRequires: python3-modules | |
31 | %endif | |
32 | # Below Rs only work for main package (python2) | |
33 | #Requires: python-libs | |
34 | Requires: python-modules | |
35 | BuildArch: noarch | |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description | |
39 | Blinker provides a fast dispatching system that allows any number of | |
40 | interested parties to subscribe to events, or "signals". Signal | |
41 | receivers can subscribe to specific senders or receive signals sent by | |
42 | any sender. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | Blinker dostarcza szybki system rozporowadzania sygnałów który | |
46 | pozawala na dowolną liczbe odbiorców zdarzeń czy szygnałów. Odbiorcy | |
47 | sygnałów mogą zapisywac się do wybranych nadawców czy odbierać sygnały | |
48 | nadadane przez wszystkich nadawców. | |
49 | ||
50 | %package -n python3-%{module} | |
51 | Summary: - | |
52 | Summary(pl.UTF-8): - | |
53 | Group: Libraries/Python | |
54 | Requires: python3-modules | |
55 | ||
56 | %description -n python3-%{module} | |
57 | Blinker provides a fast dispatching system that allows any number of | |
58 | interested parties to subscribe to events, or "signals". Signal | |
59 | receivers can subscribe to specific senders or receive signals sent by | |
60 | any sender. | |
61 | ||
62 | %description -n python3-%{module} -l pl.UTF-8 | |
63 | Blinker dostarcza szybki system rozporowadzania sygnałów który | |
64 | pozawala na dowolną liczbe odbiorców zdarzeń czy szygnałów. Odbiorcy | |
65 | sygnałów mogą zapisywac się do wybranych nadawców czy odbierać sygnały | |
66 | nadadane przez wszystkich nadawców. | |
67 | ||
68 | %package apidocs | |
69 | Summary: %{module} API documentation | |
70 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
71 | Group: Documentation | |
72 | ||
73 | %description apidocs | |
74 | API documentation for %{module}. | |
75 | ||
76 | %description apidocs -l pl.UTF-8 | |
77 | Dokumentacja API %{module}. | |
78 | ||
79 | %prep | |
80 | %setup -q -n %{module}-%{version} | |
81 | ||
82 | %build | |
83 | %if %{with python2} | |
84 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
88 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
89 | %endif | |
90 | ||
91 | %if %{with doc} | |
92 | cd docs | |
93 | %{__make} -j1 html | |
94 | rm -rf _build/html/_sources | |
95 | %endif | |
96 | ||
97 | %install | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
100 | %if %{with python2} | |
101 | %{__python} setup.py \ | |
102 | build --build-base build-2 \ | |
103 | install --skip-build \ | |
104 | --optimize=2 \ | |
105 | --root=$RPM_BUILD_ROOT | |
106 | ||
107 | %py_postclean | |
108 | %endif | |
109 | ||
110 | %if %{with python3} | |
111 | %{__python3} setup.py \ | |
112 | build --build-base build-3 \ | |
113 | install --skip-build \ | |
114 | --optimize=2 \ | |
115 | --root=$RPM_BUILD_ROOT | |
116 | %endif | |
117 | ||
118 | %clean | |
119 | rm -rf $RPM_BUILD_ROOT | |
120 | ||
121 | %if %{with python2} | |
122 | %files | |
123 | %defattr(644,root,root,755) | |
124 | %doc AUTHORS CHANGES README LICENSE | |
125 | %dir %{py_sitescriptdir}/%{module} | |
126 | %{py_sitescriptdir}/%{module}/*.py[co] | |
127 | %if "%{py_ver}" > "2.4" | |
128 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
129 | %endif | |
130 | %endif | |
131 | ||
132 | %if %{with python3} | |
133 | %files -n python3-%{module} | |
134 | %defattr(644,root,root,755) | |
135 | %doc AUTHORS CHANGES README LICENSE | |
136 | %{py3_sitescriptdir}/%{module} | |
137 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
138 | %endif | |
139 | ||
140 | %if %{with doc} | |
141 | %files apidocs | |
142 | %defattr(644,root,root,755) | |
143 | %doc docs/_build/html/* | |
144 | %endif |