2 # This is template for pure python modules (noarch)
3 # use template-specs/python-ext.spec for binary python packages
7 %bcond_without python2 # CPython 2.x module
8 %bcond_without python3 # CPython 3.x module
11 # - 'module' should match the Python import path (first component?)
12 # - 'egg_name' should equal to Python egg name
13 # - 'pypi_name' must match the Python Package Index name
14 %define module pybind11
15 %define egg_name pybind11
16 %define pypi_name pybind11
17 Summary: Seamless operability between C++11 and Python
18 Name: python-%{pypi_name}
22 Group: Libraries/Python
23 Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
24 # Source0-md5: 159d9ac0b6570c2888511b14019a2578
25 URL: https://pypi.org/project/pybind11/
26 BuildRequires: rpmbuild(macros) >= 1.714
28 BuildRequires: python-modules
29 BuildRequires: python-setuptools
30 BuildRequires: rpm-pythonprov
33 BuildRequires: python3-modules
34 BuildRequires: python3-setuptools
36 # when using /usr/bin/env or other in-place substitutions
37 #BuildRequires: sed >= 4.0
38 # replace with other requires if defined in setup.py
39 Requires: python-modules
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 pybind11 is a lightweight header-only library that exposes C++ types
45 in Python and vice versa, mainly to create Python bindings of existing
46 C++ code. Its goals and syntax are similar to the excellent
47 Boost.Python library by David Abrahams: to minimize boilerplate code
48 in traditional extension modules by inferring type information using
49 compile-time introspection.
51 %package -n python3-%{pypi_name}
52 Summary: Seamless operability between C++11 and Python
53 Group: Libraries/Python
54 Requires: python3-modules
56 %description -n python3-%{pypi_name}
57 pybind11 is a lightweight header-only library that exposes C++ types
58 in Python and vice versa, mainly to create Python bindings of existing
59 C++ code. Its goals and syntax are similar to the excellent
60 Boost.Python library by David Abrahams: to minimize boilerplate code
61 in traditional extension modules by inferring type information using
62 compile-time introspection.
65 %setup -q -n %{pypi_name}-%{version}
77 rm -rf $RPM_BUILD_ROOT
82 # when files are installed in other way that standard 'setup.py
83 # they need to be (re-)compiled
84 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
85 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
86 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
96 rm -rf $RPM_BUILD_ROOT
100 %defattr(644,root,root,755)
101 %doc CONTRIBUTING.md README.md
102 %{py_sitescriptdir}/%{module}
103 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
104 %{py_incdir}/pybind11
108 %files -n python3-%{pypi_name}
109 %defattr(644,root,root,755)
110 %doc CONTRIBUTING.md README.md
111 %{py3_sitescriptdir}/%{module}
112 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
113 %{py3_incdir}/pybind11