From 14109a81c846c17a079b0630d3ae1f82968167b1 Mon Sep 17 00:00:00 2001 From: Amit Karsale Date: Tue, 12 Mar 2024 01:31:49 +0530 Subject: [PATCH] (PA-6001) Add sles11 platform to pxp-agent --- configs/components/cpp-hocon.rb | 2 +- configs/components/cpp-pcp-client.rb | 3 +++ configs/components/leatherman.rb | 10 +++++++++- configs/components/pxp-agent.rb | 2 ++ configs/components/runtime.rb | 2 ++ configs/platforms/sles-11-x86_64.rb | 22 ++++++++++++++++++++++ configs/projects/pxp-agent.rb | 2 +- 7 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 configs/platforms/sles-11-x86_64.rb diff --git a/configs/components/cpp-hocon.rb b/configs/components/cpp-hocon.rb index b8d76e4..75d9806 100644 --- a/configs/components/cpp-hocon.rb +++ b/configs/components/cpp-hocon.rb @@ -45,7 +45,7 @@ cmake = 'C:/ProgramData/chocolatey/bin/cmake.exe -G "MinGW Makefiles"' toolchain = "-DCMAKE_TOOLCHAIN_FILE=#{settings[:tools_root]}/pl-build-toolchain.cmake" - elsif platform.name =~ /el-[67]|redhatfips-7|sles-12|ubuntu-18.04-amd64/ + elsif platform.name =~ /el-[67]|redhatfips-7|sles-1[12]|ubuntu-18.04-amd64/ toolchain = '-DCMAKE_TOOLCHAIN_FILE=/opt/pl-build-tools/pl-build-toolchain.cmake' cmake = '/opt/pl-build-tools/bin/cmake' elsif platform.is_aix? diff --git a/configs/components/cpp-pcp-client.rb b/configs/components/cpp-pcp-client.rb index 1a9bf1b..a4dd07d 100644 --- a/configs/components/cpp-pcp-client.rb +++ b/configs/components/cpp-pcp-client.rb @@ -59,6 +59,9 @@ cmake = 'C:/ProgramData/chocolatey/bin/cmake.exe -G "MinGW Makefiles"' toolchain = "-DCMAKE_TOOLCHAIN_FILE=#{settings[:tools_root]}/pl-build-toolchain.cmake" + elsif platform.name == 'sles-11-x86_64' + cmake = 'env LD_LIBRARY_PATH=/opt/pl-build-tools/lib64 /opt/pl-build-tools/bin/cmake' + special_flags = " -DCMAKE_CXX_FLAGS='-Wno-error=implicit-fallthrough -Wno-error=catch-value' " elsif platform.name =~ /el-[67]|redhatfips-7|sles-12|ubuntu-18.04-amd64/ # use default that is pl-build-tools else diff --git a/configs/components/leatherman.rb b/configs/components/leatherman.rb index 2bfed93..073e4a2 100644 --- a/configs/components/leatherman.rb +++ b/configs/components/leatherman.rb @@ -20,6 +20,10 @@ elsif platform.is_windows? pkg.build_requires 'cmake' pkg.build_requires "pl-gettext-#{platform.architecture}" + elsif platform.name == 'sles-11-x86_64' + pkg.build_requires 'pl-cmake' + pkg.build_requires 'pl-gettext' + pkg.build_requires 'runtime' elsif platform.name =~ /el-[67]|redhatfips-7|sles-12|ubuntu-18.04-amd64/ pkg.build_requires 'pl-cmake' pkg.build_requires 'pl-gettext' @@ -90,6 +94,10 @@ # Use environment variable set in environment.bat to find locale files leatherman_locale_var = "-DLEATHERMAN_LOCALE_VAR='PUPPET_DIR' -DLEATHERMAN_LOCALE_INSTALL='share/locale'" + elsif platform.name == 'sles-11-x86_64' + cmake = 'env LD_LIBRARY_PATH=/opt/pl-build-tools/lib64 /opt/pl-build-tools/bin/cmake' + toolchain = '-DCMAKE_TOOLCHAIN_FILE=/opt/pl-build-tools/pl-build-toolchain.cmake' + special_flags += " -DCMAKE_CXX_FLAGS='-Wno-deprecated-declarations -Wno-error=class-memaccess -Wno-error=ignored-qualifiers -Wno-error=catch-value' " elsif platform.name =~ /el-[67]|redhatfips-7|sles-12|ubuntu-18.04-amd64/ toolchain = '-DCMAKE_TOOLCHAIN_FILE=/opt/pl-build-tools/pl-build-toolchain.cmake' cmake = '/opt/pl-build-tools/bin/cmake' @@ -150,7 +158,7 @@ pkg.check do ["LEATHERMAN_RUBY=#{settings[:libdir]}/$(shell #{ruby} -e 'print RbConfig::CONFIG[\"LIBRUBY_SO\"]') \ - LD_LIBRARY_PATH=#{settings[:libdir]} LIBPATH=#{settings[:libdir]} #{test_locale} #{make} test ARGS=-V"] + LD_LIBRARY_PATH=/opt/pl-build-tools/lib64 LIBPATH=#{settings[:libdir]} #{test_locale} #{make} test ARGS=-V"] end end diff --git a/configs/components/pxp-agent.rb b/configs/components/pxp-agent.rb index dcd0c96..25ee389 100644 --- a/configs/components/pxp-agent.rb +++ b/configs/components/pxp-agent.rb @@ -75,6 +75,8 @@ elsif platform.name =~ /el-[67]|redhatfips-7|sles-12|ubuntu-18.04-amd64/ # use default that is pl-build-tools + elsif platform.name =~ /sles-11/ + special_flags += "-DCMAKE_CXX_FLAGS='#{settings[:cflags]}' -DENABLE_CXX_WERROR=OFF" else # These platforms use the default OS toolchain, rather than pl-build-tools cmake = 'cmake' diff --git a/configs/components/runtime.rb b/configs/components/runtime.rb index d1865af..9d839b5 100644 --- a/configs/components/runtime.rb +++ b/configs/components/runtime.rb @@ -12,6 +12,8 @@ pkg.build_requires "pl-iconv-#{platform.architecture}" pkg.build_requires "pl-libffi-#{platform.architecture}" pkg.build_requires "pl-pdcurses-#{platform.architecture}" + elsif platform.name == 'sles-11-x86_64' + pkg.build_requires 'pl-gcc8' elsif platform.name =~ /el-[67]|redhatfips-7|sles-12|ubuntu-18.04-amd64/ pkg.build_requires 'pl-gcc' end diff --git a/configs/platforms/sles-11-x86_64.rb b/configs/platforms/sles-11-x86_64.rb new file mode 100644 index 0000000..84be60a --- /dev/null +++ b/configs/platforms/sles-11-x86_64.rb @@ -0,0 +1,22 @@ +platform "sles-11-x86_64" do |plat| + plat.servicedir "/etc/init.d" + plat.defaultdir "/etc/sysconfig" + plat.servicetype "sysv" + + plat.add_build_repository "http://osmirror.delivery.puppetlabs.net/sles-11-deps-x86_64/sles-11-deps-x86_64.repo" + plat.add_build_repository "http://pl-build-tools.delivery.puppetlabs.net/yum/sles/11/x86_64/pl-build-tools-sles-11-x86_64.repo" + packages = [ + "aaa_base", + "libbz2-devel", + "pkgconfig", + "pl-autotools", + "pl-cmake", + "pl-gcc8", + "readline-devel", + "rsync", + "zlib-devel" + ] + plat.install_build_dependencies_with "zypper -n --no-gpg-checks install -y" + plat.provision_with("zypper -n --no-gpg-checks install -y #{packages.join(' ')}") + plat.vmpooler_template "sles-11-x86_64" +end diff --git a/configs/projects/pxp-agent.rb b/configs/projects/pxp-agent.rb index db915a8..18cd9fb 100644 --- a/configs/projects/pxp-agent.rb +++ b/configs/projects/pxp-agent.rb @@ -31,7 +31,7 @@ proj.component 'pl-cmake-patch' proj.component 'puppet-runtime' - proj.component 'runtime' if platform.name =~ /el-[67]|redhatfips-7|sles-12|ubuntu-18.04-amd64/ || !platform.is_linux? + proj.component 'runtime' if platform.name =~ /el-[67]|redhatfips-7|sles-1[12]|ubuntu-18.04-amd64/ || !platform.is_linux? proj.component 'leatherman' proj.component 'cpp-hocon'