From b1c66eb7b174ebb45aa07cdb612f44010df4501a Mon Sep 17 00:00:00 2001
From: gtxaspec <gtxent@gmail.com>
Date: Thu, 28 Dec 2023 05:57:16 -0800
Subject: [PATCH] [no ci] update onvif-simple-server package (#1215)

---
 .../01-enable-mbedtls-only.patch              | 25 +++++++++++--------
 .../02-change-config-file-and-dir-names.patch | 10 +++++---
 .../onvif-simple-server.mk                    |  5 ++--
 3 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/general/package/onvif-simple-server/01-enable-mbedtls-only.patch b/general/package/onvif-simple-server/01-enable-mbedtls-only.patch
index 25382154..4f307e08 100644
--- a/general/package/onvif-simple-server/01-enable-mbedtls-only.patch
+++ b/general/package/onvif-simple-server/01-enable-mbedtls-only.patch
@@ -1,18 +1,21 @@
 --- a/Makefile	2023-07-04 13:52:08.000000000 +0300
 +++ b/Makefile	2023-07-11 00:10:53.987288000 +0300
-@@ -2,13 +2,8 @@
- 
- OBJECTS_O = onvif_simple_server.o device_service.o media_service.o ptz_service.o utils.o log.o
- OBJECTS_W = wsd_simple_server.o utils.o log.o
+@@ -3,15 +3,9 @@
+ OBJECTS_O = onvif_simple_server.o device_service.o media_service.o ptz_service.o events_service.o fault.o conf.o utils.o log.o ezxml_wrapper.o ezxml/ezxml.o
+ OBJECTS_N = onvif_notify_server.o conf.o utils.o log.o ezxml_wrapper.o ezxml/ezxml.o
+ OBJECTS_W = wsd_simple_server.o utils.o log.o ezxml_wrapper.o ezxml/ezxml.o
 -ifdef HAVE_MBEDTLS
--INCLUDE = -DHAVE_MBEDTLS -I../mbedtls/include -ffunction-sections -fdata-sections
--LIBS_O = -Wl,--gc-sections ../mbedtls/library/libmbedcrypto.a -lpthread
+-INCLUDE = -DHAVE_MBEDTLS -I../mbedtls/include -ffunction-sections -fdata-sections -lrt
+-LIBS_O = -Wl,--gc-sections ../mbedtls/library/libmbedcrypto.a -lpthread -lrt
+-LIBS_N = -Wl,--gc-sections ../mbedtls/library/libmbedcrypto.a -lpthread -lrt
 -else
--INCLUDE = -I../libtomcrypt/src/headers -ffunction-sections -fdata-sections
--LIBS_O = -Wl,--gc-sections ../libtomcrypt/libtomcrypt.a -lpthread
+-INCLUDE = -I../libtomcrypt/src/headers -ffunction-sections -fdata-sections -lrt
+-LIBS_O = -Wl,--gc-sections ../libtomcrypt/libtomcrypt.a -lpthread -lrt
+-LIBS_N = -Wl,--gc-sections ../libtomcrypt/libtomcrypt.a -lpthread -lrt
 -endif
-+INCLUDE = -DHAVE_MBEDTLS -ffunction-sections -fdata-sections
-+LIBS_O = -Wl,--gc-sections -lmbedtls -lmbedcrypto -lpthread
++INCLUDE = -DHAVE_MBEDTLS -ffunction-sections -fdata-sections -lrt
++LIBS_O = -Wl,--gc-sections -lmbedtls -lmbedcrypto -lpthread -lrt
++LIBS_N = -Wl,--gc-sections -lmbedtls -lmbedcrypto -lpthread -lrt
  LIBS_W = -Wl,--gc-sections
  
- all: onvif_simple_server wsd_simple_server
+ all: onvif_simple_server onvif_notify_server wsd_simple_server
diff --git a/general/package/onvif-simple-server/02-change-config-file-and-dir-names.patch b/general/package/onvif-simple-server/02-change-config-file-and-dir-names.patch
index 6c36771f..430b2eb4 100644
--- a/general/package/onvif-simple-server/02-change-config-file-and-dir-names.patch
+++ b/general/package/onvif-simple-server/02-change-config-file-and-dir-names.patch
@@ -1,19 +1,21 @@
 --- a/onvif_simple_server.c	2023-07-16 16:48:12.000000000 +0300
 +++ b/onvif_simple_server.c	2023-09-09 22:42:57.126222514 +0300
-@@ -32,8 +32,8 @@
+@@ -36,9 +36,9 @@
  #include "utils.h"
  #include "log.h"
- 
+
 -#define DEFAULT_CONF_FILE "/etc/onvif_simple_server.conf"
 -#define DEFAULT_LOG_FILE "/var/log/onvif_simple_server.log"
+-#define DEBUG_FILE "/tmp/onvif_simple_server.debug"
 +#define DEFAULT_CONF_FILE "/etc/onvif.conf"
 +#define DEFAULT_LOG_FILE "/tmp/onvif.log"
- 
++#define DEBUG_FILE "/tmp/onvif.debug"
+
  service_context_t service_ctx;
  
 --- a/wsd_simple_server.c	2023-07-16 16:48:12.000000000 +0300
 +++ b/wsd_simple_server.c	2023-09-09 22:55:59.594700185 +0300
-@@ -36,8 +36,8 @@
+@@ -38,8 +38,8 @@
  #define PORT 3702
  #define TYPE "NetworkVideoTransmitter"
  
diff --git a/general/package/onvif-simple-server/onvif-simple-server.mk b/general/package/onvif-simple-server/onvif-simple-server.mk
index 4aad01b6..1169058f 100644
--- a/general/package/onvif-simple-server/onvif-simple-server.mk
+++ b/general/package/onvif-simple-server/onvif-simple-server.mk
@@ -6,9 +6,10 @@
 
 ONVIF_SIMPLE_SERVER_SITE_METHOD = git
 ONVIF_SIMPLE_SERVER_SITE = https://github.com/roleoroleo/onvif_simple_server
-ONVIF_SIMPLE_SERVER_VERSION = b875f42b81db13032070c35d934ed3b46f52101e
+#ONVIF_SIMPLE_SERVER_VERSION = de6d585a245e4873c49b113360f98907f2b4cf49
+ONVIF_SIMPLE_SERVER_VERSION = $(shell git ls-remote $(ONVIF_SIMPLE_SERVER_SITE) HEAD | head -1 | awk '{ print $$1 }')
 
-ONVIF_SIMPLE_SERVER_DEPENDENCIES = mbedtls-openipc
+ONVIF_SIMPLE_SERVER_DEPENDENCIES = mbedtls
 ONVIF_SIMPLE_SERVER_LICENSE = MIT
 ONVIF_SIMPLE_SERVER_LICENSE_FILES = LICENSE