Skip to content

Console Output

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