Blame dolfin.spec

f602303
Name:		dolfin
f602303
Version:	2019.1.0.post0
f602303
%global fenics_version 2019.1
c31197f
Release:        3%{?dist}
f602303
Summary:        FEniCS computational backend and problem solving environment
f602303
f602303
License:        LGPLv3+
f602303
URL:            https://fenicsproject.org/
f602303
Source0:        https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-%{version}.tar.gz
f602303
Source1:        https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-%{version}.tar.gz.asc
f602303
Source2:        3083BE4C722232E28AD0828CBED06106DD22BAB3.gpg
f602303
f602303
BuildRequires:  gcc-c++
f602303
BuildRequires:  gnupg2
f602303
BuildRequires:  cmake
f602303
BuildRequires:  boost-devel
f602303
BuildRequires:  eigen3-devel
f602303
BuildRequires:  petsc-devel
f602303
BuildRequires:  sundials-devel
f602303
BuildRequires:  scotch-devel
f602303
# ptscotch-mpich-devel?
f602303
BuildRequires:  blas-devel
f602303
# openblas-devel?
f602303
BuildRequires:  hdf5-devel
f602303
# hdf5-mpich-devel?
f602303
BuildRequires:  zlib-devel
f602303
BuildRequires:  python3-devel
f602303
BuildRequires:  pybind11-devel
f602303
BuildRequires:  python3dist(numpy)
f602303
BuildRequires:  python3dist(fenics-ffc) >= %{fenics_version}
f602303
BuildRequires:  python3dist(fenics-ufl) >= %{fenics_version}
f602303
BuildRequires:  python3dist(fenics-dijitso) >= %{fenics_version}
f602303
# go cmake go
f602303
BuildRequires:  chrpath
f602303
f602303
# check-buildroot flags the python .so, but it should be fine after rpath removal.
f602303
# It seems that the original path to the library is stored in some comment.
f602303
%global __arch_install_post /usr/lib/rpm/check-buildroot || :
f602303
f602303
#BuildRequires:  mpich-devel
f602303
#BuildRequires:  openmpi-devel
f602303
f602303
%global _description %{expand:
f602303
DOLFIN is the computational backend of FEniCS and implements the
f602303
FEniCS Problem Solving Environment.}
f602303
f602303
%description %_description
f602303
f602303
%package devel
f602303
Summary:        Development files for %{name}
f602303
Requires:       %{name} = %{version}-%{release}%{?isa}
f602303
f602303
%description devel
f602303
%{summary}.
f602303
f602303
%package -n python3-dolfin
f602303
Summary:        Python wrapper for the FEniCS dolfin environment
f602303
# The jit compiles and links to the dolfin library
f602303
Requires:       %{name}-devel = %{version}-%{release}%{?isa}
f602303
%{?python_provide:%python_provide python3-dolfin}
f602303
f602303
%description -n python3-dolfin %_description
f602303
f602303
%package doc
f602303
Summary:        Documentation and demos for %{name}
f602303
BuildArch:      noarch
f602303
f602303
%description doc
f602303
%{summary}.
f602303
f602303
%prep
f602303
%{?gpgverify:%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'}
f602303
f602303
%autosetup -n dolfin-%{version}
f602303
f602303
# Let's just specify an exact version of a dependency, yay!
f602303
sed -i -r 's|pybind11==|pybind11>=|' python/setup.py
f602303
f602303
cat >>python/CMakeLists.txt <
f602303
set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -I$PWD")
f602303
EOF
f602303
f602303
%build
f602303
# %%_mpich_load
f602303
mkdir -p build && cd build
f602303
CFLAGS=-Wno-unused-variable %cmake .. -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=off
f602303
%make_build
f602303
f602303
# "temporary install" so the python build can find the stuff it needs
f602303
%make_install
f602303
f602303
cd ../python
f602303
VERBOSE=1 CMAKE_PREFIX_PATH=%{buildroot}/usr/share/dolfin/cmake CMAKE_SKIP_INSTALL_RPATH=yes CMAKE_SKIP_RPATH=yes %py3_build
f602303
f602303
%install
f602303
cd build
f602303
%make_install
f602303
f602303
cd ../python
f602303
VERBOSE=1 CMAKE_PREFIX_PATH=%{buildroot}/usr/share/dolfin/cmake CMAKE_SKIP_INSTALL_RPATH=yes CMAKE_SKIP_RPATH=yes %py3_install
f602303
f602303
sed -r -i '1 {s|#!/usr/bin/env python.*|#!%{__python3}|}' \
f602303
    %{buildroot}/usr/bin/dolfin-order \
f602303
    %{buildroot}/usr/bin/dolfin-plot \
f602303
    %{buildroot}/usr/bin/dolfin-convert
f602303
f602303
# this file is just pointless
f602303
rm %{buildroot}/usr/share/dolfin/dolfin.conf
f602303
f602303
# there's even an option for this, except it seems to have no effect
f602303
chrpath %{buildroot}%{python3_sitearch}/dolfin/*.so
f602303
chrpath --delete %{buildroot}%{python3_sitearch}/dolfin/*.so
f602303
f602303
%check
f602303
ctest -V %{?_smp_mflags}
f602303
f602303
%files
f602303
%license COPYING COPYING.LESSER AUTHORS
f602303
%doc README.rst
f602303
/usr/bin/dolfin-version
f602303
/usr/bin/fenics-version
f602303
%{_libdir}/libdolfin.so.%{fenics_version}
f602303
%{_libdir}/libdolfin.so.%{fenics_version}.*
f602303
%dir /usr/share/dolfin
f602303
%dir /usr/share/dolfin/data
f602303
/usr/share/dolfin/data/README
f602303
f602303
%files devel
f602303
/usr/include/dolfin.h
f602303
/usr/include/dolfin/
f602303
%{_libdir}/libdolfin.so
f602303
%{_libdir}/pkgconfig/dolfin.pc
f602303
/usr/share/dolfin/cmake/
f602303
f602303
%files doc
f602303
/usr/bin/dolfin-get-demos
f602303
/usr/share/dolfin/demo/
f602303
f602303
%files -n python3-dolfin
f602303
/usr/bin/dolfin-convert
f602303
/usr/bin/dolfin-order
f602303
/usr/bin/dolfin-plot
f602303
%{python3_sitearch}/dolfin/
f602303
%{python3_sitearch}/dolfin_utils/
f602303
%{python3_sitearch}/fenics/
f602303
%{python3_sitearch}/fenics_dolfin-%{fenics_version}*-py%{python3_version}.egg-info/
f602303
f602303
%changelog
c31197f
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2019.1.0.post0-3
c31197f
- Rebuilt for Python 3.9
c31197f
ead233c
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2019.1.0.post0-2
ead233c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
ead233c
f602303
* Wed Oct  9 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2019.1.0-1
f602303
- Initial packaging