A new user interface for you! Read more...

File openmodelica.spec of Package openmodelica

#
# spec file for package openmodelica
#
# Copyright (c) 2019 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/

%define _omclibdir %{_libdir}/omc
Summary:       A complete Modelica environment
Name:          openmodelica
#https://bugzilla.opensuse.org/show_bug.cgi?id=1131755
License:       OSMC-PL
Group:         Productivity/Scientific/Math
Version:       1.13.2
Release:       0
URL:           https://openmodelica.org/
Source0:       %{name}-%{version}.tar.bz2
Source1:       %{name}-doc_%{version}.tar.bz2	
Source2:       %{name}_system_integration.tar.bz2
Source3:	   %{name}-rpmlintrc
Patch1:		   fix_paradiseo_on_newer_cmake.patch
Patch2:		   fix_rpath_search_on_opensuse.patch
Patch3:		   fix-no-return-in-nonvoid-function.patch
Patch4:        fix-implicit-fortify-decl.patch
BuildRequires: chrpath
BuildRequires: doxygen
BuildRequires: gnuplot
BuildRequires: gettext
BuildRequires: gcc-fortran
BuildRequires: fdupes
BuildRequires: omniORB-devel
BuildRequires: openmpi-devel
BuildRequires: libexpat-devel
BuildRequires: lapack-devel
BuildRequires: libtool
BuildRequires: uuid-devel
BuildRequires: hdf5-devel
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_serialization-devel
BuildRequires: libboost_program_options-devel
BuildRequires: hwloc-devel
BuildRequires: readline-devel
BuildRequires: readline-devel
BuildRequires: opencl-headers
BuildRequires: uuid-devel
BuildRequires: java-1_8_0-openjdk-devel
BuildRequires: libqt5-linguist
BuildRequires: libqt5-qttools
BuildRequires: libqt5-qtbase-devel
BuildRequires: libqt5-qtsvg-devel
BuildRequires: libQt5WebKit5-devel
BuildRequires: libQt5WebKitWidgets-devel
BuildRequires: libqt5-qtxmlpatterns-devel
BuildRequires: libqt5-qt3d-devel
BuildRequires: libOpenSceneGraph-devel
BuildRequires: pugixml-devel
BuildRequires: hwloc-devel
BuildRequires: update-desktop-files
BuildRequires: -post-build-checks
# Try to use as much shared libraries as possible
# OMCompiler
BuildRequires: zeromq-devel
BuildRequires: zlib-devel
BuildRequires: ipopt-devel
BuildRequires: sundials-devel
BuildRequires: sqlite3-devel
BuildRequires: libfl-devel
BuildRequires: cminpack-devel
BuildRequires: suitesparse-devel
BuildRequires: flex
BuildRequires: lpsolve-devel
BuildRequires: metis-devel
BuildRequires: open62541-devel
#BuildRequires: trilinos-devel


%description
OPENMODELICA is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage.
The goal of the project is to create a complete Modelica modeling, 
compilation and simulation environment based on free software 
distributed in binary and source code form.

%package -n omc
Summary:        The OpenModelica Compiler
Group:          Productivity/Scientific/Math
Requires:       clang
Requires:       gcc
Requires:       gnuplot
Requires:       automake 
Requires:       make
Requires:       omc-java = %{version}-%{release}
Requires:       omc-common = %{version}-%{release}
Requires:       libomc = %{version}-%{release}
Requires:		libomc-simulation = %{version}-%{release}
Requires:		libomc-simulator = %{version}-%{release}
Suggests:		libomccpp = %{version}-%{release}
Suggests:       omplot = %{version}-%{release}
Suggests:       omc-doc = %{version}-%{release}
Suggests:       omedit = %{version}-%{release}
Suggests:       omnotebook = %{version}-%{release}
Suggests:       omshell = %{version}-%{release}
Suggests:       omshell-terminal = %{version}-%{release}
Suggests:       omc-lang = %{version}-%{release}

%description -n omc
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage.

%package -n omc-common
Summary:        OpenModelica Compiler - common files
Group:          Productivity/Scientific/Math
Requires:       libomc = %{version}-%{release}
Suggests:       libomccpp = %{version}-%{release}

%description -n omc-common
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage.
This package contains the common files of the OpenModelica project.

