diff --git a/cross/mysql-connector-c/Makefile b/cross/mysql-connector-c/Makefile index 65514b8d4f2..391793cdaca 100644 --- a/cross/mysql-connector-c/Makefile +++ b/cross/mysql-connector-c/Makefile @@ -15,6 +15,8 @@ LICENSE = GNU GPLv2 USE_NATIVE_CMAKE_LEGACY = 1 CMAKE_USE_NINJA = 1 +POST_INSTALL_TARGET = mysql-connector-c_post_install + include ../../mk/spksrc.cross-cmake.mk # give access to comp_err binary on host @@ -60,3 +62,8 @@ CMAKE_ARGS += -DWITH_ZLIB=system ifneq ($(findstring $(ARCH),$(PPC_ARCHS)),) CMAKE_ARGS += -DHAVE_GCC_ATOMIC_BUILTINS=1 endif + +.PHONY: mysql-connector-c_post_install +mysql-connector-c_post_install: + @$(MSG) Fix for mysql_config --libs + @$(RUN) sed 's|"$$libs -l "|"$$libs -lmysqlclient "|g' -i $(INSTALL_DIR)$(INSTALL_PREFIX)/bin/mysql_config diff --git a/cross/ntopng/Makefile b/cross/ntopng/Makefile index 2ddf3084cc6..09a26fbfb84 100644 --- a/cross/ntopng/Makefile +++ b/cross/ntopng/Makefile @@ -15,7 +15,7 @@ DEPENDS += cross/json-c cross/rrdtool cross/lua UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) HOMEPAGE = https://www.ntop.org/ -COMMENT = ntopng is the next generation version of the original ntop, a network traffic probe that monitors network usage. ntopng is based on libpcap and it has been written in a portable way in order to virtually run on every Unix platform, MacOSX and on Windows as well. +COMMENT = High-Speed Web-based Traffic Analysis and Flow Collection. LICENSE = GPLv3 include ../../mk/spksrc.archs.mk @@ -25,74 +25,67 @@ ifeq ($(findstring $(ARCH),$(SRM_ARCHS)),$(ARCH)) SYNOLOGY_OS = SRM endif +RW_LOCKS_SUPPORTED = yes +ADDITIONAL_LIBRARIES = -lcurl -llua # similar to 'uname -m' on the target plattform (not essential, for information only) PACKAGE_MACHINE = x86_64 -ifeq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) -PACKAGE_MACHINE = armv5 -endif ifeq ($(findstring $(ARCH),$(ARMv7L_ARCHS)),$(ARCH)) PACKAGE_MACHINE = armv7l +RW_LOCKS_SUPPORTED = no endif ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS)),$(ARCH)) PACKAGE_MACHINE = armv7 +RW_LOCKS_SUPPORTED = no endif ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) PACKAGE_MACHINE = aarch64 +RW_LOCKS_SUPPORTED = no endif ifeq ($(findstring $(ARCH),$(PPC_ARCHS)),$(ARCH)) PACKAGE_MACHINE = ppc +RW_LOCKS_SUPPORTED = no +# for qoriq: +ADDITIONAL_LIBRARIES += -latomic endif ifeq ($(findstring $(ARCH),$(i686_ARCHS)),$(ARCH)) PACKAGE_MACHINE = i686 +RW_LOCKS_SUPPORTED = no endif GNU_CONFIGURE = 1 -PRE_PATCH_TARGET = ntopng_pre_patch PRE_CONFIGURE_TARGET = ntopng_pre_configure PRE_COMPILE_TARGET = ntopng_pre_compile CONFIGURE_ARGS = --prefix=$(INSTALL_PREFIX) CONFIGURE_ARGS += --with-ndpi-includes=$(STAGING_INSTALL_PREFIX)/include/ndpi CONFIGURE_ARGS += --with-ndpi-static-lib=$(STAGING_INSTALL_PREFIX)/lib +CONFIGURE_ARGS += my_cv_rw_locks_supported=$(RW_LOCKS_SUPPORTED) -# May be required as mysql-connector-c include -# files are now located under include/mysql -# ADDITIONAL_CFLAGS = -I$(STAGING_INSTALL_PREFIX)/include/mysql - +ENV += DESTDIR=$(INSTALL_DIR) # let ./configure find mysql_config (it is a script and works for cross compile) ENV += "PATH=$(PATH):$(STAGING_INSTALL_PREFIX)/bin" -ENV += DESTDIR=$(INSTALL_DIR) include ../../mk/spksrc.cross-cc.mk -.PHONY: ntopng_pre_patch -ntopng_pre_patch: - @$(RUN) ./autogen.sh - .PHONY: ntopng_pre_configure ntopng_pre_configure: - @$(MSG) "- patch generated configure file to define synology specific package info" - @$(RUN) sed -i 's|#define PACKAGE_OSNAME "$${OSNAME}"|#define PACKAGE_OSNAME "Synology $(SYNOLOGY_OS) $(TCVERSION)+"|g' ./configure - @$(RUN) sed -i 's|#define PACKAGE_OS "$${OS}"|#define PACKAGE_OS "$(TC_ARCH)"|g' ./configure - @$(RUN) sed -i 's|#define PACKAGE_MACHINE "$$MACHINE"|#define PACKAGE_MACHINE "$(PACKAGE_MACHINE)"|g' ./configure - @$(MSG) "- patch sources to define real version instead of 'major.minor.currentdate', fix github links, reformat copyright date" - @$(RUN) sed -i "s|PACKAGE_VERSION='.*'|PACKAGE_VERSION='$(PKG_VERS)'|g" ./configure - @$(RUN) sed -i "s|PACKAGE_STRING='ntopng .*'|PACKAGE_STRING='ntopng $(PKG_VERS)'|g" ./configure - @$(RUN) sed -i 's|GIT_RELEASE=".*"|GIT_RELEASE="$(PKG_VERS)"|g' ./configure - @$(RUN) sed -i 's|"https://github.com/ntop/ntopng/commit/"..|"https://github.com/ntop/ntopng/releases/tag/"..|g' ./scripts/lua/about.lua - @$(RUN) sed -i 's|"http://www.d3js.org|"http://d3js.org|g' ./scripts/lua/about.lua - @$(RUN) sed -i 's|"(C) 1998-\(..\) ntop.org"|"(C) 1998-20\1 ntop.org"|g' ./include/ntop_defines.h - @$(RUN) sed -i 's|copy; 1998-\(..\) - ntop.org"|copy; 1998-20\1 - ntop.org"|g' ./src/LuaEngine.cpp - @$(RUN) sed -i 's|"Welcome to %s %s v.%s - (C) 1998-\(..\) ntop.org"|"Welcome to %s %s v.%s - (C) 1998-20\1 ntop.org"|g' ./src/Ntop.cpp + @$(MSG) "- RUN autogen to create configure file" + @$(RUN) ./autogen.sh + @$(MSG) "- PATCH generated configure file to define synology specific package info" + @$(RUN) sed 's|#define PACKAGE_OSNAME \\"$${OSNAME}\\"|#define PACKAGE_OSNAME \\"Synology $(SYNOLOGY_OS) $(TCVERSION)+\\"|g' -i ./configure + @$(RUN) sed 's|#define PACKAGE_OS \\"$${OS}\\"|#define PACKAGE_OS \\"$(TC_ARCH)\\"|g' -i ./configure + @$(RUN) sed 's|#define PACKAGE_MACHINE \\"$$MACHINE\\"|#define PACKAGE_MACHINE \\"$(PACKAGE_MACHINE)\\"|g' -i ./configure + @$(MSG) "- PATCH sources to define real version instead of 'major.minor.currentdate', fix github links, reformat copyright date" + @$(RUN) sed "s|PACKAGE_VERSION='.*'|PACKAGE_VERSION='$(PKG_VERS)'|g" -i ./configure + @$(RUN) sed "s|PACKAGE_STRING='ntopng .*'|PACKAGE_STRING='ntopng $(PKG_VERS)'|g" -i ./configure + @$(RUN) sed 's|GIT_RELEASE=".*"|GIT_RELEASE="$(PKG_VERS)"|g' -i ./configure + @$(RUN) sed 's|"https://github.com/ntop/ntopng/commit/"..|"https://github.com/ntop/ntopng/releases/tag/"..|g' -i ./scripts/lua/about.lua + @$(RUN) sed 's|"(C) 1998-\(..\) ntop.org"|"(C) 1998-20\1 ntop.org"|g' -i ./include/ntop_defines.h + @$(RUN) sed 's|"Welcome to %s %s v.%s - (C) 1998-\(..\) ntop.org"|"Welcome to %s %s v.%s - (C) 1998-20\1 ntop.org"|g' -i ./src/Ntop.cpp + @$(RUN) sed 's|copy; 1998-\(..\) - ntop.org"|copy; 1998-20\1 - ntop.org"|g' -i ./src/LuaEngineNtop.cpp.inc .PHONY: ntopng_pre_compile ntopng_pre_compile: - @$(MSG) "- patch generated Makefile to ignore third-party libs and use cross/* packages instead" - @$(RUN) sed -i 's|LIB_TARGETS = $$(LUA_LIB)|LIB_TARGETS =|g' ./Makefile - @$(RUN) sed -i 's|$$(LIBPCAP) $$(LUA_LIB) $$(LIBRRDTOOL_LIB)|$$(LIBPCAP) $$(LIBRRDTOOL_LIB)|g' ./Makefile - @$(RUN) sed -i 's| -l -L/| -L/|g' ./Makefile - @$(RUN) sed -i 's| -l -lexpat -L/| -lexpat -L/|g' ./Makefile - @$(RUN) sed -i 's| -lssl -lssl | -lssl -lcurl -llua -lmysqlclient |g' ./Makefile - @$(RUN) sed -i 's|-L/usr/local/lib -lrt -lz -ldl -lcurl |-L/usr/local/lib -lrt -lz -ldl |g' ./Makefile - @$(RUN) sed -i 's|-L/usr/local/lib -lcap -lrt -lz -ldl -lcurl |-L/usr/local/lib -lcap -lrt -lz -ldl |g' ./Makefile + @$(MSG) "- PATCH generated Makefile to link with additional (cross/*) libraries" + @$(RUN) sed 's| -lssl *-lssl | -lssl $(ADDITIONAL_LIBRARIES) |g' -i ./Makefile diff --git a/cross/ntopng/patches/001-disable-rw_locks_support.patch b/cross/ntopng/patches/001-disable-rw_locks_support.patch deleted file mode 100644 index b68784554cb..00000000000 --- a/cross/ntopng/patches/001-disable-rw_locks_support.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- ../ntopng-4.2-ORIG/configure 2020-11-03 01:31:00.194252642 +0000 -+++ configure 2020-11-03 02:05:50.470053152 +0000 -@@ -5731,32 +5731,32 @@ if ${my_cv_rw_locks_supported+:} false; - $as_echo_n "(cached) " >&6 - else - -- if test "$cross_compiling" = yes; then : -- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 --$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} --as_fn_error $? "cannot run test program while cross compiling --See \`config.log' for more details" "$LINENO" 5; } --else -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- -- #include -- -- int main() { -- pthread_rwlock_t t; -- return 0; -- } -- -- --_ACEOF --if ac_fn_c_try_run "$LINENO"; then : -- my_cv_rw_locks_supported=yes --else -+# if test "$cross_compiling" = yes; then : -+# { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+#as_fn_error $? "cannot run test program while cross compiling -+#See \`config.log' for more details" "$LINENO" 5; } -+#else -+# cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+#/* end confdefs.h. */ -+# -+# #include -+# -+# int main() { -+# pthread_rwlock_t t; -+# return 0; -+# } -+# -+# -+#_ACEOF -+#if ac_fn_c_try_run "$LINENO"; then : -+# my_cv_rw_locks_supported=yes -+#else - my_cv_rw_locks_supported=no --fi -+#fi - rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext --fi -+#fi - - - diff --git a/cross/ntopng/patches/001-makefile.in_ignore_local_static_lua.patch b/cross/ntopng/patches/001-makefile.in_ignore_local_static_lua.patch new file mode 100644 index 00000000000..0daba49b333 --- /dev/null +++ b/cross/ntopng/patches/001-makefile.in_ignore_local_static_lua.patch @@ -0,0 +1,23 @@ +# ignore static lua library within ntopng sources +# we use cross/lua instead +# +--- Makefile.in.orig 2020-11-02 21:27:19.000000000 +0000 ++++ Makefile.in 2024-09-01 14:35:35.320735253 +0000 +@@ -106,7 +106,7 @@ + + ###### + TARGET = ntopng +-NLIBS = $(NDPI_LIB) $(LIBPCAP) $(LUA_LIB) $(LIBRRDTOOL_LIB) $(ZEROMQ_LIB) $(JSON_LIB) $(SNMP_LIB) @MAXMINDDB_LIB@ $(SODIUM_LIB) @HIREDIS_LIB@ @SQLITE_LIB@ @MYSQL_LIB@ @RADCLI_LIB@ @EXPAT_LIB@ @SSL_LIB@ @LINK_OPTS@ @LDFLAGS@ @PRO_LIBS@ $(ZSTD_LIB) -lm -lpthread ++NLIBS = $(NDPI_LIB) $(LIBPCAP) $(LIBRRDTOOL_LIB) $(ZEROMQ_LIB) $(JSON_LIB) $(SNMP_LIB) @MAXMINDDB_LIB@ $(SODIUM_LIB) @HIREDIS_LIB@ @SQLITE_LIB@ @MYSQL_LIB@ @RADCLI_LIB@ @EXPAT_LIB@ @SSL_LIB@ @LINK_OPTS@ @LDFLAGS@ @PRO_LIBS@ $(ZSTD_LIB) -lm -lpthread + CPPFLAGS = @CFLAGS@ @HIREDIS_INC@ $(MONGOOSE_INC) $(JSON_INC) $(SNMP_INC) $(SODIUM_INC) $(NDPI_INC) $(LUA_INC) $(LIBRRDTOOL_INC) $(ZEROMQ_INC) @MYSQL_INC@ @CPPFLAGS@ -I$(HTTPCLIENT_INC) @SSL_INC@ @PRO_INCS@ -DDATA_DIR='"$(datadir)"' -I${PWD}/third-party/libgeohash -I${PWD}/third-party/patricia # -D_GLIBCXX_DEBUG + ###### + # ntopng-1.0_1234.x86_64.rpm +@@ -118,7 +118,7 @@ + RPM_DATA_PKG = $(TARGET)-data-$(NTOPNG_VERSION)-@REVISION@.noarch.rpm + ###### + +-LIB_TARGETS = $(LUA_LIB) ++LIB_TARGETS = + + ifneq ($(HAS_ZEROMQ), 0) + LIB_TARGETS += $(ZEROMQ_LIB) diff --git a/cross/ntopng/patches/88f6281/001-define-atomic-not-cstatomic.patch b/cross/ntopng/patches/88f6281/001-define-atomic-not-cstatomic.patch deleted file mode 100644 index a25f3610017..00000000000 --- a/cross/ntopng/patches/88f6281/001-define-atomic-not-cstatomic.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uprN ../ntopng-4.2-ORIG/include/ntop_includes.h ./include/ntop_includes.h ---- ../ntopng-4.2-ORIG/include/ntop_includes.h 2020-11-02 21:27:19.000000000 +0000 -+++ ./include/ntop_includes.h 2020-11-03 23:25:25.008923063 +0000 -@@ -174,7 +174,7 @@ https://translate.google.co.uk/translate - #include - #include - --#if !defined(__clang__) && (__GNUC__ <= 4) && (__GNUC_MINOR__ < 8) && !defined(WIN32) -+#if !defined(__clang__) && (__GNUC__ <= 4) && (__GNUC_MINOR__ < 6) && !defined(WIN32) - #include - #else - #include diff --git a/cross/ntopng/patches/qoriq/001-add-atomic-lib.patch b/cross/ntopng/patches/qoriq/001-add-atomic-lib.patch deleted file mode 100644 index 38b8daa2af5..00000000000 --- a/cross/ntopng/patches/qoriq/001-add-atomic-lib.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../ntopng-4.2-ORIG/Makefile.in 2020-11-02 21:27:19.000000000 +0000 -+++ Makefile.in 2020-11-04 01:36:06.491541165 +0000 -@@ -106,7 +106,7 @@ endif - - ###### - TARGET = ntopng --NLIBS = $(NDPI_LIB) $(LIBPCAP) $(LUA_LIB) $(LIBRRDTOOL_LIB) $(ZEROMQ_LIB) $(JSON_LIB) $(SNMP_LIB) @MAXMINDDB_LIB@ $(SODIUM_LIB) @HIREDIS_LIB@ @SQLITE_LIB@ @MYSQL_LIB@ @RADCLI_LIB@ @EXPAT_LIB@ @SSL_LIB@ @LINK_OPTS@ @LDFLAGS@ @PRO_LIBS@ $(ZSTD_LIB) -lm -lpthread -+NLIBS = $(NDPI_LIB) $(LIBPCAP) $(LUA_LIB) $(LIBRRDTOOL_LIB) $(ZEROMQ_LIB) $(JSON_LIB) $(SNMP_LIB) @MAXMINDDB_LIB@ $(SODIUM_LIB) @HIREDIS_LIB@ @SQLITE_LIB@ @MYSQL_LIB@ @RADCLI_LIB@ @EXPAT_LIB@ @SSL_LIB@ @LINK_OPTS@ @LDFLAGS@ @PRO_LIBS@ $(ZSTD_LIB) -lm -lpthread -latomic - CPPFLAGS = @CFLAGS@ @HIREDIS_INC@ $(MONGOOSE_INC) $(JSON_INC) $(SNMP_INC) $(SODIUM_INC) $(NDPI_INC) $(LUA_INC) $(LIBRRDTOOL_INC) $(ZEROMQ_INC) @MYSQL_INC@ @CPPFLAGS@ -I$(HTTPCLIENT_INC) @SSL_INC@ @PRO_INCS@ -DDATA_DIR='"$(datadir)"' -I${PWD}/third-party/libgeohash -I${PWD}/third-party/patricia # -D_GLIBCXX_DEBUG - ###### - # ntopng-1.0_1234.x86_64.rpm diff --git a/cross/ntopng/patches/x64/001-enable-rwlock-arch-x64.patch b/cross/ntopng/patches/x64/001-enable-rwlock-arch-x64.patch deleted file mode 100644 index b49f25c5af7..00000000000 --- a/cross/ntopng/patches/x64/001-enable-rwlock-arch-x64.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../ntopng-4.2-ORIG/configure 2020-11-03 12:29:24.663744889 +0000 -+++ configure 2020-11-04 01:56:55.581691869 +0000 -@@ -5750,9 +5750,9 @@ else - # - #_ACEOF - #if ac_fn_c_try_run "$LINENO"; then : --# my_cv_rw_locks_supported=yes -+ my_cv_rw_locks_supported=yes - #else -- my_cv_rw_locks_supported=no -+# my_cv_rw_locks_supported=no - #fi - rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext diff --git a/spk/ntopng/Makefile b/spk/ntopng/Makefile index 01ac8c38228..2a18e070a99 100644 --- a/spk/ntopng/Makefile +++ b/spk/ntopng/Makefile @@ -1,44 +1,53 @@ SPK_NAME = ntopng SPK_VERS = 4.2 -SPK_REV = 3 -SPK_ICON = src/$(SPK_NAME).png +SPK_REV = 4 +SPK_ICON = src/ntopng.png -DEPENDS = cross/$(SPK_NAME) +DEPENDS = cross/ntopng SPK_DEPENDS = "redis" -# toolchains of DSM <=5.2 have outdated compiler (PPC archs except qoriq) -UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) +# cross/libcap not supported: +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) MAINTAINER = hgy59 -DESCRIPTION = ntopng is the next generation version of the original ntop, a network traffic probe that monitors network usage. ntopng is based on libpcap and it has been written in a portable way in order to virtually run on every Unix platform, MacOSX and on Windows as well. -CHANGELOG = "1. Update to version 4.2
2. Update nDPI to version 3.4" +DESCRIPTION = High-Speed Web-based Traffic Analysis and Flow Collection. ntopng is a network traffic probe that provides 360° Network visibility, with its ability to gather traffic information from traffic mirrors, NetFlow exporters, SNMP devices, Firewall logs, Intrusion Detection systems. To run ntopng on DSM 7, the installed privileges file must be manually patched after installation or update. +CHANGELOG = "1. Update to version 4.2
2. Update nDPI to version 3.4
3. Add support for DSM 7." DISPLAY_NAME = ntopng HELPURL = https://www.ntop.org/guides/ntopng/index.html -LICENSE = GNU GPLv3 +LICENSE = GPLv3 # 'auto' (reserved value) grabs SPK_NAME -SERVICE_USER = auto -SSS_SCRIPT = src/start-stop-status.sh -STARTABLE = yes -SERVICE_PORT = 3000 +SERVICE_USER = auto +SSS_SCRIPT = src/start-stop-status.sh +STARTABLE = yes + +SERVICE_PORT = 3000 +SERVICE_PORT_TITLE = ntopng (HTTP) # generate app/config and app/images/*.png DSM_UI_DIR = app -# In case script start-stop-status has to run as root on DSM 6, package can -# provide its own conf/privilege file as far as CONF_DIR variable is set. +include ../../mk/spksrc.common.mk + +ifeq ($(call version_lt, ${TCVERSION}, 7.0),1) +# On DSM 6: package runs as root CONF_DIR = src/conf +else +# On DSM 7: package must be defined to run as package user to allow installation. +# Since ntopng must be run as root, the privilege file must be manually +# patched after installation (and after package update or package repair). +CONF_DIR = src/conf.dsm7 +WIZARDS_DIR = src/wizard.dsm7/ +endif POST_STRIP_TARGET = ntopng_extra_install - include ../../mk/spksrc.spk.mk .PHONY: ntopng_extra_install ntopng_extra_install: install -m 755 -d $(STAGING_DIR)/var/data - install -m 755 -d $(STAGING_DIR)/etc - install -m 644 src/ntopng.conf $(STAGING_DIR)/etc/ntopng.conf + install -m 644 src/ntopng.conf $(STAGING_DIR)/var/ntopng.conf unzip -o src/GeoLite2.mmdb.zip -d $(STAGING_DIR)/share/ntopng/httpdocs/geoip/ diff --git a/spk/ntopng/src/conf.dsm7/privilege b/spk/ntopng/src/conf.dsm7/privilege new file mode 100644 index 00000000000..5661f692a24 --- /dev/null +++ b/spk/ntopng/src/conf.dsm7/privilege @@ -0,0 +1,6 @@ +{ + "defaults":{ + "run-as": "package" + }, + "username": "sc-ntopng" +} diff --git a/spk/ntopng/src/ntopng.conf b/spk/ntopng/src/ntopng.conf index d95bb781eee..9f838395dd4 100644 --- a/spk/ntopng/src/ntopng.conf +++ b/spk/ntopng/src/ntopng.conf @@ -7,10 +7,10 @@ ## initial configuration by spk installation --user sc-ntopng --daemon ---pid /usr/local/ntopng/var/ntopng.pid ---data-dir /usr/local/ntopng/var/data ---prefsdir /usr/local/ntopng/var/data ---pcapdir /usr/local/ntopng/var/data +--pid /var/packages/ntopng/var/ntopng.pid +--data-dir /var/packages/ntopng/var/data +--prefsdir /var/packages/ntopng/var/data +--pcapdir /var/packages/ntopng/var/data ## DNS address resolution mode diff --git a/spk/ntopng/src/start-stop-status.sh b/spk/ntopng/src/start-stop-status.sh index f611a679ade..19a3d30f0eb 100644 --- a/spk/ntopng/src/start-stop-status.sh +++ b/spk/ntopng/src/start-stop-status.sh @@ -2,9 +2,20 @@ # start/stop script derived from ntopng/packages/etc/init.d/ntopng -SERVICE_CFG_FILE="${SYNOPKG_PKGDEST}/etc/ntopng.conf" +if [ -z "${SYNOPKG_PKGNAME}" ] || [ -z "${SYNOPKG_DSM_VERSION_MAJOR}" ]; then + echo "Error: Environment variables are not set." 1>&2; + echo "Please run me using synopkg instead. Example: 'synopkg start ntopng'" 1>&2; + exit 1 +fi + +if [ "$SYNOPKG_DSM_VERSION_MAJOR" -lt 7 ]; then + # define SYNOPKG_PKGVAR for forward compatibility + SYNOPKG_PKGVAR="${SYNOPKG_PKGDEST}/var" +fi + +SERVICE_CFG_FILE="${SYNOPKG_PKGVAR}/ntopng.conf" SERVICE_COMMAND="${SYNOPKG_PKGDEST}/bin/ntopng ${SERVICE_CFG_FILE}" -SERVICE_LOG_FILE="${SYNOPKG_PKGDEST}/var/ntopng.log" +SERVICE_LOG_FILE="${SYNOPKG_PKGVAR}/ntopng.log" ERROR=0 @@ -161,24 +172,24 @@ status_ntopng() { ######## case "$1" in - start) + start) start_ntopng; ;; - stop) + stop) stop_ntopng; ;; - status) + status) status_ntopng; ;; - restart) + restart) stop_ntopng; start_ntopng; ;; - *) + *) echo "Usage: ${0} {start|stop|restart|status}]" exit 1 esac diff --git a/spk/ntopng/src/wizard.dsm7/install_uifile b/spk/ntopng/src/wizard.dsm7/install_uifile new file mode 100644 index 00000000000..54ec6551b41 --- /dev/null +++ b/spk/ntopng/src/wizard.dsm7/install_uifile @@ -0,0 +1,19 @@ +[ + { + "step_title": "Important installation notes", + "items": [ + { + "desc": "This package must be run as root, but Synology prohibits this for packages that have not been verified by them." + }, + { + "desc": "Please continue the installation until the package fails to start and shows 'Manually Stopped' in the Package Center." + }, + { + "desc": "Than you need to ssh into DSM and execute the command:
sudo sed -i 's/package/root/g' /var/packages/ntopng/conf/privilege" + }, + { + "desc": "Finally press Run in the Package Center, or manually start the package in the ssh session with:
sudo synopkg start ntopng" + } + ] + } +] diff --git a/spk/ntopng/src/wizard.dsm7/upgrade_uifile b/spk/ntopng/src/wizard.dsm7/upgrade_uifile new file mode 100644 index 00000000000..4fc6dc5efca --- /dev/null +++ b/spk/ntopng/src/wizard.dsm7/upgrade_uifile @@ -0,0 +1,19 @@ +[ + { + "step_title": "Important update notes", + "items": [ + { + "desc": "This package must be run as root, but Synology prohibits this for packages that have not been verified by them." + }, + { + "desc": "Please continue the update until the package fails to start and shows 'Manually Stopped' in the Package Center." + }, + { + "desc": "Than you need to ssh into DSM and execute the command:
sudo sed -i 's/package/root/g' /var/packages/ntopng/conf/privilege" + }, + { + "desc": "Finally press Run in the Package Center, or manually start the package in the ssh session with:
sudo synopkg start ntopng" + } + ] + } +]