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