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