Skip to content

Commit

Permalink
Merge pull request #1179
Browse files Browse the repository at this point in the history
Add support for Ubuntu 22.04, Fedora 36, EL 9, openSUSE 15.4
  • Loading branch information
pstorz committed Jun 22, 2022
2 parents 4affb38 + 6b33d61 commit 863e9f4
Show file tree
Hide file tree
Showing 18 changed files with 327 additions and 45 deletions.
37 changes: 29 additions & 8 deletions .matrix.yml
Expand Up @@ -18,6 +18,17 @@ OS:
- bareos

xUbuntu:
"22.04":
TYPE: deb
IMAGE: "ubuntu22.04"
ARCH:
- x86_64
PROJECTPACKAGES:
x86_64:
- bareos
- bareos-webui
- bareos-vmware
- python-bareos
"20.04":
TYPE: deb
IMAGE: "ubuntu20.04"
Expand All @@ -43,19 +54,19 @@ OS:
- python-bareos

openSUSE:
"Leap_15.3":
"Leap_15.4":
TYPE: rpm
IMAGE: opensuse-leap153
IMAGE: opensuse-leap154
ARCH:
- x86_64
PROJECTPACKAGES:
x86_64:
- bareos
- python-bareos

"Leap_15.2":
"Leap_15.3":
TYPE: rpm
IMAGE: opensuse-leap152
IMAGE: opensuse-leap153
ARCH:
- x86_64
PROJECTPACKAGES:
Expand Down Expand Up @@ -115,18 +126,18 @@ OS:
- python-bareos

Fedora:
"35":
"36":
TYPE: rpm
IMAGE: fedora35
IMAGE: fedora36
ARCH:
- x86_64
PROJECTPACKAGES:
x86_64:
- bareos
- python-bareos
"34":
"35":
TYPE: rpm
IMAGE: fedora34
IMAGE: fedora35
ARCH:
- x86_64
PROJECTPACKAGES:
Expand Down Expand Up @@ -158,6 +169,16 @@ OS:
- python-bareos

