File ecflow.spec of Package ecflow

#
# spec file for package ecflow
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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 https://bugs.opensuse.org/
#


%define origname ecFlow

Name:           ecflow
Version:        5.15.2
Release:        0
Summary:        ECMWF work-flow manager and job scheduler
License:        Apache-2.0
Group:          Productivity/Scientific/Other
URL:            https://confluence.ecmwf.int/display/ECFLOW
Source:         https://confluence.ecmwf.int/download/attachments/8650755/%{origname}-%{version}-Source.tar.gz
Patch0:         ecflow_fuse.py.patch


BuildRequires:  pkgconfig
BuildRequires:  cmake >= 3.12
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  perl
BuildRequires:  freetype-devel
BuildRequires:  fontconfig-devel
BuildRequires:  boost-devel
BuildRequires:  libboost_chrono-devel
BuildRequires:  libboost_date_time-devel
BuildRequires:  libboost_filesystem-devel
%if 0%{?suse_version} >= 1600
BuildRequires:  libboost_process-devel
%endif
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_python3-devel
BuildRequires:  libboost_numpy3-devel
BuildRequires:  libboost_regex-devel
BuildRequires:  libboost_serialization-devel
%if 0%{?suse_version} <= 1600
BuildRequires:  libboost_system-devel
%endif
BuildRequires:  libboost_test-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  libboost_timer-devel
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Charts)
BuildRequires:  python-rpm-macros
BuildRequires:  python3-devel
BuildRequires:  python3-numpy-devel


################################################

%description
A work flow package that enables users to run a large number of programs
(with dependencies on each other and on time) in a controlled environment.
It provides tolerance for hardware and software failures, combined with good
restart capabilities. It is used at ECMWF to run all our operational suites
across a range of platforms.

ecFlow submits tasks (jobs) and receives acknowledgements from tasks when they
change status and when they send events. It does this using using child commands
embedded in the scripts. ecFlow stores the relationship between tasks and is
able to submit tasks dependent on triggers.

%prep
%autosetup -p1 -n "%{origname}-%{version}-Source"

%build
# --debug-output --debug-find -DECBUILD_LOG_LEVEL=DEBUG
%cmake \
    -Wno-dev \
    -DCMAKE_PREFIX_PATH="%{_prefix}" \
    -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_C_FLAGS="%{optflags}" \
    -DCMAKE_CXX_FLAGS="%{optflags} -Wno-deprecated-declarations -Wno-unused-local-typedefs" \
    -DINSTALL_LIB_DIR="%{_lib}" \
    -DCMAKE_SKIP_RPATH=ON \
    -DCMAKE_SKIP_INSTALL_RPATH=ON \
    -DENABLE_RPATHS=OFF \
    -DENABLE_RELATIVE_RPATHS=OFF \
    -DBOOST_INCLUDEDIR=%{_includedir} \
    -DBOOSTROOT=%{_libdir} \
    -DBoost_CHRONO_LIBRARY_RELEASE=%{_libdir}/libboost_chrono.so \
    -DBoost_DATE_TIME_LIBRARY_RELEASE=%{_libdir}/libboost_date_time.so  \
    -DBoost_FILESYSTEM_LIBRARY_RELEASE=%{_libdir}/libboost_filesystem.so  \
%if 0%{?suse_version} >= 1600
    -DBoost_PROCESS_LIBRARY_RELEASE=%{_libdir}/libboost_process.so  \
%endif
    -DBoost_PROGRAM_OPTIONS_LIBRARY_RELEASE=%{_libdir}/libboost_program_options.so  \
    -DBoost_PYTHON3_LIBRARY_RELEASE=%{_libdir}/libboost_python-py3.so \
    -DBoost_PYTHON311_LIBRARY_RELEASE=%{_libdir}/libboost_python-py3.so \
    -DBoost_PYTHON312_LIBRARY_RELEASE=%{_libdir}/libboost_python-py3.so \
    -DBoost_PYTHON313_LIBRARY_RELEASE=%{_libdir}/libboost_python-py3.so \
    -DBoost_REGEX_LIBRARY_RELEASE=%{_libdir}/libboost_regex.so  \
    -DBoost_SERIALIZATION_LIBRARY_RELEASE=%{_libdir}/libboost_serialization.so  \
%if 0%{?suse_version} <= 1600
    -DBoost_SYSTEM_LIBRARY_RELEASE=%{_libdir}/libboost_system.so \
%endif
    -DBoost_TEST_EXEC_MONITOR_LIBRARY_RELEASE=%{_libdir}/libboost_test_exec_monitor.so \
    -DBoost_THREAD_LIBRARY_RELEASE=%{_libdir}/libboost_thread.so  \
    -DBoost_TIMER_LIBRARY_RELEASE=%{_libdir}/libboost_timer.so \
    -DBoost_UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE=%{_libdir}/libboost_unit_test_framework.so \
    -DENABLE_STATIC_BOOST_LIBS=OFF \
    -DENABLE_PYTHON=ON \
    -DPython3_EXECUTABLE=/usr/bin/python3 \
    -DENABLE_TESTS=ON \
    -DENABLE_SSL=ON \
    -DENABLE_UI=ON \
    -DENABLE_UDP=OFF

%cmake_build

%install
%cmake_install

#---no need to have *.cmake files:
rm -r %{buildroot}%{_libdir}/cmake

#---env-shebangs generate warning / error messages:
for fil in %{buildroot}%{_bindir}/ecflow_fuse.py \
           %{buildroot}%{python3_sitelib}/%{name}/ecf.py \
           %{buildroot}%{python3_sitelib}/%{name}/sms2ecf.py; do
  sed -i -e '1 s|/usr/bin/env python.*|/usr/bin/python3|' $fil
done
%python3_fix_shebang
sed -i '1 s|/usr/bin/env perl|/usr/bin/perl|' \
  %{buildroot}%{_bindir}/ecflow_logsvr.pl

%{python3_fix_shebang}

#---make python scripts executable:
chmod 755 %{buildroot}%{python3_sitelib}/%{name}/ecf.py \
          %{buildroot}%{python3_sitelib}/%{name}/sms2ecf.py

%check
%define _smp_mflags -j1
%ifarch aarch64 ppc64le x86_64
#---temporarily disable u_server_authentication (Test not implemented)
%ctest --exclude-regex u_server_authentication
%else
#---32bit archs fail test "Test_Http" (Client::handle_connect: Ran out of end points):
%ctest || true
%endif


%files
%license LICENSE
%doc README.md NOTICE
%{_bindir}/%{name}_*
%{_datadir}/%{name}/
%{python3_sitelib}/%{name}/

%changelog
openSUSE Build Service is sponsored by