1d3ad0b
# While the headers are architecture independent, the package must be
1d3ad0b
# built separately on all architectures so that the tests are run
1d3ad0b
# properly. See also
1d3ad0b
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
1d3ad0b
%global debug_package %{nil}
1d3ad0b
2f09cf5
%if 0%{?fedora} >= 30
2f09cf5
%global python2_enabled 0
2f09cf5
%else
2f09cf5
%global python2_enabled 1
2f09cf5
%endif
1524d6f
2f09cf5
%global python3_enabled 1
2f09cf5
2f09cf5
7fc5961
Name:    pybind11
e3cb2b8
Version: 2.5.0
e3cb2b8
Release: 1%{?dist}
1d3ad0b
Summary: Seamless operability between C++11 and Python
7fc5961
License: BSD
7fc5961
URL:	 https://github.com/pybind/pybind11
6ef401e
Source0: https://github.com/pybind/pybind11/archive/v%{version}/%{name}-%{version}.tar.gz
1d3ad0b
e3cb2b8
# Patch out header path
e3cb2b8
Patch1:  pybind11-2.5.0-hpath.patch
998fbc5
2f09cf5
%if %{python2_enabled}
998fbc5
# Needed to build the python libraries
1d3ad0b
BuildRequires: python2-devel
998fbc5
BuildRequires: python2-setuptools
998fbc5
# These are only needed for the checks
1d3ad0b
BuildRequires: python2-pytest
1d3ad0b
BuildRequires: python2-numpy
1d3ad0b
BuildRequires: python2-scipy
2f09cf5
%endif
2f09cf5
2f09cf5
%if %{python3_enabled}
2f09cf5
# Needed to build the python libraries
2f09cf5
BuildRequires: python3-devel
2f09cf5
BuildRequires: python3-setuptools
2f09cf5
# These are only needed for the checks
1d3ad0b
BuildRequires: python3-pytest
1d3ad0b
BuildRequires: python3-numpy
1d3ad0b
BuildRequires: python3-scipy
2f09cf5
%endif
2f09cf5
1d3ad0b
BuildRequires: eigen3-devel
1d3ad0b
BuildRequires: gcc-c++
1d3ad0b
BuildRequires: cmake
1d3ad0b
998fbc5
%global base_description \
998fbc5
pybind11 is a lightweight header-only library that exposes C++ types \
998fbc5
in Python and vice versa, mainly to create Python bindings of existing \
1d3ad0b
C++ code.
1d3ad0b
998fbc5
%description
998fbc5
%{base_description}
998fbc5
1d3ad0b
%package devel
1d3ad0b
Summary:  Development headers for pybind11
1d3ad0b
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
1d3ad0b
Provides: %{name}-static = %{version}-%{release}
1d3ad0b
# For dir ownership
1d3ad0b
Requires: cmake
1d3ad0b
1d3ad0b
%description devel
998fbc5
%{base_description}
1d3ad0b
1d3ad0b
This package contains the development headers for pybind11.
1d3ad0b
2f09cf5
%if %{python2_enabled}
998fbc5
%package -n     python2-%{name}
998fbc5
Summary:        %{summary}
998fbc5
%{?python_provide:%python_provide python2-%{srcname}}
998fbc5
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
998fbc5
998fbc5
%description -n python2-%{name}
998fbc5
%{base_description}
998fbc5
998fbc5
This package contains the Python 2 files.
2f09cf5
%endif
998fbc5
2f09cf5
%if %{python3_enabled}
998fbc5
%package -n     python3-%{name}
998fbc5
Summary:        %{summary}
998fbc5
%{?python_provide:%python_provide python3-%{srcname}}
998fbc5
998fbc5
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
998fbc5
2f09cf5
%if !%{python2_enabled}
2f09cf5
# Take care of upgrade path
2f09cf5
Obsoletes:      python2-%{name} < %{version}-%{release}
2f09cf5
%endif
2f09cf5
998fbc5
%description -n python3-%{name}
998fbc5
%{base_description}
998fbc5
998fbc5
This package contains the Python 3 files.
2f09cf5
%endif
998fbc5
1d3ad0b
%prep
998fbc5
%setup -q
e3cb2b8
%patch1 -p1 -b .hpath
1d3ad0b
1d3ad0b
%build
2f09cf5
pys=""
2f09cf5
%if %{python2_enabled}
5ee4868
pys="$pys python2"
2f09cf5
%endif
2f09cf5
%if %{python3_enabled}
5ee4868
pys="$pys python3"
2f09cf5
%endif
2f09cf5
for py in $pys; do
998fbc5
    mkdir $py
998fbc5
    cd $py
7fc5961
    %cmake .. -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=%{_bindir}/$py -DPYBIND11_INSTALL=TRUE -DUSE_PYTHON_INCLUDE_DIR=FALSE
998fbc5
    make %{?_smp_mflags}
998fbc5
    cd ..
