Blob Blame History Raw
%global __cmake_in_source_build 1
Name:		dolfin
Version:	2019.1.0.post0
%global fenics_version 2019.1
Release:        9%{?dist}
Summary:        FEniCS computational backend and problem solving environment

License:        LGPLv3+
Source2:        3083BE4C722232E28AD0828CBED06106DD22BAB3.gpg

BuildRequires:  gcc-c++
BuildRequires:  gnupg2
BuildRequires:  cmake
BuildRequires:  boost-devel
BuildRequires:  eigen3-devel
BuildRequires:  petsc-devel
BuildRequires:  sundials-devel
BuildRequires:  scotch-devel
# ptscotch-mpich-devel?
BuildRequires:  blas-devel
# openblas-devel?
BuildRequires:  hdf5-devel
# hdf5-mpich-devel?
BuildRequires:  zlib-devel
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  pybind11-devel
BuildRequires:  python3dist(numpy)
BuildRequires:  python3dist(fenics-ffc) >= %{fenics_version}
BuildRequires:  python3dist(fenics-ufl) >= %{fenics_version}
BuildRequires:  python3dist(fenics-dijitso) >= %{fenics_version}
# go cmake go
BuildRequires:  chrpath

# check-buildroot flags the python .so, but it should be fine after rpath removal.
# It seems that the original path to the library is stored in some comment.
%global __arch_install_post /usr/lib/rpm/check-buildroot || :

#BuildRequires:  mpich-devel
#BuildRequires:  openmpi-devel

%global _description %{expand:
DOLFIN is the computational backend of FEniCS and implements the
FEniCS Problem Solving Environment.}

%description %_description

%package devel
Summary:        Development files for %{name}
Requires:       %{name} = %{version}-%{release}%{?isa}

%description devel

%package -n python3-dolfin
Summary:        Python wrapper for the FEniCS dolfin environment
# The jit compiles and links to the dolfin library
Requires:       %{name}-devel = %{version}-%{release}%{?isa}
%{?python_provide:%python_provide python3-dolfin}

%description -n python3-dolfin %_description

%package doc
Summary:        Documentation and demos for %{name}
BuildArch:      noarch

%description doc

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

%autosetup -n dolfin-%{version}

# Let's just specify an exact version of a dependency, yay!
sed -i -r 's|pybind11==|pybind11>=|' python/

cat >>python/CMakeLists.txt <<EOF

sed -r -i 's/#include </#include <algorithm>\n\0/' \
  dolfin/geometry/IntersectionConstruction.cpp \

sed -r -i 's|boost/detail/endian.hpp|boost/endian/arithmetic.hpp|' \
  dolfin/io/VTKFile.cpp \

# %%_mpich_load
mkdir -p build && cd build
CFLAGS=-Wno-unused-variable %cmake .. -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=off

# "temporary install" so the python build can find the stuff it needs

cd ../python
VERBOSE=1 CMAKE_PREFIX_PATH=%{buildroot}/usr/share/dolfin/cmake CMAKE_SKIP_INSTALL_RPATH=yes CMAKE_SKIP_RPATH=yes %py3_build

cd build

cd ../python
VERBOSE=1 CMAKE_PREFIX_PATH=%{buildroot}/usr/share/dolfin/cmake CMAKE_SKIP_INSTALL_RPATH=yes CMAKE_SKIP_RPATH=yes %py3_install

sed -r -i '1 {s|#!/usr/bin/env python.*|#!%{__python3}|}' \
    %{buildroot}/usr/bin/dolfin-order \
    %{buildroot}/usr/bin/dolfin-plot \

# this file is just pointless
rm %{buildroot}/usr/share/dolfin/dolfin.conf

# there's even an option for this, except it seems to have no effect
chrpath %{buildroot}%{python3_sitearch}/dolfin/*.so
chrpath --delete %{buildroot}%{python3_sitearch}/dolfin/*.so

ctest -V %{?_smp_mflags}

%doc README.rst
%dir /usr/share/dolfin
%dir /usr/share/dolfin/data

%files devel

%files doc

%files -n python3-dolfin

* Tue Aug 04 2020 Gwyn Ciesla <> - 2019.1.0.post0-9
- Fix FTBFS.

* Sat Aug 01 2020 Fedora Release Engineering <> - 2019.1.0.post0-8
- Second attempt - Rebuilt for

* Mon Jul 27 2020 Fedora Release Engineering <> - 2019.1.0.post0-7
- Rebuilt for

* Thu Jun 25 2020 Orion Poplawski <> - 2019.1.0.post0-6
- Rebuild for hdf5 1.10.6

* Tue Jun 23 2020 Gwyn Ciesla <> - 2019.1.0.post0-5
- Directly BR python3-setuptools.

* Wed Jun  3 2020 Zbigniew Jędrzejewski-Szmek <> - 2019.1.0.post0-4
- Rebuilt for new boost (#1843103)

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

* Tue Jan 28 2020 Fedora Release Engineering <> - 2019.1.0.post0-2
- Rebuilt for

* Wed Oct  9 2019 Zbigniew Jędrzejewski-Szmek <> - 2019.1.0-1
- Initial packaging