Blame SPECS/python3.11-pybind11.spec

b21952
%global __python3 /usr/bin/python3.11
b21952
%global python3_pkgversion 3.11
b21952
b21952
# While the headers are architecture independent, the package must be
b21952
# built separately on all architectures so that the tests are run
b21952
# properly. See also
b21952
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
b21952
%global debug_package %{nil}
b21952
b21952
# Whether to run the tests, enabled by default
b21952
%bcond_without tests
b21952
b21952
%global modname pybind11
b21952
b21952
Name:    python%{python3_pkgversion}-pybind11
b21952
Version: 2.10.3
b21952
Release: 2%{?dist}
b21952
Summary: Seamless operability between C++11 and Python
b21952
License: BSD
b21952
URL:   https://github.com/pybind/pybind11
b21952
Source0: https://github.com/pybind/pybind11/archive/v%{version}/%{modname}-%{version}.tar.gz
b21952
b21952
# Patch out header path
b21952
Patch1:  pybind11-2.10.1-hpath.patch
b21952
b21952
BuildRequires: make
b21952
b21952
# Needed to build the python libraries
b21952
BuildRequires: python%{python3_pkgversion}-devel
b21952
BuildRequires: python%{python3_pkgversion}-rpm-macros
b21952
BuildRequires: python%{python3_pkgversion}-setuptools
b21952
# These are only needed for the checks
b21952
%if %{with tests}
b21952
BuildRequires: python%{python3_pkgversion}-pytest
b21952
BuildRequires: python%{python3_pkgversion}-numpy
b21952
BuildRequires: python%{python3_pkgversion}-scipy
b21952
%endif
b21952
b21952
BuildRequires: eigen3-devel
b21952
BuildRequires: gcc-c++
b21952
BuildRequires: cmake
b21952
b21952
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
b21952
b21952
%global base_description \
b21952
pybind11 is a lightweight header-only library that exposes C++ types \
b21952
in Python and vice versa, mainly to create Python bindings of existing \
b21952
C++ code.
b21952
b21952
%description
b21952
%{base_description}
b21952
b21952
%package devel
b21952
Summary:  Development headers for pybind11
b21952
b21952
# This package does not have namespaced file locations, so if we build the
b21952
# pybind11-devel subpackage in any other stack as well, the files from these
b21952
# packages will conflict. The package name is namespaced so that customers can
b21952
# decide which to install, but the packages will conflict with each other.
b21952
Provides:   %{modname}-devel = %{version}-%{release}
b21952
Conflicts:  %{modname}-devel < %{version}-%{release} 
b21952
b21952
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
b21952
Provides: %{modname}-static = %{version}-%{release}
b21952
Provides: %{name}-static = %{version}-%{release}
b21952
# For dir ownership
b21952
Requires: cmake
b21952
b21952
%description devel
b21952
%{base_description}
b21952
b21952
This package contains the development headers for pybind11.
b21952
b21952
%prep
b21952
%autosetup -p1 -n %{modname}-%{version}
b21952
b21952
%build
b21952
py=python3
b21952
mkdir $py
b21952
# When -DCMAKE_BUILD_TYPE is set to Release, the tests in %%check might segfault.
b21952
# However, we do not ship any binaries, and therefore Debug
b21952
# build type does not affect the results.
b21952
# https://bugzilla.redhat.com/show_bug.cgi?id=1921199
b21952
%if 0%{?rhel} < 9
b21952
cd $py
b21952
%cmake .. -DCMAKE_BUILD_TYPE=Debug -DPYTHON_EXECUTABLE=%{__python3} -DPYBIND11_INSTALL=TRUE -DUSE_PYTHON_INCLUDE_DIR=FALSE %{!?with_tests:-DPYBIND11_TEST=OFF}
b21952
%make_build
b21952
cd ..
b21952
%else
b21952
%cmake -B $py -DCMAKE_BUILD_TYPE=Debug -DPYTHON_EXECUTABLE=%{__python3} -DPYBIND11_INSTALL=TRUE -DUSE_PYTHON_INCLUDE_DIR=FALSE %{!?with_tests:-DPYBIND11_TEST=OFF}
b21952
%make_build -C $py
b21952
%endif
b21952
b21952
%py3_build
b21952
b21952
%if %{with tests}
b21952
%check
b21952
make -C python3 check %{?_smp_mflags}
b21952
%endif
b21952
b21952
%install
b21952
%make_install -C python3
b21952
# Force install to arch-ful directories instead.
b21952
PYBIND11_USE_CMAKE=true %py3_install "--install-purelib" "%{python3_sitearch}"
b21952
b21952
%files devel
b21952
%license LICENSE
b21952
%doc README.rst
b21952
%{_includedir}/pybind11/
b21952
%{_datadir}/cmake/pybind11/
b21952
%{_bindir}/pybind11-config
b21952
%{_datadir}/pkgconfig/%{modname}.pc
b21952
b21952
%files
b21952
%{python3_sitearch}/%{modname}/
b21952
%{python3_sitearch}/%{modname}-%{version}-py%{python3_version}.egg-info
b21952
b21952
%changelog
b21952
* Mon Feb 20 2023 Charalampos Stratakis <cstratak@redhat.com> - 2.10.3-2
b21952
- Enable tests
b21952
b21952
* Thu Dec 01 2022 Charalampos Stratakis <cstratak@redhat.com> - 2.10.3-1
b21952
- Initial package
b21952
- Fedora contributions by:
b21952
      Elliott Sales de Andrade <quantum.analyst@gmail.com>
b21952
      Jonathan <jonathan@knownhost.com>
b21952
      jonathanspw <jonathan@almalinux.org>
b21952
      Merlin Mathesius <mmathesi@redhat.com>
b21952
      Miro HronĨok <miro@hroncok.cz>
b21952
      Susi Lehtola <jussilehtola@fedoraproject.org>
b21952
      Tom Stellard <tstellar@redhat.com>