EL:
"9":
TYPE: rpm
IMAGE: centos9
ARCH:
- x86_64
PROJECTPACKAGES:
x86_64:
- bareos
- bareos-vmware
- python-bareos
"8":
TYPE: rpm
IMAGE: rocky8
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -29,6 +29,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- systemtest py*plug-fd-contrib-bareos_tasks_mysql [PR #768]
- webui: introduce rerun of multiple jobs at once [PR #1109]
- dird: console: add the ability to rerun multiple commas separated jobids [PR #1170]
- build: Add support for Ubuntu 22.04, Fedora 36, EL 9, openSUSE 15.4 [PR #1179]

### Fixed
- python plugins: store architecture specific modules in sitearch (instead of sitelib) [PR #698]
Expand Down
10 changes: 8 additions & 2 deletions core/cmake/BareosFindAllLibraries.cmake
@@ -1,6 +1,6 @@
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2017-2021 Bareos GmbH & Co. KG
# Copyright (C) 2017-2022 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand All @@ -23,6 +23,8 @@ if(${SYSTEMD_FOUND})
endif()

option(ENABLE_PYTHON "Enable Python support" ON)
option(ENABLE_PYTHON2 "Enable Python2 support" ON)

if(NOT ENABLE_PYTHON)
set(HAVE_PYTHON 0)
set(Python2_FOUND 0)
Expand All @@ -42,7 +44,11 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set(Python3_FOUND 0)

else()
find_package(Python2 COMPONENTS Interpreter Development)
if(ENABLE_PYTHON2)
find_package(Python2 COMPONENTS Interpreter Development)
else()
set(Python2_FOUND 0)
endif()
find_package(Python3 COMPONENTS Interpreter Development)

set(Python3_VERSION_MAJOR
Expand Down
74 changes: 49 additions & 25 deletions core/platforms/packaging/bareos.spec
@@ -1,7 +1,7 @@
#
# spec file for package bareos
# Copyright (c) 2011-2012 Bruno Friedmann (Ioda-Net) and Philipp Storz (dass IT)
# 2013-2021 Bareos GmbH & Co KG
# 2013-2022 Bareos GmbH & Co KG
#

Name: bareos
Expand Down Expand Up @@ -45,6 +45,7 @@ Vendor: The Bareos Team
%define install_suse_fw 0
%define systemd_support 0
%define python_plugins 1
%define python2_available 1
%define contrib 1

# cmake build directory
Expand Down Expand Up @@ -122,13 +123,18 @@ BuildRequires: devtoolset-8-gcc
BuildRequires: devtoolset-8-gcc-c++
%endif

%if 0%{?sle_version} >= 150300 || 0%{?suse_version} > 1500
%if 0%{?sle_version} == 150400
BuildRequires: gcc11
BuildRequires: gcc11-c++
%else
%if 0%{?sle_version} == 150300 || 0%{?suse_version} > 1500
BuildRequires: gcc10
BuildRequires: gcc10-c++
%else
%if 0%{?suse_version}
%else
%if 0%{?suse_version}
BuildRequires: gcc9
BuildRequires: gcc9-c++
%endif
%endif
%endif

Expand All @@ -155,7 +161,7 @@ BuildRequires: librados-devel
BuildRequires: librados2-devel
BuildRequires: libcephfs1-devel
%else
%if 0%{?rhel} == 8
%if 0%{?rhel} == 8 || 0%{?rhel} == 9
BuildRequires: librados-devel
BuildRequires: libradosstriper-devel
BuildRequires: libcephfs-devel
Expand Down Expand Up @@ -208,15 +214,14 @@ BuildRequires: qt-devel
%endif
%endif


%if 0%{?python_plugins}
%if 0%{?centos_version} >= 800 || 0%{?rhel_version} >= 800 || 0%{?fedora} >= 31
%if 0%{?fedora} >= 36 || 0%{?rhel_version} >= 900 || 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150400
%define python2_available 0
%endif
%if 0%{python2_available}
BuildRequires: python2-devel >= 2.6
%endif
BuildRequires: python3-devel >= 3.4
%else
BuildRequires: python-devel >= 2.6
BuildRequires: python3-devel >= 3.4
%endif
%endif

%if 0%{?suse_version}
Expand Down Expand Up @@ -249,7 +254,9 @@ BuildRequires: passwd
# Some magic to be able to determine what platform we are running on.
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}

%if 0%{?centos_version} < 900
BuildRequires: redhat-lsb
%endif

# older versions require additional release packages
%if 0%{?rhel_version} && 0%{?rhel_version} <= 600
Expand Down Expand Up @@ -462,14 +469,15 @@ Provides: %{name}-tray-monitor-qt
%endif

%if 0%{?python_plugins}
%if 0%{?python2_available}
%package director-python2-plugin
Summary: Python plugin for Bareos Director daemon
Group: Productivity/Archiving/Backup
Requires: bareos-director = %{version}
Requires: bareos-director-python-plugins-common = %{version}
Provides: bareos-director-python-plugin
Obsoletes: bareos-director-python-plugin <= %{version}

%endif
%package director-python3-plugin
Summary: Python plugin for Bareos Director daemon
Group: Productivity/Archiving/Backup
Expand All @@ -484,14 +492,15 @@ Group: Productivity/Archiving/Backup
Requires: bareos-director = %{version}


%if 0%{?python2_available}
%package filedaemon-python2-plugin
Summary: Python plugin for Bareos File daemon
Group: Productivity/Archiving/Backup
Requires: bareos-filedaemon = %{version}
Requires: bareos-filedaemon-python-plugins-common = %{version}
Provides: bareos-filedaemon-python-plugin
Obsoletes: bareos-filedaemon-python-plugin <= %{version}

%endif
%package filedaemon-python3-plugin
Summary: Python plugin for Bareos File daemon
Group: Productivity/Archiving/Backup
Expand Down Expand Up @@ -544,14 +553,15 @@ Requires: bareos-filedaemon = %{version}
Requires: bareos-filedaemon-python-plugin = %{version}


%if 0%{?python2_available}
%package storage-python2-plugin
Summary: Python plugin for Bareos Storage daemon
Group: Productivity/Archiving/Backup
Requires: bareos-storage = %{version}
Requires: bareos-storage-python-plugins-common = %{version}
Provides: bareos-storage-python-plugin
Obsoletes: bareos-storage-python-plugin <= %{version}

%endif
%package storage-python3-plugin
Summary: Python plugin for Bareos Storage daemon
Group: Productivity/Archiving/Backup
Expand Down Expand Up @@ -606,11 +616,12 @@ Keeps bareos/plugins/vmware_plugin subdirectory, which have been used in Bareos
# VMware Plugin END
%endif

%if 0%{python2_available}
%description director-python2-plugin
%{dscr}

This package contains the python plugin for the director daemon

%endif
%description director-python3-plugin
%{dscr}

Expand All @@ -621,11 +632,12 @@ This package contains the python 3 plugin for the director daemon

This package contains the common files for the python 2 and python 3 director plugins.

%if 0%{python2_available}
%description filedaemon-python2-plugin
%{dscr}

This package contains the python plugin for the file daemon

%endif
%description filedaemon-python3-plugin
%{dscr}

Expand Down Expand Up @@ -667,11 +679,12 @@ This package contains the Percona python plugin for the file daemon
This package contains the Mariabackup python plugin for the file daemon


%if 0%{python2_available}
%description storage-python2-plugin
%{dscr}

This package contains the python plugin for the storage daemon

%endif
%description storage-python3-plugin
%{dscr}

Expand Down Expand Up @@ -766,7 +779,7 @@ BuildRequires: httpd-devel
%define _apache_conf_dir /etc/httpd/conf.d/
%define www_daemon_user apache
%define www_daemon_group apache
%if 0%{?fedora_version} >= 33
%if 0%{?fedora_version} >= 33 || 0%{?rhel_version} >= 900
Requires: php-fpm
%else
Requires: mod_php
Expand Down Expand Up @@ -947,13 +960,18 @@ source /opt/rh/devtoolset-8/enable
%endif

# use modern compiler on suse
%if 0%{?sle_version} >= 150300 || 0%{?suse_version} > 1500
%if 0%{?sle_version} == 150400
CC=gcc-11 ; export CC
CXX=g++-11 ; export CXX
%else
%if 0%{?sle_version} == 150300 || 0%{?suse_version} > 1500
CC=gcc-10 ; export CC
CXX=g++-10 ; export CXX
%else
%if 0%{?suse_version}
%else
%if 0%{?suse_version}
CC=gcc-9 ; export CC
CXX=g++-9 ; export CXX
%endif
%endif
%endif

Expand Down Expand Up @@ -1032,7 +1050,10 @@ cmake .. \
-Dincludes=yes \
-Ddefault_db_backend="XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" \
-Dwebuiconfdir=%{_sysconfdir}/bareos-webui \
-DVERSION_STRING=%version
-DVERSION_STRING=%version \
%if !0%{python2_available}
-DENABLE_PYTHON2=no \
%endif

#Add flags
%__make CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags};
Expand Down Expand Up @@ -1561,11 +1582,12 @@ mkdir -p %{?buildroot}/%{_libdir}/bareos/plugins/vmware_plugin
%endif

%if 0%{?python_plugins}
%if 0%{python2_available}
%files filedaemon-python2-plugin
%defattr(-, root, root)
%{plugin_dir}/python-fd.so
%{python2_sitearch}/bareosfd*.so

%endif
%files filedaemon-python3-plugin
%defattr(-, root, root)
%{plugin_dir}/python3-fd.so
Expand Down Expand Up @@ -1620,11 +1642,12 @@ mkdir -p %{?buildroot}/%{_libdir}/bareos/plugins/vmware_plugin
%{plugin_dir}/BareosFdPluginMariabackup.py*


%if 0%{python2_available}
%files director-python2-plugin
%defattr(-, root, root)
%{plugin_dir}/python-dir.so
%{python2_sitearch}/bareosdir*.so

%endif
%files director-python3-plugin
%defattr(-, root, root)
%{plugin_dir}/python3-dir.so
Expand All @@ -1635,11 +1658,12 @@ mkdir -p %{?buildroot}/%{_libdir}/bareos/plugins/vmware_plugin
%{plugin_dir}/bareos-dir-class-plugin.py*
%{plugin_dir}/BareosDirWrapper.py*

%if 0%{python2_available}
%files storage-python2-plugin
%defattr(-, root, root)
%{plugin_dir}/python-sd.so
%{python2_sitearch}/bareossd*.so

%endif
%files storage-python3-plugin
%defattr(-, root, root)
%{plugin_dir}/python3-sd.so
Expand Down
5 changes: 4 additions & 1 deletion core/src/droplet/libdroplet/CMakeLists.txt
@@ -1,6 +1,6 @@
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2020-2020 Bareos GmbH & Co. KG
# Copyright (C) 2020-2022 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -98,6 +98,9 @@ add_library(
src/backend/posix/replyparser.c
)

# openssl 3.0
target_compile_options(droplet PUBLIC -Wno-deprecated-declarations)

target_include_directories(
droplet PUBLIC include ${LIBXML2_INCLUDE_DIR} ${JSONC_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
Expand Down

0 comments on commit 863e9f4

Please sign in to comment.