]> git.pld-linux.org Git - packages/python-pybind11.git/blame - python-pybind11.spec
- rel 1
[packages/python-pybind11.git] / python-pybind11.spec
CommitLineData
42b43fca
JR
1#
2# This is template for pure python modules (noarch)
3# use template-specs/python-ext.spec for binary python packages
4#
5#
6# Conditional build:
7%bcond_without python2 # CPython 2.x module
8%bcond_without python3 # CPython 3.x module
9
10# NOTES:
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
17Summary: Seamless operability between C++11 and Python
18Name: python-%{pypi_name}
19Version: 2.2.4
8eabd08d 20Release: 1
42b43fca
JR
21License: BSD
22Group: Libraries/Python
23Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
24# Source0-md5: 159d9ac0b6570c2888511b14019a2578
25URL: https://pypi.org/project/pybind11/
26BuildRequires: rpmbuild(macros) >= 1.714
27%if %{with python2}
28BuildRequires: python-modules
29BuildRequires: python-setuptools
30BuildRequires: rpm-pythonprov
31%endif
32%if %{with python3}
33BuildRequires: python3-modules
34BuildRequires: python3-setuptools
35%endif
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
39Requires: python-modules
40BuildArch: noarch
41BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43%description
44pybind11 is a lightweight header-only library that exposes C++ types
45in Python and vice versa, mainly to create Python bindings of existing
46C++ code. Its goals and syntax are similar to the excellent
47Boost.Python library by David Abrahams: to minimize boilerplate code
48in traditional extension modules by inferring type information using
49compile-time introspection.
50
51%package -n python3-%{pypi_name}
52Summary: Seamless operability between C++11 and Python
53Group: Libraries/Python
54Requires: python3-modules
55
56%description -n python3-%{pypi_name}
57pybind11 is a lightweight header-only library that exposes C++ types
58in Python and vice versa, mainly to create Python bindings of existing
59C++ code. Its goals and syntax are similar to the excellent
60Boost.Python library by David Abrahams: to minimize boilerplate code
61in traditional extension modules by inferring type information using
62compile-time introspection.
63
64%prep
65%setup -q -n %{pypi_name}-%{version}
66
67%build
68%if %{with python2}
69%py_build
70%endif
71
72%if %{with python3}
73%py3_build
74%endif
75
76%install
77rm -rf $RPM_BUILD_ROOT
78
79%if %{with python2}
80%py_install
81
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}
87
88%py_postclean
89%endif
90
91%if %{with python3}
92%py3_install
93%endif
94
95%clean
96rm -rf $RPM_BUILD_ROOT
97
98%if %{with python2}
99%files
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
105%endif
106
107%if %{with python3}
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
114%endif
This page took 0.078426 seconds and 4 git commands to generate.