3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 %define module pybind11
7 %define egg_name pybind11
8 %define pypi_name pybind11
9 Summary: Seamless operability between C++11 and Python
10 Summary(pl.UTF-8): Gładka współpraca między C++11 a Pythonem
11 Name: python-%{pypi_name}
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/pybind11/
17 Source0: https://github.com/pybind/pybind11/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
18 # Source0-md5: 7609dcb4e6e18eee9dc1a5f26572ded1
19 URL: https://pypi.org/project/pybind11/
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-modules >= 1:2.7
24 BuildRequires: python-setuptools
27 BuildRequires: python3-modules >= 1:3.2
28 BuildRequires: python3-setuptools
30 Requires: libstdc++-devel >= 6:4.7
31 Requires: python-devel >= 1:2.7
32 Conflicts: eigen3 < 3.2.7
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 pybind11 is a lightweight header-only library that exposes C++ types
38 in Python and vice versa, mainly to create Python bindings of existing
39 C++ code. Its goals and syntax are similar to the excellent
40 Boost.Python library by David Abrahams: to minimize boilerplate code
41 in traditional extension modules by inferring type information using
42 compile-time introspection.
44 %description -l pl.UTF-8
45 pybind11 to lekka, składająca się z samych nagłówków biblioteka
46 udostępniająca typy C++ w Pythonie i na odwrót, służąca głównie do
47 tworzenia wiązań Pythona do istniejącego kodu w C++. Cele i składnia
48 są podobne do biblioteki Boost.Python autorstwa Davida Abrahamsa - aby
49 zminimalizować kod wiążący w tradycyjnych modułach rozszerzeń poprzez
50 wnioskowanie informacji o typach przy użyciu introspekcji w trakcie
53 %package -n python3-%{pypi_name}
54 Summary: Seamless operability between C++11 and Python
55 Summary(pl.UTF-8): Gładka współpraca między C++11 a Pythonem
56 Group: Libraries/Python
57 Requires: libstdc++-devel >= 6:4.7
58 Requires: python3-devel >= 1:3.2
59 Conflicts: eigen3 < 3.2.7
61 %description -n python3-%{pypi_name}
62 pybind11 is a lightweight header-only library that exposes C++ types
63 in Python and vice versa, mainly to create Python bindings of existing
64 C++ code. Its goals and syntax are similar to the excellent
65 Boost.Python library by David Abrahams: to minimize boilerplate code
66 in traditional extension modules by inferring type information using
67 compile-time introspection.
69 %description -n python3-%{pypi_name} -l pl.UTF-8
70 pybind11 to lekka, składająca się z samych nagłówków biblioteka
71 udostępniająca typy C++ w Pythonie i na odwrót, służąca głównie do
72 tworzenia wiązań Pythona do istniejącego kodu w C++. Cele i składnia
73 są podobne do biblioteki Boost.Python autorstwa Davida Abrahamsa - aby
74 zminimalizować kod wiążący w tradycyjnych modułach rozszerzeń poprzez
75 wnioskowanie informacji o typach przy użyciu introspekcji w trakcie
79 %setup -q -n %{pypi_name}-%{version}
91 %cmake -B $py -DCMAKE_BUILD_TYPE=Debug -DPYTHON_EXECUTABLE=%{_bindir}/$py -DPYBIND11_INSTALL=TRUE -DUSE_PYTHON_INCLUDE_DIR=FALSE -DPYBIND11_TEST=OFF
104 rm -rf $RPM_BUILD_ROOT
107 %{__make} install -C python2 DESTDIR=$RPM_BUILD_ROOT
114 %{__make} install -C python3 DESTDIR=$RPM_BUILD_ROOT
119 rm -rf $RPM_BUILD_ROOT
123 %defattr(644,root,root,755)
124 %doc LICENSE README.rst
125 %{py_sitescriptdir}/%{module}
126 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
130 %files -n python3-%{pypi_name}
131 %defattr(644,root,root,755)
132 %doc LICENSE README.rst
133 %attr(755,root,root) %{_bindir}/pybind11-config
134 %{py3_sitescriptdir}/%{module}
135 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
136 %{_includedir}/%{module}
137 %{_datadir}/cmake/pybind11