diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2022-12-26 09:07:57 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-12-26 19:35:12 +0100 |
commit | e9443d7618276873f2dbcb2bdffca5d9991c1f84 (patch) | |
tree | 16eea1d0623d87b2d809fe8ccbb706cae6c11853 | |
parent | 4e19ab929c4d1866387623135845c1e75004fd07 (diff) |
Fix libnDPI build script.
* added ntop Webinar 2022 reference
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r-- | .gitlab-ci.yml | 32 | ||||
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rwxr-xr-x | scripts/get-and-build-libndpi.sh | 5 |
4 files changed, 39 insertions, 9 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f16d2389d..02701f8ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ after_script: - test -r /tmp/nDPIsrvd.log && cat /tmp/nDPIsrvd.log - test -r /tmp/nDPId.log && cat /tmp/nDPId.log -build_and_test: +build_and_test_static_libndpi_tsan: script: - C_VAL=$(cat config.h | sed -n 's/^#define\s\+NETWORK_BUFFER_MAX_SIZE\s\+\([0-9]\+\).*$/\1/gp') - PY_VAL=$(cat dependencies/nDPIsrvd.py | sed -n 's/^NETWORK_BUFFER_MAX_SIZE = \([0-9]\+\).*$/\1/gp') @@ -29,9 +29,17 @@ build_and_test: - env CMAKE_C_FLAGS='-Werror' CMAKE_C_COMPILER='clang' cmake .. -DBUILD_EXAMPLES=OFF -DBUILD_NDPI=ON -DENABLE_SANITIZER_THREAD=ON -DENABLE_ZLIB=ON - make libnDPI - tree libnDPI - - make install VERBOSE=1 DESTDIR="$(realpath ./_install)" - - ../test/run_tests.sh ../libnDPI ./_install/usr/local/bin/nDPId-test + - make install VERBOSE=1 DESTDIR="$(realpath ../_install)" - cd .. + - ./test/run_tests.sh ./libnDPI ./_install/usr/local/bin/nDPId-test + artifacts: + expire_in: 1 week + paths: + - _install/ + stage: build_and_test + +build_and_test_static_libndpi: + script: - mkdir build-cmake-submodule - cd build-cmake-submodule - env CMAKE_C_FLAGS='-Werror' cmake .. -DENABLE_SYSTEMD=ON -DENABLE_COVERAGE=ON -DBUILD_EXAMPLES=ON -DBUILD_NDPI=ON -DENABLE_SANITIZER=ON -DENABLE_ZLIB=ON @@ -52,13 +60,29 @@ build_and_test: - > if ldd build/nDPId | grep -qoEi libndpi; then \ echo 'nDPId linked against a static libnDPI should not contain a shared linked libnDPI.' >&2; false; fi + artifacts: + expire_in: 1 week + paths: + - _install/ + stage: build_and_test + +build_dynamic_libndpi: + script: # pkg-config dynamic linked build + - git clone https://github.com/ntop/nDPI.git + - cd nDPI + - ./autogen.sh --prefix="$(realpath ../_install)" --enable-option-checking=fatal + - make install V=s + - cd .. + - tree ./_install - mkdir build - cd build - - export PKG_CONFIG_PATH="$(realpath ../build-cmake-submodule/libnDPI/lib/pkgconfig)" + - export CMAKE_PREFIX_PATH="$(realpath ../_install)" - env CMAKE_C_FLAGS='-Werror' cmake .. -DBUILD_EXAMPLES=ON -DENABLE_SANITIZER=ON -DENABLE_MEMORY_PROFILING=ON -DENABLE_ZLIB=ON - make all VERBOSE=1 + - make install VERBOSE=1 DESTDIR="$(realpath ../_install)" - cd .. + - tree ./_install - ./build/nDPId-test || test $? -eq 1 - ./build/nDPId -h || test $? -eq 1 - ./build/nDPIsrvd -h || test $? -eq 1 diff --git a/CMakeLists.txt b/CMakeLists.txt index b5584274e..438ae5988 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,7 +251,7 @@ if(STATIC_LIBNDPI_INSTALLDIR OR BUILD_NDPI) unset(DEFAULT_NDPI_INCLUDE CACHE) else() if(NOT NDPI_NO_PKGCONFIG) - pkg_check_modules(NDPI REQUIRED libndpi>=4.3.0) + pkg_check_modules(NDPI REQUIRED libndpi>=4.5.0) unset(STATIC_LIBNDPI_INC CACHE) unset(STATIC_LIBNDPI_LIB CACHE) @@ -374,8 +374,8 @@ if(BUILD_NDPI) message(STATUS "NDPI_ADDITIONAL_ARGS.....: ${NDPI_ADDITIONAL_ARGS}") endif() message(STATUS "NDPI_NO_PKGCONFIG........: ${NDPI_NO_PKGCONFIG}") -if(STATIC_LIBNDPI_INSTALLDIR OR BUILD_NDPI OR NDPI_NO_PKGCONFIG) message(STATUS "--------------------------") +if(STATIC_LIBNDPI_INSTALLDIR OR BUILD_NDPI OR NDPI_NO_PKGCONFIG) message(STATUS "- STATIC_LIBNDPI_INC....: ${STATIC_LIBNDPI_INC}") message(STATUS "- STATIC_LIBNDPI_LIB....: ${STATIC_LIBNDPI_LIB}") message(STATUS "- NDPI_WITH_GCRYPT......: ${NDPI_WITH_GCRYPT}") @@ -385,4 +385,7 @@ endif() if(NOT STATIC_LIBNDPI_INSTALLDIR AND NOT BUILD_NDPI) message(STATUS "- DEFAULT_NDPI_INCLUDE..: ${DEFAULT_NDPI_INCLUDE}") endif() +if(NOT NDPI_NO_PKGCONFIG) +message(STATUS "- pkgcfg_lib_NDPI_ndpi..: ${pkgcfg_lib_NDPI_ndpi}") +endif() message(STATUS "--------------------------") @@ -1,6 +1,10 @@ [](https://github.com/utoni/nDPId/actions/workflows/build.yml) [](https://gitlab.com/utoni/nDPId/-/pipelines) +# References + +[ntop Webinar 2022](https://www.ntop.org/webinar/ntop-webinar-on-dec-14th-community-meeting-and-future-plans/) + # Disclaimer Please respect&protect the privacy of others. diff --git a/scripts/get-and-build-libndpi.sh b/scripts/get-and-build-libndpi.sh index a3c0c52b6..aee11b0e5 100755 --- a/scripts/get-and-build-libndpi.sh +++ b/scripts/get-and-build-libndpi.sh @@ -57,9 +57,8 @@ DEST_INSTALL="${DEST_INSTALL:-$(realpath ./install)}" MAKE_PROGRAM="${MAKE_PROGRAM:-make -j4}" HOST_ARG="--host=${HOST_TRIPLET}" ./autogen.sh --enable-option-checking=fatal \ - --prefix="${DEST_INSTALL}" --exec-prefix="${DEST_INSTALL}" \ - --includedir="${DEST_INSTALL}/include" --libdir="${DEST_INSTALL}/lib" \ + --prefix="/" \ --with-only-libndpi ${HOST_ARG} ${ADDITIONAL_ARGS} -${MAKE_PROGRAM} install +${MAKE_PROGRAM} install DESTDIR="${DEST_INSTALL}" rm -f "${LOCKFILE}" |