%package -n omc-java
Summary:        OpenModelica Java interface
Group:          Productivity/Scientific/Math
Requires:       omc = %{version}-%{release}

%description -n omc-java
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage.
OpenModelica Java interface. Contains jar-files to interface with OpenModelica.

%package -n omc-lang
Summary:        The OpenModelica Compiler language files
Group:          Productivity/Scientific/Math
Requires:       omc = %{version}-%{release}

%description -n omc-lang
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage.
This package contains the language files.

%package -n omc-doc
Summary:        OpenModelica documentation
Group:          Productivity/Scientific/Math
Requires:       omc = %{version}-%{release}

%description -n omc-doc
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage.
This package contains large pdf-manuals for OpenModelica.

%package -n libomc
Summary:        The OpenModelica Compiler
Group:          Productivity/Scientific/Math
Requires:       omc-common = %{version}-%{release}
Requires:       libomc-simulator = %{version}-%{release}
Requires:       libomc-simulation = %{version}-%{release}
Requires:       libomc-simulation-devel = %{version}-%{release}
Requires:       lapack-devel
Requires:       blas-devel

%description -n libomc
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage.
This package contains the runtime libraries used by the OpenModelica Compiler

%package -n libomc-devel
Summary:        OpenModelica Compiler - development files
Group:          Development/Libraries/Other
Requires:       libomc = %{version}-%{release}

%description -n libomc-devel
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage.
This package contains the development files for the OpenModelica Compiler.

%package -n libomc-simulation
Summary:        Core libraries of the OpenModelica
Group:          Productivity/Scientific/Math
Requires:       libomc = %{version}-%{release}
Requires:       omc-common = %{version}-%{release}

%description -n libomc-simulation
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage.
This is the core libraries of the OpenModelica project and can be used
for cross-compiling simulation executables and FMU's.

%package -n libomc-simulation-devel
Summary:        Core libraries of OpenModelica - development files
Group:          Development/Libraries/Other
Requires:       libomc-simulation = %{version}-%{release}

%description -n libomc-simulation-devel
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage.
This is the core libraries of the OpenModelica project and can be used
for cross-compiling simulation executables and FMU's.
This package contains the development files.

%package -n libomc-simulator
Summary:        OpenModelica OMSimulator - runtime libraries
Group:          Productivity/Scientific/Math
Requires:       omc-common = %{version}-%{release}
Requires:       libomc = %{version}-%{release}

%description -n libomc-simulator
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage
The OpenModelica OMSimulator is a simulator that allows a tool to for example 
simulate FMUs.

%package -n libomc-simulator-devel
Summary:        OpenModelica OMSimulator - development files
Group:          Development/Libraries/Other
Requires:       libomc-simulator = %{version}-%{release}

%description -n libomc-simulator-devel
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage
The OpenModelica OMSimulator is a simulator that allows a tool to for example 
simulate FMUs.
This package contains the development files.

%package -n libomccpp
Summary:        Libraries for the C++ code generation target of OpenModelica
Group:          Productivity/Scientific/Math
Requires:       omc-common = %{version}-%{release}
Requires:       libomc = %{version}-%{release}

%description -n libomccpp
The OpenModelica Compiler is the core of the OpenModelica project, 
which is an open-source Modelica-based modeling and simulation environment 
intended for industrial and academic usage
The OpenModelica OMSimulator is a simulator that allows a tool to for example 
simulate FMUs.
Libraries for the C++ code generation target of OpenModelica.

%package -n omplot
Summary:        Plot tool for OpenModelica
Group:          Productivity/Scientific/Math
Requires:       libomplot = %{version}-%{release}
Requires:       omc = %{version}-%{release}

%description -n omplot
Plot tool for OpenModelica. This tool is essential for using the plot() command in omc.

%package -n libomplot
Summary:        Plot tool for OpenModelica - runtime libraries
Group:          Productivity/Scientific/Math
Requires:       omc = %{version}-%{release}

%description -n libomplot
Plot tool for OpenModelica. This tool is essential for using the plot() command in omc.
This package contains the runtime libraries for omplot

%package -n libomplot-devel
Summary:        Plot tool for OpenModelica - development files
Group:          Development/Libraries/Other
Requires:       libomplot = %{version}-%{release}

