Sophie

Sophie

distrib > Mageia > 9 > armv7hl > by-pkgid > b556fbba0778ddcc22cf53be790c22e4 > files > 8

openfoam-10-2.mga9.src.rpm

%define oname           OpenFOAM
%define osrcname        %{oname}-%{version}
%define libfoamdir      %{_libdir}/%{name}
%define binfoamdir      %{_libexecdir}/%{name}
%define datafoamdir     %{_datadir}/%{oname}-%{version}
%define pvversion       5.8
%define tag             version-10

#openfoam devel is doing a very good job lagging ages behind paraview
%define with_paraview   0

%ifarch %arm %ix86
%global _smp_ncpus_max $(expr $(nproc) / 2)
%endif


Name:          openfoam
Version:       10
Release:       %mkrel 2
Summary:       The open source CFD toolbox
License:       GPLv3+
Group:         Sciences/Physics
Url:           https://www.openfoam.org/
# https://github.com/OpenFOAM/OpenFOAM-9/
Source0:       https://github.com/%{name}/%{name}-%{version}/archive/refs/tags/%{tag}.tar.gz
Source1:       openfoam

#find system include and libraries for scotch
Patch0:        openfoam-9-scotch.patch

#find system include and libraries for paraview
Patch1:        openfoam-9-paraview-5.10.1.patch

#Fix basic mistakes in bash preventing to even start compiling...
Patch2:        openfoam-7-aliases.patch

#aarch64 support
Patch4:        openfoam-7-arm8aarch64.patch

#fix deprecated cmake macro
Patch6:        openfoam-7-pvreader-5.8.0.patch

# Fix usage of non fixed root path for etc/bashrc:  can be OpenFOAM-9 or OpenFOAM-9-20211122
Patch7:        openfoam-9-Fix-bashrc-for-not-specific-root-path.patch


BuildRequires: bison
BuildRequires: boost-devel
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: flex
BuildRequires: mpfr-devel
BuildRequires: pkgconfig(ompi)
BuildRequires: libgomp-devel
BuildRequires: pkgconfig(zlib)
BuildRequires: ptscotch-openmpi-devel
BuildRequires: libptscotch-parmetis-openmpi-devel
BuildRequires: cgal-devel
BuildRequires: paraview-devel
BuildRequires: paraview-static-devel
BuildRequires: python3-mpi4py-devel
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Help)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: qtxmlpatterns5-xmlpatterns
BuildRequires: pkgconfig(Qt5XmlPatterns)
BuildRequires: pkgconfig(jsoncpp)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(protobuf)
BuildRequires: netcdf-cxx-devel
BuildRequires: pkgconfig(xt)
BuildRequires: pkgconfig(glew)
BuildRequires: utf8cpp-devel
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(libtiff-4)
BuildRequires: lz4-devel
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(eigen3)
BuildRequires: double-conversion-devel
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(theora)
BuildRequires: pkgconfig(pugixml)
BuildRequires: pkgconfig(libpng)
BuildRequires: utf8cpp-devel
BuildRequires: cgns-devel

Requires:      gcc-c++
Requires:      openmpi-devel

%description
OpenFOAM is a free, open source computational fluid dynamics (CFD)
software package released by the OpenFOAM Foundation. It has a large
user base across most areas of engineering and science, from both
commercial and academic organisations. OpenFOAM has an extensive range
of features to solve anything from complex fluid flows involving
chemical reactions, turbulence and heat transfer, to solid dynamics
and electromagnetics. This package provides the platform specific
binaries and modules located in %{binfoamdir} and %{libfoamdir},
respectively.



%package       tutorials
Summary:       Development files for %{name}
Group:         Sciences/Physics
Requires:      %{name} = %{version}

%description   tutorials
The %{name}-tutorials package contains tutorials and examples
for %{oname}.


%prep
%setup -q -n %{osrcname}-%{tag}
#autopatch -p1
%patch0 -p1 -b .orig
sed -i "s|libARCH|%{_lib}|g" ./etc/config.sh/scotch
%patch1 -p1 -b .orig
sed -i "s|libARCH|%{_lib}|g" ./etc/config.sh/paraview
sed -i "s|PVINSTLIBDIR|%{_libdir}|g" ./etc/config.sh/paraview

