This is an automated email from the ASF dual-hosted git repository. szaszm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit 612e9f5c3d390a93a3a055fb1ba4f8a354fe3614 Author: Martin Zink <[email protected]> AuthorDate: Fri Oct 17 17:17:04 2025 +0200 MINIFICPP-2652 Remove deprecated bootstrap.sh Closes #2049 Signed-off-by: Marton Szasz <[email protected]> --- README.md | 72 -------- ThirdParties.md | 7 - aptitude.sh | 89 --------- arch.sh | 77 -------- bootstrap.sh | 524 ----------------------------------------------------- bstrp_functions.sh | 474 ------------------------------------------------ centos.sh | 99 ---------- conanfile.py | 2 +- darwin.sh | 109 ----------- debian.sh | 90 --------- deploy.sh | 28 --- fedora.sh | 83 --------- linux.sh | 60 ------ rheldistro.sh | 91 ---------- suse.sh | 96 ---------- 15 files changed, 1 insertion(+), 1900 deletions(-) diff --git a/README.md b/README.md index 8e1603b63..c4da64624 100644 --- a/README.md +++ b/README.md @@ -304,68 +304,6 @@ Prerequisites: This will set up a virtual environment in the bootstrap folder, and guide you through the build process. -#### Shell based bootstrapping (linux and macOS) -- Please run the command `bootstrap.sh` from the root of the MiNiFi C++ source tree. - -- Per the table, below, you will be presented with a menu guided bootstrap process. You may enable and disable extensions ( further defined below ). Once you are finished selecting the features - you wish to build, enter P to continue with the process. CMAKE dependencies will be resolved for your distro. You may enter command line options -n to force yes to all prompts - (including the package installation prompts ) and -b to automatically run make once the cmake process is complete. Alternatively, you may include the package argument to bootstrap, -p, - which will run make package. - -- If you provide -b or -p to bootstrap.sh, you do not need to follow the Building section, below. If you do not provide these arguments you may skip the cmake .. section from Building. - -- Using the Release build profile is recommended to reduce binary size. (~200 MB vs ~30 MB) - - ``` - # ~/Development/code/apache/nifi-minifi-cpp on git:master - $ ./bootstrap.sh - # CMAKE Build dir exists, should we overwrite your build directory before we begin? - If you have already bootstrapped, bootstrapping again isn't necessary to run make [ Y/N ] Y - **************************************** - Select MiNiFi C++ Features to toggle. - **************************************** - A. Persistent Repositories .....Enabled - C. libarchive features .........Enabled - D. Python Scripting support ....Enabled - E. Expression Language support .Enabled - F. Kafka support ...............Enabled - K. Bustache Support ............Disabled - L. Lua Scripting Support .......Enabled - M. MQTT Support ................Enabled - O. SFTP Support ................Disabled - S. AWS Support .................Enabled - T. OpenCV Support ..............Disabled - U. OPC-UA Support...............Enabled - V. SQL Support..................Enabled - X. Azure Support ...............Enabled - Y. Systemd Support .............Enabled - AA. Splunk Support .............Enabled - AB. Kubernetes Support .........Enabled - AC. Google Cloud Support .......Enabled - AD. ProcFs Support .............Enabled - AE. Prometheus Support .........Enabled - AF. Elasticsearch Support ......Enabled - **************************************** - Build Options. - **************************************** - 1. Enable Tests ................Enabled - 2. Enable all extensions - 4. Use Shared Dependency Links .Enabled - 5. Build Profile ...............RelWithDebInfo Debug MinSizeRel Release - 6. Create ASAN build ...........Disabled - 7. Treat warnings as errors.....Disabled - P. Continue with these options - Q. Quit - * Extension cannot be installed due to - version of cmake or other software, or - incompatibility with other extensions - - Enter choice [A-Z or AA-AF or 1-7] - ``` - -- Bootstrap now saves state between runs. State will automatically be saved. Provide -c or --clear to clear this state. The -i option provides a guided menu install with the ability to change -advanced features. - ### Building #### Build MiNiFi using Standalone CMake @@ -545,16 +483,6 @@ The container can be run with a specific configuration by mounting the locally e $ docker run -v ~/Development/apache/nifi-minifi-cpp/conf/config.yml:/opt/minifi/minifi-current/conf/config.yml -v ~/Development/apache/nifi-minifi-cpp/conf/minifi.properties:/opt/minifi/minifi-current/conf/minifi.properties apache/nifi-minifi-cpp ``` -### Deploying -MiNiFi C++ comes with a deployment script. This will build and package minifi. Additionally, a file named build_output will be -created within the build directory that contains a manifest of build artifacts. - - $ deploy.sh <build identifier> - -The build identifier will be carried with the deployed binary for the configuration you specify. By default all extensions will be built. - -On Windows it is suggested that MSI be used for installation. - ### Cleaning Remove the build directory created above. ``` diff --git a/ThirdParties.md b/ThirdParties.md index a2aca323d..19dd6afad 100644 --- a/ThirdParties.md +++ b/ThirdParties.md @@ -25,7 +25,6 @@ This document describes the way we build and use third parties and provides a gu + [License](#license) * [Built-in or system dependency](#built-in-or-system-dependency) * [System dependency](#system-dependency) - + [bootstrap.sh](#bootstrapsh) + [Find\<Package\>.cmake](#find--package--cmake) + [find_package](#find-package) * [Built-in dependency](#built-in-dependency) @@ -98,12 +97,6 @@ Both a system and a built-in version can be supported, in which case the choice To add a new system dependency, you have to follow the following steps: -### bootstrap.sh - -If you are using a system dependency, you have to ensure that the development packages are installed on the build system if the extension is selected. - -To ensure this, edit `bootstrap.sh` and all the platform-specific scripts (`centos.sh`, `fedora.sh`, `debian.sh`, `suse.sh`, `rheldistro.sh`, `darwin.sh`). - ### Find\<Package\>.cmake If a `Find<Package>.cmake` is provided for your third party by not unreasonably new (not later than 3.2) CMake versions out of the box, then you have nothing further to do, unless they don't create imported library targets. diff --git a/aptitude.sh b/aptitude.sh deleted file mode 100644 index 9528fed32..000000000 --- a/aptitude.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -verify_enable_platform(){ - feature="$1" - verify_gcc_enable "$feature" -} -add_os_flags() { - CC=${CC:-gcc} - CXX=${CXX:-g++} - export CC - export CXX - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX" -} -bootstrap_cmake(){ - ## on Ubuntu install the latest CMake - echo "Adding KitWare CMake apt repository..." - sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget - wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - - sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -c --short) main" && sudo apt-get update - sudo apt-get -y install cmake -} -bootstrap_compiler() { - compiler_pkgs="gcc g++" - # shellcheck disable=SC2086 - sudo apt-get -y install $compiler_pkgs -} -build_deps(){ - COMMAND="sudo apt-get -y install zlib1g-dev libssl-dev uuid uuid-dev perl libbz2-dev libcurl4-openssl-dev" - - export DEBIAN_FRONTEND=noninteractive - INSTALLED=() - sudo apt-get -y update - for option in "${OPTIONS[@]}" ; do - option_value="${!option}" - if [ "$option_value" = "${TRUE}" ]; then - # option is enabled - FOUND_VALUE="" - for cmake_opt in "${DEPENDENCIES[@]}" ; do - KEY=${cmake_opt%%:*} - VALUE=${cmake_opt#*:} - if [ "$KEY" = "$option" ]; then - FOUND_VALUE="$VALUE" - if [ "$FOUND_VALUE" = "openssl" ]; then - INSTALLED+=("openssl") - elif [ "$FOUND_VALUE" = "bison" ]; then - INSTALLED+=("bison") - elif [ "$FOUND_VALUE" = "flex" ]; then - INSTALLED+=("flex") - elif [ "$FOUND_VALUE" = "automake" ]; then - INSTALLED+=("automake") - elif [ "$FOUND_VALUE" = "autoconf" ]; then - INSTALLED+=("autoconf") - elif [ "$FOUND_VALUE" = "libtool" ]; then - INSTALLED+=("libtool") - elif [ "$FOUND_VALUE" = "python" ]; then - INSTALLED+=("libpython3-dev") - elif [ "$FOUND_VALUE" = "libarchive" ]; then - INSTALLED+=("liblzma-dev") - fi - fi - done - - fi - done - - for option in "${INSTALLED[@]}" ; do - COMMAND="${COMMAND} $option" - done - - echo "Ensuring you have all dependencies installed..." - ${COMMAND} - -} diff --git a/arch.sh b/arch.sh deleted file mode 100644 index 47cb53313..000000000 --- a/arch.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -verify_enable_platform(){ - feature="$1" - verify_gcc_enable "${feature}" -} -add_os_flags() { - #CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND}" - : -} -bootstrap_cmake(){ - sudo pacman -S --noconfirm cmake -} -bootstrap_compiler(){ - sudo pacman -S --noconfirm gcc -} -build_deps(){ - COMMAND="sudo pacman -S --noconfirm --needed cmake zlib openssl util-linux make patch which pkgconf perl bzip2 curl" - - INSTALLED=() - for option in "${OPTIONS[@]}" ; do - option_value="${!option}" - if [ "$option_value" = "${TRUE}" ]; then - # option is enabled - FOUND_VALUE="" - for cmake_opt in "${DEPENDENCIES[@]}" ; do - KEY=${cmake_opt%%:*} - VALUE=${cmake_opt#*:} - if [ "$KEY" = "$option" ]; then - FOUND_VALUE="$VALUE" - if [ "$FOUND_VALUE" = "openssl" ]; then - INSTALLED+=("openssl") - elif [ "$FOUND_VALUE" = "bison" ]; then - INSTALLED+=("bison") - elif [ "$FOUND_VALUE" = "flex" ]; then - INSTALLED+=("flex") - elif [ "$FOUND_VALUE" = "automake" ]; then - INSTALLED+=("automake") - elif [ "$FOUND_VALUE" = "autoconf" ]; then - INSTALLED+=("autoconf") - elif [ "$FOUND_VALUE" = "libtool" ]; then - INSTALLED+=("libtool") - elif [ "$FOUND_VALUE" = "python" ]; then - INSTALLED+=("python") - elif [ "$FOUND_VALUE" = "libarchive" ]; then - INSTALLED+=("libarchive") - fi - fi - done - - fi - done - - for option in "${INSTALLED[@]}" ; do - COMMAND="${COMMAND} $option" - done - - echo "Ensuring you have all dependencies installed..." - ${COMMAND} - -} diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index 08de26be8..000000000 --- a/bootstrap.sh +++ /dev/null @@ -1,524 +0,0 @@ -#!/usr/bin/env bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -script_directory="$(cd "$(dirname "$0")" && pwd)" - -CMAKE_GLOBAL_MIN_VERSION_MAJOR=3 -CMAKE_GLOBAL_MIN_VERSION_MINOR=24 -CMAKE_GLOBAL_MIN_VERSION_REVISION=0 - -export RED='\033[0;101m' -export NO_COLOR='\033[0;0;39m' -export TRUE="Enabled" -export FALSE="Disabled" -export DEPLOY="false" -export NO_PROMPT="false" -export FEATURES_SELECTED="false" -export ALL_FEATURES_ENABLED=${FALSE} -export BUILD_DIR="build" -export BUILD_IDENTIFIER="" -export OPTIONS=() -export CMAKE_OPTIONS=() -export CMAKE_MIN_VERSION=() -export INCOMPATIBLE_WITH=() -export DEPLOY_LIMITS=() -export DEPENDENCIES=() -export DEPENDS_ON=() - -CORES=1 -BUILD="false" -PACKAGE="false" -USER_DISABLE_TESTS="${FALSE}" -USE_NINJA="false" - -. "${script_directory}/bstrp_functions.sh" -SKIP_CMAKE=${FALSE} -MENU="features" -GUIDED_INSTALL=${FALSE} -while :; do - case $1 in - -n|--noprompt) - NO_PROMPT="true" - ;; - -s|--skiptests) - USER_DISABLE_TESTS="${TRUE}" - ;; - -g|--useninja) - USE_NINJA="${TRUE}" - ;; - -e|--enableall) - NO_PROMPT="true" - FEATURES_SELECTED="true" - EnableAllFeatures - ;; - -c|--clear) - rm "${script_directory}/bt_state" > /dev/null 2>&1 - ;; - -d|--deploy) - NO_PROMPT="true" - DEPLOY="true" - FEATURES_SELECTED="true" - EnableAllFeatures - ;; - "--build_dir="* ) - BUILD_DIR="${1#*=}" - ;; - -t|--continous-integration) - NO_PROMPT="true" - FEATURES_SELECTED="true" - SKIP_CMAKE="${TRUE}" - ;; - -p|--package) - CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu) - BUILD="true" - PACKAGE="true" - ;; - -i|--install) - GUIDED_INSTALL="Enabled" - EnableAllFeatures - MENU="main" - ALL_FEATURES_ENABLED=${TRUE} - ;; - -b|--build) - CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu) - BUILD="true" - ;; - "--build_identifier="* ) - BUILD_IDENTIFIER="${1#*=}" - ;; - *) break - esac - shift -done - -if [ -x "$(command -v hostname)" ]; then - HOSTNAME=$(hostname) - PING_RESULT=$(ping -c 1 "${HOSTNAME}" 2>&1) - if [[ "$PING_RESULT" = *unknown* ]]; then - cntinu="N" - read -r -p "Cannot resolve your host name -- ${HOSTNAME} -- tests may fail, Continue? [ Y/N ] " cntinu - if [ "$cntinu" = "Y" ] || [ "$cntinu" = "y" ]; then - echo "Continuing..." - else - exit - fi - fi -fi - - -if [ "$NO_PROMPT" = "true" ]; then - echo "****************************************" - echo "Welcome, this bootstrap script will update your system to install MiNiFi C++" - echo "You have opted to skip prompts. " -fi - - - -if [ -f /etc/os-release ]; then - . /etc/os-release - OS=$NAME - VER=$VERSION_ID -elif type lsb_release >/dev/null 2>&1; then - OS=$(lsb_release -si) - VER=$(lsb_release -sr) -elif [ -f /etc/lsb-release ]; then - . /etc/lsb-release - OS=$DISTRIB_ID - VER=$DISTRIB_RELEASE -elif [ -f /etc/debian_version ]; then - OS=Debian - VER=$(cat /etc/debian_version) -elif [ -f /etc/SUSE-brand ]; then - VER=$(tr '\n' ' ' < /etc/SUSE-brand | sed s/.*=\ //) - OS=$(tr '\n' ' ' < /etc/SUSE-brand | sed s/VERSION.*//) -elif [ -f /etc/SUSE-release ]; then - VER=$(tr '\n' ' ' < /etc/SUSE-release | sed s/.*=\ //) - OS=$(tr '\n' ' ' < /etc/SUSE-release | sed s/VERSION.*//) -elif [ -f /etc/redhat-release ]; then - # Older Red Hat, CentOS, etc. - echo "Unsupported old release!" -else - OS=$(uname -s) - VER=$(uname -r) -fi -OS_MAJOR=$(echo "$VER" | cut -d. -f1) -export OS_MAJOR -OS_MINOR=$(echo "$VER" | cut -d. -f2) -export OS_MINOR -OS_REVISION=$(echo "$EVR" | cut -d. -f3) -export OS_REVISION - -if [[ "$OSTYPE" =~ .*linux.* ]]; then - LINUX=true -else - LINUX=false -fi - -if [[ "$OS" = "Darwin" ]]; then - . "${script_directory}/darwin.sh" -else - . "${script_directory}/linux.sh" - if [[ "$OS" = Deb* ]]; then - . "${script_directory}/debian.sh" - elif [[ "$OS" = Ubuntu* || "$OS" = Rasp* || "$OS" = Pop* ]]; then - . "${script_directory}/aptitude.sh" - elif [[ "$OS" = *SUSE* ]]; then - . "${script_directory}/suse.sh" - elif [[ "$OS" = *SLE* ]]; then - if [[ "$VER" = 11* ]]; then - echo "Please install SLES11 manually...exiting" - exit - else - . "${script_directory}/suse.sh" - fi - elif [[ "$OS" = Red* ]]; then - . "${script_directory}/rheldistro.sh" - elif [[ "$OS" = Amazon* || "$OS" = Alma* || "$OS" = Rocky* || "$OS" = CentOS* ]]; then - . "${script_directory}/centos.sh" - elif [[ "$OS" = Fedora* ]]; then - . "${script_directory}/fedora.sh" - elif [[ "$OS" = Arch* || "$OS" = Manjaro* ]]; then - . "${script_directory}/arch.sh" - fi -fi - -### Verify the compiler version -COMPILER_VERSION="0.0.0" -COMPILER_COMMAND="${CXX:-g++}" - -if [ -z "$(command -v "$COMPILER_COMMAND")" ]; then - echo "Couldn't find compiler, attempting to install GCC" - bootstrap_compiler -fi -if [ -x "$(command -v "${COMPILER_COMMAND}")" ]; then - COMPILER_VERSION=$(${COMPILER_COMMAND} -dumpversion) -else - echo "Couldn't find compiler, please install one, or set CXX appropriately" 1>&2 - exit 1 -fi - -COMPILER_MAJOR=$(echo "$COMPILER_VERSION" | cut -d. -f1) -export COMPILER_MAJOR -COMPILER_MINOR=$(echo "$COMPILER_VERSION" | cut -d. -f2) -export COMPILER_MINOR -COMPILER_REVISION=$(echo "$COMPILER_VERSION" | cut -d. -f3) -export COMPILER_REVISION - -### verify the cmake version -CMAKE_COMMAND="" -if [ -x "$(command -v cmake3)" ]; then - CMAKE_COMMAND="cmake3" -elif [ -x "$(command -v cmake)" ]; then - CMAKE_COMMAND="cmake" -fi - -if [ -n "${CMAKE_COMMAND}" ]; then - get_cmake_version -fi - -if [ -z "${CMAKE_COMMAND}" ] || - version_is_less_than "$CMAKE_MAJOR" "$CMAKE_MINOR" "$CMAKE_REVISION" "$CMAKE_GLOBAL_MIN_VERSION_MAJOR" "$CMAKE_GLOBAL_MIN_VERSION_MINOR" "$CMAKE_GLOBAL_MIN_VERSION_REVISION"; then - echo "CMake is not installed or too old, attempting to install it..." - bootstrap_cmake - if [ -x "$(command -v cmake3)" ]; then - CMAKE_COMMAND="cmake3" - elif [ -x "$(command -v cmake)" ]; then - CMAKE_COMMAND="cmake" - fi - - get_cmake_version -fi - -# RHEL8: If cmake3 is too old, try cmake -if [ "$CMAKE_COMMAND" = "cmake3" ] && - version_is_less_than "$CMAKE_MAJOR" "$CMAKE_MINOR" "$CMAKE_REVISION" "$CMAKE_GLOBAL_MIN_VERSION_MAJOR" "$CMAKE_GLOBAL_MIN_VERSION_MINOR" "$CMAKE_GLOBAL_MIN_VERSION_REVISION" && - [ -x "$(command -v cmake)" ]; then - CMAKE_COMMAND="cmake" - get_cmake_version -fi - -if version_is_less_than "$CMAKE_MAJOR" "$CMAKE_MINOR" "$CMAKE_REVISION" "$CMAKE_GLOBAL_MIN_VERSION_MAJOR" "$CMAKE_GLOBAL_MIN_VERSION_MINOR" "$CMAKE_GLOBAL_MIN_VERSION_REVISION"; then - echo "Failed to install or update CMake, exiting..." - exit -fi - - -add_cmake_option PORTABLE_BUILD ${TRUE} -add_cmake_option DEBUG_SYMBOLS ${FALSE} -add_cmake_option BUILD_ROCKSDB ${TRUE} -## uses the source from the third party directory -add_option ROCKSDB_ENABLED ${TRUE} "ENABLE_ROCKSDB" - -# third party directory -add_option LIBARCHIVE_ENABLED ${TRUE} "ENABLE_LIBARCHIVE" -add_dependency LIBARCHIVE_ENABLED "libarchive" - -add_option PYTHON_SCRIPTING_ENABLED ${TRUE} "ENABLE_PYTHON_SCRIPTING" -add_dependency PYTHON_SCRIPTING_ENABLED "python" -add_option LUA_SCRIPTING_ENABLED ${TRUE} "ENABLE_LUA_SCRIPTING" -add_dependency LUA_SCRIPTING_ENABLED "lua" - -add_option EXPRESSION_LANGUAGE_ENABLED ${TRUE} "ENABLE_EXPRESSION_LANGUAGE" -add_dependency EXPRESSION_LANGUAGE_ENABLED "bison" -add_dependency EXPRESSION_LANGUAGE_ENABLED "flex" - -add_option AWS_ENABLED ${TRUE} "ENABLE_AWS" - -add_option KAFKA_ENABLED ${TRUE} "ENABLE_KAFKA" - -add_option KUBERNETES_ENABLED ${TRUE} "ENABLE_KUBERNETES" - -add_option MQTT_ENABLED ${TRUE} "ENABLE_MQTT" - -add_option OPENCV_ENABLED ${FALSE} "ENABLE_OPENCV" - -add_option SFTP_ENABLED ${FALSE} "ENABLE_SFTP" -add_dependency SFTP_ENABLED "libssh2" - -add_option SQL_ENABLED ${TRUE} "ENABLE_SQL" - -# Since the following extensions have limitations on -add_option BUSTACHE_ENABLED ${FALSE} "ENABLE_BUSTACHE" "2.6" ${TRUE} - -add_option OPC_ENABLED ${TRUE} "ENABLE_OPC" -add_dependency OPC_ENABLED "mbedtls" - -add_option AZURE_ENABLED ${TRUE} "ENABLE_AZURE" - -if $LINUX; then - add_option SYSTEMD_ENABLED ${TRUE} "ENABLE_SYSTEMD" -fi - -add_option SPLUNK_ENABLED ${TRUE} "ENABLE_SPLUNK" - -add_option GCP_ENABLED ${TRUE} "ENABLE_GCP" - -add_option ELASTIC_ENABLED ${TRUE} "ENABLE_ELASTICSEARCH" - -add_option GRAFANA_LOKI_ENABLED ${FALSE} "ENABLE_GRAFANA_LOKI" - -add_option PROCFS_ENABLED ${TRUE} "ENABLE_PROCFS" - -add_option PROMETHEUS_ENABLED ${TRUE} "ENABLE_PROMETHEUS" - -add_option COUCHBASE_ENABLED ${FALSE} "ENABLE_COUCHBASE" - -add_option LLAMACPP_ENABLED ${FALSE} "ENABLE_LLAMACPP" - -USE_SHARED_LIBS=${TRUE} -ASAN_ENABLED=${FALSE} -MINIFI_FAIL_ON_WARNINGS=${FALSE} -TESTS_ENABLED=${TRUE} -LTO_ENABLED=${FALSE} - -## name, default, values -add_multi_option BUILD_PROFILE "RelWithDebInfo" "RelWithDebInfo" "Debug" "MinSizeRel" "Release" - -if [ "$GUIDED_INSTALL" == "${TRUE}" ]; then - EnableAllFeatures - ALL_FEATURES_ENABLED=${TRUE} -fi - -BUILD_DIR_D=${BUILD_DIR} -OVERRIDE_BUILD_IDENTIFIER=${BUILD_IDENTIFIER} - -load_state - -if [ "$USER_DISABLE_TESTS" == "${TRUE}" ]; then - ToggleFeature TESTS_ENABLED -fi - - -if [ "${OVERRIDE_BUILD_IDENTIFIER}" != "${BUILD_IDENTIFIER}" ]; then - BUILD_IDENTIFIER=${OVERRIDE_BUILD_IDENTIFIER} -fi - -if [ "$BUILD_DIR_D" != "build" ] && [ "$BUILD_DIR_D" != "$BUILD_DIR" ]; then - echo -n "Build dir will override stored state, $BUILD_DIR. Press any key to continue " - read -r overwrite - BUILD_DIR=$BUILD_DIR_D - -fi - -if [ ! -d "${BUILD_DIR}" ]; then - mkdir "${BUILD_DIR}/" -else - - overwrite="Y" - if [ "$NO_PROMPT" = "false" ] && [ "$FEATURES_SELECTED" = "false" ]; then - echo "CMAKE Build dir (${BUILD_DIR}) exists, should we overwrite your build directory before we begin?" - echo -n "If you have already bootstrapped, bootstrapping again isn't necessary to run make [ Y/N ] " - read -r overwrite - fi - if [ "$overwrite" = "N" ] || [ "$overwrite" = "n" ]; then - echo "Exiting ...." - exit - else - rm "${BUILD_DIR}/CMakeCache.txt" > /dev/null 2>&1 - fi -fi - -## change to the directory -pushd "${BUILD_DIR}" || exit 1 - -while [ ! "$FEATURES_SELECTED" == "true" ] -do - if [ "$MENU" == "main" ]; then - show_main_menu - read_main_menu_options - elif [ "$MENU" == "advanced" ]; then - show_advanced_features_menu - read_advanced_menu_options - else - show_supported_features - read_feature_options - fi -done - -### ensure we have all dependencies -save_state -build_deps - - -## just in case -CMAKE_VERSION=$(${CMAKE_COMMAND} --version | head -n 1 | awk '{print $3}') - -CMAKE_MAJOR=$(echo "$CMAKE_VERSION" | cut -d. -f1) -CMAKE_MINOR=$(echo "$CMAKE_VERSION" | cut -d. -f2) -CMAKE_REVISION=$(echo "$CMAKE_VERSION" | cut -d. -f3) - - -CMAKE_BUILD_COMMAND="${CMAKE_COMMAND} " - -if [ "${USE_NINJA}" = "${TRUE}" ]; then - echo "use ninja" - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DFORCE_COLORED_OUTPUT=ON -GNinja " -fi - -build_cmake_command(){ - for option in "${OPTIONS[@]}" ; do - for cmake_opt in "${CMAKE_OPTIONS[@]}" ; do - KEY=${cmake_opt%%:*} - VALUE=${cmake_opt#*:} - if [ "$KEY" = "$option" ]; then - FOUND="1" - FOUND_VALUE="$VALUE" - fi - done - if [ "$FOUND" = "1" ]; then - set_value=OFF - option_value="${!option}" - if { [[ "$option_value" = "${FALSE}" ]] && [[ "$FOUND_VALUE" == "DISABLE"* ]]; } || \ - { [[ "$option_value" = "${TRUE}" ]] && [[ "$FOUND_VALUE" == "ENABLE"* ]]; } || \ - { [[ "$option_value" = "${TRUE}" ]] && [[ "$FOUND_VALUE" != "ENABLE"* ]] && [[ "$FOUND_VALUE" != "DISABLE"* ]]; }; then - set_value=ON - fi - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -D${FOUND_VALUE}=${set_value}" - fi - done - - if [ "${DEBUG_SYMBOLS}" = "${TRUE}" ]; then - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DCMAKE_BUILD_TYPE=RelWithDebInfo" - fi - - if [ "${TESTS_ENABLED}" = "${TRUE}" ]; then - # user may have disabled tests previously, so let's force them to be re-enabled - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DSKIP_TESTS= " - else - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DSKIP_TESTS=true " - fi - - if [ "${ASAN_ENABLED}" = "${TRUE}" ]; then - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DMINIFI_ADVANCED_ASAN_BUILD=ON " - else - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DMINIFI_ADVANCED_ASAN_BUILD=OFF" - fi - - if [ "${USE_SHARED_LIBS}" = "${TRUE}" ]; then - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DUSE_SHARED_LIBS=ON " - else - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DUSE_SHARED_LIBS= " - fi - - - - if [ "${PORTABLE_BUILD}" = "${TRUE}" ]; then - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DPORTABLE=ON " - else - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DPORTABLE=OFF " - fi - - if [ "${BUILD_ROCKSDB}" = "${TRUE}" ]; then - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DBUILD_ROCKSDB=ON " - else - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DBUILD_ROCKSDB= " - fi - - if [ "${MINIFI_FAIL_ON_WARNINGS}" = "${TRUE}" ]; then - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DMINIFI_FAIL_ON_WARNINGS=ON " - else - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DMINIFI_FAIL_ON_WARNINGS=OFF" - fi - - if [ "${LTO_ENABLED}" = "${TRUE}" ]; then - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DMINIFI_ADVANCED_LINK_TIME_OPTIMIZATION=ON " - else - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DMINIFI_ADVANCED_LINK_TIME_OPTIMIZATION=OFF" - fi - - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DBUILD_IDENTIFIER=${BUILD_IDENTIFIER}" - - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DCMAKE_BUILD_TYPE=${BUILD_PROFILE}" - - add_os_flags - - CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} .." - - continue_with_plan="Y" - if [ ! "$NO_PROMPT" = "true" ]; then - echo -n "Command will be '${CMAKE_BUILD_COMMAND}', run this? [ Y/N ] " - read -r continue_with_plan - fi - if [ "$continue_with_plan" = "N" ] || [ "$continue_with_plan" = "n" ]; then - echo "Exiting ...." - exit - fi -} - - -build_cmake_command - -### run the cmake command -if [ "${SKIP_CMAKE}" = "${TRUE}" ]; then - echo "Not running ${CMAKE_BUILD_COMMAND} " -else - ${CMAKE_BUILD_COMMAND} -fi - -if [ "$BUILD" = "true" ]; then - make -j"${CORES}" -fi - -if [ "$PACKAGE" = "true" ]; then - make package -fi - - -popd || exit 2 - -# vim: shiftwidth=2 tabstop=2 expandtab diff --git a/bstrp_functions.sh b/bstrp_functions.sh deleted file mode 100755 index 4783a8d27..000000000 --- a/bstrp_functions.sh +++ /dev/null @@ -1,474 +0,0 @@ -#!/usr/bin/env bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -script_directory="$(cd "$(dirname "$0")" && pwd)" - -get_cmake_version(){ - CMAKE_VERSION=$(${CMAKE_COMMAND} --version | head -n 1 | awk '{print $3}') - - CMAKE_MAJOR=$(echo "$CMAKE_VERSION" | cut -d. -f1) - CMAKE_MINOR=$(echo "$CMAKE_VERSION" | cut -d. -f2) - CMAKE_REVISION=$(echo "$CMAKE_VERSION" | cut -d. -f3) -} - -# Checks if a version is smaller than another -version_is_less_than() { - # Parameters: - local lhs_major=$1 - local lhs_minor=$2 - local lhs_patch=$3 - local rhs_major=$4 - local rhs_minor=$5 - local rhs_patch=$6 - # Return: true (0) if left hand side (lhs) is smaller than right hand side (rhs), otherwise return false - if [ "$lhs_major" -lt "$rhs_major" ]; then return 0; fi - if [ "$lhs_minor" -lt "$rhs_minor" ]; then return 0; fi - if [ "$lhs_patch" -lt "$rhs_patch" ]; then return 0; fi - - # otherwise return - false -} - -add_cmake_option(){ - eval "$1=$2" -} - -add_option(){ - BOOTSTRAP_OPTION_NAME="$1" - DEFAULT_VALUE="$2" - CMAKE_OPTION_NAME="$3" - eval "$BOOTSTRAP_OPTION_NAME=$DEFAULT_VALUE" - OPTIONS+=("$BOOTSTRAP_OPTION_NAME") - CMAKE_OPTIONS+=("$BOOTSTRAP_OPTION_NAME:$CMAKE_OPTION_NAME") - if [ -n "$4" ]; then - CMAKE_MIN_VERSION+=("$BOOTSTRAP_OPTION_NAME:$4") - fi - - if [ -n "$5" ]; then - if [ "$5" = "true" ]; then - DEPLOY_LIMITS+=("$BOOTSTRAP_OPTION_NAME") - fi - fi -} - -add_multi_option(){ - eval "$1=$2" - ARRAY=() - eval "export $1_OPTIONS=()" - for i in "${@:3}"; do - ARRAY+=("$i") - done - for i in "${!ARRAY[@]}"; do - eval "$1_OPTIONS[$i]=${ARRAY[$i]}" - done -} - -set_dependency(){ - DEPENDS_ON+=("$1:$2") -} - -set_incompatible_with(){ - INCOMPATIBLE_WITH+=("$1:$2") - INCOMPATIBLE_WITH+=("$2:$1") -} - -print_multi_option_status(){ - feature_status=${!1} - declare -a VAR_OPTS=() - - declare VAR_OPTS=("$1_OPTIONS[@]") - VAR_OPTS=("$1_OPTIONS[@]") - - for option in "${!VAR_OPTS}" ; do - if [ "${option}" = "$feature_status" ]; then - printf "%b%s%b " "${RED}" "${option}" "${NO_COLOR}" - else - printf "%s " "${option}" - fi - done -} - -ToggleMultiOption(){ - feature_status=${!1} - declare -a VAR_OPTS=() - - declare VAR_OPTS=("$1_OPTIONS[@]") - #echo -e "${RED}${feature_status}${NO_COLOR} (${VAR_OPTS_VAL})" - VAR_OPTS=("$1_OPTIONS[@]") - invariant="" - first="" - # the alternative is to loop through an array but since we're an indirected - # copy, we'll treat this as a manual circular buffer - for option in "${!VAR_OPTS}" ; do - if [ -z "${first}" ]; then - first=${option} - fi - if [ "${invariant}" = "next" ]; then - eval "$1=${option}" - invariant="" - break - fi - if [ "${option}" = "$feature_status" ]; then - invariant="next" - fi - done - if [ "${invariant}" = "next" ]; then - eval "$1=${first}" - fi -} - - - -add_dependency(){ - DEPENDENCIES+=("$1:$2") -} - -### parse the command line arguments - - -EnableAllFeatures(){ - for option in "${OPTIONS[@]}" ; do - feature_status=${!option} - if [ "$feature_status" = "${FALSE}" ]; then - ToggleFeature "${option}" - fi - # eval "$option=${TRUE}" - done -} - -pause(){ - echo -n "Press [Enter] key to continue..." - read -r _ -} - - -load_state(){ - if [ -f "${script_directory}/bt_state" ]; then - . "${script_directory}/bt_state" - for option in "${OPTIONS[@]}" ; do - option_value="${!option}" - if [ "${option_value}" = "${FALSE}" ]; then - ALL_FEATURES_ENABLED=${FALSE} - fi - done - fi -} - -echo_state_variable(){ - VARIABLE_VALUE=${!1} - echo "$1=\"${VARIABLE_VALUE}\"" >> "${script_directory}/bt_state" -} - -save_state(){ - echo "VERSION=1" > "${script_directory}/bt_state" - echo_state_variable BUILD_IDENTIFIER - echo_state_variable BUILD_DIR - echo_state_variable TESTS_ENABLED - echo_state_variable BUILD_PROFILE - echo_state_variable USE_SHARED_LIBS - echo_state_variable ASAN_ENABLED - echo_state_variable MINIFI_FAIL_ON_WARNINGS - echo_state_variable LTO_ENABLED - for option in "${OPTIONS[@]}" ; do - echo_state_variable "${option}" - done -} - -check_compatibility(){ - for option in "${INCOMPATIBLE_WITH[@]}" ; do - OPT=${option%%:*} - if [ "$OPT" = "$1" ]; then - OTHER_FEATURE=${option#*:} - OTHER_FEATURE_VALUE=${!OTHER_FEATURE} - if [ "${OTHER_FEATURE_VALUE}" = "Enabled" ]; then - echo "false" - return - fi - fi - done - for option in "${DEPENDS_ON[@]}" ; do - OPT=${option%%:*} - if [ "$OPT" = "$1" ]; then - OTHER_FEATURE=${option#*:} - OTHER_FEATURE_VALUE=${!OTHER_FEATURE} - if [ "${OTHER_FEATURE_VALUE}" != "Enabled" ]; then - echo "false" - return - fi - fi - done - echo "true" -} - -verify_enable(){ - COMPATIBLE=$(check_compatibility "$1") - if [ "$COMPATIBLE" = "true" ]; then - verify_enable_platform "$1" - else - echo "false" - fi -} - -can_deploy(){ - for option in "${DEPLOY_LIMITS[@]}" ; do - OPT=${option%%:*} - if [ "${OPT}" = "$1" ]; then - echo "false" - fi - done - echo "true" -} - -ToggleFeature(){ - VARIABLE_VALUE=${!1} - ALL_FEATURES_ENABLED="Disabled" - if [ "${VARIABLE_VALUE}" = "Enabled" ]; then - eval "$1=${FALSE}" - for option in "${DEPENDS_ON[@]}" ; do - DEPENDENT_FEATURE=${option%%:*} - FEATURE=${option#*:} - if [ "$FEATURE" = "$1" ]; then - eval "$DEPENDENT_FEATURE=${FALSE}" - fi - done - else - for option in "${CMAKE_MIN_VERSION[@]}" ; do - OPT=${option%%:*} - if [ "$OPT" = "$1" ]; then - NEEDED_VER=${option#*:} - NEEDED_MAJOR=$(echo "$NEEDED_VER" | cut -d. -f1) - NEEDED_MINOR=$(echo "$NEEDED_VER" | cut -d. -f2) - NEEDED_REVISION=$(echo "$NEEDED_VERSION" | cut -d. -f3) - if (( NEEDED_MAJOR > CMAKE_MAJOR )); then - return 1 - fi - - if (( NEEDED_MINOR > CMAKE_MINOR )); then - return 1 - fi - - if (( NEEDED_REVISION > CMAKE_REVISION )); then - return 1 - fi - fi - done - CAN_ENABLE=$(verify_enable "$1") - CAN_DEPLOY=$(can_deploy "$1") - if [ "$CAN_ENABLE" = "true" ]; then - if [[ "$DEPLOY" = "true" && "$CAN_DEPLOY" = "true" ]] || [[ "$DEPLOY" = "false" ]]; then - eval "$1=${TRUE}" - fi - fi - fi -} - - -print_feature_status(){ - feature_status=${!1} - if [ "$feature_status" = "Enabled" ]; then - echo "Enabled" - else - for option in "${CMAKE_MIN_VERSION[@]}" ; do - OPT=${option%%:*} - if [ "${OPT}" = "$1" ]; then - NEEDED_VER=${option#*:} - NEEDED_MAJOR=$(echo "$NEEDED_VER" | cut -d. -f1) - NEEDED_MINOR=$(echo "$NEEDED_VER" | cut -d. -f2) - NEEDED_REVISION=$(echo "$NEEDED_VERSION" | cut -d. -f3) - if (( NEEDED_MAJOR > CMAKE_MAJOR )); then - echo -e "${RED}Disabled*${NO_COLOR}" - return 1 - fi - - if (( NEEDED_MINOR > CMAKE_MINOR )); then - echo -e "${RED}Disabled*${NO_COLOR}" - return 1 - fi - - if (( NEEDED_REVISION > CMAKE_REVISION )); then - echo -e "${RED}Disabled*${NO_COLOR}" - return 1 - fi - fi - done - CAN_ENABLE=$(verify_enable "$1") - if [ "$CAN_ENABLE" = "true" ]; then - echo -e "${RED}Disabled${NO_COLOR}" - else - echo -e "${RED}Disabled*${NO_COLOR}" - fi - - fi -} - - - -show_main_menu() { - clear - echo "****************************************" - echo " MiNiFi C++ Main Menu." - echo "****************************************" - echo "A. Select MiNiFi C++ Features " - if [ "$ALL_FEATURES_ENABLED" = "${TRUE}" ]; then - echo " All features enabled ........$(print_feature_status ALL_FEATURES_ENABLED)" - fi - echo "B. Select Advanced Features " - echo "C. Continue with selected options " - echo -e "Q. Exit\r\n" -} - -read_main_menu_options(){ - local choice - echo -n "Enter choice [ A-C ] " - read -r choice - choice=$(echo "${choice}" | tr '[:upper:]' '[:lower:]') - case $choice in - a) MENU="features" ;; - b) MENU="advanced" ;; - c) FEATURES_SELECTED="true" ;; - q) exit 0;; - *) echo -e "${RED}Please enter a valid option...${NO_COLOR}" && sleep 1 - esac -} - -show_advanced_features_menu() { - clear - echo "****************************************" - echo " MiNiFi C++ Advanced Features." - echo "****************************************" - echo "A. Portable Build ..............$(print_feature_status PORTABLE_BUILD)" - echo "B. Build with Debug symbols ....$(print_feature_status DEBUG_SYMBOLS)" - echo "C. Build RocksDB from source ...$(print_feature_status BUILD_ROCKSDB)" - echo -e "R. Return to Main Menu\r\n" -} - -read_advanced_menu_options(){ - local choice - echo -n "Enter choice [ A-C ] " - read -r choice - choice=$(echo "${choice}" | tr '[:upper:]' '[:lower:]') - case $choice in - a) ToggleFeature PORTABLE_BUILD ;; - b) ToggleFeature DEBUG_SYMBOLS ;; - c) ToggleFeature BUILD_ROCKSDB ;; - r) MENU="main" ;; - *) echo -e "${RED}Please enter a valid option...${NO_COLOR}" && sleep 1 - esac -} - - - -show_supported_features() { - clear - echo "****************************************" - echo " Select MiNiFi C++ Features to toggle." - echo "****************************************" - echo "A. Persistent Repositories .....$(print_feature_status ROCKSDB_ENABLED)" - echo "C. libarchive features .........$(print_feature_status LIBARCHIVE_ENABLED)" - echo "D. Python Scripting support ....$(print_feature_status PYTHON_SCRIPTING_ENABLED)" - echo "E. Expression Language support .$(print_feature_status EXPRESSION_LANGUAGE_ENABLED)" - echo "F. Kafka support ...............$(print_feature_status KAFKA_ENABLED)" - echo "K. Bustache Support ............$(print_feature_status BUSTACHE_ENABLED)" - echo "L. Lua Scripting Support .......$(print_feature_status LUA_SCRIPTING_ENABLED)" - echo "M. MQTT Support ................$(print_feature_status MQTT_ENABLED)" - echo "O. SFTP Support ................$(print_feature_status SFTP_ENABLED)" - echo "S. AWS Support .................$(print_feature_status AWS_ENABLED)" - echo "T. OpenCV Support ..............$(print_feature_status OPENCV_ENABLED)" - echo "U. OPC-UA Support...............$(print_feature_status OPC_ENABLED)" - echo "V. SQL Support..................$(print_feature_status SQL_ENABLED)" - echo "X. Azure Support ...............$(print_feature_status AZURE_ENABLED)" - if $LINUX; then - echo "Y. Systemd Support .............$(print_feature_status SYSTEMD_ENABLED)" - fi - echo "AA. Splunk Support .............$(print_feature_status SPLUNK_ENABLED)" - echo "AB. Kubernetes Support .........$(print_feature_status KUBERNETES_ENABLED)" - echo "AC. Google Cloud Support .......$(print_feature_status GCP_ENABLED)" - echo "AD. ProcFs Support .............$(print_feature_status PROCFS_ENABLED)" - echo "AE. Prometheus Support .........$(print_feature_status PROMETHEUS_ENABLED)" - echo "AF. Elasticsearch Support ......$(print_feature_status ELASTIC_ENABLED)" - echo "AG. Grafana Loki Support .......$(print_feature_status GRAFANA_LOKI_ENABLED)" - echo "AH. Couchbase Support ..........$(print_feature_status COUCHBASE_ENABLED)" - echo "AI. llama.cpp Support ..........$(print_feature_status LLAMACPP_ENABLED)" - echo "****************************************" - echo " Build Options." - echo "****************************************" - echo "1. Enable Tests ................$(print_feature_status TESTS_ENABLED)" - echo "2. Enable all extensions" - echo "4. Use Shared Dependency Links ...$(print_feature_status USE_SHARED_LIBS)" - echo "5. Build Profile .................$(print_multi_option_status BUILD_PROFILE)" - echo "6. Create ASAN build .............$(print_feature_status ASAN_ENABLED)" - echo "7. Treat warnings as errors.......$(print_feature_status MINIFI_FAIL_ON_WARNINGS)" - echo "8. Enable link time optimization .$(print_feature_status LTO_ENABLED)" - echo "P. Continue with these options" - if [ "$GUIDED_INSTALL" = "${TRUE}" ]; then - echo "R. Return to Main Menu" - fi - echo "Q. Quit" - echo "* Extension cannot be installed due to" - echo " version of cmake or other software, or" - echo -e " incompatibility with other extensions\r\n" -} - -read_feature_options(){ - local choice - echo -n "Enter choice [A-Z or AA-AF or 1-7] " - read -r choice - choice=$(echo "${choice}" | tr '[:upper:]' '[:lower:]') - case $choice in - a) ToggleFeature ROCKSDB_ENABLED ;; - c) ToggleFeature LIBARCHIVE_ENABLED ;; - d) ToggleFeature PYTHON_SCRIPTING_ENABLED ;; - e) ToggleFeature EXPRESSION_LANGUAGE_ENABLED ;; - f) ToggleFeature KAFKA_ENABLED ;; - k) ToggleFeature BUSTACHE_ENABLED ;; - l) ToggleFeature LUA_SCRIPTING_ENABLED ;; - m) ToggleFeature MQTT_ENABLED ;; - o) ToggleFeature SFTP_ENABLED ;; - s) ToggleFeature AWS_ENABLED ;; - t) ToggleFeature OPENCV_ENABLED ;; - u) ToggleFeature OPC_ENABLED ;; - v) ToggleFeature SQL_ENABLED ;; - x) ToggleFeature AZURE_ENABLED ;; - y) if $LINUX; then ToggleFeature SYSTEMD_ENABLED; fi ;; - aa) ToggleFeature SPLUNK_ENABLED ;; - ab) ToggleFeature KUBERNETES_ENABLED ;; - ac) ToggleFeature GCP_ENABLED ;; - ad) ToggleFeature PROCFS_ENABLED ;; - ae) ToggleFeature PROMETHEUS_ENABLED ;; - af) ToggleFeature ELASTIC_ENABLED ;; - ag) ToggleFeature GRAFANA_LOKI_ENABLED ;; - ah) ToggleFeature COUCHBASE_ENABLED ;; - ai) ToggleFeature LLAMACPP_ENABLED ;; - 1) ToggleFeature TESTS_ENABLED ;; - 2) EnableAllFeatures ;; - 4) ToggleFeature USE_SHARED_LIBS;; - 5) ToggleMultiOption BUILD_PROFILE;; - 6) ToggleFeature ASAN_ENABLED;; - 7) ToggleFeature MINIFI_FAIL_ON_WARNINGS;; - 8) ToggleFeature LTO_ENABLED;; - p) export FEATURES_SELECTED="true" ;; - r) if [ "$GUIDED_INSTALL" = "${TRUE}" ]; then - export MENU="main" - fi - ;; - q) exit 0;; - *) echo -e "${RED}Please enter an option A-Z or AA-AF or 1-7...${NO_COLOR}" && sleep 2 - esac -} - -# vim: shiftwidth=2 tabstop=2 expandtab diff --git a/centos.sh b/centos.sh deleted file mode 100644 index e7610881b..000000000 --- a/centos.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -get_toolset_name() { - case "$OS_MAJOR" in - 7) TOOLSET_NAME=devtoolset-11 ;; - 8) TOOLSET_NAME=gcc-toolset-12 ;; - 9) TOOLSET_NAME=gcc-toolset-12 ;; - esac -} - -install_pkgs() { - if [ "$OS_MAJOR" -gt 7 ]; then - sudo dnf -y install "$@" - else - ulimit -n 1024000 && sudo yum -y install "$@" - fi -} - -verify_enable_platform() { - feature="$1" - verify_gcc_enable "$feature" -} - -add_os_flags() { - get_toolset_name - source "/opt/rh/$TOOLSET_NAME/enable" -} -install_bison() { - INSTALLED+=("bison") -} - -bootstrap_cmake(){ - install_cmake_from_binary -} - -bootstrap_compiler() { - get_toolset_name - if [ -n "$TOOLSET_NAME" ]; then - install_pkgs centos-release-scl - install_pkgs "$TOOLSET_NAME" - fi - source "/opt/rh/$TOOLSET_NAME/enable" -} - -build_deps() { - COMMAND="install_pkgs libuuid libuuid-devel libtool patch epel-release perl" - INSTALLED=() - for option in "${OPTIONS[@]}" ; do - option_value="${!option}" - if [ "$option_value" = "${TRUE}" ]; then - # option is enabled - FOUND_VALUE="" - for cmake_opt in "${DEPENDENCIES[@]}" ; do - KEY=${cmake_opt%%:*} - VALUE=${cmake_opt#*:} - if [ "$KEY" = "$option" ]; then - FOUND_VALUE="$VALUE" - if [ "$FOUND_VALUE" = "bison" ]; then - install_bison - elif [ "$FOUND_VALUE" = "flex" ]; then - INSTALLED+=("flex") - elif [ "$FOUND_VALUE" = "automake" ]; then - INSTALLED+=("automake") - elif [ "$FOUND_VALUE" = "python" ]; then - INSTALLED+=("python36-devel") - elif [ "$FOUND_VALUE" = "libarchive" ]; then - INSTALLED+=("xz-devel") - INSTALLED+=("bzip2-devel") - elif [ "$FOUND_VALUE" = "libssh2" ]; then - INSTALLED+=("libssh2-devel") - fi - fi - done - - fi - done - INSTALLED+=("autoconf") - for option in "${INSTALLED[@]}" ; do - COMMAND="${COMMAND} $option" - done - - ${COMMAND} -} diff --git a/conanfile.py b/conanfile.py index 6939c6eb5..318a9f941 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,7 +9,7 @@ required_conan_version = ">=2.0" shared_requires = ("openssl/3.2.1", "libcurl/8.4.0", "civetweb/1.16", "libxml2/2.12.6", "fmt/10.2.1", "spdlog/1.14.0", "catch2/3.5.4", "zlib/1.2.11", "zstd/1.5.2", "bzip2/1.0.8", "rocksdb/8.10.2@minifi/develop") -shared_sources = ("CMakeLists.txt", "libminifi/*", "extensions/*", "minifi_main/*", "nanofi/*", "bin/*", "bootstrap/*", "cmake/*", "conf/*", "controller/*", "encrypt-config/*", "etc/*", "examples/*", "packaging/msi/*", "thirdparty/*", "docker/*", "LICENSE", "NOTICE", "README.md", "C2.md", "CONFIGURE.md", "CONTRIBUTING.md", "CONTROLLERS.md", "EXPRESSIONS.md", "Extensions.md", "JNI.md", "METRICS.md", "OPS.md", "PROCESSORS.md", "ThirdParties.md", "Windows.md", "aptitude.sh", "arch.sh", "boo [...] +shared_sources = ("CMakeLists.txt", "libminifi/*", "extensions/*", "minifi_main/*", "nanofi/*", "bin/*", "bootstrap/*", "cmake/*", "conf/*", "controller/*", "encrypt-config/*", "etc/*", "examples/*", "packaging/msi/*", "thirdparty/*", "docker/*", "LICENSE", "NOTICE", "README.md", "C2.md", "CONFIGURE.md", "CONTRIBUTING.md", "CONTROLLERS.md", "EXPRESSIONS.md", "Extensions.md", "JNI.md", "METRICS.md", "OPS.md", "PROCESSORS.md", "ThirdParties.md", "Windows.md", "CPPLINT.cfg", "generateVersio [...] class MiNiFiCppMain(ConanFile): diff --git a/darwin.sh b/darwin.sh deleted file mode 100644 index 946a2e260..000000000 --- a/darwin.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -verify_enable_platform() { - feature="$1" - if [ "$feature" = "BUSTACHE_ENABLED" ]; then - BUSTACHE_MAX="9" - ## we should check the xcode version - CLANG_VERSION=$(clang --version | head -n 1 | awk '{print $4}') - CLANG_MAJOR=$(echo "$CLANG_VERSION" | cut -d. -f1) - if [ "$CLANG_MAJOR" -ge "$BUSTACHE_MAX" ]; then - echo "false" - else - echo "true" - fi - else - echo "true" - fi -} - -add_os_flags(){ - : -} - -install_bison() { - BISON_INSTALLED="false" - if [ -x "$(command -v bison)" ]; then - BISON_VERSION=$(bison --version | head -n 1 | awk '{print $4}') - BISON_MAJOR=$(echo "$BISON_VERSION" | cut -d. -f1) - if (( BISON_MAJOR >= 3 )); then - BISON_INSTALLED="true" - fi - fi - if [ "$BISON_INSTALLED" = "false" ]; then - wget https://ftp.gnu.org/gnu/bison/bison-3.0.5.tar.xz - tar xvf bison-3.0.5.tar.xz - pushd bison-3.0.5 || exit 1 - ./configure - make - sudo make install - popd || exit 2 - fi - -} - -bootstrap_cmake(){ - brew install cmake -} -bootstrap_compiler() { - : -} -build_deps(){ - - COMMAND="brew install cmake perl bzip2" - INSTALLED=() - for option in "${OPTIONS[@]}" ; do - option_value="${!option}" - if [ "$option_value" = "${TRUE}" ]; then - # option is enabled - FOUND_VALUE="" - for cmake_opt in "${DEPENDENCIES[@]}" ; do - KEY=${cmake_opt%%:*} - VALUE=${cmake_opt#*:} - if [ "$KEY" = "$option" ]; then - FOUND_VALUE="$VALUE" - if [ "$FOUND_VALUE" = "bison" ]; then - install_bison - elif [ "$FOUND_VALUE" = "flex" ]; then - INSTALLED+=("flex") - elif [ "$FOUND_VALUE" = "python" ]; then - INSTALLED+=("python") - elif [ "$FOUND_VALUE" = "libtool" ]; then - INSTALLED+=("libtool") - elif [ "$FOUND_VALUE" = "automake" ]; then - INSTALLED+=("automake") - INSTALLED+=("autoconf") - elif [ "$FOUND_VALUE" = "libarchive" ]; then - INSTALLED+=("bzip2") - elif [ "$FOUND_VALUE" = "libssh2" ]; then - INSTALLED+=("libssh2") - fi - fi - done - - fi - done - - for option in "${INSTALLED[@]}" ; do - COMMAND="${COMMAND} $option" - done - - echo "Ensuring you have all dependencies installed..." - ${COMMAND} > /dev/null 2>&1 -} diff --git a/debian.sh b/debian.sh deleted file mode 100644 index 612106eaf..000000000 --- a/debian.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -verify_enable_platform(){ - feature="$1" - verify_gcc_enable "$feature" -} -add_os_flags() { - #CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND}" - : -} -bootstrap_cmake(){ - if [ "$VERSION_CODENAME" = buster ]; then - sudo bash -c 'source /etc/os-release; grep "$VERSION_CODENAME-backports" /etc/apt/sources.list &>/dev/null || echo "deb http://deb.debian.org/debian $VERSION_CODENAME-backports main" >> /etc/apt/sources.list' - sudo apt-get -y update - sudo apt-get -t buster-backports install -y cmake - else - sudo apt-get -y update - sudo apt-get install -y cmake - fi -} -bootstrap_compiler(){ - sudo apt-get -y install build-essential -} -build_deps(){ - sudo apt-get -y update - RETVAL=$? - if [ "$RETVAL" -ne "0" ]; then - sudo apt-get install -y libssl-dev > /dev/null - fi - COMMAND="sudo apt-get -y install gcc g++ zlib1g-dev uuid uuid-dev perl libbz2-dev" - export DEBIAN_FRONTEND=noninteractive - INSTALLED=() - sudo apt-get -y update - for option in "${OPTIONS[@]}" ; do - option_value="${!option}" - if [ "$option_value" = "${TRUE}" ]; then - # option is enabled - FOUND_VALUE="" - for cmake_opt in "${DEPENDENCIES[@]}" ; do - KEY=${cmake_opt%%:*} - VALUE=${cmake_opt#*:} - if [ "$KEY" = "$option" ]; then - FOUND_VALUE="$VALUE" - if [ "$FOUND_VALUE" = "bison" ]; then - INSTALLED+=("bison") - elif [ "$FOUND_VALUE" = "flex" ]; then - INSTALLED+=("flex") - elif [ "$FOUND_VALUE" = "libtool" ]; then - INSTALLED+=("libtool") - elif [ "$FOUND_VALUE" = "python" ]; then - INSTALLED+=("libpython3-dev") - elif [ "$FOUND_VALUE" = "automake" ]; then - INSTALLED+=("automake") - elif [ "$FOUND_VALUE" = "libarchive" ]; then - INSTALLED+=("liblzma-dev") - elif [ "$FOUND_VALUE" = "libssh2" ]; then - INSTALLED+=("libssh2-1-dev") - fi - fi - done - - fi - done - - INSTALLED+=("autoconf") - - for option in "${INSTALLED[@]}" ; do - COMMAND="${COMMAND} $option" - done - - echo "Ensuring you have all dependencies installed..." - ${COMMAND} - -} diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index f1df2ffc2..000000000 --- a/deploy.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -build_identifier=$1 - -echo "${build_identifier}" > build_identifier - -./bootstrap.sh -d -p --build_identifier="${build_identifier}" - -pushd build || exit 1 -./controller/minifi-controller --manifest >> build_output -popd || exit 2 diff --git a/fedora.sh b/fedora.sh deleted file mode 100644 index 455aabf42..000000000 --- a/fedora.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -verify_enable_platform(){ - feature="$1" - verify_gcc_enable "$feature" -} -add_os_flags() { - : -} -bootstrap_cmake(){ - sudo yum -y install wget - wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - sudo yum -y install epel-release-latest-7.noarch.rpm - sudo yum -y install cmake3 -} -bootstrap_compiler() { - sudo yum -y install gcc gcc-c++ -} -build_deps(){ - # Install epel-release so that cmake3 will be available for installation - sudo yum -y install wget - wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - sudo yum -y install epel-release-latest-7.noarch.rpm - - COMMAND="sudo yum -y install libuuid libuuid-devel patch perl bzip2-devel" - INSTALLED=() - for option in "${OPTIONS[@]}" ; do - option_value="${!option}" - if [ "$option_value" = "${TRUE}" ]; then - # option is enabled - FOUND_VALUE="" - for cmake_opt in "${DEPENDENCIES[@]}" ; do - KEY=${cmake_opt%%:*} - VALUE=${cmake_opt#*:} - if [ "$KEY" = "$option" ]; then - FOUND_VALUE="$VALUE" - echo "$FOUND_VALUE" - if [ "$FOUND_VALUE" = "bison" ]; then - INSTALLED+=("bison") - elif [ "$FOUND_VALUE" = "flex" ]; then - INSTALLED+=("flex") - elif [ "$FOUND_VALUE" = "python" ]; then - INSTALLED+=("python3-devel") - elif [ "$FOUND_VALUE" = "libtool" ]; then - INSTALLED+=("libtool") - elif [ "$FOUND_VALUE" = "autoconf" ]; then - INSTALLED+=("autoconf") - elif [ "$FOUND_VALUE" = "automake" ]; then - INSTALLED+=("automake") - elif [ "$FOUND_VALUE" = "libarchive" ]; then - INSTALLED+=("xz-devel") - elif [ "$FOUND_VALUE" = "libssh2" ]; then - INSTALLED+=("libssh2-devel") - fi - fi - done - - fi - done - - for option in "${INSTALLED[@]}" ; do - COMMAND="${COMMAND} $option" - done - echo "Installing ${COMMAND}" - ${COMMAND} - -} diff --git a/linux.sh b/linux.sh deleted file mode 100644 index 88f81ae1f..000000000 --- a/linux.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -verify_gcc_enable(){ - #feature="$1" - [ "$COMPILER_MAJOR" -ge 11 ] && echo true || echo false -} - -install_cmake_from_binary() { - CMAKE_VERSION="3.24.4" - arch=$(uname -m) - if [ "$arch" = "x86_64" ]; then - CMAKE_URL="https://cmake.org/files/v3.24/cmake-3.24.4-linux-x86_64.tar.gz" - EXPECTED_SHA256="cac77d28fb8668c179ac02c283b058aeb846fe2133a57d40b503711281ed9f19" - elif [ "$arch" = "aarch64" ]; then - CMAKE_URL="https://cmake.org/files/v3.24/cmake-3.24.4-linux-aarch64.tar.gz" - EXPECTED_SHA256="86f823f2636bf715af89da10e04daa476755a799d451baee66247846e95d7bee" - else - echo "Unknown architecture: $arch" - exit 1 - fi - - TMP_DIR=$(mktemp -d) - - install_pkgs wget - wget -P "$TMP_DIR" "$CMAKE_URL" - - ACTUAL_SHA256=$(sha256sum "$TMP_DIR/cmake-$CMAKE_VERSION-linux-$arch.tar.gz" | cut -d " " -f 1) - - if [ "$ACTUAL_SHA256" != "$EXPECTED_SHA256" ]; then - echo "ERROR: SHA-256 verification failed. Aborting." - rm -r "$TMP_DIR" - exit 1 - fi - - echo "Installing CMake $CMAKE_VERSION to /opt/cmake-$CMAKE_VERSION..." - set -x - tar -C "$TMP_DIR" -zxf "$TMP_DIR/cmake-$CMAKE_VERSION-linux-$arch.tar.gz" - sudo mv "$TMP_DIR/cmake-$CMAKE_VERSION-linux-$arch" /opt/cmake-$CMAKE_VERSION - - sudo ln -s "/opt/cmake-$CMAKE_VERSION/bin/cmake" /usr/local/bin/cmake - set +x - - echo "CMake $CMAKE_VERSION has been installed successfully." - rm -r "$TMP_DIR" -} diff --git a/rheldistro.sh b/rheldistro.sh deleted file mode 100644 index 4cc2d4ff5..000000000 --- a/rheldistro.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -verify_enable_platform() { - feature="$1" - verify_gcc_enable "$feature" -} - -add_os_flags() { - : -} -install_bison() { - INSTALLED+=("bison") -} - -bootstrap_cmake(){ - if [ "$OS_MAJOR" -lt 8 ]; then - sudo yum -y install wget patch - wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - sudo yum -y install epel-release-latest-7.noarch.rpm - sudo yum -y install cmake3 - else - sudo dnf -y install cmake - fi -} -bootstrap_compiler() { - sudo yum -y install gcc gcc-c++ -} -build_deps(){ -# Install epel-release so that cmake3 will be available for installation - sudo yum -y install wget - wget "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${OS_MAJOR}.noarch.rpm" - sudo yum -y install "epel-release-latest-${OS_MAJOR}.noarch.rpm" - - COMMAND="sudo yum install libuuid libuuid-devel perl bzip2-devel" - INSTALLED=() - for option in "${OPTIONS[@]}" ; do - option_value="${!option}" - if [ "$option_value" = "${TRUE}" ]; then - # option is enabled - FOUND_VALUE="" - for cmake_opt in "${DEPENDENCIES[@]}" ; do - KEY=${cmake_opt%%:*} - VALUE=${cmake_opt#*:} - if [ "$KEY" = "$option" ]; then - FOUND_VALUE="$VALUE" - if [ "$FOUND_VALUE" = "bison" ]; then - install_bison - elif [ "$FOUND_VALUE" = "flex" ]; then - INSTALLED+=("flex") - elif [ "$FOUND_VALUE" = "automake" ]; then - INSTALLED+=("automake") - elif [ "$FOUND_VALUE" = "autoconf" ]; then - INSTALLED+=("autoconf") - elif [ "$FOUND_VALUE" = "libtool" ]; then - INSTALLED+=("libtool") - elif [ "$FOUND_VALUE" = "python" ]; then - INSTALLED+=("python3-devel") - elif [ "$FOUND_VALUE" = "libarchive" ]; then - INSTALLED+=("xz-devel") - elif [ "$FOUND_VALUE" = "libssh2" ]; then - INSTALLED+=("libssh2-devel") - fi - fi - done - - fi - done - - for option in "${INSTALLED[@]}" ; do - COMMAND="${COMMAND} $option" - done - - ${COMMAND} - -} diff --git a/suse.sh b/suse.sh deleted file mode 100644 index c484681e9..000000000 --- a/suse.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -verify_enable_platform() { - feature="$1" - verify_gcc_enable "${feature}" -} - -add_os_flags() { - : -} -install_bison() { - BISON_INSTALLED="false" - if [ -x "$(command -v bison)" ]; then - BISON_VERSION=$(bison --version | head -n 1 | awk '{print $4}') - BISON_MAJOR=$(echo "${BISON_VERSION}" | cut -d. -f1) - if (( BISON_MAJOR >= 3 )); then - BISON_INSTALLED="true" - fi - fi - if [ "$BISON_INSTALLED" = "false" ]; then - wget https://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.xz - tar xvf bison-3.0.4.tar.xz - pushd bison-3.0.4 || exit 1 - ./configure - make - sudo make install - popd || exit 2 - fi -} - -bootstrap_cmake(){ - sudo zypper in -y cmake -} -bootstrap_compiler() { - sudo zypper in -y gcc gcc-c++ -} -build_deps(){ - # Install epel-release so that cmake3 will be available for installation - COMMAND="sudo zypper in -y libuuid1 libuuid-devel perl libbz2-devel" - INSTALLED=() - for option in "${OPTIONS[@]}" ; do - option_value="${!option}" - if [ "$option_value" = "${TRUE}" ]; then - # option is enabled - FOUND_VALUE="" - for cmake_opt in "${DEPENDENCIES[@]}" ; do - KEY=${cmake_opt%%:*} - VALUE=${cmake_opt#*:} - if [ "$KEY" = "$option" ]; then - FOUND_VALUE="$VALUE" - if [ "$FOUND_VALUE" = "bison" ]; then - install_bison - elif [ "$FOUND_VALUE" = "flex" ]; then - INSTALLED+=("flex") - elif [ "$FOUND_VALUE" = "automake" ]; then - INSTALLED+=("automake") - elif [ "$FOUND_VALUE" = "autoconf" ]; then - INSTALLED+=("autoconf") - elif [ "$FOUND_VALUE" = "libtool" ]; then - INSTALLED+=("libtool") - elif [ "$FOUND_VALUE" = "python" ]; then - INSTALLED+=("python3-devel") - elif [ "$FOUND_VALUE" = "libarchive" ]; then - INSTALLED+=("xz-devel") - elif [ "$FOUND_VALUE" = "libssh2" ]; then - INSTALLED+=("libssh2-devel") - fi - fi - done - - fi - done - - for option in "${INSTALLED[@]}" ; do - COMMAND="${COMMAND} $option" - done - - ${COMMAND} - -}
