pybind11/pybind11.spec

328 lines
9.8 KiB
RPMSpec
Raw Normal View History

2017-02-27 19:56:28 +00:00
# While the headers are architecture independent, the package must be
# built separately on all architectures so that the tests are run
# properly. See also
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
%global debug_package %{nil}
2020-05-25 20:15:53 +00:00
# Whether to run the tests, enabled by default
%bcond_without tests
%if 0%{?fedora} >= 30 || 0%{?rhel} >= 9
%global python2_enabled 0
%else
%global python2_enabled 1
%endif
2018-09-18 16:49:55 +00:00
%global python3_enabled 1
2018-09-22 19:20:37 +00:00
Name: pybind11
2022-02-08 21:33:05 +00:00
Version: 2.9.1
Release: 1%{?dist}
2017-02-27 19:56:28 +00:00
Summary: Seamless operability between C++11 and Python
2018-09-22 19:20:37 +00:00
License: BSD
URL: https://github.com/pybind/pybind11
2021-12-30 01:16:48 +00:00
Source0: https://github.com/pybind/pybind11/archive/v%{version}/%{name}-%{version}.tar.gz
2017-02-27 19:56:28 +00:00
2020-04-01 06:33:55 +00:00
# Patch out header path
2021-11-26 18:42:22 +00:00
Patch1: pybind11-2.8.1-hpath.patch
2018-04-16 09:55:48 +00:00
BuildRequires: make
%if %{python2_enabled}
2018-04-16 09:55:48 +00:00
# Needed to build the python libraries
2017-02-27 19:56:28 +00:00
BuildRequires: python2-devel
2018-04-16 09:55:48 +00:00
BuildRequires: python2-setuptools
# These are only needed for the checks
2020-05-25 20:15:53 +00:00
%if %{with tests}
2017-02-27 19:56:28 +00:00
BuildRequires: python2-pytest
BuildRequires: python2-numpy
BuildRequires: python2-scipy
%endif
2020-05-25 20:15:53 +00:00
%endif
%if %{python3_enabled}
# Needed to build the python libraries
BuildRequires: python3-devel
BuildRequires: python3-setuptools
# These are only needed for the checks
2020-05-25 20:15:53 +00:00
%if %{with tests}
2017-02-27 19:56:28 +00:00
BuildRequires: python3-pytest
BuildRequires: python3-numpy
BuildRequires: python3-scipy
%endif
2020-05-25 20:15:53 +00:00
%endif
2017-02-27 19:56:28 +00:00
BuildRequires: eigen3-devel
BuildRequires: gcc-c++
BuildRequires: cmake
2018-04-16 09:55:48 +00:00
%global base_description \
pybind11 is a lightweight header-only library that exposes C++ types \
in Python and vice versa, mainly to create Python bindings of existing \
2017-02-27 19:56:28 +00:00
C++ code.
2018-04-16 09:55:48 +00:00
%description
%{base_description}
2017-02-27 19:56:28 +00:00
%package devel
Summary: Development headers for pybind11
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
Provides: %{name}-static = %{version}-%{release}
# For dir ownership
Requires: cmake
%description devel
2018-04-16 09:55:48 +00:00
%{base_description}
2017-02-27 19:56:28 +00:00
This package contains the development headers for pybind11.
%if %{python2_enabled}
2018-04-16 09:55:48 +00:00
%package -n python2-%{name}
Summary: %{summary}
2020-12-06 11:07:01 +00:00
%{?python_provide:%python_provide python2-pybind11}
2018-04-16 09:55:48 +00:00
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description -n python2-%{name}
%{base_description}
This package contains the Python 2 files.
%endif
2018-04-16 09:55:48 +00:00
%if %{python3_enabled}
2018-04-16 09:55:48 +00:00
%package -n python3-%{name}
Summary: %{summary}
2020-12-06 11:07:01 +00:00
%{?python_provide:%python_provide python3-pybind11}
2018-04-16 09:55:48 +00:00
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%if !%{python2_enabled}
# Take care of upgrade path
Obsoletes: python2-%{name} < %{version}-%{release}
%endif
2018-04-16 09:55:48 +00:00
%description -n python3-%{name}
%{base_description}
This package contains the Python 3 files.
%endif
2018-04-16 09:55:48 +00:00
2017-02-27 19:56:28 +00:00
%prep
2018-04-16 09:55:48 +00:00
%setup -q
2020-04-01 06:33:55 +00:00
%patch1 -p1 -b .hpath
2017-02-27 19:56:28 +00:00
%build
pys=""
%if %{python2_enabled}
2018-09-22 19:44:53 +00:00
pys="$pys python2"
%endif
%if %{python3_enabled}
2018-09-22 19:44:53 +00:00
pys="$pys python3"
%endif
for py in $pys; do
2018-04-16 09:55:48 +00:00
mkdir $py
# When -DCMAKE_BUILD_TYPE is set to Release, the tests in %%check might segfault.
# However, we do not ship any binaries, and therefore Debug
# build type does not affect the results.
# https://bugzilla.redhat.com/show_bug.cgi?id=1921199
%cmake -B $py -DCMAKE_BUILD_TYPE=Debug -DPYTHON_EXECUTABLE=%{_bindir}/$py -DPYBIND11_INSTALL=TRUE -DUSE_PYTHON_INCLUDE_DIR=FALSE %{!?with_tests:-DPYBIND11_TEST=OFF}
2020-08-05 11:08:03 +00:00
%make_build -C $py
2017-02-27 19:56:28 +00:00
done
%if %{python2_enabled}
2018-04-16 09:55:48 +00:00
%py2_build
%endif
%if %{python3_enabled}
2018-04-16 09:55:48 +00:00
%py3_build
%endif
2017-02-27 19:56:28 +00:00
2020-05-25 20:15:53 +00:00
%if %{with tests}
2017-02-27 19:56:28 +00:00
%check
%if %{python2_enabled}
2017-02-27 19:56:28 +00:00
make -C python2 check %{?_smp_mflags}
%endif
%if %{python3_enabled}
2017-02-27 19:56:28 +00:00
make -C python3 check %{?_smp_mflags}
%endif
2020-05-25 20:15:53 +00:00
%endif
2017-02-27 19:56:28 +00:00
%install
2018-09-18 16:49:55 +00:00
# Doesn't matter if both installs run
%if %{python2_enabled}
2017-02-27 19:56:28 +00:00
%make_install -C python2
2018-09-18 16:49:55 +00:00
%endif
%if %{python3_enabled}
%make_install -C python3
%endif
2018-04-16 09:55:48 +00:00
# Force install to arch-ful directories instead.
%if %{python2_enabled}
2018-04-16 09:55:48 +00:00
PYBIND11_USE_CMAKE=true %py2_install "--install-purelib" "%{python2_sitearch}"
%endif
%if %{python3_enabled}
2018-04-16 09:55:48 +00:00
PYBIND11_USE_CMAKE=true %py3_install "--install-purelib" "%{python3_sitearch}"
%endif
2017-02-27 19:56:28 +00:00
%files devel
%license LICENSE
2020-12-06 11:04:07 +00:00
%doc README.rst
2017-02-27 19:56:28 +00:00
%{_includedir}/pybind11/
%{_datadir}/cmake/pybind11/
2020-12-06 11:17:51 +00:00
%{_bindir}/pybind11-config
2017-02-27 19:56:28 +00:00
%if %{python2_enabled}
2018-04-16 09:55:48 +00:00
%files -n python2-%{name}
%{python2_sitearch}/%{name}/
%{python2_sitearch}/%{name}-%{version}-py?.?.egg-info
%endif
2018-04-16 09:55:48 +00:00
%if %{python3_enabled}
2018-04-16 09:55:48 +00:00
%files -n python3-%{name}
%{python3_sitearch}/%{name}/
%{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info
%endif
2017-02-27 19:56:28 +00:00
%changelog
2022-02-08 21:33:05 +00:00
* Tue Feb 08 2022 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.9.1-1
- Update to 2.9.1.
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
2021-12-30 01:16:48 +00:00
* Wed Dec 29 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.9.0-1
- Update to 2.9.0.
2021-11-26 18:35:50 +00:00
* Fri Nov 26 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.8.1-1
- Update to 2.8.1.
2021-08-04 22:35:33 +00:00
* Wed Aug 04 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.7.1-1
- Update to 2.7.1.
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
2021-07-17 16:52:52 +00:00
* Sat Jul 17 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.7.0-1
- Update to 2.7.0.
2021-06-04 17:10:33 +00:00
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.6.2-3
- Rebuilt for Python 3.10
2021-06-04 08:02:33 +00:00
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.6.2-2
- Bootstrap for Python 3.10
2021-01-27 15:13:05 +00:00
* Wed Jan 27 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.6.2-1
- Update to 2.6.2.
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
2020-11-12 12:18:18 +00:00
* Thu Nov 12 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.6.1-1
- Update to 2.6.1.
* Wed Aug 12 2020 Merlin Mathesius <mmathesi@redhat.com> - 2.5.0-5
- Drop Python 2 support for ELN and RHEL9+
2020-08-05 11:08:03 +00:00
* Wed Aug 05 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.5.0-6
- Adapt to new CMake macros.
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-5
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
2020-05-26 00:25:17 +00:00
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.5.0-3
- Rebuilt for Python 3.9
2020-05-25 20:17:57 +00:00
* Mon May 25 2020 Miro Hrončok <mhroncok@redhat.com> - 2.5.0-2
- Bootstrap for Python 3.9
2020-08-05 11:08:03 +00:00
* Wed Apr 01 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.5.0-1
2020-04-01 06:33:55 +00:00
- Update to 2.5.0.
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2020-08-05 11:08:03 +00:00
* Tue Oct 15 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.3-1
2019-10-15 17:09:23 +00:00
- Update to 2.4.3.
2020-08-05 11:08:03 +00:00
* Tue Oct 08 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.2-2
2019-10-08 16:50:20 +00:00
- Fix Python 3.8 incompatibility.
2020-08-05 11:08:03 +00:00
* Sat Sep 28 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.2-1
2019-09-28 09:35:17 +00:00
- Update to 2.4.2.
2020-08-05 11:08:03 +00:00
* Fri Sep 20 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.1-1
2019-09-20 09:36:41 +00:00
- Update to 2.4.1.
2020-08-05 11:08:03 +00:00
* Fri Sep 20 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.0-1
2019-09-20 06:31:15 +00:00
- Update to 2.4.0.
2019-08-19 08:23:20 +00:00
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.3.0-3
- Rebuilt for Python 3.8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
2020-08-05 11:08:03 +00:00
* Wed Jul 10 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.3.0-1
2019-07-10 12:17:17 +00:00
- Update to 2.3.0.
2020-08-05 11:08:03 +00:00
* Fri May 03 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.4-3
2019-05-03 14:35:07 +00:00
- Fix incompatibility with pytest 4.0.
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
2020-08-05 11:08:03 +00:00
* Tue Sep 18 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.4-1
- Remove python2 packages for Fedora >= 30.
- Update to 2.2.4.
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
2018-06-23 08:25:33 +00:00
* Sat Jun 23 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.3-2
- Rebuilt for Python 3.7
2018-06-22 12:47:15 +00:00
* Fri Jun 22 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.3-1
- Update to 2.2.3.
2018-06-19 08:50:14 +00:00
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.2-4
- Rebuilt for Python 3.7
2018-04-16 09:55:48 +00:00
* Mon Apr 16 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-3
- Add Python subpackages based on Elliott Sales de Andrade's patch.
* Sat Feb 17 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-2
- Fix FTBS by patch from upstream.
2018-02-14 18:41:37 +00:00
* Wed Feb 14 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-1
- Update to 2.2.2.
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2017-12-14 07:21:10 +00:00
* Thu Dec 14 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.1-1
- Update to latest version
2017-12-14 07:30:26 +00:00
- Update Source URL to include project name.
2017-12-14 07:21:10 +00:00
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2017-02-27 19:56:28 +00:00
* Mon Feb 27 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-5
- Full compliance with header only libraries guidelines.
* Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-4
- As advised by upstream, disable dtypes test for now.
- Include patch for tests on bigendian systems.
* Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-3
- Make the package arched so that tests can be run on all architectures.
- Run tests both against python2 and python3.
* Wed Feb 22 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-2
- Switch to python3 for tests.
* Sun Feb 05 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-1
- First release.