1d3ad0b
done
2f09cf5
2f09cf5
%if %{python2_enabled}
998fbc5
%py2_build
2f09cf5
%endif
2f09cf5
%if %{python3_enabled}
998fbc5
%py3_build
2f09cf5
%endif
1d3ad0b
1d3ad0b
%check
2f09cf5
%if %{python2_enabled}
1d3ad0b
make -C python2 check %{?_smp_mflags}
2f09cf5
%endif
2f09cf5
%if %{python3_enabled}
1d3ad0b
make -C python3 check %{?_smp_mflags}
2f09cf5
%endif
1d3ad0b
1d3ad0b
%install
1524d6f
# Doesn't matter if both installs run
2f09cf5
%if %{python2_enabled}
1d3ad0b
%make_install -C python2
1524d6f
%endif
1524d6f
%if %{python3_enabled}
2f09cf5
%make_install -C python3
2f09cf5
%endif
998fbc5
# Force install to arch-ful directories instead.
2f09cf5
%if %{python2_enabled}
998fbc5
PYBIND11_USE_CMAKE=true %py2_install "--install-purelib" "%{python2_sitearch}"
2f09cf5
%endif
2f09cf5
%if %{python3_enabled}
998fbc5
PYBIND11_USE_CMAKE=true %py3_install "--install-purelib" "%{python3_sitearch}"
2f09cf5
%endif
1d3ad0b
1d3ad0b
%files devel
1d3ad0b
%license LICENSE
1d3ad0b
%doc README.md
1d3ad0b
%{_includedir}/pybind11/
1d3ad0b
%{_datadir}/cmake/pybind11/
1d3ad0b
2f09cf5
%if %{python2_enabled}
998fbc5
%files -n python2-%{name}
998fbc5
%{python2_sitearch}/%{name}/
998fbc5
%{python2_sitearch}/%{name}-%{version}-py?.?.egg-info
2f09cf5
%endif
998fbc5
2f09cf5
%if %{python3_enabled}
998fbc5
%files -n python3-%{name}
998fbc5
%{python3_sitearch}/%{name}/
998fbc5
%{python3_sitearch}/%{name}-%{version}-py?.?.egg-info
2f09cf5
%endif
1d3ad0b
1d3ad0b
%changelog
e3cb2b8
* Wed Apr 01 2020 Susi Lehtola - 2.5.0-1
e3cb2b8
- Update to 2.5.0.
e3cb2b8
37ead64
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.3-2
37ead64
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
37ead64
f2b41fb
* Tue Oct 15 2019 Susi Lehtola - 2.4.3-1
f2b41fb
- Update to 2.4.3.
f2b41fb
c9d4333
* Tue Oct 08 2019 Susi Lehtola - 2.4.2-2
c9d4333
- Fix Python 3.8 incompatibility.
c9d4333
b3c6e37
* Sat Sep 28 2019 Susi Lehtola - 2.4.2-1
b3c6e37
- Update to 2.4.2.
b3c6e37
86256b1
* Fri Sep 20 2019 Susi Lehtola - 2.4.1-1
86256b1
- Update to 2.4.1.
86256b1
595d158
* Fri Sep 20 2019 Susi Lehtola - 2.4.0-1
595d158
- Update to 2.4.0.
595d158
a0b23a8
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.3.0-3
a0b23a8
- Rebuilt for Python 3.8
a0b23a8
631ea2e
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-2
631ea2e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
631ea2e
7d7576c
* Wed Jul 10 2019 Susi Lehtola - 2.3.0-1
7d7576c
- Update to 2.3.0.
7d7576c
db5e4f4
* Fri May 03 2019 Susi Lehtola - 2.2.4-3
db5e4f4
- Fix incompatibility with pytest 4.0.
db5e4f4
21a7fe2
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.4-2
21a7fe2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
21a7fe2
2f09cf5
* Tue Sep 18 2018 Susi Lehtola - 2.2.4-1
2f09cf5
- Remove python2 packages for Fedora >= 30.
2f09cf5
- Update to 2.2.4.
2f09cf5
b9a3bbd
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-3
b9a3bbd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
b9a3bbd
d1939f6
* Sat Jun 23 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.3-2
d1939f6
- Rebuilt for Python 3.7
d1939f6
d4a1289
* Fri Jun 22 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.3-1
d4a1289
- Update to 2.2.3.
d4a1289
e39cdd5
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.2-4
e39cdd5
- Rebuilt for Python 3.7
e39cdd5
998fbc5
* Mon Apr 16 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-3
998fbc5
- Add Python subpackages based on Elliott Sales de Andrade's patch.
998fbc5
48d9465
* Sat Feb 17 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-2
48d9465
- Fix FTBS by patch from upstream.
48d9465
1437f0b
* Wed Feb 14 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-1
1437f0b
- Update to 2.2.2.
1437f0b
ee11255
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-2
ee11255
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ee11255
5fc86bf
* Thu Dec 14 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.1-1
5fc86bf
- Update to latest version
6ef401e
- Update Source URL to include project name.
5fc86bf
8174232
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-7
8174232
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
8174232
8918228
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-6
8918228
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
8918228
1d3ad0b
* Mon Feb 27 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-5
1d3ad0b
- Full compliance with header only libraries guidelines.
1d3ad0b
1d3ad0b
* Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-4
1d3ad0b
- As advised by upstream, disable dtypes test for now.
1d3ad0b
- Include patch for tests on bigendian systems.
1d3ad0b
1d3ad0b
* Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-3
1d3ad0b
- Make the package arched so that tests can be run on all architectures.
1d3ad0b
- Run tests both against python2 and python3.
1d3ad0b
1d3ad0b
* Wed Feb 22 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-2
1d3ad0b
- Switch to python3 for tests.
1d3ad0b
1d3ad0b
* Sun Feb 05 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-1
1d3ad0b
- First release.