[12484] | 1 | # While the headers are architecture independent, the package must be |
---|
| 2 | # built separately on all architectures so that the tests are run |
---|
| 3 | # properly. See also |
---|
| 4 | # https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries |
---|
| 5 | %global debug_package %{nil} |
---|
| 6 | |
---|
| 7 | # Whether to run the tests, enabled by default |
---|
| 8 | %bcond_with tests |
---|
| 9 | |
---|
| 10 | %global python2_enabled 0 |
---|
| 11 | %global python3_enabled 1 |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | Summary: Seamless operability between C++11 and Python |
---|
| 15 | Name: pybind11 |
---|
| 16 | Version: 2.5.0 |
---|
| 17 | Release: 7%{?_dist_release} |
---|
| 18 | Group: programming |
---|
| 19 | Vendor: Project Vine |
---|
| 20 | Distribution: Vine Linux |
---|
| 21 | |
---|
| 22 | License: BSD |
---|
| 23 | URL: https://github.com/pybind/pybind11 |
---|
| 24 | Source0: https://github.com/pybind/pybind11/archive/v%{version}/%{name}-%{version}.tar.gz |
---|
| 25 | |
---|
| 26 | # Patch out header path |
---|
| 27 | Patch1: pybind11-2.5.0-hpath.patch |
---|
| 28 | |
---|
| 29 | BuildRequires: python-rpm-macros |
---|
| 30 | %if %{python2_enabled} |
---|
| 31 | # Needed to build the python libraries |
---|
| 32 | BuildRequires: python-devel |
---|
| 33 | BuildRequires: python2-setuptools |
---|
| 34 | BuildRequires: python3-rpm-macros |
---|
| 35 | # These are only needed for the checks |
---|
| 36 | %if %{with tests} |
---|
| 37 | BuildRequires: python-pytest |
---|
| 38 | BuildRequires: python-numpy |
---|
| 39 | BuildRequires: python-scipy |
---|
| 40 | %endif |
---|
| 41 | %endif |
---|
| 42 | |
---|
| 43 | %if %{python3_enabled} |
---|
| 44 | # Needed to build the python libraries |
---|
| 45 | BuildRequires: python3-devel |
---|
| 46 | BuildRequires: python3-setuptools |
---|
| 47 | BuildRequires: python3-rpm-macros |
---|
| 48 | # These are only needed for the checks |
---|
| 49 | %if %{with tests} |
---|
| 50 | BuildRequires: python3-pytest |
---|
| 51 | BuildRequires: python3-numpy |
---|
| 52 | BuildRequires: python3-scipy |
---|
| 53 | %endif |
---|
| 54 | %endif |
---|
| 55 | |
---|
| 56 | BuildRequires: eigen3-devel |
---|
| 57 | BuildRequires: gcc-c++ |
---|
| 58 | BuildRequires: cmake |
---|
| 59 | |
---|
| 60 | %global base_description \ |
---|
| 61 | pybind11 is a lightweight header-only library that exposes C++ types \ |
---|
| 62 | in Python and vice versa, mainly to create Python bindings of existing \ |
---|
| 63 | C++ code. |
---|
| 64 | |
---|
| 65 | %description |
---|
| 66 | %{base_description} |
---|
| 67 | |
---|
| 68 | |
---|
| 69 | %package devel |
---|
| 70 | Summary: Development headers for pybind11 |
---|
| 71 | Group: programming |
---|
| 72 | # https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries |
---|
| 73 | Provides: %{name}-static = %{version}-%{release} |
---|
| 74 | # For dir ownership |
---|
| 75 | Requires: cmake |
---|
| 76 | |
---|
| 77 | %description devel |
---|
| 78 | %{base_description} |
---|
| 79 | |
---|
| 80 | This package contains the development headers for pybind11. |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | %if %{python2_enabled} |
---|
| 84 | %package -n python-%{name} |
---|
| 85 | Summary: %{summary} |
---|
| 86 | Group: programming |
---|
| 87 | %{?python_provide:%python_provide python2-%{srcname}} |
---|
| 88 | Requires: %{name}-devel%{?_isa} = %{version}-%{release} |
---|
| 89 | |
---|
| 90 | %description -n python-%{name} |
---|
| 91 | %{base_description} |
---|
| 92 | |
---|
| 93 | This package contains the Python 2 files. |
---|
| 94 | %endif |
---|
| 95 | |
---|
| 96 | %if %{python3_enabled} |
---|
| 97 | %package -n python3-%{name} |
---|
| 98 | Summary: %{summary} |
---|
| 99 | Group: programming |
---|
| 100 | %{?python_provide:%python_provide python3-%{srcname}} |
---|
| 101 | |
---|
| 102 | Requires: %{name}-devel%{?_isa} = %{version}-%{release} |
---|
| 103 | |
---|
| 104 | %if !%{python2_enabled} |
---|
| 105 | # Take care of upgrade path |
---|
| 106 | Obsoletes: python-%{name} < %{version}-%{release} |
---|
| 107 | %endif |
---|
| 108 | |
---|
| 109 | %description -n python3-%{name} |
---|
| 110 | %{base_description} |
---|
| 111 | |
---|
| 112 | This package contains the Python 3 files. |
---|
| 113 | %endif |
---|
| 114 | |
---|
| 115 | |
---|
| 116 | %prep |
---|
| 117 | %setup -q |
---|
| 118 | %patch1 -p1 -b .hpath |
---|
| 119 | |
---|
| 120 | |
---|
| 121 | %build |
---|
| 122 | pys="" |
---|
| 123 | %if %{python2_enabled} |
---|
| 124 | pys="$pys python2" |
---|
| 125 | %endif |
---|
| 126 | %if %{python3_enabled} |
---|
| 127 | pys="$pys python3" |
---|
| 128 | %endif |
---|
| 129 | for py in $pys; do |
---|
| 130 | mkdir $py |
---|
| 131 | %cmake -B $py -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=%{_bindir}/$py -DPYBIND11_INSTALL=TRUE -DUSE_PYTHON_INCLUDE_DIR=FALSE %{!?with_tests:-DPYBIND11_TEST=OFF} |
---|
| 132 | %make_build -C $py |
---|
| 133 | done |
---|
| 134 | |
---|
| 135 | %if %{python2_enabled} |
---|
| 136 | %py2_build |
---|
| 137 | %endif |
---|
| 138 | %if %{python3_enabled} |
---|
| 139 | %py3_build |
---|
| 140 | %endif |
---|
| 141 | |
---|
| 142 | |
---|
| 143 | %if %{with tests} |
---|
| 144 | %check |
---|
| 145 | %if %{python2_enabled} |
---|
| 146 | make -C python2 check %{?_smp_mflags} |
---|
| 147 | %endif |
---|
| 148 | %if %{python3_enabled} |
---|
| 149 | make -C python3 check %{?_smp_mflags} |
---|
| 150 | %endif |
---|
| 151 | %endif |
---|
| 152 | |
---|
| 153 | |
---|
| 154 | %install |
---|
| 155 | # Doesn't matter if both installs run |
---|
| 156 | %if %{python2_enabled} |
---|
| 157 | %make_install -C python2 |
---|
| 158 | %endif |
---|
| 159 | %if %{python3_enabled} |
---|
| 160 | %make_install -C python3 |
---|
| 161 | %endif |
---|
| 162 | # Force install to arch-ful directories instead. |
---|
| 163 | %if %{python2_enabled} |
---|
| 164 | PYBIND11_USE_CMAKE=true %py2_install "--install-purelib" "%{python2_sitearch}" |
---|
| 165 | %endif |
---|
| 166 | %if %{python3_enabled} |
---|
| 167 | PYBIND11_USE_CMAKE=true %py3_install "--install-purelib" "%{python3_sitearch}" |
---|
| 168 | %endif |
---|
| 169 | |
---|
| 170 | |
---|
| 171 | %files devel |
---|
| 172 | %license LICENSE |
---|
| 173 | %doc README.md |
---|
| 174 | %{_includedir}/pybind11/ |
---|
| 175 | %{_datadir}/cmake/pybind11/ |
---|
| 176 | |
---|
| 177 | %if %{python2_enabled} |
---|
| 178 | %files -n python2-%{name} |
---|
| 179 | %{python2_sitearch}/%{name}/ |
---|
| 180 | %{python2_sitearch}/%{name}-%{version}-py?.?.egg-info |
---|
| 181 | %endif |
---|
| 182 | |
---|
| 183 | %if %{python3_enabled} |
---|
| 184 | %files -n python3-%{name} |
---|
| 185 | %{python3_sitearch}/%{name}/ |
---|
| 186 | %{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info |
---|
| 187 | %endif |
---|
| 188 | |
---|
| 189 | |
---|
| 190 | %changelog |
---|
| 191 | * Fri Sep 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.5.0-7 |
---|
| 192 | - initial build for Vine Linux. |
---|
| 193 | |
---|
| 194 | * Wed Aug 05 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.5.0-6 |
---|
| 195 | - Adapt to new CMake macros. |
---|
| 196 | |
---|
| 197 | * Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-5 |
---|
| 198 | - Second attempt - Rebuilt for |
---|
| 199 | https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild |
---|
| 200 | |
---|
| 201 | * Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-4 |
---|
| 202 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild |
---|
| 203 | |
---|
| 204 | * Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.5.0-3 |
---|
| 205 | - Rebuilt for Python 3.9 |
---|
| 206 | |
---|
| 207 | * Mon May 25 2020 Miro Hrončok <mhroncok@redhat.com> - 2.5.0-2 |
---|
| 208 | - Bootstrap for Python 3.9 |
---|
| 209 | |
---|
| 210 | * Wed Apr 01 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.5.0-1 |
---|
| 211 | - Update to 2.5.0. |
---|
| 212 | |
---|
| 213 | * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.3-2 |
---|
| 214 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild |
---|
| 215 | |
---|
| 216 | * Tue Oct 15 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.3-1 |
---|
| 217 | - Update to 2.4.3. |
---|
| 218 | |
---|
| 219 | * Tue Oct 08 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.2-2 |
---|
| 220 | - Fix Python 3.8 incompatibility. |
---|
| 221 | |
---|
| 222 | * Sat Sep 28 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.2-1 |
---|
| 223 | - Update to 2.4.2. |
---|
| 224 | |
---|
| 225 | * Fri Sep 20 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.1-1 |
---|
| 226 | - Update to 2.4.1. |
---|
| 227 | |
---|
| 228 | * Fri Sep 20 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.0-1 |
---|
| 229 | - Update to 2.4.0. |
---|
| 230 | |
---|
| 231 | * Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.3.0-3 |
---|
| 232 | - Rebuilt for Python 3.8 |
---|
| 233 | |
---|
| 234 | * Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-2 |
---|
| 235 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild |
---|
| 236 | |
---|
| 237 | * Wed Jul 10 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.3.0-1 |
---|
| 238 | - Update to 2.3.0. |
---|
| 239 | |
---|
| 240 | * Fri May 03 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.4-3 |
---|
| 241 | - Fix incompatibility with pytest 4.0. |
---|
| 242 | |
---|
| 243 | * Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.4-2 |
---|
| 244 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild |
---|
| 245 | |
---|
| 246 | * Tue Sep 18 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.4-1 |
---|
| 247 | - Remove python2 packages for Fedora >= 30. |
---|
| 248 | - Update to 2.2.4. |
---|
| 249 | |
---|
| 250 | * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-3 |
---|
| 251 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild |
---|
| 252 | |
---|
| 253 | * Sat Jun 23 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.3-2 |
---|
| 254 | - Rebuilt for Python 3.7 |
---|
| 255 | |
---|
| 256 | * Fri Jun 22 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.3-1 |
---|
| 257 | - Update to 2.2.3. |
---|
| 258 | |
---|
| 259 | * Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.2-4 |
---|
| 260 | - Rebuilt for Python 3.7 |
---|
| 261 | |
---|
| 262 | * Mon Apr 16 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-3 |
---|
| 263 | - Add Python subpackages based on Elliott Sales de Andrade's patch. |
---|
| 264 | |
---|
| 265 | * Sat Feb 17 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-2 |
---|
| 266 | - Fix FTBS by patch from upstream. |
---|
| 267 | |
---|
| 268 | * Wed Feb 14 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-1 |
---|
| 269 | - Update to 2.2.2. |
---|
| 270 | |
---|
| 271 | * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-2 |
---|
| 272 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild |
---|
| 273 | |
---|
| 274 | * Thu Dec 14 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.1-1 |
---|
| 275 | - Update to latest version |
---|
| 276 | - Update Source URL to include project name. |
---|
| 277 | |
---|
| 278 | * Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-7 |
---|
| 279 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild |
---|
| 280 | |
---|
| 281 | * Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-6 |
---|
| 282 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild |
---|
| 283 | |
---|
| 284 | * Mon Feb 27 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-5 |
---|
| 285 | - Full compliance with header only libraries guidelines. |
---|
| 286 | |
---|
| 287 | * Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-4 |
---|
| 288 | - As advised by upstream, disable dtypes test for now. |
---|
| 289 | - Include patch for tests on bigendian systems. |
---|
| 290 | |
---|
| 291 | * Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-3 |
---|
| 292 | - Make the package arched so that tests can be run on all architectures. |
---|
| 293 | - Run tests both against python2 and python3. |
---|
| 294 | |
---|
| 295 | * Wed Feb 22 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-2 |
---|
| 296 | - Switch to python3 for tests. |
---|
| 297 | |
---|
| 298 | * Sun Feb 05 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-1 |
---|
| 299 | - First release. |
---|