%define oname OpenFOAM %define osrcname %{oname}-%{version} %define libfoamdir %{_libdir}/%{name} %define binfoamdir %{_libexecdir}/%{name} %define datafoamdir %{_datadir}/%{oname}-%{version} %define pvversion 5.6 %define optnopipe %(LC_ALL=C echo "%{optflags}" | sed "s|-pipe||g") Name: openfoam Version: 7 Release: %mkrel 4 Summary: The open source CFD toolbox License: GPLv3+ Group: Sciences/Physics Url: http://www.openfoam.org # https://github.com/OpenFOAM/OpenFOAM-6/ Source0: http://downloads.sourceforge.net/foam/%{osrcname}.tar.gz Source1: openfoam #find system include and libraries for scotch Patch0: openfoam-7-scotch.patch #find system include and libraries for paraview Patch1: openfoam-7-paraview-5.6.0.patch #Fix basic mistakes in bash preventing to even start compiling... Patch2: openfoam-7-aliases.patch #aarch64 support Patch4: openfoam-5.0-aarch64.patch #fix .txt file output in /usr/lib64... Patch5: openfoam-6-PVSMH-outputdir.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: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Help) BuildRequires: pkgconfig(Qt5Network) BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(jsoncpp) BuildRequires: pkgconfig(glu) BuildRequires: pkgconfig(protobuf) BuildRequires: netcdf-cxx-devel BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(glew) Requires: gcc-c++ Requires: openmpi-devel Obsoletes: openfoam-doc < 4.1 %description OpenFOAM is a free, open source computational fluid dynamcis (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} #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|%{buildroot}%{_libdir}|g" ./etc/config.sh/paraview %patch2 -p1 -b .orig %patch5 -p1 -b .orig %__sed -i "s|libARCH|%{_lib}|g" ./applications/utilities/postProcessing/graphics/PVReaders/Allwmake # aarch64 cp -ar wmake/rules/linux64Gcc wmake/rules/linuxAArch64Gcc %patch4 -p1 -b .aarch64-fix %__sed -i "/^\(CC\|cc\)/s/-m\(32\|64\)//" wmake/rules/linuxAArch64Gcc/* #tentative for reducing memory usage at compilation (removed -pipe) %ifarch aarch64 %__sed -i "s/^cOPT.*$/cOPT = %{optnopipe}/" wmake/rules/linux*Gcc/cOpt %__sed -i "s/^c++OPT.*$/c++OPT = %{optnopipe}/" wmake/rules/linux*Gcc/c++Opt %else %__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 %endif %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}/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/linuxAArch64GccDPInt32Opt %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 %__install -D ./lib/paraview-%{pvversion}/*.so -t %{buildroot}%{libfoamdir}/paraview-%{pvversion} %__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 #removed, sees to be screwing up the tutorials #fdupes -s %{buildroot}%{datafoamdir}/tutorials %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 %dir %{datafoamdir} %{datafoamdir}/bin %{datafoamdir}/etc %{binfoamdir} %{libfoamdir} %files tutorials %{datafoamdir}/tutorials %changelog * Tue Sep 24 2019 eatdirt <eatdirt> 7-4.mga7 + Revision: 1445487 - Add missing Requires to openmpi-devel - Removing synlinks created by fdupes that crash tutorials - Upgrade to version 7, fix mga#25443 and supports paraview-5.6 * 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