%description -n libomplot-devel
Plot tool for OpenModelica. This tool is essential for using the plot() command in omc. 
This package contains the development files.

%package -n omshell
Summary:        A text-based interface to OpenModelica (based on Qt)
Group:          Productivity/Scientific/Math
Requires:       omc = %{version}-%{release}

%description -n omshell
A text-based interface to OpenModelica (based on Qt).

%package -n omshell-terminal
Summary:        A text-based interface to OpenModelica (based on readline)
Group:          Productivity/Scientific/Math
Requires:       omc = %{version}-%{release}

%description -n omshell-terminal
A text-based interface to OpenModelica (based on readline).

%package -n omoptim
Summary:        A Modelica optimization tool for OpenModelica
Group:          Productivity/Scientific/Math
Requires:       omc = %{version}-%{release}
Requires:       gnuplot

%description -n omoptim
A Modelica optimization tool for OpenModelica.

%package -n omnotebook
Summary:        A Mathematica-style Notebook for OpenModelica
Group:          Productivity/Scientific/Math
Requires:       omc = %{version}-%{release}
Requires:       omplot = %{version}-%{release}
Suggests:		drcontrol = %{version}-%{release}
Suggests:		drmodelica = %{version}-%{release}

%description -n omnotebook
A Mathematica-style Notebook for OpenModelica.

%package -n omedit
Summary:        Modelica connection editor for OpenModelica
Group:          Productivity/Scientific/Math
Requires:       omc = %{version}-%{release}
Requires:       omplot = %{version}-%{release}
Requires:       omshell = %{version}-%{release}

%description -n omedit
A Modelica connection editor for OpenModelica. OMEdit is still in active development. 
Please try it out and give feedback.

%package -n omedit-devel
Summary:        Modelica connection editor for OpenModelica - development files
Group:          Development/Libraries/Other
Requires:       omedit = %{version}-%{release}

%description -n omedit-devel
A Modelica connection editor for OpenModelica. OMEdit is still in active development.
Please try it out and give feedback.
This package contains the development files.

%package -n omsimulator
Summary:        OpenModelica OMSimulator
Group:          Productivity/Scientific/Math
Requires:       omc = %{version}-%{release}

%description -n omsimulator
The OpenModelica Simulator is a simulator that allows a tool to for example 
simulate FMUs.

%package -n drmodelica
Summary:        An OMNotebook course in the Modelica language 
Group:          Productivity/Scientific/Math
Requires:       omnotebook = %{version}-%{release}
BuildArch:      noarch

%description -n drmodelica
An OMNotebook course in the Modelica language. The course is based on Peter Fritzson's book 
“Principles of Object-Oriented Modeling and Simulation with Modelica 2.1”.

%package -n drcontrol
Summary:        An OMNotebook course in basic control theory
Group:          Productivity/Scientific/Math
Requires:       omc = %{version}-%{release}
Requires:       omnotebook = %{version}-%{release}
BuildArch:      noarch

%description -n drcontrol
An OMNotebook course in basic control theory.

%prep
%setup -q -b0 -b1 -b2
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

export CFLAGS="$RPM_OPT_FLAGS -Os"
export CXXFLAGS="$CFLAGS"
export OMPCC="gcc -fopenmp"

autoconf

%configure QTDIR=%{_libdir}/qt5/ \
			--libdir=/usr/lib \
			--with-omniORB \
            '--with-lapack=-llapack -lblas -lm' \
            --without-omlibrary \
            --with-MODPAR \
            --with-METIS \
            --with-BOOST \
            --disable-static \
            --with-cppruntime

%build      
%make_jobs

%install
%make_install

