Skip to content

Console Output

16:02:59 # See also Jenkinsfile in apt-build repository for stuff that is installed BEFORE everything here
16:02:59 # Don't try fancy stuff like debuginfo, which is useless on binary-only
16:02:59 # packages. Don't strip binary too
16:02:59 # Be sure buildpolicy set to do nothing
16:02:59 %define        __spec_install_post %{nil}
16:02:59 %define          debug_package %{nil}
16:02:59 %define        __os_install_post %{_dbpath}/brp-compress
16:02:59 
16:02:59 Summary: OpenModelica
16:02:59 Name: NAME
16:02:59 Version: RPMVERSION
16:02:59 Release: RELEASENUM%{?dist}
16:02:59 License: OSMC-PL
16:02:59 Group: Development/Tools
16:02:59 # spectool -g -R SPECS/xxx.spec
16:02:59 # sudo yum-builddep SPECS/xxx.spec
16:02:59 SOURCE0 : https://build.openmodelica.org/apt/pool/contrib/openmodelica_DEBVERSION.orig.tar.xz
16:02:59 SOURCE1 : https://openmodelica.org/doc/openmodelica-doc-DOCUMENTATIONVERSION.tar.xz
16:02:59 PATCHES
16:02:59 URL: https://openmodelica.org/
16:02:59 
16:02:59 %if 0%{?rhel} == 6
16:02:59 Autoreq: 0
16:02:59 Requires: readline
16:02:59 Requires: qt5-qtbase
16:02:59 Requires: qt5-qtsvg
16:02:59 Requires: qt5-qtwebkit
16:02:59 Requires: qt5-qtxmlpatterns
16:02:59 Requires: libffi
16:02:59 %endif
16:02:59 Autoprov: 0
16:02:59 Prefix: /opt/%{name}
16:02:59 Prefix: %{_bindir}
16:02:59 
16:02:59 %global __requires_exclude ^(PRIVATELIBS)$
16:02:59 
16:02:59 # Recommended (for the repo): git rpm-build rpmdevtools epel-release
16:02:59 %if 0%{?rhel} > 0
16:02:59 # CentOS / RHEL requires the EPEL repository (for omniORB, etc)
16:02:59 BuildRequires: epel-release
16:02:59 Requires: epel-release
16:02:59 %endif
16:02:59 
16:02:59 Requires: lapack-devel
16:02:59 Requires: make
16:02:59 Requires: gcc
16:02:59 Requires: gcc-gfortran
16:02:59 Requires: gcc-c++
16:02:59 
16:02:59 BuildRequires: automake
16:02:59 %if 0%{?rhel} >= 8
16:02:59 %define withomniorb --without-omniORB
16:02:59 %else
16:02:59 %define withomniorb --with-omniORB
16:02:59 BuildRequires: omniORB-devel
16:02:59 BuildRequires: lpsolve-devel
16:02:59 %endif
16:02:59 BuildRequires: expat-devel
16:02:59 BuildRequires: bison
16:02:59 BuildRequires: flex
16:02:59 BuildRequires: lapack-devel
16:02:59 BuildRequires: libtool
16:02:59 BuildRequires: uuid
16:02:59 BuildRequires: uuid-devel
16:02:59 BuildRequires: hdf5-devel
16:02:59 BuildRequires: boost-devel
16:02:59 BuildRequires: boost-static
16:02:59 BuildRequires: hwloc-devel
16:02:59 BuildRequires: readline-devel
16:02:59 BuildRequires: libffi-devel
16:02:59 BuildRequires: curl-devel
16:02:59 BuildRequires: gettext
16:02:59 BuildRequires: make
16:02:59 BuildRequires: java
16:02:59 BuildRequires: tar
16:02:59 BuildRequires: xz
16:02:59 BuildRequires: gcc
16:02:59 BuildRequires: gcc-c++
16:02:59 BuildRequires: gcc-gfortran
16:02:59 %if 0%{?rhel} <= 9
16:02:59 BuildRequires: qt5-qtwebkit-devel
16:02:59 BuildRequires: qt5-linguist
16:02:59 BuildRequires: qt5-qttools
16:02:59 BuildRequires: qt5-qtbase-devel
16:02:59 BuildRequires: qt5-qtsvg-devel
16:02:59 BuildRequires: qt5-qtxmlpatterns-devel
16:02:59 %else 
16:02:59 # el 10 does not have qt5-qtwebkit anymore, use qt6
16:02:59 BuildRequires: qt6-qtwebengine-devel
16:02:59 BuildRequires: qt6-linguist
16:02:59 BuildRequires: qt6-qttools
16:02:59 BuildRequires: qt6-qtbase-devel
16:02:59 BuildRequires: qt6-qtsvg-devel
16:02:59 BuildRequires: qt6-qt3d-devel
16:02:59 BuildRequires: qt6-qt5compat-devel
16:02:59 %endif
16:02:59 %if 0%{?rhel} >= 7
16:02:59 BuildRequires: qt5-qt3d-devel
16:02:59 %endif
16:02:59 
16:02:59 
16:02:59 # Use cmake versions > 3. On EL7 this is provided by cmake3 package.
16:02:59 # On EL > 7 it is just cmake.
16:02:59 %if 0%{?rhel} == 7
16:02:59 BuildRequires: cmake3
16:02:59 %define cmakecommand CMAKE=cmake3
16:02:59 %else
16:02:59 BuildRequires: cmake
16:02:59 %define cmakecommand CMAKE=cmake
16:02:59 %endif
16:02:59 
16:02:59 # The base centos:8 image (we use for our build-deps:el8 image) comes with
16:02:59 # broken cmake package due to old libarchive (v3.3.2). v3.3.3 Seems to work.
16:02:59 # Once the base image is updated this can be removed.
16:02:59 %if 0%{?rhel} == 8
16:02:59 BuildRequires: libarchive >= 3.3.3
16:02:59 %endif
16:02:59 
16:02:59 # Use gcc-11 on EL8 as well. devtoolset does not seem to be available on
16:02:59 # EL8. One is supposed to use gcc-toolset instead.
16:02:59 %{?el8:Requires: gcc-toolset-11-gcc gcc-toolset-11-gcc-c++ gcc-toolset-11-gcc-gfortran}
16:02:59 %if 0%{?rhel} == 8
16:02:59 BuildRequires: gcc-toolset-11-gcc gcc-toolset-11-gcc-c++ gcc-toolset-11-gcc-gfortran
16:02:59 %define devtoolsconfigureflags CC=/opt/rh/gcc-toolset-11/root/usr/bin/gcc CXX=/opt/rh/gcc-toolset-11/root/usr/bin/g++ FC=/opt/rh/gcc-toolset-11/root/usr/bin/gfortran AS=/opt/rh/gcc-toolset-11/root/usr/bin/as
16:02:59 %endif
16:02:59 
16:02:59 # EL7 has -static-libstdc++ inside devtools (but the system g++ does not know the flag) -- adrpo: check this, also for el6
16:02:59 %{?el7:Requires: devtoolset-11-gcc}
16:02:59 %{?el7:Requires: devtoolset-11-gcc-c++}
16:02:59 %{?el7:Requires: devtoolset-11-gcc-gfortran}
16:02:59 
16:02:59 %if 0%{?rhel} <= 7 && 0%{?rhel} >= 1
16:02:59 BuildRequires: devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-gcc-gfortran
16:02:59 %define devtoolsconfigureflags CC=/opt/rh/devtoolset-11/root/usr/bin/gcc CXX=/opt/rh/devtoolset-11/root/usr/bin/g++ FC=/opt/rh/devtoolset-11/root/usr/bin/gfortran
16:02:59 %endif
16:02:59 
16:02:59 %if 0%{?fedora} >= 25
16:02:59 BuildRequires: OpenSceneGraph-devel
16:02:59 %endif
16:02:59 
16:02:59 %if 0%{?rhel} >= 10
16:02:59 %define withqt6 --with-qt6
16:02:59 %define omqtversion=QT6
16:02:59 %else
16:02:59 %define withqt6 ''
16:02:59 %define omqtversion=QT5
16:02:59 %endif
16:02:59 
16:02:59 
16:02:59 # We should use clang, but OMEdit does not compile with it due to odd default qmake flags
16:02:59 Requires: gcc
16:02:59 Requires: gcc-c++
16:02:59 Requires: lapack-devel
16:02:59 
16:02:59 Requires(post): %{_sbindir}/update-alternatives
16:02:59 Requires(postun): %{_sbindir}/update-alternatives
16:02:59 
16:02:59 # CentOS does not have suggests
16:02:59 %if 0%{?fedora} >= 24 || 0%{?rhel} >= 8
16:02:59 Suggests: boost-devel
16:02:59 Suggests: boost-static
16:02:59 Suggests: lapack-static
16:02:59 Suggests: openblas-static
16:02:59 %else
16:02:59 Requires: boost-devel
16:02:59 Requires: boost-static
16:02:59 %endif
16:02:59 
16:02:59 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
16:02:59 
16:02:59 %description
16:02:59 %{summary}
16:02:59 
16:02:59 %prep
16:02:59 
16:02:59 %setup -q -n openmodelica_DEBVERSION
16:02:59 tar xJf %{_sourcedir}/openmodelica-doc-DOCUMENTATIONVERSION.tar.xz
16:02:59 
16:02:59 PATCHCMDS
16:02:59 
16:02:59 %if 0%{?rhel} <= 7 && 0%{?rhel} >= 1
16:02:59 source /opt/rh/devtoolset-11/enable
16:02:59 %endif
16:02:59 
16:02:59 %if 0%{?rhel} == 8
16:02:59 source /opt/rh/gcc-toolset-11/enable
16:02:59 %endif
16:02:59 
16:02:59 autoreconf --install
16:02:59 ./configure CFLAGS="-Os" CXXFLAGS="-Os" QTDIR=/usr/%{_lib}/{omqtversion} %{withomniorb} %{withqt6} CONFIGUREFLAGS %{?devtoolsconfigureflags} --without-omc --prefix=/opt/%{name} --without-omlibrary %{cmakecommand}
16:02:59 
16:02:59 %build
16:02:59 
16:02:59 %if 0%{?rhel} <= 7 && 0%{?rhel} >= 1
16:02:59 source /opt/rh/devtoolset-11/enable
16:02:59 %endif
16:02:59 
16:02:59 %if 0%{?rhel} == 8
16:02:59 source /opt/rh/gcc-toolset-11/enable
16:02:59 %endif
16:02:59 
16:02:59 make -j8
16:02:59 test ! -f libraries/install-index.json || make -j8 omlibrary
16:02:59 
16:02:59 %install
16:02:59 rm -rf %{buildroot}
16:02:59 make install DESTDIR="%{buildroot}"
16:02:59 mkdir -p %{buildroot}/opt/%{name}/lib/ %{buildroot}/opt/%{name}/share/doc/omc/ %{buildroot}%{_bindir}
16:02:59 ln -s /usr/lib/omlibrary %{buildroot}/opt/%{name}/lib/
16:02:59 ln -s /opt/%{name}/bin/omc %{buildroot}%{_bindir}/omc-BRANCH
16:02:59 ln -s /opt/%{name}/bin/OMEdit %{buildroot}%{_bindir}/OMEdit-BRANCH
16:02:59 ln -s /opt/%{name}/bin/OMShell %{buildroot}%{_bindir}/OMShell-BRANCH
16:02:59 ln -s /opt/%{name}/bin/OMShell-terminal %{buildroot}%{_bindir}/OMShell-terminal-BRANCH
16:02:59 ln -s /opt/%{name}/bin/OMNotebook %{buildroot}%{_bindir}/OMNotebook-BRANCH
16:02:59 ln -s /opt/%{name}/bin/OMPlot %{buildroot}%{_bindir}/OMPlot-BRANCH
16:02:59 touch %{buildroot}%{_bindir}/omc
16:02:59 touch %{buildroot}%{_bindir}/OMEdit
16:02:59 touch %{buildroot}%{_bindir}/OMShell
16:02:59 touch %{buildroot}%{_bindir}/OMShell-terminal
16:02:59 touch %{buildroot}%{_bindir}/OMNotebook
16:02:59 touch %{buildroot}%{_bindir}/OMPlot
16:02:59 cp -a openmodelica-doc*/* %{buildroot}/opt/%{name}/share/doc/omc/
16:02:59 
16:02:59 %postun
16:02:59 if [ "$1" -ge "1" ]; then
16:02:59   if [ "`readlink %{_sysconfdir}/alternatives/openmodelica`" == "%{_bindir}/omc-BRANCH" ]; then
16:02:59     %{_sbindir}/alternatives --set openmodelica %{_bindir}/omc-BRANCH
16:02:59   fi
16:02:59 fi
16:02:59 
16:02:59 %post
16:02:59 %{_sbindir}/update-alternatives --install %{_bindir}/omc openmodelica %{_bindir}/omc-BRANCH PRIORITY \
16:02:59   --slave %{_bindir}/OMEdit openmodelica-OMEdit %{_bindir}/OMEdit-BRANCH \
16:02:59   --slave %{_bindir}/OMShell openmodelica-OMShell %{_bindir}/OMShell-BRANCH \
16:02:59   --slave %{_bindir}/OMShell-terminal openmodelica-OMShell-terminal %{_bindir}/OMShell-terminal-BRANCH \
16:02:59   --slave %{_bindir}/OMNotebook openmodelica-OMNotebook %{_bindir}/OMNotebook-BRANCH \
16:02:59   --slave %{_bindir}/OMPlot openmodelica-OMPlot %{_bindir}/OMPlot-BRANCH
16:02:59 
16:02:59 %preun
16:02:59 if [ $1 = 0 ]; then
16:02:59   %{_sbindir}/update-alternatives --remove openmodelica %{_bindir}/omc-BRANCH
16:02:59 fi
16:02:59 
16:02:59 %clean
16:02:59 rm -rf %{buildroot}
16:02:59 
16:02:59 %files
16:02:59 %defattr(-,root,root,-)
16:02:59 /opt/%{name}/*
16:02:59 %{_bindir}/*-BRANCH
16:02:59 %ghost %{_bindir}/omc
16:02:59 %ghost %{_bindir}/OMEdit
16:02:59 %ghost %{_bindir}/OMShell
16:02:59 %ghost %{_bindir}/OMShell-terminal
16:02:59 %ghost %{_bindir}/OMNotebook
16:02:59 %ghost %{_bindir}/OMPlot
16:02:59 
16:02:59 %changelog
16:02:59 * DATE  OpenModelica <openmodelica@ida.liu.se> ${version}-1
16:02:59 - First Build