Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Nov 2017 07:55:34 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r453267 - in head/comms/telldus-core: . files
Message-ID:  <201711010755.vA17tYAC084639@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky (src committer)
Date: Wed Nov  1 07:55:34 2017
New Revision: 453267
URL: https://svnweb.freebsd.org/changeset/ports/453267

Log:
  Update devd rules and various build cleanup.
  Added support for Tellstick Duo.
  
  Approved by:	maintainer (Johan Strom, johan@stromnet.se)
  Tested by:	hselasky @
  PR:		222790

Added:
  head/comms/telldus-core/files/pkg-message.in   (contents, props changed)
Deleted:
  head/comms/telldus-core/pkg-message
Modified:
  head/comms/telldus-core/Makefile
  head/comms/telldus-core/files/patch-CMakeLists.txt
  head/comms/telldus-core/files/patch-common-Socket_unix.cpp
  head/comms/telldus-core/files/patch-service-SettingsConfuse.cpp
  head/comms/telldus-core/files/patch-tdadmin-freebsd-devd-tellstick.conf
  head/comms/telldus-core/pkg-plist

Modified: head/comms/telldus-core/Makefile
==============================================================================
--- head/comms/telldus-core/Makefile	Wed Nov  1 07:44:24 2017	(r453266)
+++ head/comms/telldus-core/Makefile	Wed Nov  1 07:55:34 2017	(r453267)
@@ -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 @@ LIB_DEPENDS=	libftdi.so:devel/libftdi \
 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 @@ USE_RC_SUBR=	telldusd
 USER=		nobody
 GROUP=		dialer
 
+SUB_FILES=	pkg-message
+
 .include <bsd.port.pre.mk>
 
 post-patch:
@@ -44,6 +48,9 @@ post-patch:
 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>

Modified: head/comms/telldus-core/files/patch-CMakeLists.txt
==============================================================================
--- head/comms/telldus-core/files/patch-CMakeLists.txt	Wed Nov  1 07:44:24 2017	(r453266)
+++ head/comms/telldus-core/files/patch-CMakeLists.txt	Wed Nov  1 07:55:34 2017	(r453267)
@@ -1,6 +1,6 @@
 --- 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")
  
@@ -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}

Modified: head/comms/telldus-core/files/patch-common-Socket_unix.cpp
==============================================================================
--- head/comms/telldus-core/files/patch-common-Socket_unix.cpp	Wed Nov  1 07:44:24 2017	(r453266)
+++ head/comms/telldus-core/files/patch-common-Socket_unix.cpp	Wed Nov  1 07:55:34 2017	(r453267)
@@ -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);

Modified: head/comms/telldus-core/files/patch-service-SettingsConfuse.cpp
==============================================================================
--- head/comms/telldus-core/files/patch-service-SettingsConfuse.cpp	Wed Nov  1 07:44:24 2017	(r453266)
+++ head/comms/telldus-core/files/patch-service-SettingsConfuse.cpp	Wed Nov  1 07:55:34 2017	(r453267)
@@ -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);

Modified: head/comms/telldus-core/files/patch-tdadmin-freebsd-devd-tellstick.conf
==============================================================================
--- head/comms/telldus-core/files/patch-tdadmin-freebsd-devd-tellstick.conf	Wed Nov  1 07:44:24 2017	(r453266)
+++ head/comms/telldus-core/files/patch-tdadmin-freebsd-devd-tellstick.conf	Wed Nov  1 07:55:34 2017	(r453267)
@@ -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";
++};

Added: head/comms/telldus-core/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/comms/telldus-core/files/pkg-message.in	Wed Nov  1 07:55:34 2017	(r453267)
@@ -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.
+

Modified: head/comms/telldus-core/pkg-plist
==============================================================================
--- head/comms/telldus-core/pkg-plist	Wed Nov  1 07:44:24 2017	(r453266)
+++ head/comms/telldus-core/pkg-plist	Wed Nov  1 07:55:34 2017	(r453267)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711010755.vA17tYAC084639>