Skip to content

Commit

Permalink
Merge pull request #1520
Browse files Browse the repository at this point in the history
build: remove python2 support
  • Loading branch information
BareosBot committed Aug 24, 2023
2 parents 24de795 + 77a2d34 commit 4acf3b1
Show file tree
Hide file tree
Showing 356 changed files with 176 additions and 964 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -155,7 +155,6 @@ debian/bareos-database-tools.postinst
debian/bareos-director.install
debian/bareos-director.postinst
debian/bareos-director.preinst
debian/bareos-director-python2-plugin.install
debian/bareos-director-python3-plugin.install
debian/bareos-director-python-plugins-common.install
debian/bareos-director.service
Expand All @@ -168,7 +167,6 @@ debian/bareos-filedaemon-percona-xtrabackup-python-plugin.install
debian/bareos-filedaemon-postgresql-python-plugin.install
debian/bareos-filedaemon.postinst
debian/bareos-filedaemon.preinst
debian/bareos-filedaemon-python2-plugin.install
debian/bareos-filedaemon-python3-plugin.install
debian/bareos-filedaemon-python-plugins-common.install
debian/bareos-filedaemon.service
Expand All @@ -178,7 +176,6 @@ debian/bareos-storage-glusterfs.install
debian/bareos-storage.install
debian/bareos-storage.postinst
debian/bareos-storage.preinst
debian/bareos-storage-python2-plugin.install
debian/bareos-storage-python3-plugin.install
debian/bareos-storage-python-plugins-common.install
debian/bareos-storage.service
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -99,6 +99,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- cats: remove remains of deprecated databases [PR #1377]
- dird: filed: stored: remove deprecated `maxconnections` option from configuration [PR #1340]
- cats: remove dynamic catalog backends [PR #1392]
- build: remove python2 support [PR #1520]

### Changed
- cats: fix issue where `startfile` field gets wrongly updated [PR #1346]
Expand Down Expand Up @@ -232,6 +233,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
[PR #1511]: https://github.com/bareos/bareos/pull/1511
[PR #1512]: https://github.com/bareos/bareos/pull/1512
[PR #1516]: https://github.com/bareos/bareos/pull/1516
[PR #1520]: https://github.com/bareos/bareos/pull/1520
[PR #1522]: https://github.com/bareos/bareos/pull/1522
[PR #1524]: https://github.com/bareos/bareos/pull/1524
[unreleased]: https://github.com/bareos/bareos/tree/master
9 changes: 0 additions & 9 deletions core/CMakeLists.txt
Expand Up @@ -359,7 +359,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")

set(HAVE_WIN32 1)

set(Python2_LIBRARIES python27.dll)
set(Python3_LIBRARIES python38.dll)

if(${WINDOWS_BITS} MATCHES "32")
Expand All @@ -368,7 +367,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(cross-prefix x86_64-w64-mingw32)
endif()

set(Python2_INCLUDE_DIRS /usr/${cross-prefix}/include/python2/)
set(Python3_INCLUDE_DIRS /usr/${cross-prefix}/include/python3/)

set(PostgreSQL_LIBRARY libpq.dll)
Expand Down Expand Up @@ -413,10 +411,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m${WINDOWS_BITS} -mwin32 -mthreads")

# c++17 removed register keyword
set(Python2_CCSHARED -Wno-register)

set(Python2_SITEARCH ${plugindir})
set(Python3_SITEARCH ${plugindir})
endif()

Expand Down Expand Up @@ -904,9 +898,6 @@ message(
message(
" CEPHFS support: ${CEPHFS_FOUND} ${CEPHFS_LIBRARIES} ${CEPHFS_INCLUDE_DIRS} "
)
message(
" Python2 support: ${Python2_FOUND} ${Python2_VERSION} ${Python2_INCLUDE_DIRS} ${Python2_EXECUTABLE}"
)
message(
" Python3 support: ${Python3_FOUND} ${Python3_VERSION} ${Python3_INCLUDE_DIRS} ${Python3_EXECUTABLE}"
)
Expand Down
31 changes: 1 addition & 30 deletions core/cmake/BareosFindAllLibraries.cmake
Expand Up @@ -23,32 +23,21 @@ 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)
set(Python3_FOUND 0)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(HAVE_PYTHON 1)
set(Python2_FOUND 1)
set(Python2_EXT_SUFFIX ".dll")

set(Python3_FOUND 1)
set(Python3_EXT_SUFFIX ".pyd")

# Python Plugins currently cannot be built for Solaris
elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set(HAVE_PYTHON 0)
set(Python2_FOUND 0)
set(Python3_FOUND 0)

else()
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 All @@ -61,28 +50,10 @@ else()
PARENT_SCOPE
)

if(${Python2_FOUND} OR ${Python3_FOUND})
if(${Python3_FOUND})
set(HAVE_PYTHON 1)
endif()

if(${Python2_FOUND})
set(PYTHON_EXECUTABLE
${Python2_EXECUTABLE}
PARENT_SCOPE
)
set(Python2_EXECUTABLE
${Python2_EXECUTABLE}
PARENT_SCOPE
)
execute_process(
COMMAND ${Python2_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/cmake/get_python_compile_settings.py
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/py2settings.cmake
)
include(${CMAKE_CURRENT_BINARY_DIR}/py2settings.cmake)
set(Python2_CCSHARED ${Python2_CC_FLAGS} -Wno-register)
endif()

if(${Python3_FOUND})
set(PYTHON_EXECUTABLE
${Python3_EXECUTABLE}
Expand Down
29 changes: 7 additions & 22 deletions core/cmake/BareosGenerateDebianInfo.cmake
@@ -1,6 +1,6 @@
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2018-2022 Bareos GmbH & Co. KG
# Copyright (C) 2018-2023 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 @@ -45,27 +45,17 @@ else()

if(NOT client-only
AND ENABLE_PYTHON
AND (Python2_FOUND OR Python3_FOUND)
AND (Python3_FOUND)
)
if(Python2_FOUND)
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-director-python2-plugin")
endif()
if(Python3_FOUND)
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-director-python3-plugin")
endif()
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-director-python3-plugin")
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-director-python-plugins-common")
endif()

if(HAVE_GLUSTERFS)
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-filedaemon-glusterfs-plugin")
endif()
if(ENABLE_PYTHON AND (Python2_FOUND OR Python3_FOUND))
if(Python2_FOUND)
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-filedaemon-python2-plugin")
endif()
if(Python3_FOUND)
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-filedaemon-python3-plugin")
endif()
if(ENABLE_PYTHON AND Python3_FOUND)
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-filedaemon-python3-plugin")
list(APPEND DEBIAN_CONTROL_SNIPPETS
"bareos-filedaemon-python-plugins-common"
)
Expand All @@ -79,14 +69,9 @@ else()
endif()
if(NOT client-only
AND ENABLE_PYTHON
AND (Python2_FOUND OR Python3_FOUND)
AND Python3_FOUND
)
if(Python2_FOUND)
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-storage-python2-plugin")
endif()
if(Python3_FOUND)
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-storage-python3-plugin")
endif()
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-storage-python3-plugin")
list(APPEND DEBIAN_CONTROL_SNIPPETS "bareos-storage-python-plugins-common")
endif()

Expand Down
@@ -1,3 +1,2 @@

lib/bareos/plugins/python-fd.so
lib/python2.7/site-packages/bareosfd.so
Expand Up @@ -9,7 +9,6 @@ database-postgresql
database-tools
tools
director-python-plugin
filedaemon-python2-plugin
filedaemon-python3-plugin
filedaemon-ldap-python-plugin
storage-python-plugin

0 comments on commit 4acf3b1

Please sign in to comment.