|
| 1 | +# Copyright 2024 Wong Hoi Sing Edison <[email protected]> |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +%global debug_package %{nil} |
| 16 | + |
| 17 | +%global source_date_epoch_from_changelog 0 |
| 18 | + |
| 19 | +Name: python-cffi |
| 20 | +Epoch: 100 |
| 21 | +Version: 1.16.0 |
| 22 | +Release: 1%{?dist} |
| 23 | +Summary: Foreign Function Interface for Python to call C code |
| 24 | +License: MIT |
| 25 | +URL: https://github.com/python-cffi/cffi/tags |
| 26 | +Source0: %{name}_%{version}.orig.tar.gz |
| 27 | +BuildRequires: fdupes |
| 28 | +BuildRequires: libffi-devel |
| 29 | +BuildRequires: python-rpm-macros |
| 30 | +BuildRequires: python3-Cython3 |
| 31 | +BuildRequires: python3-devel |
| 32 | +BuildRequires: python3-setuptools |
| 33 | + |
| 34 | +%description |
| 35 | +Foreign Function Interface for Python, providing a convenient and |
| 36 | +reliable way of calling existing C code from Python. The interface is |
| 37 | +based on LuaJIT’s FFI. |
| 38 | + |
| 39 | +%prep |
| 40 | +%autosetup -T -c -n %{name}_%{version}-%{release} |
| 41 | +tar -zx -f %{S:0} --strip-components=1 -C . |
| 42 | + |
| 43 | +%build |
| 44 | +%py3_build |
| 45 | + |
| 46 | +%install |
| 47 | +%py3_install |
| 48 | +find %{buildroot}%{python3_sitearch} -type f -name '*.pyc' -exec rm -rf {} \; |
| 49 | +fdupes -qnrps %{buildroot}%{python3_sitearch} |
| 50 | + |
| 51 | +%check |
| 52 | + |
| 53 | +%if 0%{?suse_version} > 1500 || 0%{?rhel} == 7 |
| 54 | +%package -n python%{python3_version_nodots}-cffi |
| 55 | +Summary: Foreign Function Interface for Python to call C code |
| 56 | +Requires: python3 |
| 57 | +Requires: python3-pycparser |
| 58 | +Provides: python3-cffi = %{epoch}:%{version}-%{release} |
| 59 | +Provides: python3dist(cffi) = %{epoch}:%{version}-%{release} |
| 60 | +Provides: python%{python3_version}-cffi = %{epoch}:%{version}-%{release} |
| 61 | +Provides: python%{python3_version}dist(cffi) = %{epoch}:%{version}-%{release} |
| 62 | +Provides: python%{python3_version_nodots}-cffi = %{epoch}:%{version}-%{release} |
| 63 | +Provides: python%{python3_version_nodots}dist(cffi) = %{epoch}:%{version}-%{release} |
| 64 | + |
| 65 | +%description -n python%{python3_version_nodots}-cffi |
| 66 | +Foreign Function Interface for Python, providing a convenient and |
| 67 | +reliable way of calling existing C code from Python. The interface is |
| 68 | +based on LuaJIT’s FFI. |
| 69 | + |
| 70 | +%files -n python%{python3_version_nodots}-cffi |
| 71 | +%license LICENSE |
| 72 | +%{python3_sitearch}/_cffi_backend.*.so |
| 73 | +%{python3_sitearch}/cffi* |
| 74 | +%endif |
| 75 | + |
| 76 | +%if !(0%{?suse_version} > 1500) && !(0%{?rhel} == 7) |
| 77 | +%package -n python3-cffi |
| 78 | +Summary: Foreign Function Interface for Python to call C code |
| 79 | +Requires: python3 |
| 80 | +Requires: python3-pycparser |
| 81 | +Provides: python3-cffi = %{epoch}:%{version}-%{release} |
| 82 | +Provides: python3dist(cffi) = %{epoch}:%{version}-%{release} |
| 83 | +Provides: python%{python3_version}-cffi = %{epoch}:%{version}-%{release} |
| 84 | +Provides: python%{python3_version}dist(cffi) = %{epoch}:%{version}-%{release} |
| 85 | +Provides: python%{python3_version_nodots}-cffi = %{epoch}:%{version}-%{release} |
| 86 | +Provides: python%{python3_version_nodots}dist(cffi) = %{epoch}:%{version}-%{release} |
| 87 | + |
| 88 | +%description -n python3-cffi |
| 89 | +Foreign Function Interface for Python, providing a convenient and |
| 90 | +reliable way of calling existing C code from Python. The interface is |
| 91 | +based on LuaJIT’s FFI. |
| 92 | + |
| 93 | +%files -n python3-cffi |
| 94 | +%license LICENSE |
| 95 | +%{python3_sitearch}/_cffi_backend.*.so |
| 96 | +%{python3_sitearch}/cffi* |
| 97 | +%endif |
| 98 | + |
| 99 | +%changelog |
0 commit comments