## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 23;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           python-ffc
Version:        2019.1.0.post0
%global fenics_version 2019.1
Release:        %autorelease
Summary:        Compiler for finite element variational forms

License:        LGPL-3.0-or-later
URL:            https://fenics-ffc.readthedocs.org/
Source0:        https://bitbucket.org/fenics-project/ffc/downloads/ffc-%{version}.tar.gz
Source1:        https://bitbucket.org/fenics-project/ffc/downloads/ffc-%{version}.tar.gz.asc
Source2:        3083BE4C722232E28AD0828CBED06106DD22BAB3.gpg

Patch0:         https://bitbucket.org/fenics-project/ffc/commits/8d80c72468282e35fd5476b42c5c03595cd38e99/raw#/8d80c72468282e35fd5476b42c5c03595cd38e99.patch

BuildArch:      noarch
BuildRequires:  python3-devel
BuildRequires:  python3dist(setuptools)
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(numpy)
BuildRequires:  python3dist(fenics-fiat) >= %{fenics_version}
BuildRequires:  python3dist(fenics-ufl) >= %{fenics_version}
BuildRequires:  python3dist(fenics-dijitso) >= %{fenics_version}
BuildRequires:  cmake
BuildRequires:  gnupg2
# Note: a copy of gtest is bundled and used for tests during build. It
# could be unbundled, but I don't think this is worth the trouble in
# this case.

%global _description %{expand:
The FEniCS Form Compiler FFC is a compiler for finite element
variational forms, translating high-level mathematical descriptions of
variational forms into efficient low-level C++ code for finite element
assembly.}

%description %_description

%package -n python3-ffc
Summary: %summary
%{?python_provides python3-ffc}

%description -n python3-ffc %_description

%prep
%{?gpgverify:%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'}

%autosetup -n ffc-%{version} -p1

sed -r -i '1d' ffc/__main__.py ffc/main.py

# Ad hoc NumPy 2.x patch replacing `numpy.product` with `numpy.prod`.
# https://bitbucket.org/fenics-project/ffc/pull-requests/102
sed -i 's/numpy\.product/numpy.prod/g' $(grep -rl 'numpy\.product')

%build
%py3_build

%install
%py3_install

%check
OPTIONS=(
  # test_evaluate.py uses libs/ffc-factory, which is currently ignored
  --ignore=test/unit/ufc/finite_element/test_evaluate.py
)
%python3 -m pytest -v test/ "${OPTIONS[@]}"

%files -n python3-ffc
%license COPYING COPYING.LESSER
%doc README.rst ChangeLog.rst AUTHORS
%doc demo
%{_bindir}/ffc
%{_bindir}/ffc-3
%{python3_sitelib}/ffc
%{python3_sitelib}/fenics_ffc-%{version}-py%{python3_version}.egg-info/
%{_mandir}/man1/ffc.1*

%changelog
## START: Generated by rpmautospec
* Sat Dec 21 2024 Sandro <devel@penguinpee.nl> - 2019.1.0.post0-23
- Ad hoc patch for NumPy 2.x

* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2019.1.0.post0-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Mon Jun 10 2024 Python Maint <python-maint@redhat.com> - 2019.1.0.post0-21
- Rebuilt for Python 3.13

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2019.1.0.post0-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2019.1.0.post0-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Wed Nov 22 2023 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2019.1.0.post0-18
- Convert license tag to SPDX

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2019.1.0.post0-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Sun Jul 16 2023 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2019.1.0.post0-16
- Rebuild for updated python-fiat (rhbz#2220220)

* Sun Jul 16 2023 Python Maint <python-maint@redhat.com> - 2019.1.0.post0-15
- Rebuilt for Python 3.12

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2019.1.0.post0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2019.1.0.post0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Fri Jun 17 2022 Python Maint <python-maint@redhat.com> - 2019.1.0.post0-9
- Rebuilt for Python 3.11

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2019.1.0.post0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2019.1.0.post0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2019.1.0.post0-6
- Rebuilt for Python 3.10

* Tue Jan 26 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2019.1.0.post0-5
- Fix compatibility with pytest-6 (#1902616)

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2019.1.0.post0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2019.1.0.post0-3
- Rebuilt for Python 3.9

* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2019.1.0.post0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Tue Oct  8 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2019.1.0.post0-1
- Initial packaging

## END: Generated by rpmautospec