]>
Commit | Line | Data |
---|---|---|
df80b467 MK |
1 | # |
2 | # Conditional build: | |
2d81bbdb | 3 | %bcond_with doc # don't build doc |
df80b467 MK |
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 | |
dfacf687 | 7 | |
2fb16dc5 | 8 | %define module msgpack |
2d81bbdb | 9 | %define pypi_name msgpack-python |
dfacf687 MK |
10 | Summary: Binary-based efficient data interchange format |
11 | Summary(pl.UTF-8): Binarny efektywny format wymiany danych. | |
12 | Name: python-%{module} | |
2fb16dc5 JR |
13 | Version: 1.0.0 |
14 | Release: 1 | |
dfacf687 MK |
15 | License: ASL |
16 | Group: Development/Languages/Python | |
278786e8 | 17 | Source0: https://pypi.debian.net/msgpack/%{module}-%{version}.tar.gz |
2fb16dc5 | 18 | # Source0-md5: c35ee8f991dad3969884e9585e56ebba |
dfacf687 | 19 | URL: http://msgpack.org/ |
a575d636 | 20 | BuildRequires: libstdc++-devel |
dfacf687 | 21 | BuildRequires: rpm-pythonprov |
b300a6a8 | 22 | BuildRequires: rpmbuild(macros) >= 1.710 |
df80b467 MK |
23 | %if %{with python2} |
24 | BuildRequires: python-devel | |
25 | BuildRequires: python-distribute | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-devel | |
29 | BuildRequires: python3-distribute | |
30 | BuildRequires: python3-modules | |
31 | %endif | |
dfacf687 MK |
32 | Requires: python-modules |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | MessagePack is a binary-based efficient object serialization library. | |
37 | It enables to exchange structured objects between many languages like | |
38 | JSON. But unlike JSON, it is very fast and small. | |
39 | ||
40 | %description -l pl.UTF-8 | |
41 | MessagePack jest binarną, efektywną biblioteką serializacji obiektów. | |
42 | Pozwala wymieniać strukturalne obiekty pomiędzy wieloma językami | |
43 | podobnie jak JSON. W odróżnieniu jest bardzo szybka i mała. | |
44 | ||
df80b467 | 45 | %package -n python3-%{module} |
2d81bbdb ER |
46 | Summary: Binary-based efficient data interchange format |
47 | Summary(pl.UTF-8): Binarny efektywny format wymiany danych. | |
df80b467 MK |
48 | Group: Libraries/Python |
49 | Requires: python3-modules | |
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 jest binarną, efektywną biblioteką serializacji obiektów. | |
58 | Pozwala wymieniać strukturalne obiekty pomiędzy wieloma językami | |
59 | podobnie jak JSON. W odróżnieniu jest bardzo szybka i mała. | |
60 | ||
61 | %package apidocs | |
62 | Summary: %{module} API documentation | |
63 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
64 | Group: Documentation | |
65 | ||
66 | %description apidocs | |
67 | API documentation for %{module}. | |
68 | ||
69 | %description apidocs -l pl.UTF-8 | |
70 | Dokumentacja API %{module}. | |
71 | ||
dfacf687 | 72 | %prep |
278786e8 | 73 | %setup -q -n %{module}-%{version} |
dfacf687 MK |
74 | |
75 | %build | |
df80b467 | 76 | %if %{with python2} |
5b646f98 | 77 | %py_build %{?with_tests:test} |
df80b467 MK |
78 | %endif |
79 | ||
80 | %if %{with python3} | |
5b646f98 | 81 | %py3_build %{?with_tests:test} |
df80b467 MK |
82 | %endif |
83 | ||
84 | %if %{with doc} | |
85 | cd docs | |
86 | %{__make} -j1 html | |
87 | rm -rf _build/html/_sources | |
88 | %endif | |
dfacf687 MK |
89 | |
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
df80b467 | 92 | %if %{with python2} |
5b646f98 | 93 | %py_install |
dfacf687 | 94 | %py_postclean |
df80b467 MK |
95 | %endif |
96 | ||
97 | %if %{with python3} | |
5b646f98 | 98 | %py3_install |
df80b467 | 99 | %endif |
dfacf687 MK |
100 | |
101 | %clean | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
df80b467 | 104 | %if %{with python2} |
dfacf687 MK |
105 | %files |
106 | %defattr(644,root,root,755) | |
2fb16dc5 JR |
107 | %doc COPYING README.md |
108 | %dir %{py_sitescriptdir}/%{module} | |
109 | %{py_sitescriptdir}/%{module}/*.py[co] | |
110 | %{py_sitescriptdir}/msgpack-%{version}-py*.egg-info | |
df80b467 | 111 | %endif |
df80b467 MK |
112 | |
113 | %if %{with python3} | |
114 | %files -n python3-%{module} | |
115 | %defattr(644,root,root,755) | |
2fb16dc5 | 116 | %doc COPYING README.md |
df80b467 | 117 | %dir %{py3_sitedir}/%{module} |
2fb16dc5 | 118 | %attr(755,root,root) %{py3_sitedir}/%{module}/_cmsgpack.cpython-*.so |
df80b467 MK |
119 | %{py3_sitedir}/%{module}/*.py |
120 | %{py3_sitedir}/%{module}/__pycache__ | |
278786e8 | 121 | %{py3_sitedir}/msgpack-%{version}-py*.egg-info |
df80b467 MK |
122 | %endif |
123 | ||
124 | %if %{with doc} | |
125 | %files apidocs | |
126 | %defattr(644,root,root,755) | |
127 | %doc docs/_build/html/* | |
dfacf687 | 128 | %endif |