]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module msgpack | |
8 | %define pypi_name msgpack-python | |
9 | Summary: Binary-based efficient data interchange format | |
10 | Summary(pl.UTF-8): Binarny, efektywny format wymiany danych | |
11 | Name: python-%{module} | |
12 | Version: 1.0.0 | |
13 | Release: 2 | |
14 | License: Apache v2.0 | |
15 | Group: Development/Languages/Python | |
16 | Source0: https://pypi.debian.net/msgpack/%{module}-%{version}.tar.gz | |
17 | # Source0-md5: c35ee8f991dad3969884e9585e56ebba | |
18 | URL: http://msgpack.org/ | |
19 | BuildRequires: libstdc++-devel | |
20 | BuildRequires: rpm-pythonprov | |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | %if %{with python2} | |
23 | BuildRequires: python-modules >= 1:2.7 | |
24 | BuildRequires: python-setuptools | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-devel >= 1:3.5 | |
28 | BuildRequires: python3-modules | |
29 | BuildRequires: python3-setuptools | |
30 | %endif | |
31 | Requires: python-modules >= 1:2.7 | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | MessagePack is a binary-based efficient object serialization library. | |
36 | It enables to exchange structured objects between many languages like | |
37 | JSON. But unlike JSON, it is very fast and small. | |
38 | ||
39 | %description -l pl.UTF-8 | |
40 | MessagePack to biblioteka do binarnej, efektywnej serializacji | |
41 | obiektów. Pozwala wymieniać strukturalne obiekty pomiędzy wieloma | |
42 | językami, podobnie jak JSON. W odróżnieniu od JSON-a jest bardzo | |
43 | szybka i mała. | |
44 | ||
45 | %package -n python3-%{module} | |
46 | Summary: Binary-based efficient data interchange format | |
47 | Summary(pl.UTF-8): Binarny, efektywny format wymiany danych | |
48 | Group: Libraries/Python | |
49 | Requires: python3-modules >= 1:3.5 | |
50 | ||
51 | %description -n python3-%{module} | |
52 | MessagePack is a binary-based efficient object serialization library. | |
53 | It enables to exchange structured objects between many languages like | |
54 | JSON. But unlike JSON, it is very fast and small. | |
55 | ||
56 | %description -n python3-%{module} -l pl.UTF-8 | |
57 | MessagePack to biblioteka do binarnej, efektywnej serializacji | |
58 | obiektów. Pozwala wymieniać strukturalne obiekty pomiędzy wieloma | |
59 | językami, podobnie jak JSON. W odróżnieniu od JSON-a jest bardzo | |
60 | szybka i mała. | |
61 | ||
62 | %prep | |
63 | %setup -q -n %{module}-%{version} | |
64 | ||
65 | %build | |
66 | %if %{with python2} | |
67 | %py_build | |
68 | ||
69 | %if %{with tests} | |
70 | %{__python} -m pytest test | |
71 | %endif | |
72 | %endif | |
73 | ||
74 | %if %{with python3} | |
75 | %py3_build | |
76 | ||
77 | %if %{with tests} | |
78 | %{__python3} -m pytest test | |
79 | %endif | |
80 | %endif | |
81 | ||
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %if %{with python2} | |
86 | %py_install | |
87 | ||
88 | %py_postclean | |
89 | %endif | |
90 | ||
91 | %if %{with python3} | |
92 | %py3_install | |
93 | %endif | |
94 | ||
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %if %{with python2} | |
99 | %files | |
100 | %defattr(644,root,root,755) | |
101 | %doc COPYING README.md | |
102 | %dir %{py_sitescriptdir}/%{module} | |
103 | %{py_sitescriptdir}/%{module}/*.py[co] | |
104 | %{py_sitescriptdir}/msgpack-%{version}-py*.egg-info | |
105 | %endif | |
106 | ||
107 | %if %{with python3} | |
108 | %files -n python3-%{module} | |
109 | %defattr(644,root,root,755) | |
110 | %doc COPYING README.md | |
111 | %dir %{py3_sitedir}/%{module} | |
112 | %attr(755,root,root) %{py3_sitedir}/%{module}/_cmsgpack.cpython-*.so | |
113 | %{py3_sitedir}/%{module}/*.py | |
114 | %{py3_sitedir}/%{module}/__pycache__ | |
115 | %{py3_sitedir}/msgpack-%{version}-py*.egg-info | |
116 | %endif |