FreeBSD Bugzilla – Attachment 187625 Details for
Bug 222790
[PATCH]: comms/telldus-core devd-rule & misc cleanup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
telldus-core devd fixes, including Tellstick Duo
telldus-core-devd-patch (text/plain), 14.65 KB, created by
Johan Ström
on 2017-10-31 20:34:30 UTC
(
hide
)
Description:
telldus-core devd fixes, including Tellstick Duo
Filename:
MIME Type:
Creator:
Johan Ström
Created:
2017-10-31 20:34:30 UTC
Size:
14.65 KB
patch
obsolete
>diff -urN comms/telldus-core.old/Makefile comms/telldus-core/Makefile >--- comms/telldus-core.old/Makefile 2017-09-10 22:55:38.000000000 +0200 >+++ comms/telldus-core/Makefile 2017-10-05 09:22:53.698399780 +0200 >@@ -3,7 +3,7 @@ > > PORTNAME= telldus-core > PORTVERSION= 2.1.2 >-PORTREVISION= 3 >+PORTREVISION= 4 > CATEGORIES= comms > MASTER_SITES= http://download.telldus.se/TellStick/Software/telldus-core/ > >@@ -20,11 +20,13 @@ > 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 >@@ -33,6 +35,8 @@ > USER= nobody > GROUP= dialer > >+SUB_FILES= pkg-message >+ > .include <bsd.port.pre.mk> > > post-patch: >@@ -44,6 +48,9 @@ > 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 <bsd.port.post.mk> >diff -urN comms/telldus-core.old/files/patch-CMakeLists.txt comms/telldus-core/files/patch-CMakeLists.txt >--- comms/telldus-core.old/files/patch-CMakeLists.txt 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/files/patch-CMakeLists.txt 2017-10-04 23:04:42.881956390 +0200 >@@ -1,6 +1,6 @@ >---- CMakeLists.txt >+--- CMakeLists.txt.orig 2014-04-01 13:52:01 UTC > +++ 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") > >@@ -19,7 +19,7 @@ > 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) > >@@ -27,12 +27,20 @@ > - > -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} >@@ -40,16 +48,6 @@ > - 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} >diff -urN comms/telldus-core.old/files/patch-common-Socket_unix.cpp comms/telldus-core/files/patch-common-Socket_unix.cpp >--- comms/telldus-core.old/files/patch-common-Socket_unix.cpp 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/files/patch-common-Socket_unix.cpp 2017-10-04 23:04:42.883956143 +0200 >@@ -1,4 +1,4 @@ >---- common/Socket_unix.cpp >+--- common/Socket_unix.cpp.orig 2014-03-31 10:30:09 UTC > +++ common/Socket_unix.cpp > @@ -18,7 +18,7 @@ > #include "common/Strings.h" >@@ -9,7 +9,7 @@ > #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); >diff -urN comms/telldus-core.old/files/patch-common-Thread.h comms/telldus-core/files/patch-common-Thread.h >--- comms/telldus-core.old/files/patch-common-Thread.h 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/files/patch-common-Thread.h 2017-10-04 23:04:42.886956456 +0200 >@@ -1,4 +1,4 @@ >---- common/Thread.h >+--- common/Thread.h.orig 2014-03-31 10:30:09 UTC > +++ common/Thread.h > @@ -13,6 +13,9 @@ > #define TELLDUS_CORE_COMMON_THREAD_H_ >diff -urN comms/telldus-core.old/files/patch-service-CMakeLists.txt comms/telldus-core/files/patch-service-CMakeLists.txt >--- comms/telldus-core.old/files/patch-service-CMakeLists.txt 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/files/patch-service-CMakeLists.txt 2017-10-04 23:04:42.888956431 +0200 >@@ -1,4 +1,4 @@ >---- service/CMakeLists.txt >+--- service/CMakeLists.txt.orig 2014-03-31 10:30:09 UTC > +++ service/CMakeLists.txt > @@ -249,7 +249,7 @@ IF (UNIX) > WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} >diff -urN comms/telldus-core.old/files/patch-service-ConnectionListener_unix.cpp comms/telldus-core/files/patch-service-ConnectionListener_unix.cpp >--- comms/telldus-core.old/files/patch-service-ConnectionListener_unix.cpp 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/files/patch-service-ConnectionListener_unix.cpp 2017-10-04 23:04:42.890956809 +0200 >@@ -1,4 +1,4 @@ >---- service/ConnectionListener_unix.cpp >+--- service/ConnectionListener_unix.cpp.orig 2014-03-31 10:30:09 UTC > +++ service/ConnectionListener_unix.cpp > @@ -17,7 +17,7 @@ > #include "service/ConnectionListener.h" >diff -urN comms/telldus-core.old/files/patch-service-EventUpdateManager.cpp comms/telldus-core/files/patch-service-EventUpdateManager.cpp >--- comms/telldus-core.old/files/patch-service-EventUpdateManager.cpp 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/files/patch-service-EventUpdateManager.cpp 2017-10-04 23:04:42.892956519 +0200 >@@ -1,4 +1,4 @@ >---- service/EventUpdateManager.cpp >+--- service/EventUpdateManager.cpp.orig 2014-03-31 10:30:09 UTC > +++ service/EventUpdateManager.cpp > @@ -33,6 +33,10 @@ > #include "service/ConnectionListener.h" >diff -urN comms/telldus-core.old/files/patch-service-ProtocolNexa.cpp comms/telldus-core/files/patch-service-ProtocolNexa.cpp >--- comms/telldus-core.old/files/patch-service-ProtocolNexa.cpp 2016-04-04 21:00:23.000000000 +0200 >+++ comms/telldus-core/files/patch-service-ProtocolNexa.cpp 2017-10-04 23:04:42.894956383 +0200 >@@ -1,5 +1,5 @@ >---- service/ProtocolNexa.cpp.orig 2014-03-31 12:30:09.000000000 +0200 >-+++ service/ProtocolNexa.cpp 2016-04-04 13:32:35.124699000 +0200 >+--- service/ProtocolNexa.cpp.orig 2014-03-31 10:30:09 UTC >++++ service/ProtocolNexa.cpp > @@ -56,7 +56,7 @@ std::string ProtocolNexa::getStringForMe > // We also return the last packet so Device::doAction() doesn't > // report TELLSTICK_ERROR_METHOD_NOT_SUPPORTED >diff -urN comms/telldus-core.old/files/patch-service-Sensor.h comms/telldus-core/files/patch-service-Sensor.h >--- comms/telldus-core.old/files/patch-service-Sensor.h 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/files/patch-service-Sensor.h 2017-10-04 23:04:42.896956595 +0200 >@@ -1,4 +1,4 @@ >---- service/Sensor.h >+--- service/Sensor.h.orig 2014-03-31 10:30:09 UTC > +++ service/Sensor.h > @@ -8,6 +8,9 @@ > #define TELLDUS_CORE_SERVICE_SENSOR_H_ >diff -urN comms/telldus-core.old/files/patch-service-SettingsConfuse.cpp comms/telldus-core/files/patch-service-SettingsConfuse.cpp >--- comms/telldus-core.old/files/patch-service-SettingsConfuse.cpp 2017-01-18 22:34:42.000000000 +0100 >+++ comms/telldus-core/files/patch-service-SettingsConfuse.cpp 2017-10-04 23:04:42.897956571 +0200 >@@ -1,4 +1,4 @@ >---- service/SettingsConfuse.cpp >+--- service/SettingsConfuse.cpp.orig 2014-03-31 10:30:09 UTC > +++ service/SettingsConfuse.cpp > @@ -17,6 +17,8 @@ > >@@ -9,7 +9,7 @@ > 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); >@@ -22,7 +22,7 @@ > 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); >@@ -31,7 +31,7 @@ > 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); >diff -urN comms/telldus-core.old/files/patch-service-tellstick.conf comms/telldus-core/files/patch-service-tellstick.conf >--- comms/telldus-core.old/files/patch-service-tellstick.conf 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/files/patch-service-tellstick.conf 2017-10-04 23:04:42.899956360 +0200 >@@ -1,5 +1,5 @@ >---- service/tellstick.conf 2014-04-08 20:53:25.374751487 +0200 >-+++ service/tellstick.conf 2014-04-08 20:53:36.055838124 +0200 >+--- service/tellstick.conf.orig 2014-03-31 10:30:09 UTC >++++ service/tellstick.conf > @@ -1,5 +1,5 @@ > user = "nobody" > -group = "plugdev" >diff -urN comms/telldus-core.old/files/patch-tdadmin-CMakeLists.txt comms/telldus-core/files/patch-tdadmin-CMakeLists.txt >--- comms/telldus-core.old/files/patch-tdadmin-CMakeLists.txt 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/files/patch-tdadmin-CMakeLists.txt 2017-10-04 23:04:42.901956272 +0200 >@@ -1,4 +1,4 @@ >---- tdadmin/CMakeLists.txt >+--- tdadmin/CMakeLists.txt.orig 2014-03-31 10:30:09 UTC > +++ tdadmin/CMakeLists.txt > @@ -52,13 +52,13 @@ IF (UNIX) > WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} >diff -urN comms/telldus-core.old/files/patch-tdadmin-freebsd-devd-tellstick.conf comms/telldus-core/files/patch-tdadmin-freebsd-devd-tellstick.conf >--- comms/telldus-core.old/files/patch-tdadmin-freebsd-devd-tellstick.conf 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/files/patch-tdadmin-freebsd-devd-tellstick.conf 2017-10-31 21:28:54.125336854 +0100 >@@ -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]+"; >+--- tdadmin/freebsd-devd-tellstick.conf.orig 2017-10-31 21:00:00 UTC >++++ tdadmin/freebsd-devd-tellstick.conf >+@@ -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/ugen$port.$devaddr; chmod 660 /dev/ugen$port.$devaddr; >-+ @CMAKE_INSTALL_PREFIX@/sbin/tdadmin --pid $product --vid $vendor --serial $sernum controller connect"; >++ action "chgrp dialer /dev/$cdev; chmod 660 /dev/$cdev; @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 "/usr/local/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 "/usr/local/sbin/tdadmin --pid $product --vid $vendor --serial $sernum controller disconnect"; >++}; >diff -urN comms/telldus-core.old/files/patch-tdtool-CMakeLists.txt comms/telldus-core/files/patch-tdtool-CMakeLists.txt >--- comms/telldus-core.old/files/patch-tdtool-CMakeLists.txt 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/files/patch-tdtool-CMakeLists.txt 2017-10-04 23:04:42.904956347 +0200 >@@ -1,4 +1,4 @@ >---- tdtool/CMakeLists.txt >+--- tdtool/CMakeLists.txt.orig 2014-03-31 10:30:09 UTC > +++ tdtool/CMakeLists.txt > @@ -49,7 +49,7 @@ IF (UNIX) > WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} >diff -urN comms/telldus-core.old/files/pkg-message.in comms/telldus-core/files/pkg-message.in >--- comms/telldus-core.old/files/pkg-message.in 1970-01-01 01:00:00.000000000 +0100 >+++ comms/telldus-core/files/pkg-message.in 2017-10-05 07:35:57.641031040 +0200 >@@ -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. >+ >diff -urN comms/telldus-core.old/pkg-message comms/telldus-core/pkg-message >--- comms/telldus-core.old/pkg-message 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/pkg-message 1970-01-01 01:00:00.000000000 +0100 >@@ -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. >- >diff -urN comms/telldus-core.old/pkg-plist comms/telldus-core/pkg-plist >--- comms/telldus-core.old/pkg-plist 2014-08-15 16:43:47.000000000 +0200 >+++ comms/telldus-core/pkg-plist 2017-10-05 09:22:28.442872875 +0200 >@@ -1,13 +1,13 @@ >-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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
johan
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 222790
:
186916
|
186917
| 187625