You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by al...@apache.org on 2019/04/29 19:42:15 UTC
[nifi-minifi-cpp] branch master updated: MINIFICPP-827: Install
jdk8, maven,
and require these to be installed. bash beautify while editing scripts too
This is an automated email from the ASF dual-hosted git repository.
aldrin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
The following commit(s) were added to refs/heads/master by this push:
new e8310ea MINIFICPP-827: Install jdk8, maven, and require these to be installed. bash beautify while editing scripts too
e8310ea is described below
commit e8310ea2231c74d73cd30d609aeff9c27ea478b7
Author: Marc Parisi <ph...@apache.org>
AuthorDate: Fri Apr 26 08:28:52 2019 -0400
MINIFICPP-827: Install jdk8, maven, and require these to be installed. bash beautify while editing scripts too
This closes #546.
Signed-off-by: Aldrin Piri <al...@apache.org>
---
CONFIGURE.md | 4 +-
extensions/jni/README.md => JNI.md | 0
aptitude.sh | 124 ++++++++++---------
bootstrap.sh | 1 +
centos.sh | 244 +++++++++++++++++++------------------
cmake/FindMaven.cmake | 33 +++++
darwin.sh | 183 ++++++++++++++--------------
debian.sh | 4 +
extensions/jni/CMakeLists.txt | 40 ++++--
fedora.sh | 135 ++++++++++----------
10 files changed, 419 insertions(+), 349 deletions(-)
diff --git a/CONFIGURE.md b/CONFIGURE.md
index 5e6c31c..f4151b6 100644
--- a/CONFIGURE.md
+++ b/CONFIGURE.md
@@ -322,4 +322,6 @@ The MQTTController Service can be configured for MQTT connectivity and provide t
Network Controllers: en2,en3
Max Throughput: 1,024,1024
Max Payload: 1,024,1024
-
+
+### JNI Functionality
+Please see the [JNI Configuration Guide](JNI.md).
diff --git a/extensions/jni/README.md b/JNI.md
similarity index 100%
rename from extensions/jni/README.md
rename to JNI.md
diff --git a/aptitude.sh b/aptitude.sh
index e5969da..ed3d815 100644
--- a/aptitude.sh
+++ b/aptitude.sh
@@ -17,74 +17,78 @@
# under the License.
verify_enable(){
- feature="$1"
- feature_status=${!1}
- verify_gcc_enable $feature
+ feature="$1"
+ feature_status=${!1}
+ verify_gcc_enable $feature
}
add_os_flags() {
- CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DFAIL_ON_WARNINGS= "
+ CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DFAIL_ON_WARNINGS= "
}
bootstrap_cmake(){
- sudo apt-get -y install cmake
+ sudo apt-get -y install cmake
}
build_deps(){
- ## need to account for debian
- COMMAND="sudo apt-get -y install cmake gcc g++ zlib1g-dev libssl-dev uuid uuid-dev"
- export DEBIAN_FRONTEND=noninteractive
- INSTALLED=()
- INSTALLED+=("libbz2-dev")
- 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" = "libcurl" ]; then
- INSTALLED+=("libcurl4-openssl-dev")
- elif [ "$FOUND_VALUE" = "libpcap" ]; then
- INSTALLED+=("libpcap-dev")
- elif [ "$FOUND_VALUE" = "openssl" ]; then
- INSTALLED+=("openssl")
- elif [ "$FOUND_VALUE" = "libusb" ]; then
- INSTALLED+=("libusb-1.0-0-dev")
- INSTALLED+=("libusb-dev")
- elif [ "$FOUND_VALUE" = "libpng" ]; then
- INSTALLED+=("libpng-dev")
- 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" = "lua" ]; then
- INSTALLED+=("liblua5.1-0-dev")
- elif [ "$FOUND_VALUE" = "gpsd" ]; then
- INSTALLED+=("libgps-dev")
- elif [ "$FOUND_VALUE" = "libarchive" ]; then
- INSTALLED+=("liblzma-dev")
- fi
- fi
- done
+ ## need to account for debian
+ COMMAND="sudo apt-get -y install cmake gcc g++ zlib1g-dev libssl-dev uuid uuid-dev"
+ export DEBIAN_FRONTEND=noninteractive
+ INSTALLED=()
+ INSTALLED+=("libbz2-dev")
+ 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" = "libcurl" ]; then
+ INSTALLED+=("libcurl4-openssl-dev")
+ elif [ "$FOUND_VALUE" = "libpcap" ]; then
+ INSTALLED+=("libpcap-dev")
+ elif [ "$FOUND_VALUE" = "openssl" ]; then
+ INSTALLED+=("openssl")
+ elif [ "$FOUND_VALUE" = "libusb" ]; then
+ INSTALLED+=("libusb-1.0-0-dev")
+ INSTALLED+=("libusb-dev")
+ elif [ "$FOUND_VALUE" = "libpng" ]; then
+ INSTALLED+=("libpng-dev")
+ 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" = "jnibuild" ]; then
+ INSTALLED+=("openjdk-8-jdk")
+ INSTALLED+=("openjdk-8-source")
+ INSTALLED+=("maven")
+ elif [ "$FOUND_VALUE" = "lua" ]; then
+ INSTALLED+=("liblua5.1-0-dev")
+ elif [ "$FOUND_VALUE" = "gpsd" ]; then
+ INSTALLED+=("libgps-dev")
+ elif [ "$FOUND_VALUE" = "libarchive" ]; then
+ INSTALLED+=("liblzma-dev")
+ fi
+ fi
+ done
- fi
- done
+ fi
+ done
- for option in "${INSTALLED[@]}" ; do
- COMMAND="${COMMAND} $option"
- done
+ for option in "${INSTALLED[@]}" ; do
+ COMMAND="${COMMAND} $option"
+ done
- echo "Ensuring you have all dependencies installed..."
- ${COMMAND}
+ echo "Ensuring you have all dependencies installed..."
+ ${COMMAND}
}
diff --git a/bootstrap.sh b/bootstrap.sh
index 7b34e16..df6eb65 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -277,6 +277,7 @@ add_dependency COAP_ENABLED "autoconf"
add_dependency COAP_ENABLED "libtool"
add_disabled_option JNI_ENABLED ${FALSE} "ENABLE_JNI"
+add_dependency JNI_ENABLED "jnibuild"
TESTS_DISABLED=${FALSE}
diff --git a/centos.sh b/centos.sh
index ebe9fe2..9b1251c 100644
--- a/centos.sh
+++ b/centos.sh
@@ -17,149 +17,153 @@
# under the License.
verify_enable() {
- feature="$1"
- feature_status=${!1}
- if [ "$OS_MAJOR" = "6" ]; then
- if [ "$feature" = "GPS_ENABLED" ]; then
- echo "false"
- elif [ "$feature" = "USB_ENABLED" ]; then
- echo "false"
- elif [ "$feature" = "TENSORFLOW_ENABLED" ]; then
- echo "false"
- else
- verify_gcc_enable $feature
- fi
- else
- if [ "$feature" = "USB_ENABLED" ]; then
- echo "false"
+ feature="$1"
+ feature_status=${!1}
+ if [ "$OS_MAJOR" = "6" ]; then
+ if [ "$feature" = "GPS_ENABLED" ]; then
+ echo "false"
+ elif [ "$feature" = "USB_ENABLED" ]; then
+ echo "false"
+ elif [ "$feature" = "TENSORFLOW_ENABLED" ]; then
+ echo "false"
+ else
+ verify_gcc_enable $feature
+ fi
else
- verify_gcc_enable $feature
+ if [ "$feature" = "USB_ENABLED" ]; then
+ echo "false"
+ else
+ verify_gcc_enable $feature
+ fi
fi
- fi
}
add_os_flags() {
- if [ "$OS_MAJOR" = "6" ]; then
- CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DCMAKE_CXX_FLAGS=-lrt "
- fi
+ if [ "$OS_MAJOR" = "6" ]; then
+ CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DCMAKE_CXX_FLAGS=-lrt "
+ fi
}
install_bison() {
- if [ "$OS_MAJOR" = "6" ]; then
- 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
- ./configure
- make
- make install
- popd
- fi
+ if [ "$OS_MAJOR" = "6" ]; then
+ 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
+ ./configure
+ make
+ make install
+ popd
+ fi
- else
- INSTALLED+=("bison")
- fi
+ else
+ INSTALLED+=("bison")
+ fi
}
install_libusb() {
- if [ "$OS_MAJOR" = "6" ]; then
- sudo yum -y install libtool libudev-devel patch
- # git clone --branch v1.0.18 https://github.com/libusb/libusb.git
- git clone https://github.com/libusb/libusb.git
- pushd libusb
- git checkout v1.0.18
- ./bootstrap.sh
- ./configure
- make
- sudo make install
- popd
- rm -rf libusb
- else
- INSTALLED+=("libusb-devel")
- fi
+ if [ "$OS_MAJOR" = "6" ]; then
+ sudo yum -y install libtool libudev-devel patch
+ # git clone --branch v1.0.18 https://github.com/libusb/libusb.git
+ git clone https://github.com/libusb/libusb.git
+ pushd libusb
+ git checkout v1.0.18
+ ./bootstrap.sh
+ ./configure
+ make
+ sudo make install
+ popd
+ rm -rf libusb
+ else
+ INSTALLED+=("libusb-devel")
+ fi
}
bootstrap_cmake(){
- sudo yum -y install wget
- if [ "$OS_MAJOR" = "6" ]; then
- sudo yum -y install centos-release-scl
- sudo yum -y install devtoolset-6
- sudo yum -y install epel-release
- sudo yum -y install cmake3
- if [ "$NO_PROMPT" = "true" ]; then
- scl enable devtoolset-6 bash ./bootstrap.sh -n
+ sudo yum -y install wget
+ if [ "$OS_MAJOR" = "6" ]; then
+ sudo yum -y install centos-release-scl
+ sudo yum -y install devtoolset-6
+ sudo yum -y install epel-release
+ sudo yum -y install cmake3
+ if [ "$NO_PROMPT" = "true" ]; then
+ scl enable devtoolset-6 bash ./bootstrap.sh -n
+ else
+ scl enable devtoolset-6 bash ./bootstrap.sh
+ fi
else
- scl enable devtoolset-6 bash ./bootstrap.sh
+ 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
fi
- else
- 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
- fi
}
build_deps(){
-# Install epel-release so that cmake3 will be available for installation
+ # Install epel-release so that cmake3 will be available for installation
- COMMAND="sudo yum -y install gcc gcc-c++ libuuid libuuid-devel libtool patch"
- 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" = "libcurl" ]; then
- INSTALLED+=("libcurl-devel")
- elif [ "$FOUND_VALUE" = "libpcap" ]; then
- INSTALLED+=("libpcap-devel")
- elif [ "$FOUND_VALUE" = "openssl" ]; then
- INSTALLED+=("openssl")
- INSTALLED+=("openssl-devel")
- INSTALLED+=("openssl-static")
- elif [ "$FOUND_VALUE" = "libusb" ]; then
- install_libusb
- elif [ "$FOUND_VALUE" = "libpng" ]; then
- INSTALLED+=("libpng-devel")
- elif [ "$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+=("python34-devel")
- elif [ "$FOUND_VALUE" = "lua" ]; then
- INSTALLED+=("lua-devel")
- elif [ "$FOUND_VALUE" = "gpsd" ]; then
- INSTALLED+=("gpsd-devel")
- elif [ "$FOUND_VALUE" = "libarchive" ]; then
- INSTALLED+=("xz-devel")
- INSTALLED+=("bzip2-devel")
- fi
- fi
- done
+ COMMAND="sudo yum -y install gcc gcc-c++ libuuid libuuid-devel libtool patch"
+ 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" = "libcurl" ]; then
+ INSTALLED+=("libcurl-devel")
+ elif [ "$FOUND_VALUE" = "libpcap" ]; then
+ INSTALLED+=("libpcap-devel")
+ elif [ "$FOUND_VALUE" = "openssl" ]; then
+ INSTALLED+=("openssl")
+ INSTALLED+=("openssl-devel")
+ INSTALLED+=("openssl-static")
+ elif [ "$FOUND_VALUE" = "libusb" ]; then
+ install_libusb
+ elif [ "$FOUND_VALUE" = "libpng" ]; then
+ INSTALLED+=("libpng-devel")
+ elif [ "$FOUND_VALUE" = "bison" ]; then
+ install_bison
+ elif [ "$FOUND_VALUE" = "flex" ]; then
+ INSTALLED+=("flex")
+ elif [ "$FOUND_VALUE" = "automake" ]; then
+ INSTALLED+=("automake")
+ elif [ "$FOUND_VALUE" = "jnibuild" ]; then
+ INSTALLED+=("java-1.8.0-openjdk")
+ INSTALLED+=("java-1.8.0-openjdk-devel")
+ INSTALLED+=("maven")
+ elif [ "$FOUND_VALUE" = "python" ]; then
+ INSTALLED+=("python34-devel")
+ elif [ "$FOUND_VALUE" = "lua" ]; then
+ INSTALLED+=("lua-devel")
+ elif [ "$FOUND_VALUE" = "gpsd" ]; then
+ INSTALLED+=("gpsd-devel")
+ elif [ "$FOUND_VALUE" = "libarchive" ]; then
+ INSTALLED+=("xz-devel")
+ INSTALLED+=("bzip2-devel")
+ fi
+ fi
+ done
- fi
- done
- INSTALLED+=("autoconf")
- for option in "${INSTALLED[@]}" ; do
- COMMAND="${COMMAND} $option"
- done
+ fi
+ done
+ INSTALLED+=("autoconf")
+ for option in "${INSTALLED[@]}" ; do
+ COMMAND="${COMMAND} $option"
+ done
- ${COMMAND}
+ ${COMMAND}
}
diff --git a/cmake/FindMaven.cmake b/cmake/FindMaven.cmake
new file mode 100644
index 0000000..0151d31
--- /dev/null
+++ b/cmake/FindMaven.cmake
@@ -0,0 +1,33 @@
+# 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.
+
+set (MAVEN_HINT_UNIX /usr/bin CACHE STRING "maven default directory")
+
+if (WIN32)
+ find_program(MAVEN_EXECUTABLE NAMES mvn.bat mvn)
+else()
+ find_program(MAVEN_EXECUTABLE NAMES mvn
+ HINTS ENV${MAVEN_HINT_UNIX}/mvn ${MAVEN_HINT_UNIX}/mvn)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args (Maven
+ FOUND_VAR MAVEN_FOUND
+ REQUIRED_VARS MAVEN_EXECUTABLE
+)
+
+mark_as_advanced(MAVEN_FOUND MAVEN_EXECUTABLE)
diff --git a/darwin.sh b/darwin.sh
index 4f79f69..2eec470 100644
--- a/darwin.sh
+++ b/darwin.sh
@@ -17,114 +17,117 @@
# under the License.
verify_enable() {
- feature="$1"
- feature_status=${!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`
- CLANG_MINOR=`echo $CLANG_VERSION | cut -d. -f2`
- CLANG_REVISION=`echo $CLANG_VERSION | cut -d. -f3`
- if [ "$CLANG_MAJOR" -ge "$BUSTACHE_MAX" ]; then
- echo "false"
+ feature="$1"
+ feature_status=${!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`
+ CLANG_MINOR=`echo $CLANG_VERSION | cut -d. -f2`
+ CLANG_REVISION=`echo $CLANG_VERSION | cut -d. -f3`
+ if [ "$CLANG_MAJOR" -ge "$BUSTACHE_MAX" ]; then
+ echo "false"
+ else
+ echo "true"
+ fi
else
- echo "true"
+ 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"
+ 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
+ ./configure
+ make
+ sudo make install
+ popd
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
- ./configure
- make
- sudo make install
- popd
- fi
}
bootstrap_cmake(){
- brew install cmake
+ brew install cmake
}
build_deps(){
- COMMAND="brew install cmake"
- INSTALLED=()
- INSTALLED+=("bzip2")
- 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" = "libcurl" ]; then
- brew install curl
- elif [ "$FOUND_VALUE" = "libpcap" ]; then
- INSTALLED+=("libpcap")
- elif [ "$FOUND_VALUE" = "openssl" ]; then
- INSTALLED+=("openssl")
- elif [ "$FOUND_VALUE" = "libusb" ]; then
- INSTALLED+=("libusb")
- elif [ "$FOUND_VALUE" = "libpng" ]; then
- INSTALLED+=("libpng")
- elif [ "$FOUND_VALUE" = "bison" ]; then
- install_bison
- elif [ "$FOUND_VALUE" = "flex" ]; then
- INSTALLED+=("flex")
- elif [ "$FOUND_VALUE" = "python" ]; then
- INSTALLED+=("python")
- elif [ "$FOUND_VALUE" = "boost" ]; then
- INSTALLED+=("boost")
- elif [ "$FOUND_VALUE" = "lua" ]; then
- INSTALLED+=("lua")
- elif [ "$FOUND_VALUE" = "libtool" ]; then
- INSTALLED+=("libtool")
- elif [ "$FOUND_VALUE" = "automake" ]; then
- INSTALLED+=("automake")
- INSTALLED+=("autoconf")
- elif [ "$FOUND_VALUE" = "gpsd" ]; then
- INSTALLED+=("gpsd")
- elif [ "$FOUND_VALUE" = "libarchive" ]; then
- INSTALLED+=("bzip2")
- fi
- fi
- done
+ COMMAND="brew install cmake"
+ INSTALLED=()
+ INSTALLED+=("bzip2")
+ 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" = "libcurl" ]; then
+ brew install curl
+ elif [ "$FOUND_VALUE" = "libpcap" ]; then
+ INSTALLED+=("libpcap")
+ elif [ "$FOUND_VALUE" = "openssl" ]; then
+ INSTALLED+=("openssl")
+ elif [ "$FOUND_VALUE" = "libusb" ]; then
+ INSTALLED+=("libusb")
+ elif [ "$FOUND_VALUE" = "libpng" ]; then
+ INSTALLED+=("libpng")
+ elif [ "$FOUND_VALUE" = "bison" ]; then
+ install_bison
+ elif [ "$FOUND_VALUE" = "flex" ]; then
+ INSTALLED+=("flex")
+ elif [ "$FOUND_VALUE" = "python" ]; then
+ INSTALLED+=("python")
+ elif [ "$FOUND_VALUE" = "boost" ]; then
+ INSTALLED+=("boost")
+ elif [ "$FOUND_VALUE" = "lua" ]; then
+ INSTALLED+=("lua")
+ elif [ "$FOUND_VALUE" = "jnibuild" ]; then
+ brew cask install java8 > /dev/null 2>&1
+ INSTALLED+=("maven")
+ elif [ "$FOUND_VALUE" = "libtool" ]; then
+ INSTALLED+=("libtool")
+ elif [ "$FOUND_VALUE" = "automake" ]; then
+ INSTALLED+=("automake")
+ INSTALLED+=("autoconf")
+ elif [ "$FOUND_VALUE" = "gpsd" ]; then
+ INSTALLED+=("gpsd")
+ elif [ "$FOUND_VALUE" = "libarchive" ]; then
+ INSTALLED+=("bzip2")
+ fi
+ fi
+ done
- fi
- done
+ fi
+ done
- for option in "${INSTALLED[@]}" ; do
- COMMAND="${COMMAND} $option"
- done
+ for option in "${INSTALLED[@]}" ; do
+ COMMAND="${COMMAND} $option"
+ done
- echo "Ensuring you have all dependencies installed..."
- ${COMMAND} > /dev/null 2>&1
+ echo "Ensuring you have all dependencies installed..."
+ ${COMMAND} > /dev/null 2>&1
- for option in "${INSTALLED[@]}" ; do
- if [ "$option" = "curl" ]; then
- brew link curl --force > /dev/null 2>&1
- fi
- done
+ for option in "${INSTALLED[@]}" ; do
+ if [ "$option" = "curl" ]; then
+ brew link curl --force > /dev/null 2>&1
+ fi
+ done
}
diff --git a/debian.sh b/debian.sh
index 12ba3a9..df39cb1 100644
--- a/debian.sh
+++ b/debian.sh
@@ -71,6 +71,10 @@ build_deps(){
INSTALLED+=("libpython3-dev")
elif [ "$FOUND_VALUE" = "lua" ]; then
INSTALLED+=("liblua5.1-0-dev")
+ elif [ "$FOUND_VALUE" = "jnibuild" ]; then
+ INSTALLED+=("openjdk-8-jdk")
+ INSTALLED+=("openjdk-8-source")
+ INSTALLED+=("maven")
elif [ "$FOUND_VALUE" = "automake" ]; then
INSTALLED+=("automake")
elif [ "$FOUND_VALUE" = "gpsd" ]; then
diff --git a/extensions/jni/CMakeLists.txt b/extensions/jni/CMakeLists.txt
index 2fcd529..721175c 100644
--- a/extensions/jni/CMakeLists.txt
+++ b/extensions/jni/CMakeLists.txt
@@ -22,8 +22,8 @@ include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt)
message(STATUS "JAVA_HOME: '$ENV{JAVA_HOME}'")
find_package(JNI REQUIRED)
find_package(Java REQUIRED)
-
-message(STATUS "JAVA_HOME: '$ENV{JAVA_HOME}'")
+find_package(Maven REQUIRED)
+message(STATUS "MAVEN: ${MAVEN_EXECUTABLE}")
include_directories(${JNI_INCLUDE_DIRS})
file(GLOB SOURCES "jvm/*.cpp" "*.cpp")
@@ -31,7 +31,6 @@ file(GLOB SOURCES "jvm/*.cpp" "*.cpp")
add_library(minifi-jni STATIC ${SOURCES})
set_property(TARGET minifi-jni PROPERTY POSITION_INDEPENDENT_CODE ON)
-
set(JNI_FRAMEWORK_JAR_SOURCE "${CMAKE_SOURCE_DIR}/extensions/jni/nifi-framework-jni")
set(JNI_FRAMEWORK_JAR_BIN "${CMAKE_CURRENT_BINARY_DIR}/" )
@@ -40,17 +39,26 @@ file(COPY ${JNI_FRAMEWORK_JAR_SOURCE} DESTINATION ${JNI_FRAMEWORK_JAR_BIN})
set(JNI_ASSEMBLY_JAR_SOURCE "${CMAKE_SOURCE_DIR}/extensions/jni/nifi-minifi-jni-assembly")
set(JNI_ASSEMBLY_JAR_BIN "${CMAKE_CURRENT_BINARY_DIR}/" )
-include_directories(${PCAPPLUSPLUS_HEADER_DIR})
-
file(COPY ${JNI_FRAMEWORK_JAR_SOURCE} DESTINATION ${JNI_FRAMEWORK_JAR_BIN})
file(COPY ${JNI_ASSEMBLY_JAR_SOURCE} DESTINATION ${JNI_ASSEMBLY_JAR_BIN})
message("Building NiFi assembly for packaging ....")
-execute_process(COMMAND "mvn" "-q" "package" "-Denforcer.skip=true"
+# duplicating the execute_process because a version of cmake tested exhibited failures
+# with an empty cmd before ${MAVEN_EXECUTABLE}. Until this is resolved ( or proven to be a non cmake issue on all versions)
+# we should stick with the the minor duplication
+if (WIN32)
+execute_process(COMMAND cmd /c "${MAVEN_EXECUTABLE}" "-q" "package" "-Denforcer.skip=true"
WORKING_DIRECTORY "${JNI_ASSEMBLY_JAR_BIN}/nifi-minifi-jni-assembly"
RESULT_VARIABLE mvn_result
- OUTPUT_VARIABLE mvn_output)
-
+ OUTPUT_VARIABLE mvn_output
+ ERROR_VARIABLE mvn_error)
+else()
+execute_process(COMMAND "${MAVEN_EXECUTABLE}" "-q" "package" "-Denforcer.skip=true"
+ WORKING_DIRECTORY "${JNI_ASSEMBLY_JAR_BIN}/nifi-minifi-jni-assembly"
+ RESULT_VARIABLE mvn_result
+ OUTPUT_VARIABLE mvn_output
+ ERROR_VARIABLE mvn_error)
+endif()
if("${mvn_result}" STREQUAL "0")
message("${mvn_output}")
@@ -59,16 +67,24 @@ if("${mvn_result}" STREQUAL "0")
COMPONENT bin)
else()
- message("Maven failed ${mvn_output}")
+ message("Maven failed ${mvn_result} ${mvn_output} ${mvn_error}")
endif()
message("Building NiFi JNI Jar for packaging ....")
-execute_process(COMMAND "mvn" "-q" "package"
+if (WIN32)
+execute_process(COMMAND cmd /c "${MAVEN_EXECUTABLE}" "-q" "package"
WORKING_DIRECTORY "${JNI_FRAMEWORK_JAR_BIN}/nifi-framework-jni"
RESULT_VARIABLE mvn_result
- OUTPUT_VARIABLE mvn_output)
-
+ OUTPUT_VARIABLE mvn_output
+ ERROR_VARIABLE mvn_error)
+else()
+execute_process(COMMAND "${MAVEN_EXECUTABLE}" "-q" "package"
+ WORKING_DIRECTORY "${JNI_FRAMEWORK_JAR_BIN}/nifi-framework-jni"
+ RESULT_VARIABLE mvn_result
+ OUTPUT_VARIABLE mvn_output
+ ERROR_VARIABLE mvn_error)
+endif()
if("${mvn_result}" STREQUAL "0")
message("${mvn_output}")
SET (JNI-FRAMEWORK-JAR "${JNI_FRAMEWORK_JAR_BIN}/nifi-framework-jni/target/nifi-framework-jni-1.9.0.jar")
diff --git a/fedora.sh b/fedora.sh
index 7fdaaac..87f8898 100644
--- a/fedora.sh
+++ b/fedora.sh
@@ -17,80 +17,83 @@
# under the License.
verify_enable(){
- feature="$1"
- feature_status=${!1}
- verify_gcc_enable $feature
+ feature="$1"
+ feature_status=${!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
+ 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
}
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
+ # 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 gcc gcc-c++ libuuid libuuid-devel patch"
- INSTALLED=()
- INSTALLED+=("bzip2-devel")
- 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" = "libcurl" ]; then
- INSTALLED+=("libcurl-devel")
- elif [ "$FOUND_VALUE" = "libpcap" ]; then
- INSTALLED+=("libpcap-devel")
- elif [ "$FOUND_VALUE" = "openssl" ]; then
- INSTALLED+=("openssl")
- INSTALLED+=("openssl-devel")
- elif [ "$FOUND_VALUE" = "libusb" ]; then
- INSTALLED+=("libusb-devel")
- elif [ "$FOUND_VALUE" = "libpng" ]; then
- INSTALLED+=("libpng-devel")
- elif [ "$FOUND_VALUE" = "bison" ]; then
- INSTALLED+=("bison")
- elif [ "$FOUND_VALUE" = "flex" ]; then
- INSTALLED+=("flex")
- echo "add flex"
- elif [ "$FOUND_VALUE" = "python" ]; then
- INSTALLED+=("python3-devel")
- elif [ "$FOUND_VALUE" = "lua" ]; then
- INSTALLED+=("lua-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" = "gpsd" ]; then
- INSTALLED+=("gpsd-devel")
- elif [ "$FOUND_VALUE" = "libarchive" ]; then
- INSTALLED+=("xz-devel")
- fi
- fi
- done
+ COMMAND="sudo yum -y install gcc gcc-c++ libuuid libuuid-devel patch"
+ INSTALLED=()
+ INSTALLED+=("bzip2-devel")
+ 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" = "libcurl" ]; then
+ INSTALLED+=("libcurl-devel")
+ elif [ "$FOUND_VALUE" = "libpcap" ]; then
+ INSTALLED+=("libpcap-devel")
+ elif [ "$FOUND_VALUE" = "openssl" ]; then
+ INSTALLED+=("openssl")
+ INSTALLED+=("openssl-devel")
+ elif [ "$FOUND_VALUE" = "libusb" ]; then
+ INSTALLED+=("libusb-devel")
+ elif [ "$FOUND_VALUE" = "libpng" ]; then
+ INSTALLED+=("libpng-devel")
+ elif [ "$FOUND_VALUE" = "bison" ]; then
+ INSTALLED+=("bison")
+ elif [ "$FOUND_VALUE" = "flex" ]; then
+ INSTALLED+=("flex")
+ elif [ "$FOUND_VALUE" = "jnibuild" ]; then
+ INSTALLED+=("java-1.8.0-openjdk")
+ INSTALLED+=("java-1.8.0-openjdk-devel")
+ INSTALLED+=("maven")
+ elif [ "$FOUND_VALUE" = "python" ]; then
+ INSTALLED+=("python3-devel")
+ elif [ "$FOUND_VALUE" = "lua" ]; then
+ INSTALLED+=("lua-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" = "gpsd" ]; then
+ INSTALLED+=("gpsd-devel")
+ elif [ "$FOUND_VALUE" = "libarchive" ]; then
+ INSTALLED+=("xz-devel")
+ fi
+ fi
+ done
- fi
- done
+ fi
+ done
- for option in "${INSTALLED[@]}" ; do
- COMMAND="${COMMAND} $option"
- done
-echo "Installing ${COMMAND}"
- ${COMMAND}
+ for option in "${INSTALLED[@]}" ; do
+ COMMAND="${COMMAND} $option"
+ done
+ echo "Installing ${COMMAND}"
+ ${COMMAND}
}