diff --git a/README.md b/README.md index 897d28a..1bceb10 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,16 @@ The onvif server instead runs as CGI and therefore needs an http server that sup - [Donation](#donation) ## Build -- Open the Makefile and edit the path to the libtomcrypt library to suit your needs -- Run make - -Or: - -- Open the extras folder. -- Customize build.sh script -- Run build.sh +- Open the `Makefile` and edit the path to the libtomcrypt library to suit your needs +- Run `make` + +## Create a working example with lighttpd +- Open extras folder +- Customize `build.sh` script, if you want +- Run `./build.sh` +- Copy the content of the `_install` folder to `/usr/local` +- Run `/usr/local/bin/lighttpd -f /usr/local/etc/lighttpd.conf` +- Run your preferred client and test the address `http://YOUR_IP:8080/onvif/device_service` ## Configuration ### onvif_simple_server diff --git a/extras/build.sh b/extras/build.sh index 6fc0962..3b4adcb 100755 --- a/extras/build.sh +++ b/extras/build.sh @@ -18,6 +18,10 @@ LIGHTTPD=lighttpd-1.4.73 # Don't edit below this line +cd ../.. +patch -p0 < onvif_simple_server/extras/path.patch +cd onvif_simple_server/extras + mkdir -p $INSTALL_DIR/bin mkdir -p $INSTALL_DIR/etc/onvif_notify_server mkdir -p $INSTALL_DIR/etc/wsd_simple_server diff --git a/extras/path.patch b/extras/path.patch new file mode 100644 index 0000000..d029100 --- /dev/null +++ b/extras/path.patch @@ -0,0 +1,45 @@ +diff -Naur onvif_simple_server.ori/onvif_notify_server.c onvif_simple_server/onvif_notify_server.c +--- onvif_simple_server.ori/onvif_notify_server.c 2023-12-09 22:58:35.403631631 +0100 ++++ onvif_simple_server/onvif_notify_server.c 2023-12-09 22:59:34.011730308 +0100 +@@ -39,10 +39,10 @@ + #include "log.h" + #include "onvif_simple_server.h" + +-#define DEFAULT_CONF_FILE "/etc/onvif_simple_server.conf" +-#define DEFAULT_LOG_FILE "/var/log/onvif_notify_server.log" ++#define DEFAULT_CONF_FILE "/usr/local/etc/onvif_simple_server.conf" ++#define DEFAULT_LOG_FILE "/var/log/onvif_notify_server.log" + #define DEFAULT_PID_FILE "/var/run/onvif_notify_server.pid" +-#define TEMPLATE_DIR "/etc/onvif_notify_server" ++#define TEMPLATE_DIR "/usr/local/etc/onvif_notify_server" + #define INOTIFY_DIR "/tmp/onvif_notify_server" + + #define ALARM_OFF 0 +diff -Naur onvif_simple_server.ori/onvif_simple_server.c onvif_simple_server/onvif_simple_server.c +--- onvif_simple_server.ori/onvif_simple_server.c 2023-12-09 22:57:18.935503114 +0100 ++++ onvif_simple_server/onvif_simple_server.c 2023-12-09 23:00:26.871819429 +0100 +@@ -36,8 +36,8 @@ + #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 DEFAULT_CONF_FILE "/usr/local/etc/onvif_simple_server.conf" ++#define DEFAULT_LOG_FILE "/var/log/onvif_simple_server.log" + #define DEBUG_FILE "/tmp/onvif_simple_server.debug" + + #define ROTATION_LOG_LENGTH 3 +diff -Naur onvif_simple_server.ori/wsd_simple_server.c onvif_simple_server/wsd_simple_server.c +--- onvif_simple_server.ori/wsd_simple_server.c 2023-12-09 22:57:18.935503114 +0100 ++++ onvif_simple_server/wsd_simple_server.c 2023-12-09 23:01:06.899886974 +0100 +@@ -38,8 +38,8 @@ + #define PORT 3702 + #define TYPE "NetworkVideoTransmitter" + +-#define DEFAULT_LOG_FILE "/var/log/wsd_simple_server.log" +-#define TEMPLATE_DIR "/etc/wsd_simple_server" ++#define DEFAULT_LOG_FILE "/var/log//wsd_simple_server.log" ++#define TEMPLATE_DIR "/usr/local/etc/etc/wsd_simple_server" + + #define RECV_BUFFER_LEN 4096 +