]> git.pld-linux.org Git - packages/python-pybind11.git/blob - python-pybind11.spec
deb516ca8d943489cf21b22858798f355d76b9a6
[packages/python-pybind11.git] / python-pybind11.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5
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}
12 Version:        2.9.1
13 Release:        3
14 License:        BSD
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
22 %if %{with python2}
23 BuildRequires:  python-modules >= 1:2.7
24 BuildRequires:  python-setuptools
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-modules >= 1:3.2
28 BuildRequires:  python3-setuptools
29 %endif
30 Requires:       libstdc++-devel >= 6:4.7
31 Requires:       python-devel >= 1:2.7
32 Conflicts:      eigen3 < 3.2.7
33 BuildArch:      noarch
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %description
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.
43
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
51 kompilacji.
52
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
60
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.
68
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
76 kompilacji.
77
78 %prep
79 %setup -q -n %{pypi_name}-%{version}
80
81 %build
82 pys=""
83 %if %{with python2}
84 pys="$pys python2"
85 %endif
86 %if %{with python3}
87 pys="$pys python3"
88 %endif
89 for py in $pys; do
90         mkdir $py
91         %cmake -B $py -DCMAKE_BUILD_TYPE=Debug -DPYTHON_EXECUTABLE=%{_bindir}/$py -DPYBIND11_INSTALL=TRUE -DUSE_PYTHON_INCLUDE_DIR=FALSE -DPYBIND11_TEST=OFF
92         %{__make} -C $py
93 done
94
95 %if %{with python2}
96 %py_build
97 %endif
98
99 %if %{with python3}
100 %py3_build
101 %endif
102
103 %install
104 rm -rf $RPM_BUILD_ROOT
105
106 %if %{with python2}
107 %{__make} install -C python2 DESTDIR=$RPM_BUILD_ROOT
108 %py_install
109
110 %py_postclean
111 %endif
112
113 %if %{with python3}
114 %{__make} install -C python3 DESTDIR=$RPM_BUILD_ROOT
115 %py3_install
116 %endif
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121 %if %{with python2}
122 %files
123 %defattr(644,root,root,755)
124 %doc LICENSE README.rst
125 %{py_sitescriptdir}/%{module}
126 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
127 %endif
128
129 %if %{with python3}
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
138 %endif
This page took 0.105624 seconds and 2 git commands to generate.