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