%bcond_with mpi %bcond_without hyp2mat %bcond_without ctb %global extraversion _16-ge2764d7 Name: octave-openems Version: 0.0.35 Release: 1%{?dist} Summary: An electromagnetic field solver for octave License: GPLv3+ and LGPLv3 and BSD # CTB: BSD # CSXCAD: LGPLv3 # rest: GPLv3+ URL: http://openems.de/start/ # git clone --recursive https://github.com/thliebig/openEMS-Project.git # (cd openEMS-Project; git describe --tags | sed -e s,-,_,) # tar cJvf openems-%%{version}.tar.xz --exclude-vcs openEMS-Project Source0: openems-v%{version}%{extraversion}.tar.xz Source1: Makefile.openEMS Source2: DESCRIPTION.openEMS Source3: DESCRIPTION.CSXCAD Source4: DESCRIPTION.hyp2mat Source5: DESCRIPTION.CTB Patch0: openems-fedora.patch Patch1: openems-qt4.patch BuildRequires: cmake BuildRequires: dos2unix BuildRequires: patchelf BuildRequires: boost-devel BuildRequires: hdf5-devel BuildRequires: fparser-devel BuildRequires: vtk-devel BuildRequires: tinyxml-devel BuildRequires: CGAL-devel BuildRequires: qt5-qtbase-devel BuildRequires: libXext-devel %if %{with mpi} BuildRequires: mpich-devel BuildRequires: vtk-mpich-devel %endif %if %{with hyp2mat} BuildRequires: libharu-devel BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: gengetopt BuildRequires: flex BuildRequires: bison %endif BuildRequires: octave-devel Requires: octave(api) = %{octave_api} Requires(post): octave Requires(postun): octave %if 0%{?fedora} < 30 && 0%{?rhel} < 8 Requires: vtk-qt < 8.0.0 %endif %if 0%{?fedora} >= 30 || 0%{?rhel} >= 8 Requires: vtk-qt >= 8.0.0 %endif ExclusiveArch: %{ix86} x86_64 %description openEMS is a free and open electromagnetic field solver using the FDTD method. Octave is used as an easy and flexible scripting interface. It features: * fully 3D Cartesian and cylindrical coordinates graded mesh. * Multi-threading, SIMD (SSE) and MPI support for high speed FDTD. %package devel Summary: Development files for openems Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The openems-devel package contains libraries and header files for developing applications that use openems. %if %{with hyp2mat} %package -n octave-hyp2mat Summary: An utility which converts HyperLynx files to octave License: GPLv3+ Requires: octave(api) = %{octave_api} Requires(post): octave Requires(postun): octave %description -n octave-hyp2mat hyp2mat is an utility which converts HyperLynx files to octave for electromagnetic simulation, or to PDF for printing. %endif %if %{with ctb} %package -n octave-ctb Summary: Circuit Toolbox for octave License: BSD Requires: octave(api) = %{octave_api} Requires(post): octave Requires(postun): octave %description -n octave-ctb Small collection of useful functions to convert n-port network parameter such as scattering parameter, Z- or Y-parameter. Read/Write to touchstone file format to read with Qucs: http://qucs.sourceforge.net %endif %prep %setup -q -n openEMS-Project %patch0 -p0 -b .jnx %if 0%{?fedora} < 30 && 0%{?rhel} < 8 %patch1 -p0 -b .qt4 %endif # use system fparser rm -rf fparser # ensure correct line termination dos2unix openEMS/matlab/Tutorials/*.m %build %if %{with hyp2mat} pushd hyp2mat ./bootstrap.sh %configure %make_build popd %endif %install rm -rf $RPM_BUILD_ROOT %if %{with hyp2mat} pushd hyp2mat %make_install rm -rf $RPM_BUILD_ROOT/%{_datadir}/hyp2mat popd %endif %global optflags %{optflags} -fdebug-prefix-map=%{?buildroot}/usr=/usr mkdir -p cbuild/{csxcad,openems,qcsxcad,appcsxcad} pushd cbuild/csxcad %cmake -DFPARSER_ROOT_DIR=/usr -DENABLE_RPATH:BOOL=OFF ../../CSXCAD %make_build %make_install popd pushd cbuild/openems %if %{with mpi} %cmake -DFPARSER_ROOT_DIR=/usr -DCSXCAD_ROOT_DIR=%{?buildroot}/usr -DWITH_MPI=1 -DENABLE_RPATH:BOOL=OFF ../../openEMS %endif %if ! %{with mpi} %cmake -DFPARSER_ROOT_DIR=/usr -DCSXCAD_ROOT_DIR=%{?buildroot}/usr -DWITH_MPI=0 -DENABLE_RPATH:BOOL=OFF ../../openEMS %endif %make_build %make_install popd pushd cbuild/qcsxcad %cmake -DCSXCAD_ROOT_DIR=%{?buildroot}/usr -DENABLE_RPATH:BOOL=OFF ../../QCSXCAD %make_build %make_install popd pushd cbuild/appcsxcad %cmake -DCSXCAD_ROOT_DIR=%{?buildroot}/usr -DQCSXCAD_ROOT_DIR=%{?buildroot}/usr -DLINK_DIRECTORIES:PATH=%{?buildroot}/%{_libdir} -DENABLE_RPATH:BOOL=OFF ../../AppCSXCAD %make_build %make_install popd rm -rf $RPM_BUILD_ROOT/%{_datadir}/openEMS/matlab/examples rm -rf $RPM_BUILD_ROOT/%{_datadir}/openEMS/matlab/Tutorials rm -f $RPM_BUILD_ROOT/%{_bindir}/AppCSXCAD.sh rm -f $RPM_BUILD_ROOT/%{_bindir}/openEMS.sh mkdir -p opkg mv $RPM_BUILD_ROOT/%{_datadir}/CSXCAD opkg/csxcad mv $RPM_BUILD_ROOT/%{_datadir}/openEMS opkg/openems mv opkg/csxcad/matlab opkg/csxcad/inst mv opkg/openems/matlab opkg/openems/inst rm -f opkg/{csxcad,openems}/inst/{private/,}*.{m,cc}.jnx mkdir -p opkg/openems/src mv opkg/openems/inst/h5readatt_octave.cc opkg/openems/src/h5readatt.cc cp %{SOURCE1} opkg/openems/src/Makefile cp %{SOURCE2} opkg/openems/DESCRIPTION cp %{SOURCE3} opkg/csxcad/DESCRIPTION cp CSXCAD/COPYING opkg/csxcad/ cp openEMS/COPYING opkg/openems/ mkdir -p %{_builddir}/%{buildsubdir}/build tar czf csxcad-%{version}.tar.gz -C %{_builddir}/%{buildsubdir}/opkg/ csxcad tar czf openems-%{version}.tar.gz -C %{_builddir}/%{buildsubdir}/opkg/ openems octave -H -q --no-window-system --no-site-file --eval 'pkg build -verbose -nodeps %{_builddir}/%{buildsubdir}/build csxcad-%{version}.tar.gz' octave -H -q --no-window-system --no-site-file --eval 'pkg build -verbose -nodeps %{_builddir}/%{buildsubdir}/build openems-%{version}.tar.gz' tar xf csxcad-%{version}.tar.gz -C %{_builddir}/%{buildsubdir}/build tar xf openems-%{version}.tar.gz -C %{_builddir}/%{buildsubdir}/build %global octave_tar_suffix any-none %global octpkg csxcad %octave_pkg_install %global octave_tar_suffix %{octave_host}-%{octave_api} %global octpkg openems %octave_pkg_install %if %{with hyp2mat} mkdir -p opkg/hyp2mat/inst cp -rv hyp2mat/matlab/*.m opkg/hyp2mat/inst/ rm -f opkg/hyp2mat/inst/Contents.m cp %{SOURCE4} opkg/hyp2mat/DESCRIPTION cp hyp2mat/COPYING opkg/hyp2mat/ tar czf hyp2mat-%{version}.tar.gz -C %{_builddir}/%{buildsubdir}/opkg/ hyp2mat octave -H -q --no-window-system --no-site-file --eval 'pkg build -verbose -nodeps %{_builddir}/%{buildsubdir}/build hyp2mat-%{version}.tar.gz' tar xf hyp2mat-%{version}.tar.gz -C %{_builddir}/%{buildsubdir}/build %global octave_tar_suffix any-none %global octpkg hyp2mat %octave_pkg_install %endif %if %{with ctb} mkdir -p opkg/ctb/inst cp -rv CTB/*.m opkg/ctb/inst/ cp %{SOURCE5} opkg/ctb/DESCRIPTION cp CTB/license.txt opkg/ctb/COPYING tar czf ctb-%{version}.tar.gz -C %{_builddir}/%{buildsubdir}/opkg/ ctb octave -H -q --no-window-system --no-site-file --eval 'pkg build -verbose -nodeps %{_builddir}/%{buildsubdir}/build ctb-%{version}.tar.gz' tar xf ctb-%{version}.tar.gz -C %{_builddir}/%{buildsubdir}/build %global octave_tar_suffix any-none %global octpkg ctb %octave_pkg_install %endif for i in %{_bindir}/AppCSXCAD %{_libdir}/libQCSXCAD.so.0.6.2; do patchelf --remove-rpath %{?buildroot}/$i done %post %octave_cmd pkg rebuild /sbin/ldconfig %preun %global octpkg openems %octave_pkg_preun %global octpkg csxcad %octave_pkg_preun %postun %octave_cmd pkg rebuild /sbin/ldconfig %if %{with hyp2mat} %post -n octave-hyp2mat %octave_cmd pkg rebuild %preun -n octave-hyp2mat %global octpkg hyp2mat %octave_pkg_preun %postun -n octave-hyp2mat %octave_cmd pkg rebuild %endif %if %{with ctb} %post -n octave-ctb %octave_cmd pkg rebuild %preun -n octave-ctb %global octpkg ctb %octave_pkg_preun %postun -n octave-ctb %octave_cmd pkg rebuild %endif %files %license openEMS/COPYING %doc readme.md %doc openEMS/matlab/examples %doc openEMS/matlab/Tutorials %{_bindir}/AppCSXCAD %{_bindir}/nf2ff %{_bindir}/openEMS %{_libdir}/libCSXCAD.so.0.6.2 %{_libdir}/libCSXCAD.so.0 %{_libdir}/libnf2ff.so.0.1.0 %{_libdir}/libnf2ff.so.0 %{_libdir}/libopenEMS.so.0.0.35 %{_libdir}/libopenEMS.so.0 %{_libdir}/libQCSXCAD.so.0.6.2 %{_libdir}/libQCSXCAD.so.0 %global octpkg csxcad %dir %{octpkgdir} %doc %{octpkgdir}/doc-cache %{octpkgdir}/*.m %{octpkgdir}/private/*.m %{octpkgdir}/packinfo %doc %{octpkgdir}/packinfo/COPYING %global octpkg openems %dir %{octpkgdir} %doc %{octpkgdir}/doc-cache %{octpkgdir}/*.m %{octpkgdir}/private/*.m %{octpkgdir}/packinfo %doc %{octpkgdir}/packinfo/COPYING %{octpkglibdir} %files devel %{_includedir}/CSXCAD %{_includedir}/openEMS %{_includedir}/QCSXCAD %{_libdir}/libCSXCAD.so %{_libdir}/libnf2ff.so %{_libdir}/libopenEMS.so %{_libdir}/libQCSXCAD.so %if %{with hyp2mat} %files -n octave-hyp2mat %license hyp2mat/COPYING %doc hyp2mat/{NEWS,README,AUTHORS,THANKS} %{_bindir}/hyp2mat %{_mandir}/man1/hyp2mat.1* %global octpkg hyp2mat %dir %{octpkgdir} %doc %{octpkgdir}/doc-cache %{octpkgdir}/*.m %{octpkgdir}/packinfo %doc %{octpkgdir}/packinfo/COPYING %endif %if %{with ctb} %files -n octave-ctb %license CTB/license.txt %doc CTB/readme.txt %global octpkg ctb %dir %{octpkgdir} %doc %{octpkgdir}/doc-cache %{octpkgdir}/*.m %{octpkgdir}/packinfo %doc %{octpkgdir}/packinfo/COPYING %endif %changelog * Fri Jul 10 2020 Thomas Sailer - 0.0.35-2 - update to 0.0.35_16-ge2764d7 * Fri Feb 08 2019 Thomas Sailer - 0.0.35-1 - initial package