# Now fix private library location
mkdir -p %{buildroot}%{_omclibdir}
mv %{buildroot}%{_libexecdir}/x86_64-linux-gnu/omc/* %{buildroot}%{_omclibdir}

# Delete RPATH from those libraries as per rpmlint report
chrpath --delete %{buildroot}%{_omclibdir}/libipopt.so.0.0.0
chrpath --delete %{buildroot}%{_omclibdir}/libModelicaStandardTables.so.0.0.0
chrpath --delete %{buildroot}%{_omclibdir}/libModelicaMatIO.so.0.0.0
chrpath --delete %{buildroot}%{_omclibdir}/libModelicaIO.so.0.0.0

# Replace RPATH to allow binaries see the private library in the new location
chrpath --replace %{_omclibdir} %{buildroot}%{_bindir}/omc
chrpath --replace %{_omclibdir} %{buildroot}%{_bindir}/OMSimulator
chrpath --replace %{_omclibdir} %{buildroot}%{_bindir}/OMPlot
chrpath --replace %{_omclibdir} %{buildroot}%{_bindir}/OMShell
chrpath --replace %{_omclibdir} %{buildroot}%{_bindir}/OMShell-terminal
chrpath --replace %{_omclibdir} %{buildroot}%{_bindir}/OMNotebook
chrpath --replace %{_omclibdir} %{buildroot}%{_bindir}/OMEdit
chrpath --replace %{_omclibdir} %{buildroot}%{_bindir}/OMOptim

# Replace RPATH to private libraries to the new location
chrpath --replace %{_omclibdir} %{buildroot}%{_omclibdir}/libomantlr3.so
chrpath --replace %{_omclibdir} %{buildroot}%{_omclibdir}/libomcruntime.so
chrpath --replace %{_omclibdir} %{buildroot}%{_omclibdir}/libOMPlot.so.1
chrpath --replace %{_omclibdir} %{buildroot}%{_omclibdir}/libOMPlot.so.1.0
chrpath --replace %{_omclibdir} %{buildroot}%{_omclibdir}/libOMPlot.so.1.0.0
chrpath --replace %{_omclibdir} %{buildroot}%{_omclibdir}/libOMSimulator.so
chrpath --replace %{_omclibdir} %{buildroot}%{_omclibdir}/libOpenModelicaCompiler.so
chrpath --replace %{_omclibdir} %{buildroot}%{_omclibdir}/libOpenModelicaFMIRuntimeC.so
chrpath --replace %{_omclibdir} %{buildroot}%{_omclibdir}/libOpenModelicaRuntimeC.so

# Install documentation
mv %{_builddir}/%{name}-doc_%{version}/OpenModelicaUsersGuide %{buildroot}%{_datarootdir}/doc/omc
mv %{_builddir}/%{name}-doc_%{version}/SystemDocumentation %{buildroot}%{_datarootdir}/doc/omc
mv %{buildroot}%{_datarootdir}/doc/omc/OpenModelicaUsersGuide.pdf %{buildroot}%{_datarootdir}/doc/omc/OpenModelicaUsersGuide-latest.pdf

# Some cleanup
rmdir %{buildroot}%{_libexecdir}/omc/emcc
rm -rf %{buildroot}%{_libexecdir}/x86_64-linux-gnu
rm -rf %{buildroot}%{_datarootdir}/doc/omc/OpenModelicaMetaProgramming.pdf
rm -rf %{buildroot}%{_datarootdir}/doc/omc/OpenModelicaSystem.pdf
rm -rf %{buildroot}%{_datarootdir}/doc/omc/OpenModelicaTemplateProgramming.pdf

# Create missing directories
mkdir -p %{buildroot}/%{_datadir}/applications/
mkdir -p %{buildroot}/usr/share/pixmaps/

# Add desktop files
mv %{_builddir}/%{name}_system_integration/desktops/omshell.desktop ./
mv %{_builddir}/%{name}_system_integration/desktops/omshell-terminal.desktop ./
mv %{_builddir}/%{name}_system_integration/desktops/omnotebook.desktop ./
mv %{_builddir}/%{name}_system_integration/desktops/omedit.desktop ./
mv %{_builddir}/%{name}_system_integration/desktops/omoptim.desktop ./
%suse_update_desktop_file -i omshell
%suse_update_desktop_file -i omshell-terminal
%suse_update_desktop_file -i omnotebook
%suse_update_desktop_file -i omedit
%suse_update_desktop_file -i omoptim

# Add icons
mv %{_builddir}/%{name}-%{version}/OMShell/OMShell/OMShellGUI/Resources/omshell-large.svg %{buildroot}%{_datadir}/pixmaps/
mv %{_builddir}/%{name}-%{version}/OMShell/OMShell/OMShellGUI/Resources/omshell-terminal-large.svg %{buildroot}%{_datadir}/pixmaps/
mv %{_builddir}/%{name}-%{version}/OMNotebook/OMNotebook/OMNotebookGUI/Resources/OMNotebook_icon.svg %{buildroot}%{_datadir}/pixmaps/
mv %{_builddir}/%{name}-%{version}/OMEdit/OMEdit/OMEditGUI/Resources/icons/omedit.png %{buildroot}%{_datadir}/pixmaps/
mv %{_builddir}/%{name}-%{version}/OMOptim/OMOptim/GUI/Resources/omoptim.ico %{buildroot}%{_datadir}/pixmaps/

# Add missing example script
mv %{_builddir}/%{name}_system_integration/testmodels/flat_dcmotor.mos %{buildroot}%{_datarootdir}/doc/omc/testmodels

# Check for duplicates
%fdupes %{buildroot}

%files -n omc
%defattr(-,root,root,-)
%{_bindir}/omc
%{_bindir}/omc-diff
%dir %{_datarootdir}/omc/scripts
%{_datarootdir}/omc/scripts/*
%dir %{_datarootdir}/doc/omc/testmodels
%{_datarootdir}/doc/omc/testmodels/*

%files -n omc-common
%defattr(-,root,root,-)
%{_datarootdir}/omc/omc_communication.idl
%dir %{_datarootdir}/omc
%dir %{_datarootdir}/omc/runtime
%dir %{_datarootdir}/omc/runtime/c
%dir %{_datarootdir}/omc/runtime/c/fmi
%dir %{_datarootdir}/omc/runtime/c/fmi/buildproject
%attr(0755, root, root) %{_datarootdir}/omc/runtime/c/fmi/buildproject/config.guess
%attr(0755, root, root) %{_datarootdir}/omc/runtime/c/fmi/buildproject/config.sub
%attr(0755, root, root) %{_datarootdir}/omc/runtime/c/fmi/buildproject/configure
%attr(0755, root, root) %{_datarootdir}/omc/runtime/c/fmi/buildproject/install-sh
%dir %{_libexecdir}/omc
%{_libexecdir}/omc/*.mo
%dir %{_includedir}/omc
%dir %{_includedir}/omc/c
%{_includedir}/omc/c/*
%dir %{_includedir}/omc/scripting-API
%{_includedir}/omc/scripting-API/OpenModelicaScriptingAPI.h
%{_includedir}/omc/scripting-API/OpenModelicaScriptingAPIQt.cpp
%{_includedir}/omc/scripting-API/OpenModelicaScriptingAPIQt.h

%files -n omc-java
%defattr(-,root,root,-)
%dir %{_datarootdir}/omc/java
%{_datarootdir}/omc/java/*

%files -n omc-lang
%defattr(-,root,root,-)
%dir %{_datarootdir}/locale/de/LC_MESSAGES
%{_datarootdir}/locale/de/LC_MESSAGES/*.mo
%dir %{_datarootdir}/locale/es/LC_MESSAGES
%{_datarootdir}/locale/es/LC_MESSAGES/*.mo
%dir %{_datarootdir}/locale/sv/LC_MESSAGES
%{_datarootdir}/locale/sv/LC_MESSAGES/*.mo

%files -n omc-doc
%defattr(-,root,root,-)
%dir %{_datarootdir}/doc/omc
%{_datarootdir}/doc/omc/COPYING
%{_datarootdir}/doc/omc/*.pdf
%dir %{_datarootdir}/doc/omc/OpenModelicaUsersGuide
%{_datarootdir}/doc/omc/OpenModelicaUsersGuide/*
%dir %{_datarootdir}/doc/omc/SystemDocumentation
%{_datarootdir}/doc/omc/SystemDocumentation/*
%exclude %{_datarootdir}/doc/omc/OpenModelicaUsersGuide/.buildinfo

%files -n libomc
%defattr(-,root,root,-)
%dir %{_omclibdir}
%{_omclibdir}/libomcruntime.so
%{_omclibdir}/libOpenModelicaCompiler.so
%{_omclibdir}/libOpenModelicaRuntimeC.so
%{_omclibdir}/libomantlr3.so
%{_omclibdir}/libzmq.so.*

%post -n libomc -p /sbin/ldconfig
%postun -n libomc -p /sbin/ldconfig

%files -n libomc-devel
%defattr(-,root,root,-)
%exclude %{_includedir}/x86_64-linux-gnu
%exclude %{_includedir}/x86_64-linux-gnu/omc
%exclude %{_includedir}/x86_64-linux-gnu/omc/antlr3/
%exclude %{_includedir}/x86_64-linux-gnu/omc/antlr3/*
%{_omclibdir}/libzmq.so
%{_omclibdir}/libomparse.a
%{_omclibdir}/libParModelicaExpl.a
%{_omclibdir}/libmetis.a
%{_omclibdir}/libSimulationRuntimeFMI.a
%dir %{_includedir}/omc/
%dir %{_includedir}/omc/fmil
%dir %{_includedir}/omc/fmil/FMI
%{_includedir}/omc/fmil/FMI/fmi_import_context.h
%{_includedir}/omc/fmil/FMI/fmi_import_util.h
%{_includedir}/omc/fmil/FMI/fmi_util.h
%{_includedir}/omc/fmil/FMI/fmi_version.h
%dir %{_includedir}/omc/fmil/FMI1
%{_includedir}/omc/fmil/FMI1/fmi1_enums.h
%{_includedir}/omc/fmil/FMI1/fmi1_functions.h
%{_includedir}/omc/fmil/FMI1/fmi1_import.h
%{_includedir}/omc/fmil/FMI1/fmi1_import_capabilities.h
%{_includedir}/omc/fmil/FMI1/fmi1_import_capi.h
%{_includedir}/omc/fmil/FMI1/fmi1_import_convenience.h
%{_includedir}/omc/fmil/FMI1/fmi1_import_cosim.h
%{_includedir}/omc/fmil/FMI1/fmi1_import_type.h
%{_includedir}/omc/fmil/FMI1/fmi1_import_unit.h
%{_includedir}/omc/fmil/FMI1/fmi1_import_variable.h
%{_includedir}/omc/fmil/FMI1/fmi1_import_variable_list.h
%{_includedir}/omc/fmil/FMI1/fmi1_import_vendor_annotations.h
%{_includedir}/omc/fmil/FMI1/fmi1_types.h
%{_includedir}/omc/fmil/FMI1/fmiFunctions.h
%{_includedir}/omc/fmil/FMI1/fmiModelFunctions.h
%{_includedir}/omc/fmil/FMI1/fmiModelTypes.h
%{_includedir}/omc/fmil/FMI1/fmiPlatformTypes.h
%dir %{_includedir}/omc/fmil/FMI2
%{_includedir}/omc/fmil/FMI2/fmi2FunctionTypes.h
%{_includedir}/omc/fmil/FMI2/fmi2Functions.h
%{_includedir}/omc/fmil/FMI2/fmi2TypesPlatform.h
%{_includedir}/omc/fmil/FMI2/fmi2_enums.h
%{_includedir}/omc/fmil/FMI2/fmi2_functions.h
%{_includedir}/omc/fmil/FMI2/fmi2_import.h
%{_includedir}/omc/fmil/FMI2/fmi2_import_capi.h
%{_includedir}/omc/fmil/FMI2/fmi2_import_convenience.h
%{_includedir}/omc/fmil/FMI2/fmi2_import_type.h
%{_includedir}/omc/fmil/FMI2/fmi2_import_unit.h
%{_includedir}/omc/fmil/FMI2/fmi2_import_variable.h
%{_includedir}/omc/fmil/FMI2/fmi2_import_variable_list.h
%{_includedir}/omc/fmil/FMI2/fmi2_types.h
%{_includedir}/omc/fmil/FMI2/fmi2_xml_callbacks.h
%dir %{_includedir}/omc/fmil/JM
%{_includedir}/omc/fmil/JM/jm_callbacks.h
%{_includedir}/omc/fmil/JM/jm_named_ptr.h
%{_includedir}/omc/fmil/JM/jm_portability.h
%{_includedir}/omc/fmil/JM/jm_stack.h
%{_includedir}/omc/fmil/JM/jm_string_set.h
%{_includedir}/omc/fmil/JM/jm_types.h
%{_includedir}/omc/fmil/JM/jm_vector.h
%{_includedir}/omc/fmil/JM/jm_vector_template.h
%{_includedir}/omc/fmil/fmilib.h
%{_includedir}/omc/fmil/fmilib_config.h

%files -n libomc-simulation
%defattr(-,root,root,-)
%{_omclibdir}/libomcgc.so.*
%{_omclibdir}/libfmilib.so
%{_omclibdir}/libfmilib_shared.so
%{_omclibdir}/libModelicaExternalC*.so.*
%{_omclibdir}/libModelicaIO.so.*
%{_omclibdir}/libModelicaMatIO.so.*
%{_omclibdir}/libModelicaStandardTables*.so.*
%{_omclibdir}/libzlib.so.*
%{_omclibdir}/libOpenModelicaFMIRuntimeC.so
%{_omclibdir}/libSimulationRuntimeC.so
%{_omclibdir}/libbtf.so
%{_omclibdir}/libklu.so
%{_omclibdir}/liblis*.so.*
%{_omclibdir}/libipopt*.so.*
%{_omclibdir}/libcoin*.so.*
%{_omclibdir}/libcminpack*.so.*
%{_omclibdir}/libumfpack.so
%{_omclibdir}/libamd.so
%{_omclibdir}/libcolamd.so
%{_omclibdir}/libomopcua.so
%{_omclibdir}/libsundials_arkode.so
%{_omclibdir}/libsundials_arkode.so.*
%{_omclibdir}/libsundials_cvode.so
%{_omclibdir}/libsundials_cvode.so.*
%{_omclibdir}/libsundials_cvodes.so
%{_omclibdir}/libsundials_cvodes.so.*
%{_omclibdir}/libsundials_ida.so
%{_omclibdir}/libsundials_ida.so.*
%{_omclibdir}/libsundials_idas.so
%{_omclibdir}/libsundials_idas.so.*
%{_omclibdir}/libsundials_kinsol.so
%{_omclibdir}/libsundials_kinsol.so.*
%{_omclibdir}/libsundials_nvecserial.so
%{_omclibdir}/libsundials_nvecserial.so.*

%post -n libomc-simulation -p /sbin/ldconfig
%postun -n libomc-simulation -p /sbin/ldconfig

%files -n libomc-simulation-devel
%defattr(-,root,root,-)
%{_omclibdir}/libomcgc.so
%exclude %{_omclibdir}/libModelicaExternalC.la
%{_omclibdir}/libModelicaExternalC.so
%exclude %{_omclibdir}/libModelicaIO.la
%{_omclibdir}/libModelicaIO.so
%exclude %{_omclibdir}/libModelicaMatIO.la
%{_omclibdir}/libModelicaMatIO.so
%exclude %{_omclibdir}/libModelicaStandardTables.la
%{_omclibdir}/libModelicaStandardTables.so
%exclude %{_omclibdir}/libzlib.la
%{_omclibdir}/libzlib.so
%{_omclibdir}/liblis.so
%exclude %{_omclibdir}/libipopt.la
%{_omclibdir}/libipopt.so
%exclude %{_omclibdir}/libcoinmumps.la
%{_omclibdir}/libcoinmumps.so
%{_omclibdir}/libcminpack.so
%{_omclibdir}/libsundials_arkode.a
%{_omclibdir}/libsundials_cvode.a
%{_omclibdir}/libsundials_cvodes.a
%{_omclibdir}/libsundials_ida.a
%{_omclibdir}/libsundials_idas.a
%{_omclibdir}/libsundials_kinsol.a
%{_omclibdir}/libsundials_nvecserial.a

%files -n omsimulator
%defattr(-,root,root,-)
%{_bindir}/FMIWrapper
%{_bindir}/OMSimulator
%{_bindir}/OMSimulatorPython
%attr(0755, root, root) %{_bindir}/StartTLMFmiWrapper

%files -n libomc-simulator
%defattr(-,root,root,-)
%{_libexecdir}/OMSimulator.py
%{_omclibdir}/libOMSimulator.so
%{_omclibdir}/libomtlmsimulator.so
%{_omclibdir}/libOMSimulatorLua.a

%post -n libomc-simulator -p /sbin/ldconfig
%postun -n libomc-simulator -p /sbin/ldconfig

%files -n libomc-simulator-devel
%defattr(-,root,root,-)
%{_omclibdir}/libOMSimulator.a
%{_includedir}/OMSimulator.h
%{_includedir}/Types.h

%files -n libomccpp
%defattr(-,root,root,-)
%dir %{_includedir}/omc/cpp
%{_includedir}/omc/cpp/*
%dir %{_omclibdir}/cpp
%{_omclibdir}/cpp/*
%dir %{_datarootdir}/omc/runtime/cpp
%dir %{_datarootdir}/omc/runtime/cpp/config/
%{_datarootdir}/omc/runtime/cpp/config/EulerSettings.xml
%{_datarootdir}/omc/runtime/cpp/config/GlobalSettings.xml
%{_datarootdir}/omc/runtime/cpp/config/RK12Settings.xml
%dir %{_datarootdir}/omc/runtime/cpp/licenses
%{_datarootdir}/omc/runtime/cpp/licenses/sundials.license

%files -n omplot
%defattr(-,root,root,-)
%{_bindir}/OMPlot

%files -n libomplot
%defattr(-,root,root,-)
%{_omclibdir}/libomqwt.so.*
%{_omclibdir}/libOMPlot.so.*

%post -n libomplot -p /sbin/ldconfig
%postun -n libomplot -p /sbin/ldconfig

%files -n libomplot-devel
%defattr(-,root,root,-)
%defattr(-,root,root,-)
%dir %{_includedir}/omplot
%dir %{_includedir}/omplot/qwt
%{_includedir}/omplot/*
%{_omclibdir}/libomqwt.so
%{_omclibdir}/libOMPlot.so

%files -n omshell
%defattr(-,root,root,-)
%{_datadir}/applications/omshell.desktop
%{_bindir}/OMShell
%dir %{_datarootdir}/omshell
%{_datarootdir}/omshell/*.xml
%dir %{_datarootdir}/omshell/nls
%{_datarootdir}/omshell/nls/*.qm
%{_datarootdir}/pixmaps/omshell-large.svg

%files -n omshell-terminal
%defattr(-,root,root,-)
%{_datadir}/applications/omshell-terminal.desktop
%{_bindir}/OMShell-terminal
%{_datarootdir}/pixmaps/omshell-terminal-large.svg

%files -n omnotebook
%defattr(-,root,root,-)
%{_bindir}/OMNotebook
%{_datadir}/applications/omnotebook.desktop
%dir %{_datarootdir}/omnotebook
%{_datarootdir}/omnotebook/*.onb
%{_datarootdir}/pixmaps/OMNotebook_icon.svg
%{_datarootdir}/omnotebook/*.xml
%dir %{_datarootdir}/omnotebook/nls
%{_datarootdir}/omnotebook/nls/*

%files -n omedit
%defattr(-,root,root,-)
%{_datadir}/applications/omedit.desktop
%{_datarootdir}/pixmaps/omedit.png
%{_bindir}/OMEdit
%dir %{_datarootdir}/omedit
%dir %{_datarootdir}/omedit/nls
%{_datarootdir}/omedit/nls/*
%{_omclibdir}/libqjson.so.*

%files -n omedit-devel
%defattr(-,root,root,-)
%{_omclibdir}/libqjson.so

%files -n omoptim
%defattr(-,root,root,-)
%{_datadir}/applications/omoptim.desktop
%{_datarootdir}/pixmaps/omoptim.ico
%{_bindir}/OMOptim

%files -n drcontrol
%defattr(-,root,root,-)
%dir %{_datarootdir}/omnotebook/drcontrol
%{_datarootdir}/omnotebook/drcontrol/*

%files -n drmodelica
%defattr(-,root,root,-)
%dir %{_datarootdir}/omnotebook/drmodelica
%{_datarootdir}/omnotebook/drmodelica/*

%verifyscript
%verify_permissions -e %{_datarootdir}/omc/runtime/c/fmi/buildproject/config.guess
%verify_permissions -e %{_datarootdir}/omc/runtime/c/fmi/buildproject/config.sub
%verify_permissions -e  %{_datarootdir}/omc/runtime/c/fmi/buildproject/configure
%verify_permissions -e  %{_datarootdir}/omc/runtime/c/fmi/buildproject/install-sh
%verify_permissions -e %{_bindir}/StartTLMFmiWrapper

%changelog