mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
domoticz: new package
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
From 2504f02de752aceb5a3c1d4749032147efde8082 Mon Sep 17 00:00:00 2001
|
||||
From: dwmw2 <dwmw2@infradead.org>
|
||||
Date: Fri, 3 Feb 2017 07:40:35 +0000
|
||||
Subject: [PATCH] Add -sslkey option to allow separate cert/key files (#1195)
|
||||
|
||||
---
|
||||
main/domoticz.cpp | 11 +++++++++++
|
||||
webserver/server_settings.hpp | 2 +-
|
||||
2 files changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/main/domoticz.cpp
|
||||
+++ b/main/domoticz.cpp
|
||||
@@ -76,6 +76,7 @@ const char *szHelp=
|
||||
#ifdef WWW_ENABLE_SSL
|
||||
"\t-sslwww port (for example -sslwww 443, or -sslwww 0 to disable https)\n"
|
||||
"\t-sslcert file_path (for example /opt/domoticz/server_cert.pem)\n"
|
||||
+ "\t-sslkey file_path (if different from certificate file)\n"
|
||||
"\t-sslpass passphrase (to access to server private key in certificate)\n"
|
||||
"\t-sslmethod method (for SSL method)\n"
|
||||
"\t-ssloptions options (for SSL options, default is 'default_workarounds,no_sslv2,single_dh_use')\n"
|
||||
@@ -682,6 +683,16 @@ int main(int argc, char**argv)
|
||||
return 1;
|
||||
}
|
||||
secure_webserver_settings.cert_file_path = cmdLine.GetSafeArgument("-sslcert", 0, "");
|
||||
+ secure_webserver_settings.private_key_file_path = secure_webserver_settings.cert_file_path;
|
||||
+ }
|
||||
+ if (cmdLine.HasSwitch("-sslkey"))
|
||||
+ {
|
||||
+ if (cmdLine.GetArgumentCount("-sslkey") != 1)
|
||||
+ {
|
||||
+ _log.Log(LOG_ERROR, "Please specify a file path for your server SSL key file");
|
||||
+ return 1;
|
||||
+ }
|
||||
+ secure_webserver_settings.private_key_file_path = cmdLine.GetSafeArgument("-sslkey", 0, "");
|
||||
}
|
||||
if (cmdLine.HasSwitch("-sslpass"))
|
||||
{
|
||||
--- a/webserver/server_settings.hpp
|
||||
+++ b/webserver/server_settings.hpp
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
// use certificate file for all usage by default
|
||||
certificate_chain_file_path = ssl_settings.cert_file_path;
|
||||
ca_cert_file_path = ssl_settings.cert_file_path;
|
||||
- private_key_file_path = ssl_settings.cert_file_path;
|
||||
+ private_key_file_path = ssl_settings.private_key_file_path;
|
||||
tmp_dh_file_path = ssl_settings.cert_file_path;
|
||||
verify_file_path = ssl_settings.cert_file_path;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
diff --git a/hardware/evohome.cpp b/hardware/evohome.cpp
|
||||
index fcbee6d..f77291e 100644
|
||||
--- a/hardware/evohome.cpp
|
||||
+++ b/hardware/evohome.cpp
|
||||
@@ -423,11 +423,11 @@ void CEvohome::RunScript(const char *pdata, const unsigned char length)
|
||||
boost::replace_all(OnAction, "{state}", s_strid.str());
|
||||
boost::replace_all(OnAction, "{until}", CEvohomeDateTime::GetISODate(tsen->EVOHOME2));
|
||||
//Execute possible script
|
||||
- std::string scriptname;
|
||||
- if (OnAction.find("script:///") != std::string::npos)
|
||||
- scriptname = OnAction.substr(9);
|
||||
- else
|
||||
- scriptname = OnAction.substr(8);
|
||||
+ std::string scriptname = OnAction.substr(9);
|
||||
+#if !defined WIN32
|
||||
+ if (scriptname.find("/") != 0)
|
||||
+ scriptname = szUserDataFolder + "scripts/" + scriptname;
|
||||
+#endif
|
||||
std::string scriptparams="";
|
||||
//Add parameters
|
||||
int pindex=scriptname.find(' ');
|
||||
@@ -439,7 +439,7 @@ void CEvohome::RunScript(const char *pdata, const unsigned char length)
|
||||
|
||||
if (file_exist(scriptname.c_str()))
|
||||
{
|
||||
- m_sql.AddTaskItem(_tTaskItem::ExecuteScript(1,scriptname,scriptparams));
|
||||
+ m_sql.AddTaskItem(_tTaskItem::ExecuteScript(0.2f,scriptname,scriptparams));
|
||||
}
|
||||
else
|
||||
_log.Log(LOG_ERROR,"evohome: Error script not found '%s'",scriptname.c_str());
|
||||
@@ -1321,7 +1321,7 @@ bool CEvohome::DecodeZoneName(CEvohomeMsg &msg)
|
||||
}
|
||||
if(memcmp(&msg.payload[2],m_szNameErr,18)==0)
|
||||
{
|
||||
- Log(true,LOG_STATUS,"evohome: %s: Warning zone name not set: %d", tag, msg.payload[0]);
|
||||
+ Log(true,LOG_STATUS,"evohome: %s: Warning zone name not set: %d", tag, msg.payload[0]+1);
|
||||
m_bStartup[0]=false;
|
||||
return true;
|
||||
}
|
||||
@@ -1606,9 +1606,11 @@ bool CEvohome::DecodeBatteryInfo(CEvohomeMsg &msg)
|
||||
RFX_SETID3(msg.GetID(0),tsen.EVOHOME2.id1,tsen.EVOHOME2.id2,tsen.EVOHOME2.id3)
|
||||
tsen.EVOHOME2.updatetype = updBattery;
|
||||
|
||||
- double dbCharge=0;
|
||||
- if(nBattery!=0xFF)
|
||||
- dbCharge=(double)nBattery/2.0; //Presumed to be the charge level where sent
|
||||
+ if (nBattery == 0xFF)
|
||||
+ nBattery = 100; // recode full battery (0xFF) to 100 for consistency across device types
|
||||
+ else
|
||||
+ nBattery = nBattery / 2; // recode battery level values to 0-100 from original 0-200 values
|
||||
+
|
||||
if(nLowBat==0)
|
||||
nBattery=0;
|
||||
tsen.EVOHOME2.battery_level=nBattery;
|
||||
@@ -1657,9 +1659,11 @@ bool CEvohome::DecodeBatteryInfo(CEvohomeMsg &msg)
|
||||
tsen.EVOHOME2.type=pTypeEvohomeWater;
|
||||
tsen.EVOHOME2.subtype=sTypeEvohomeWater;
|
||||
tsen.EVOHOME2.zone=nDevNo;
|
||||
- sDecodeRXMessage(this, (const unsigned char *)&tsen.EVOHOME2, NULL, nBattery);
|
||||
+ RFX_SETID3(GetControllerID(), tsen.EVOHOME2.id1, tsen.EVOHOME2.id2, tsen.EVOHOME2.id3);
|
||||
+ sDecodeRXMessage(this, (const unsigned char *)&tsen.EVOHOME2, "DHW Temp", nBattery); // Update DHW Zone sensor
|
||||
}
|
||||
- Log(true,LOG_STATUS,"evohome: %s: %s=%d charge=%d (%.1f %%) level=%d (%s)",tag,szType.c_str(),nDevNo,nBattery,dbCharge,nLowBat,(nLowBat==0)?"Low":"OK");
|
||||
+
|
||||
+ Log(true,LOG_STATUS,"evohome: %s: %s=%d charge=%d(%%) level=%d (%s)",tag,szType.c_str(),nDevNo,nBattery,nLowBat,(nLowBat==0)?"Low":"OK");
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -606,8 +606,6 @@ else()
|
||||
target_link_libraries(domoticz -lrt ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${CURL_LIBRARIES} pthread ${LUA_LIBRARIES} ${MQTT_LIBRARIES} ${SQLite_LIBRARIES} ${CMAKE_DL_LIBS} ${TELLDUS_LIBRARIES} ${EXECINFO_LIBRARIES})
|
||||
ENDIF()
|
||||
|
||||
-ADD_PRECOMPILED_HEADER(domoticz "main/stdafx.h")
|
||||
-
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
option(USE_STATIC_LIBSTDCXX "Build with static libgcc/libstdc++ libraries" YES)
|
||||
IF(USE_STATIC_LIBSTDCXX)
|
||||
@@ -0,0 +1,42 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -534,39 +534,6 @@ IF(OpenZWave)
|
||||
target_link_libraries(domoticz ${OpenZWave})
|
||||
include_directories(${CMAKE_SOURCE_DIR}/hardware/openzwave)
|
||||
add_definitions(-DWITH_OPENZWAVE)
|
||||
- # open-zwave needs libudev
|
||||
- IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
- set(IOKIT_LIBRARY "-framework IOKit -framework CoreFoundation" CACHE FILEPATH "IOKit framework" FORCE)
|
||||
- target_link_libraries(domoticz ${IOKIT_LIBRARY})
|
||||
- else()
|
||||
- IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
- MESSAGE(STATUS "Building on FreeBSD, libudev not needed!")
|
||||
- FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
|
||||
- FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
|
||||
- IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
|
||||
- SET(ICONV_FOUND TRUE)
|
||||
- #target_link_libraries(domoticz ${ICONV_INCLUDE_DIR})
|
||||
- target_link_libraries(domoticz ${ICONV_LIBRARIES} -lrt)
|
||||
- message(STATUS ${ICONV_LIBRARIES})
|
||||
- else()
|
||||
- MESSAGE(FATAL_ERROR "libiconv not found on your system")
|
||||
- ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
|
||||
- else()
|
||||
- find_library(UDEV NAMES libudev.a)
|
||||
- IF(UDEV)
|
||||
- message(STATUS ${UDEV})
|
||||
- target_link_libraries(domoticz ${UDEV} -lrt)
|
||||
- else()
|
||||
- find_library(UDEV NAMES libudev.so)
|
||||
- IF(UDEV)
|
||||
- message(STATUS ${UDEV})
|
||||
- target_link_libraries(domoticz ${UDEV} -lrt)
|
||||
- else()
|
||||
- MESSAGE(FATAL_ERROR "LIB UDEV not found on your system, see install.txt how to get them installed.\nsudo apt-get install libudev-dev")
|
||||
- ENDIF(UDEV)
|
||||
- ENDIF(UDEV)
|
||||
- ENDIF()
|
||||
- ENDIF()
|
||||
else()
|
||||
MESSAGE(STATUS "==== OpenZWave not found, support disabled!")
|
||||
ENDIF(OpenZWave)
|
||||
@@ -0,0 +1,262 @@
|
||||
--- a/hardware/OpenZWave.cpp
|
||||
+++ b/hardware/OpenZWave.cpp
|
||||
@@ -993,7 +993,7 @@ bool COpenZWave::OpenSerialConnector()
|
||||
}
|
||||
m_nodes.clear();
|
||||
m_bNeedSave = false;
|
||||
- std::string ConfigPath = szStartupFolder + "Config/";
|
||||
+ std::string ConfigPath = "/usr/share/domoticz/openzwave/";
|
||||
std::string UserPath = ConfigPath;
|
||||
if (szStartupFolder != szUserDataFolder)
|
||||
{
|
||||
--- a/main/EventSystem.cpp
|
||||
+++ b/main/EventSystem.cpp
|
||||
@@ -44,7 +44,7 @@ extern "C" {
|
||||
using namespace boost::python;
|
||||
#endif
|
||||
|
||||
-extern std::string szUserDataFolder;
|
||||
+extern std::string szScriptsFolder;
|
||||
|
||||
CEventSystem::CEventSystem(void)
|
||||
{
|
||||
@@ -1086,9 +1086,9 @@ void CEventSystem::EvaluateEvent(const s
|
||||
std::stringstream lua_DirT;
|
||||
|
||||
#ifdef WIN32
|
||||
- lua_DirT << szUserDataFolder << "scripts\\lua\\";
|
||||
+ lua_DirT << szScriptsFolder << "lua\\";
|
||||
#else
|
||||
- lua_DirT << szUserDataFolder << "scripts/lua/";
|
||||
+ lua_DirT << szScriptsFolder << "lua/";
|
||||
#endif
|
||||
|
||||
std::string lua_Dir = lua_DirT.str();
|
||||
@@ -1139,9 +1139,9 @@ void CEventSystem::EvaluateEvent(const s
|
||||
{
|
||||
std::stringstream python_DirT;
|
||||
#ifdef WIN32
|
||||
- python_DirT << szUserDataFolder << "scripts\\python\\";
|
||||
+ python_DirT << szScriptsFolder << "python\\";
|
||||
#else
|
||||
- python_DirT << szUserDataFolder << "scripts/python/";
|
||||
+ python_DirT << szScriptsFolder << "python/";
|
||||
#endif
|
||||
|
||||
std::string python_Dir = python_DirT.str();
|
||||
@@ -2021,7 +2021,7 @@ bool CEventSystem::parseBlocklyActions(c
|
||||
}
|
||||
#if !defined WIN32
|
||||
if (sPath.find("/") != 0)
|
||||
- sPath = szUserDataFolder + "scripts/" + sPath;
|
||||
+ sPath = szScriptsFolder + sPath;
|
||||
#endif
|
||||
|
||||
m_sql.AddTaskItem(_tTaskItem::ExecuteScript(1, sPath, sParam));
|
||||
@@ -2133,9 +2133,9 @@ void CEventSystem::EvaluatePython(const
|
||||
std::stringstream python_DirT;
|
||||
|
||||
#ifdef WIN32
|
||||
- python_DirT << szUserDataFolder << "scripts\\python\\";
|
||||
+ python_DirT << szScriptsFolder << "python\\";
|
||||
#else
|
||||
- python_DirT << szUserDataFolder << "scripts/python/";
|
||||
+ python_DirT << szScriptsFolder << "python/";
|
||||
#endif
|
||||
std::string python_Dir = python_DirT.str();
|
||||
if(!Py_IsInitialized()) {
|
||||
@@ -3909,9 +3909,9 @@ namespace http {
|
||||
|
||||
std::stringstream template_file;
|
||||
#ifdef WIN32
|
||||
- template_file << szUserDataFolder << "scripts\\templates\\" << eventType << "." << interpreter;
|
||||
+ template_file << szScriptsFolder << "templates\\" << eventType << "." << interpreter;
|
||||
#else
|
||||
- template_file << szUserDataFolder << "scripts/templates/" << eventType << "." << interpreter;
|
||||
+ template_file << szScriptsFolder << "templates/" << eventType << "." << interpreter;
|
||||
#endif
|
||||
std::ifstream file;
|
||||
std::stringstream template_content;
|
||||
--- a/main/LuaHandler.cpp
|
||||
+++ b/main/LuaHandler.cpp
|
||||
@@ -22,7 +22,7 @@ extern "C" {
|
||||
#include "mainworker.h"
|
||||
#include "../hardware/hardwaretypes.h"
|
||||
|
||||
-extern std::string szUserDataFolder;
|
||||
+extern std::string szScriptsFolder;
|
||||
|
||||
int CLuaHandler::l_domoticz_applyXPath(lua_State* lua_state)
|
||||
{
|
||||
@@ -319,9 +319,9 @@ bool CLuaHandler::executeLuaScript(const
|
||||
{
|
||||
std::stringstream lua_DirT;
|
||||
#ifdef WIN32
|
||||
- lua_DirT << szUserDataFolder << "scripts\\lua_parsers\\";
|
||||
+ lua_DirT << szScriptsFolder << "lua_parsers\\";
|
||||
#else
|
||||
- lua_DirT << szUserDataFolder << "scripts/lua_parsers/";
|
||||
+ lua_DirT << szScriptsFolder << "lua_parsers/";
|
||||
#endif
|
||||
std::string lua_Dir = lua_DirT.str();
|
||||
|
||||
--- a/main/SQLHelper.cpp
|
||||
+++ b/main/SQLHelper.cpp
|
||||
@@ -612,6 +612,7 @@ const char *sqlCreateMobileDevices =
|
||||
"[LastUpdate] DATETIME DEFAULT(datetime('now', 'localtime'))"
|
||||
");";
|
||||
|
||||
+extern std::string szScriptsFolder;
|
||||
extern std::string szUserDataFolder;
|
||||
|
||||
CSQLHelper::CSQLHelper(void)
|
||||
@@ -3408,9 +3409,9 @@ unsigned long long CSQLHelper::UpdateVal
|
||||
//Execute possible script
|
||||
std::string scriptname;
|
||||
#ifdef WIN32
|
||||
- scriptname = szUserDataFolder + "scripts\\domoticz_main.bat";
|
||||
+ scriptname = szScriptsFolder + "domoticz_main.bat";
|
||||
#else
|
||||
- scriptname = szUserDataFolder + "scripts/domoticz_main";
|
||||
+ scriptname = szScriptsFolder + "domoticz_main";
|
||||
#endif
|
||||
if (file_exist(scriptname.c_str()))
|
||||
{
|
||||
@@ -6460,7 +6461,7 @@ bool CSQLHelper::HandleOnOffAction(const
|
||||
std::string scriptname = OnAction.substr(9);
|
||||
#if !defined WIN32
|
||||
if (scriptname.find("/") != 0)
|
||||
- scriptname = szUserDataFolder + "scripts/" + scriptname;
|
||||
+ scriptname = szScriptsFolder + scriptname;
|
||||
#endif
|
||||
std::string scriptparams="";
|
||||
//Add parameters
|
||||
@@ -6492,7 +6493,7 @@ bool CSQLHelper::HandleOnOffAction(const
|
||||
std::string scriptname = OffAction.substr(9);
|
||||
#if !defined WIN32
|
||||
if (scriptname.find("/") != 0)
|
||||
- scriptname = szUserDataFolder + "scripts/" + scriptname;
|
||||
+ scriptname = szScriptsFolder + scriptname;
|
||||
#endif
|
||||
std::string scriptparams="";
|
||||
int pindex=scriptname.find(' ');
|
||||
--- a/main/WebServer.cpp
|
||||
+++ b/main/WebServer.cpp
|
||||
@@ -55,6 +55,7 @@
|
||||
|
||||
#define round(a) ( int ) ( a + .5 )
|
||||
|
||||
+extern std::string szScriptsFolder;
|
||||
extern std::string szUserDataFolder;
|
||||
extern std::string szWWWFolder;
|
||||
|
||||
@@ -2614,9 +2615,9 @@ namespace http {
|
||||
if (scriptname.find("..") != std::string::npos)
|
||||
return;
|
||||
#ifdef WIN32
|
||||
- scriptname = szUserDataFolder + "scripts\\" + scriptname;
|
||||
+ scriptname = szScriptsFolder + scriptname;
|
||||
#else
|
||||
- scriptname = szUserDataFolder + "scripts/" + scriptname;
|
||||
+ scriptname = szScriptsFolder + scriptname;
|
||||
#endif
|
||||
if (!file_exist(scriptname.c_str()))
|
||||
return;
|
||||
--- a/main/domoticz.cpp
|
||||
+++ b/main/domoticz.cpp
|
||||
@@ -135,6 +135,7 @@ static const _facilities facilities[] =
|
||||
};
|
||||
std::string logfacname = "user";
|
||||
#endif
|
||||
+std::string szScriptsFolder;
|
||||
std::string szStartupFolder;
|
||||
std::string szUserDataFolder;
|
||||
std::string szWWWFolder;
|
||||
@@ -603,6 +604,19 @@ int main(int argc, char**argv)
|
||||
szUserDataFolder = szroot;
|
||||
}
|
||||
|
||||
+ szScriptsFolder=szStartupFolder;
|
||||
+ if (cmdLine.HasSwitch("-scripts"))
|
||||
+ {
|
||||
+ if (cmdLine.GetArgumentCount("-scripts") != 1)
|
||||
+ {
|
||||
+ _log.Log(LOG_ERROR, "Please specify a path for scripts directory");
|
||||
+ return 1;
|
||||
+ }
|
||||
+ std::string szroot = cmdLine.GetSafeArgument("-scripts", 0, "");
|
||||
+ if (szroot.size() != 0)
|
||||
+ szScriptsFolder = szroot;
|
||||
+ }
|
||||
+
|
||||
if (cmdLine.HasSwitch("-startupdelay"))
|
||||
{
|
||||
if (cmdLine.GetArgumentCount("-startupdelay") != 1)
|
||||
--- a/main/mainworker.cpp
|
||||
+++ b/main/mainworker.cpp
|
||||
@@ -139,6 +139,7 @@
|
||||
|
||||
#define round(a) ( int ) ( a + .5 )
|
||||
|
||||
+extern std::string szScriptsFolder;
|
||||
extern std::string szStartupFolder;
|
||||
extern std::string szUserDataFolder;
|
||||
extern std::string szWWWFolder;
|
||||
@@ -1394,8 +1395,8 @@ void MainWorker::Do_Work()
|
||||
m_sql.GetPreferencesVar("ReleaseChannel", nValue);
|
||||
bool bIsBetaChannel = (nValue != 0);
|
||||
|
||||
- std::string scriptname = szUserDataFolder + "scripts/download_update.sh";
|
||||
- std::string strparm = szUserDataFolder;
|
||||
+ std::string scriptname = szScriptsFolder + "download_update.sh";
|
||||
+ std::string strparm = szScriptsFolder;
|
||||
if (bIsBetaChannel)
|
||||
strparm += " /beta";
|
||||
|
||||
--- a/notifications/NotificationHTTP.cpp
|
||||
+++ b/notifications/NotificationHTTP.cpp
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "../main/SQLHelper.h"
|
||||
#include "../main/Logger.h"
|
||||
|
||||
-extern std::string szUserDataFolder;
|
||||
+extern std::string szScriptsFolder;
|
||||
|
||||
CNotificationHTTP::CNotificationHTTP() : CNotificationBase(std::string("http"), OPTIONS_NONE)
|
||||
{
|
||||
@@ -97,7 +97,7 @@ bool CNotificationHTTP::SendMessageImple
|
||||
std::string scriptparams = "";
|
||||
#if !defined WIN32
|
||||
if (scriptname.find("/") != 0)
|
||||
- scriptname = szUserDataFolder + "scripts/" + scriptname;
|
||||
+ scriptname = szScriptsFolder + scriptname;
|
||||
#endif
|
||||
//Add parameters
|
||||
uPos = scriptname.find(" ");
|
||||
--- a/push/GooglePubSubPush.cpp
|
||||
+++ b/push/GooglePubSubPush.cpp
|
||||
@@ -20,7 +20,7 @@ extern "C" {
|
||||
using namespace boost::python;
|
||||
#endif
|
||||
|
||||
-extern std::string szUserDataFolder;
|
||||
+extern std::string szScriptsFolder;
|
||||
|
||||
// this should be filled in by the preprocessor
|
||||
extern const char * Python_exe;
|
||||
@@ -222,11 +222,11 @@ void CGooglePubSubPush::DoGooglePubSubPu
|
||||
|
||||
#ifdef ENABLE_PYTHON
|
||||
#ifdef WIN32
|
||||
- python_DirT << szUserDataFolder << "scripts\\python\\";
|
||||
- std::string filename = szUserDataFolder + "scripts\\python\\" + "googlepubsub.py";
|
||||
+ python_DirT << szScriptsFolder << "python\\";
|
||||
+ std::string filename = szScriptsFolder + "python\\" + "googlepubsub.py";
|
||||
#else
|
||||
- python_DirT << szUserDataFolder << "scripts/python/";
|
||||
- std::string filename = szUserDataFolder + "scripts/python/" + "googlepubsub.py";
|
||||
+ python_DirT << szScriptsFolder << "python/";
|
||||
+ std::string filename = szScriptsFolder + "python/" + "googlepubsub.py";
|
||||
#endif
|
||||
|
||||
char * argv[1];
|
||||
@@ -0,0 +1,39 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -476,20 +476,23 @@ else()
|
||||
MESSAGE(FATAL_ERROR "cURL not found on your system, see install.txt how to get them installed. (for example 'sudo apt-get install curl libcurl4-openssl-dev')")
|
||||
ENDIF(CURL_FOUND)
|
||||
|
||||
-find_path(LIBUSB_INCLUDE_DIR usb.h
|
||||
- HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
|
||||
-find_library(LIBUSB_LIBRARY NAMES usb
|
||||
- HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
|
||||
-set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY})
|
||||
+option(WITH_LIBUSB "Enable libusb support" NO)
|
||||
+ if(WITH_LIBUSB)
|
||||
+ find_path(LIBUSB_INCLUDE_DIR usb.h
|
||||
+ HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
|
||||
+ find_library(LIBUSB_LIBRARY NAMES usb
|
||||
+ HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
|
||||
+ set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY})
|
||||
|
||||
-find_package_handle_standard_args(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
|
||||
-IF(LIBUSB_FOUND)
|
||||
- MESSAGE(STATUS "LIBUSB found at: ${LIBUSB_LIBRARIES}")
|
||||
- add_definitions(-DWITH_LIBUSB)
|
||||
- target_link_libraries(domoticz ${LIBUSB_LIBRARIES})
|
||||
-else()
|
||||
- MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
|
||||
-ENDIF(LIBUSB_FOUND)
|
||||
+ find_package_handle_standard_args(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
|
||||
+ IF(LIBUSB_FOUND)
|
||||
+ MESSAGE(STATUS "LIBUSB found at: ${LIBUSB_LIBRARIES}")
|
||||
+ add_definitions(-DWITH_LIBUSB)
|
||||
+ target_link_libraries(domoticz ${LIBUSB_LIBRARIES})
|
||||
+ else()
|
||||
+ MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
|
||||
+ ENDIF(LIBUSB_FOUND)
|
||||
+endif(WITH_LIBUSB)
|
||||
|
||||
#
|
||||
# Find MD5/RMD160/SHA library
|
||||
Reference in New Issue
Block a user