%patch2 -p1 -b .orig


# aarch64/armv8l
%patch4 -p1 -b .arm8aarch64
cp -ar wmake/rules/linux64Gcc wmake/rules/linuxAArch64Gcc
sed -i "/^\(CC\|cc\)/s/-m\(32\|64\)//" wmake/rules/linuxAArch64Gcc/*
sed -i "s|-m32||g" wmake/rules/linuxGcc/*
sed -i "s/^cOPT.*$/cOPT = %{optflags}/" wmake/rules/linux*Gcc/cOpt
sed -i "s/^c++OPT.*$/c++OPT = %{optflags}/" wmake/rules/linux*Gcc/c++Opt


%if %{with_paraview}
%patch6 -p1 -b .pvreader
%else
%__rm -r -f %{_builddir}/%{osrcname}/applications/utilities/postProcessing/graphics/PVReaders
%endif

%patch7 -p1 

%build
#Welcome to the best non-portable build system ever invented...

#Let's set mga compile flags in such a simple way
source %{_builddir}/%{osrcname}-%{tag}/etc/bashrc

#Let's also specify parallel make by hand
./Allwmake %{?_smp_mflags}

%install
#Clean object files, build residuals and other shits
find ./platforms/*/applications \( -name \*.o -o -name \*.dep \) -delete
find ./platforms/*/src \( -name \*.o -o -name \*.dep \) -delete
find ./platforms -name '*.la' -delete
find ./tutorials -name '.keep' -delete

#to be checked for arm?
%ifarch x86_64
PLATFORMDIR=./platforms/linux64GccDPInt32Opt
%endif
%ifarch %{ix86}
PLATFORMDIR=./platforms/linuxGccDPInt32Opt
%endif
%ifarch %{arm}
PLATFORMDIR=./platforms/linuxARM7GccDPInt32Opt
%endif
%ifarch aarch64
PLATFORMDIR=./platforms/linuxArm64GccDPInt32Opt
%endif

pushd $PLATFORMDIR
%__install -D ./bin/* -t %{buildroot}%{binfoamdir}
%__install -D ./lib/*.so -t %{buildroot}%{libfoamdir}
%__install -D ./lib/dummy/*.so -t %{buildroot}%{libfoamdir}/dummy

%if %{with_paraview}
%__install -D ./lib/paraview-%{pvversion}/*.so -t %{buildroot}%{libfoamdir}/paraview-%{pvversion}
%endif
%__install -D ./lib/openmpi-system/*.so -t %{buildroot}%{libfoamdir}/openmpi-system
popd

%__mkdir_p %{buildroot}%{datafoamdir}
cp -r -f tutorials -t %{buildroot}%{datafoamdir}/
cp -r -f bin -t %{buildroot}%{datafoamdir}/
cp -r -f etc -t %{buildroot}%{datafoamdir}/


# ld.conf.d file
%__install -d %{buildroot}%{_sysconfdir}/ld.so.conf.d
echo %{libfoamdir} > %{buildroot}%{_sysconfdir}/ld.so.conf.d/openfoam.conf
echo %{libfoamdir}/dummy >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/openfoam.conf
echo %{libfoamdir}/paraview-%{pvversion} >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/openfoam.conf
echo %{libfoamdir}/openmpi-system >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/openfoam.conf


# replace duplicates by symlinks
%fdupes -s %{buildroot}%{datafoamdir}/doc

%__install -D -m 755 %{SOURCE1} %{buildroot}%{_bindir}/openfoam

%files
%doc doc/Guides/*.pdf
%config(noreplace) %{_sysconfdir}/ld.so.conf.d/openfoam.conf
%{_bindir}/openfoam
%{datafoamdir}/bin
%{datafoamdir}/etc
%{binfoamdir}
%{libfoamdir}


%files tutorials
%{datafoamdir}/tutorials


%changelog
* Thu Jul 14 2022 papoteur <papoteur> 10-2.mga9
+ Revision: 1868834
- fix launcher with new release number

* Wed Jul 13 2022 papoteur <papoteur> 10-1.mga9
+ Revision: 1868707
- new release 10

* Fri Jul 08 2022 papoteur <papoteur> 9-4.mga9
+ Revision: 1868038
- add upstream patch for use with GCC 12

* Wed May 04 2022 papoteur <papoteur> 9-3.mga9
+ Revision: 1856186
- Fix root path for etc/bashrc
- Fix version in openfoam launcher only at one place
- Fix version in openfoam launcher
  Fix path in bashrc, no tag needed

* Tue May 03 2022 neoclust <neoclust> 9-2.mga9
+ Revision: 1855562
- Rebuild with fixed aarch64
+ papoteur <papoteur>
- Update to release 9
+ umeabot <umeabot>
- Mageia 9 Mass Rebuild

* Mon May 31 2021 akien <akien> 7-18.mga9
+ Revision: 1728989
- Rebuild for cgal 5.2.1

* Fri Dec 18 2020 luigiwalser <luigiwalser> 7-17.mga8
+ Revision: 1660990
- rebuild for protobuf

* Thu Dec 17 2020 umeabot <umeabot> 7-16.mga8
+ Revision: 1659212
- Rebuild for new Qt5

* Wed Dec 02 2020 luigiwalser <luigiwalser> 7-15.mga8
+ Revision: 1651605
- rebuild for glew

* Mon Nov 30 2020 luigiwalser <luigiwalser> 7-13.mga8
+ Revision: 1650541
- rebuild for protobuf

* Sun Nov 29 2020 luigiwalser <luigiwalser> 7-12.mga8
+ Revision: 1650316
- rebuild for jsoncpp

* Thu Oct 29 2020 joequant <joequant> 7-11.mga8
+ Revision: 1640348
- rebuild pkg

* Fri Aug 21 2020 joequant <joequant> 7-10.mga8
+ Revision: 1617560
- fix rpm build break
+ daviddavid <daviddavid>
- rebuild for new protobuf 3.12.3
+ pterjan <pterjan>
- Remove usage of obsolete macros (https://github.com/rpm-software-management/rpm/issues/1211)

* Tue Mar 24 2020 eatdirt <eatdirt> 7-8.mga8
+ Revision: 1559464
- Tentative fix for arm

* Tue Mar 24 2020 eatdirt <eatdirt> 7-7.mga8
+ Revision: 1559456
- Disable obsoleted pvreader
- Rebuild for new netcdf and paraview

* Tue Feb 18 2020 umeabot <umeabot> 7-5.mga8
+ Revision: 1541110
- Mageia 8 Mass Rebuild

* Thu Dec 19 2019 daviddavid <daviddavid> 7-4.mga8
+ Revision: 1468854
- rebuild for new protobuf 3.11.2

* Fri Oct 11 2019 tv <tv> 7-3.mga8
+ Revision: 1451604
- fix defining _smp_ncpus_max...
+ eatdirt <eatdirt>
- Fix aarch64 build, add missing requires
- Upgrade to version 7

* Sun Mar 31 2019 umeabot <umeabot> 6-5.mga7
+ Revision: 1383610
- Qt5 Rebuild

* Mon Jan 14 2019 daviddavid <daviddavid> 6-4.mga7
+ Revision: 1356391
- rediff/rename paraview patch to adapt new 5.6.0 release
+ tv <tv>
- rebuild with python 3.7

* Sun Sep 23 2018 umeabot <umeabot> 6-3.mga7
+ Revision: 1300014
- Mageia 7 Mass Rebuild

* Fri Aug 10 2018 eatdirt <eatdirt> 6-2.mga7
+ Revision: 1250900
- Fix missing BR to GLEW
- Upgrade to version 6

* Mon Jul 23 2018 wally <wally> 5.0-6.mga7
+ Revision: 1245002
- add aarch64 support

* Fri May 18 2018 eatdirt <eatdirt> 5.0-5.mga7
+ Revision: 1230356
- Rebuild for new openmpi

* Tue May 01 2018 daviddavid <daviddavid> 5.0-4.mga7
+ Revision: 1224315
- rebuild for new protobuf 3.5.2
- split out all Qt5 BRs
+ eatdirt <eatdirt>
- Fix wrong version in starter script

* Thu Oct 19 2017 eatdirt <eatdirt> 5.0-3.mga7
+ Revision: 1172739
- Fix missing BR to glu
- Fix missing BR
- Fix setting include path for scotch
- Upgrade to version 5.0
- Rebuild for new openmpi

* Sat Sep 16 2017 tv <tv> 4.1-4.mga7
+ Revision: 1154573
- rebuild with latest boost

* Tue Aug 08 2017 daviddavid <daviddavid> 4.1-3.mga7
+ Revision: 1139009
- add upstream patch to fix build against cgal 4.10
  * https://github.com/OpenFOAM/OpenFOAM-4.x/commit/53b4b3fc2dfcaad06e3595993094cebe14d9aa55
- rebuild for new cgal 4.10

* Wed May 03 2017 eatdirt <eatdirt> 4.1-2.mga6
+ Revision: 1098848
- Rebuild for new paraview

* Thu Dec 15 2016 eatdirt <eatdirt> 4.1-1.mga6
+ Revision: 1075397
- Tentative patch to fix arm built failures
- Fix missing BuildRequires
- Add environment launcher + fix module paths
- Upgrade to version 4.1

* Fri Dec 02 2016 tmb <tmb> 2.4.0-6.mga6
+ Revision: 1071630
- rebuild for new openmpi

* Tue Oct 18 2016 pterjan <pterjan> 2.4.0-5.mga6
+ Revision: 1061717
- Use of flags on armv7hl

* Tue Feb 16 2016 umeabot <umeabot> 2.4.0-4.mga6
+ Revision: 961946
- Mageia 6 Mass Rebuild

* Sun Dec 27 2015 daviddavid <daviddavid> 2.4.0-3.mga6
+ Revision: 915535
- rebuild for new boost 1.60.0

* Wed Sep 30 2015 daviddavid <daviddavid> 2.4.0-2.mga6
+ Revision: 885268
- rebuild for new openmpi 1.10.0

* Tue Sep 29 2015 tv <tv> 2.4.0-1.mga6
+ Revision: 885144
- new release

* Sun Sep 27 2015 tv <tv> 2.3.1-3.mga6
+ Revision: 884211
- rebuild for new boost

* Sun Aug 02 2015 daviddavid <daviddavid> 2.3.1-2.mga6
+ Revision: 860795
- rebuild for new boost-1.58.0

* Sun Feb 08 2015 akien <akien> 2.3.1-1.mga5
+ Revision: 814142
- Fix launcher script when tutorials are not installed
- Version 2.3.1

* Wed Oct 15 2014 umeabot <umeabot> 2.3.0-6.mga5
+ Revision: 745859
- Second Mageia 5 Mass Rebuild

* Fri Sep 26 2014 tv <tv> 2.3.0-5.mga5
+ Revision: 725152
- rebuild for bogus file deps

* Tue Sep 16 2014 umeabot <umeabot> 2.3.0-4.mga5
+ Revision: 683210
- Mageia 5 Mass Rebuild

* Tue Aug 26 2014 akien <akien> 2.3.0-3.mga5
+ Revision: 668501
- Build requires boost-devel

* Sat Jun 21 2014 akien <akien> 2.3.0-2.mga5
+ Revision: 638237
- Improve %%description
- Add a launcher script to start the OpenFOAM bash environment

* Tue Feb 18 2014 akien <akien> 2.3.0-1.mga5
+ Revision: 594265
- Update to version 2.3.0: http://www.openfoam.org/version2.3.0/
- Add BR on mpfr-devel

* Mon Dec 02 2013 philippem <philippem> 2.2.2-0.mga4
+ Revision: 554606
- imported package openfoam