Index: head/comms/telldus-core/pkg-message =================================================================== --- head/comms/telldus-core/pkg-message (revision 453266) +++ head/comms/telldus-core/pkg-message (nonexistent) @@ -1,20 +0,0 @@ - -====== -NOTICE -====== - -A devd rule has been installed to automatically notify telldusd -when a new device has been detected. - -Please restart devd to activate this: - - /etc/rc.d/devd restart - -Edit /usr/local/etc/tellstick.conf to configure some devices, -and enable telldusd in rc.conf. - -Then start telldusd. - -When starting for the first time, you might need to unplug/plugin the device -to allow devd to fix the permissions on the /dev/ugenX.X device. - Property changes on: head/comms/telldus-core/pkg-message ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/comms/telldus-core/Makefile =================================================================== --- head/comms/telldus-core/Makefile (revision 453266) +++ head/comms/telldus-core/Makefile (revision 453267) @@ -1,49 +1,56 @@ # Created by: Johan Strom # $FreeBSD$ PORTNAME= telldus-core PORTVERSION= 2.1.2 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= comms MASTER_SITES= http://download.telldus.se/TellStick/Software/telldus-core/ MAINTAINER= johan@stromnet.se COMMENT= Tellstick Telldus daemon + library LICENSE= LGPL21 BUILD_DEPENDS= help2man:misc/help2man LIB_DEPENDS= libftdi.so:devel/libftdi \ libconfuse.so:devel/libconfuse \ libargp.so:devel/argp-standalone BROKEN_powerpc64= Does not build: error: strlen was not declared in this scope BROKEN_sparc64= Does not build: error: strlen was not declared in this scope -USES= cmake compiler:c++11-lang iconv:wchar_t +USE_LDCONFIG= yes +USES= cmake compiler:c++11-lang iconv:wchar_t CMAKE_ARGS+=-DGENERATE_MAN=TRUE # Note: these are internal defines and shall NOT contain ${STAGEDIR} CMAKE_ARGS+=-DSYSCONF_INSTALL_DIR="${PREFIX}/etc" +# Using global /var, otherwise testport complains "Warning: port uses /usr/local/var instead of /var" CMAKE_ARGS+=-DSTATE_INSTALL_DIR="/var/telldus" MAKE_JOBS_UNSAFE= yes USE_RC_SUBR= telldusd USER= nobody GROUP= dialer +SUB_FILES= pkg-message + .include post-patch: # remove tr1 if using libc++ .if ${COMPILER_FEATURES:Mlibc++} @${REINPLACE_CMD} -e 's|tr1::||' ${WRKSRC}/common/Event.h .endif post-install: cd ${STAGEDIR}${PREFIX}/etc && \ ${MV} tellstick.conf tellstick.conf.sample - ${RM} ${STAGEDIR}/var/telldus/telldus-core.conf + # This file is actually empty but allows us to simply use @sample to + # make sure it stays between upgrades if modified + cd ${STAGEDIR}/var/telldus && \ + ${MV} telldus-core.conf telldus-core.conf.sample .include Index: head/comms/telldus-core/files/patch-CMakeLists.txt =================================================================== --- head/comms/telldus-core/files/patch-CMakeLists.txt (revision 453266) +++ head/comms/telldus-core/files/patch-CMakeLists.txt (revision 453267) @@ -1,62 +1,60 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -42,8 +42,18 @@ ENDIF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +@@ -37,8 +37,18 @@ ENDIF (CMAKE_SYSTEM_NAME MATCHES "FreeBS SET(BUILD_TDTOOL TRUE CACHE BOOL "Build tdtool") SET(BUILD_TDADMIN ${TDADMIN_DEFAULT} CACHE BOOL "Build tdadmin") +SET(GENERATE_DOXYGEN FALSE CACHE BOOL "Enable generation of doxygen") SET(GENERATE_MAN FALSE CACHE BOOL "Enable generation of man-files") + +IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + SET(MAN_DIR_DEFAULT "man") +ELSE() + SET(MAN_DIR_DEFAULT "share/man") +ENDIF() +SET(MAN_DIR ${MAN_DIR_DEFAULT} CACHE PATH "The directory where man pages are located (related to ${CMAKE_INSTALL_PREFIX})") + + ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(service) ADD_SUBDIRECTORY(client) -@@ -61,20 +71,23 @@ ENDIF(BUILD_TDADMIN) +@@ -56,20 +66,23 @@ ENDIF(BUILD_TDADMIN) ENABLE_TESTING() ADD_SUBDIRECTORY(tests) -FIND_PACKAGE(Doxygen) - -IF(DOXYGEN_FOUND) - SET(DOXY_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) -- ++IF (GENERATE_DOXYGEN) ++ FIND_PACKAGE(Doxygen) ++ IF(DOXYGEN_FOUND) ++ SET(DOXY_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + - CONFIGURE_FILE( - "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in" - ${DOXY_CONFIG} @ONLY - ) -- ++ CONFIGURE_FILE( ++ "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in" ++ ${DOXY_CONFIG} @ONLY ++ ) + - ADD_CUSTOM_TARGET(docs - ${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG} - DEPENDS ${DOXY_CONFIG} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Generating doxygen documentation" VERBATIM - ) -ENDIF() -+IF (GENERATE_DOXYGEN) -+ FIND_PACKAGE(Doxygen) -+ IF(DOXYGEN_FOUND) -+ SET(DOXY_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) -+ -+ CONFIGURE_FILE( -+ "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in" -+ ${DOXY_CONFIG} @ONLY -+ ) -+ + ADD_CUSTOM_TARGET(docs + ${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG} + DEPENDS ${DOXY_CONFIG} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating doxygen documentation" VERBATIM + ) + ELSE() + MESSAGE("Warn: doxygen not found, wont build") + ENDIF() +ENDIF(GENERATE_DOXYGEN) Index: head/comms/telldus-core/files/patch-common-Socket_unix.cpp =================================================================== --- head/comms/telldus-core/files/patch-common-Socket_unix.cpp (revision 453266) +++ head/comms/telldus-core/files/patch-common-Socket_unix.cpp (revision 453267) @@ -1,24 +1,24 @@ --- common/Socket_unix.cpp +++ common/Socket_unix.cpp @@ -18,7 +18,7 @@ #include "common/Strings.h" #define BUFSIZE 512 -#if defined(_MACOSX) && !defined(SOCK_CLOEXEC) +#if (defined(_MACOSX) || defined (__FreeBSD__)) && !defined(SOCK_CLOEXEC) #define SOCK_CLOEXEC 0 #endif -@@ -130,8 +130,10 @@ std::wstring Socket::read(int timeout) { +@@ -128,8 +128,10 @@ std::wstring Socket::read(int timeout) { void Socket::stopReadWait() { TelldusCore::MutexLocker locker(&d->mutex); - d->connected = false; - // TODO(stefan): somehow signal the socket here? + if(d->connected && d->socket != -1) { + d->connected = false; + shutdown(d->socket, SHUT_RDWR); + } } void Socket::write(const std::wstring &msg) { Index: head/comms/telldus-core/files/patch-service-SettingsConfuse.cpp =================================================================== --- head/comms/telldus-core/files/patch-service-SettingsConfuse.cpp (revision 453266) +++ head/comms/telldus-core/files/patch-service-SettingsConfuse.cpp (revision 453267) @@ -1,42 +1,42 @@ --- service/SettingsConfuse.cpp +++ service/SettingsConfuse.cpp @@ -17,6 +17,8 @@ class Settings::PrivateData { public: + PrivateData() + : cfg(NULL), var_cfg(NULL) {} cfg_t *cfg; cfg_t *var_cfg; }; -@@ -42,10 +44,10 @@ +@@ -42,10 +44,10 @@ Settings::Settings(void) { */ Settings::~Settings(void) { TelldusCore::MutexLocker locker(&mutex); - if (d->cfg > 0) { + if (d->cfg != 0) { cfg_free(d->cfg); } - if (d->var_cfg > 0) { + if (d->var_cfg != 0) { cfg_free(d->var_cfg); } delete d; -@@ -56,7 +58,7 @@ +@@ -56,7 +58,7 @@ Settings::~Settings(void) { */ std::wstring Settings::getSetting(const std::wstring &strName) const { TelldusCore::MutexLocker locker(&mutex); - if (d->cfg > 0) { + if (d->cfg != 0) { std::string setting(cfg_getstr(d->cfg, TelldusCore::wideToString(strName).c_str())); return TelldusCore::charToWstring(setting.c_str()); } -@@ -68,7 +70,7 @@ +@@ -68,7 +70,7 @@ std::wstring Settings::getSetting(const */ int Settings::getNumberOfNodes(Node node) const { TelldusCore::MutexLocker locker(&mutex); - if (d->cfg > 0) { + if (d->cfg != 0) { if (node == Device) { return cfg_size(d->cfg, "device"); } else if (node == Controller) { Index: head/comms/telldus-core/files/patch-tdadmin-freebsd-devd-tellstick.conf =================================================================== --- head/comms/telldus-core/files/patch-tdadmin-freebsd-devd-tellstick.conf (revision 453266) +++ head/comms/telldus-core/files/patch-tdadmin-freebsd-devd-tellstick.conf (revision 453267) @@ -1,15 +1,39 @@ --- tdadmin/freebsd-devd-tellstick.conf 2014-04-06 22:40:11.000000000 +0200 +++ tdadmin/freebsd-devd-tellstick.conf 2014-04-06 20:37:50.501751596 +0200 -@@ -0,0 +1,12 @@ -+attach 10 { -+ device-name "uftdi[0-9]+"; +@@ -0,0 +1,36 @@ ++# Original Tellstick ++notify 10 { ++ match "system" "USB"; ++ match "subsystem" "DEVICE"; ++ match "type" "ATTACH"; + match "vendor" "0x1781"; + match "product" "0x0c30"; ++ action "chgrp dialer /dev/$cdev; chmod 660 /dev/$cdev; @CMAKE_INSTALL_PREFIX@/sbin/tdadmin --pid $product --vid $vendor --serial $sernum controller connect"; ++}; + -+ action "chgrp dialer /dev/ugen$port.$devaddr; chmod 660 /dev/ugen$port.$devaddr; -+ @CMAKE_INSTALL_PREFIX@/sbin/tdadmin --pid $product --vid $vendor --serial $sernum controller connect"; ++notify 10 { ++ match "system" "USB"; ++ match "subsystem" "DEVICE"; ++ match "type" "DETACH"; ++ match "vendor" "0x1781"; ++ match "product" "0x0c30"; ++ action "@CMAKE_INSTALL_PREFIX@/sbin/tdadmin --pid $product --vid $vendor --serial $sernum controller disconnect"; +}; ++# Tellstick Duo ++notify 10 { ++ match "system" "USB"; ++ match "subsystem" "DEVICE"; ++ match "type" "ATTACH"; ++ match "vendor" "0x1781"; ++ match "product" "0x0c31"; ++ action "chgrp dialer /dev/$cdev; chmod 660 /dev/$cdev; @CMAKE_INSTALL_PREFIX@/sbin/tdadmin --pid $product --vid $vendor --serial $sernum controller connect"; ++}; + -+ -+# Haven't managed to handle detach/disconnect events, seems they do not provide any information -+# at all so cannot distinguish different uftdi devices. ++notify 10 { ++ match "system" "USB"; ++ match "subsystem" "DEVICE"; ++ match "type" "DETACH"; ++ match "vendor" "0x1781"; ++ match "product" "0x0c31"; ++ action "@CMAKE_INSTALL_PREFIX@/sbin/tdadmin --pid $product --vid $vendor --serial $sernum controller disconnect"; ++}; Index: head/comms/telldus-core/files/pkg-message.in =================================================================== --- head/comms/telldus-core/files/pkg-message.in (nonexistent) +++ head/comms/telldus-core/files/pkg-message.in (revision 453267) @@ -0,0 +1,20 @@ + +====== +NOTICE +====== + +A devd rule has been installed to automatically notify telldusd +when a new device has been detected. + +Please restart devd to activate this: + + /etc/rc.d/devd restart + +Edit %%PREFIX%%/etc/tellstick.conf to configure some devices, +and enable telldusd in rc.conf. + +Then start telldusd. + +When starting for the first time, you might need to unplug/plugin the device +to allow devd to fix the permissions on the /dev/ugenX.X device. + Property changes on: head/comms/telldus-core/files/pkg-message.in ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/comms/telldus-core/pkg-plist =================================================================== --- head/comms/telldus-core/pkg-plist (revision 453266) +++ head/comms/telldus-core/pkg-plist (revision 453267) @@ -1,20 +1,20 @@ -bin/tdtool +@owner nobody @group dialer @mode 664 -@exec mkdir -p /var/telldus && chown nobody:dialer /var/telldus -@exec [ -f /var/telldus/telldus-core.conf ] || touch /var/telldus/telldus-core.conf && chown nobody:dialer %D/var/telldus/telldus-core.conf -@unexec if [ ! -s /var/telldus/telldus-core.conf ]; then rm -vf /var/telldus/telldus-core.conf; fi -@unexec rmdir /var/telldus >/dev/null 2>&1 || : +@dir /var/telldus +@sample /var/telldus/telldus-core.conf.sample +@owner @sample etc/tellstick.conf.sample @group @mode +bin/tdtool etc/devd/tellstick.conf include/telldus-core.h lib/libtelldus-core.so lib/libtelldus-core.so.2 lib/libtelldus-core.so.2.1.2 man/man1/tdadmin.1.gz man/man1/tdtool.1.gz man/man1/telldusd.1.gz sbin/tdadmin sbin/telldusd