FreeBSD Bugzilla – Attachment 206469 Details for
Bug 239796
[NEW PORT] comms/ebusd: ebusd is a daemon for handling communication with eBUS device connected to a 2-wire bus system
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
New port: comms/ebusd
ebusd.shar (text/plain), 8.71 KB, created by
Oleksii Samorukov
on 2019-08-12 10:05:59 UTC
(
hide
)
Description:
New port: comms/ebusd
Filename:
MIME Type:
Creator:
Oleksii Samorukov
Created:
2019-08-12 10:05:59 UTC
Size:
8.71 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># ebusd ># ebusd/distinfo ># ebusd/pkg-descr ># ebusd/Makefile ># ebusd/pkg-plist ># ebusd/files ># ebusd/files/patch-src_lib_utils_tcpsocket.h ># ebusd/files/patch-configure.ac ># ebusd/files/ebusd.in ># ebusd/files/patch-src_lib_ebus_device.h ># ebusd/files/patch-src_lib_ebus_device.cpp ># ebusd/pkg-message ># >echo c - ebusd >mkdir -p ebusd > /dev/null 2>&1 >echo x - ebusd/distinfo >sed 's/^X//' >ebusd/distinfo << '9b24404a944566481ce7a235889c5d73' >XTIMESTAMP = 1565559816 >XSHA256 (john30-ebusd-3.3-v3.3_GH0.tar.gz) = 48669140cfafbe060c765b4530018b30f07e1b074dbce00b205a8f2a22dee573 >XSIZE (john30-ebusd-3.3-v3.3_GH0.tar.gz) = 696172 >9b24404a944566481ce7a235889c5d73 >echo x - ebusd/pkg-descr >sed 's/^X//' >ebusd/pkg-descr << '53a63830d7317e82b158cfd123d279df' >Xebusd is a daemon for handling communication with eBUS devices connected to a >X2-wire bus system ("energy bus" used by numerous heating systems). >X >XIt is known to run fine on regular PC hardware as well as on smaller devices >Xlike Fritzbox and Raspberry Pi. In order to use it, a hardware interface is >Xnecessary. >X >XWWW: https://github.com/john30/ebusd/wiki >53a63830d7317e82b158cfd123d279df >echo x - ebusd/Makefile >sed 's/^X//' >ebusd/Makefile << '37045d499f97fa1cb59663a9b0993e42' >X# $FreeBSD$ >X >XPORTNAME= ebusd >XPORTVERSION= 3.3 >XCATEGORIES= comms >X >XMAINTAINER= samm@os2.kiev.ua >XCOMMENT= Daemon for communication with eBUS heating systems >X >XLICENSE= GPLv3 >XLICENSE_FILE= ${WRKSRC}/LICENSE >X >XLIB_DEPENDS= libargp.so:devel/argp-standalone >X >XUSES= autoreconf >X >XOPTIONS_DEFINE= MQTT >XOPTIONS_DEFAULT=MQTT >XMQTT_DESC= MQTT protocol support >X >XUSE_GITHUB= yes >XGH_ACCOUNT= john30 >XGH_TAGNAME= v${PORTVERSION} >X >XUSE_RC_SUBR= ebusd >X >XUSERS= ebusd >XGROUPS= ebusd >X >XLDFLAGS+= -L${LOCALBASE}/lib >XLOGDIR= /var/log/${PORTNAME} >XRUNDIR= /var/run/${PORTNAME} >XCPPFLAGS+= -I${LOCALBASE}/include >XGNU_CONFIGURE= yes >X >XPLIST_SUB= USER=${USERS} GROUP=${GROUPS} \ >X LOGDIR=${LOGDIR} \ >X RUNDIR=${RUNDIR} >X >XMQTT_CONFIGURE_WITH= mqtt >XMQTT_LIB_DEPENDS= libmosquitto.so:net/mosquitto >XMQTT_VARS= LIBS+=-lmosquitto >X >Xpost-install: >X ${MKDIR} ${STAGEDIR}${LOGDIR} >X ${MKDIR} ${STAGEDIR}${RUNDIR} >X >X.include <bsd.port.mk> >37045d499f97fa1cb59663a9b0993e42 >echo x - ebusd/pkg-plist >sed 's/^X//' >ebusd/pkg-plist << 'e96b626b74ca085993f6c224350fe98a' >Xbin/ebusd >Xbin/ebusctl >Xbin/ebusfeed >X@dir(%%USER%%,%%GROUP%%,750) %%RUNDIR%% >X@dir(%%USER%%,%%GROUP%%,750) %%LOGDIR%% >e96b626b74ca085993f6c224350fe98a >echo c - ebusd/files >mkdir -p ebusd/files > /dev/null 2>&1 >echo x - ebusd/files/patch-src_lib_utils_tcpsocket.h >sed 's/^X//' >ebusd/files/patch-src_lib_utils_tcpsocket.h << '0aa23b24fda73caf26c899846d7ce63e' >X--- src/lib/utils/tcpsocket.h.orig 2018-12-26 15:38:15 UTC >X+++ src/lib/utils/tcpsocket.h >X@@ -21,6 +21,7 @@ >X >X #include <unistd.h> >X #include <sys/socket.h> >X+#include <netinet/in.h> >X #include <sys/time.h> >X #include <stdint.h> >X #include <string> >0aa23b24fda73caf26c899846d7ce63e >echo x - ebusd/files/patch-configure.ac >sed 's/^X//' >ebusd/files/patch-configure.ac << '6df1de720e557e2dbece52188eec3612' >X--- configure.ac.orig 2018-12-26 15:38:15 UTC >X+++ configure.ac >X@@ -36,6 +36,7 @@ AC_SUBST(EXTRA_LIBS) >X AC_CHECK_FUNC([pselect], [AC_DEFINE(HAVE_PSELECT, [1], [Defined if pselect() is available.])]) >X AC_CHECK_FUNC([ppoll], [AC_DEFINE(HAVE_PPOLL, [1], [Defined if ppoll() is available.])]) >X AC_CHECK_HEADER([linux/serial.h], [AC_DEFINE(HAVE_LINUX_SERIAL, [1], [Defined if linux/serial.h is available.])]) >X+AC_CHECK_HEADER([dev/usb/uftdiio.h], [AC_DEFINE(HAVE_FREEBSD_UFTDI, [1], [Defined if dev/usb/uftdiio.h is available.])]) >X >X AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable code coverage tracking]), [CXXFLAGS+=" -coverage -O0"], []) >X AC_ARG_WITH(contrib, AS_HELP_STRING([--without-contrib], [disable inclusion of contributed sources]), [], [with_contrib=yes]) >X@@ -118,7 +119,7 @@ AM_COND_IF([CONTRIB], [AC_CONFIG_FILES([ >X ])]) >X >X AC_DEFINE_UNQUOTED(PACKAGE_PIDFILE, LOCALSTATEDIR "/run/" PACKAGE ".pid", [The path and name of the PID file.]) >X-AC_DEFINE_UNQUOTED(PACKAGE_LOGFILE, LOCALSTATEDIR "/log/" PACKAGE ".log", [The path and name of the log file.]) >X+AC_DEFINE_UNQUOTED(PACKAGE_LOGFILE, LOCALSTATEDIR "/log/" PACKAGE "/" PACKAGE ".log", [The path and name of the log file.]) >X AC_DEFINE(SCAN_VERSION, "[m4_esyscmd_s([sed -e 's#^\([0-9]*\.[0-9]*\).*#\1#' -e 's#\.\([0-9]\)$#0\1#' -e 's#\.##' VERSION])]", [The version of the package formatted for the scan result.]) >X AC_DEFINE(REVISION, "[m4_esyscmd_s([git describe --always 2>/dev/null || (date +p%Y%m%d)])]", [The revision of the package.]) >X >6df1de720e557e2dbece52188eec3612 >echo x - ebusd/files/ebusd.in >sed 's/^X//' >ebusd/files/ebusd.in << 'ab585511a607147340a98d2997638499' >X# PROVIDE: ebusd >X# REQUIRE: LOGIN cleanvar >X# KEYWORD: shutdown >X >X# >X# Add the following lines to /etc/rc.conf to enable ebusd: >X# >X#ebusd_enable (bool): set to "YES" to start domotics at boot >X#ebusd_user (str): Default to ebusd, user for starting ebusd >X#ebusd_group (str): Default to ebusd, group for stating ebusd >X#ebusd_pidfile (str): Custum PID file path and name >X# Default to "/var/run/ebusd/${hostname}.pid". >X#ebusd_args (str): Custom additional arguments to be passed >X# Default to "-d /dev/ttyU0 --scanconfig --localhost" >X >X. /etc/rc.subr >X >Xname="ebusd" >Xrcvar="ebusd_enable" >X >Xload_rc_config $name >X >X: ${ebusd_user:=ebusd} >X: ${ebusd_group:=ebusd} >X: ${ebusd_enable:=NO} >X: ${ebusd_args:="-d /dev/ttyU0 --scanconfig --localhost"} >X >Xpidfile=${ebusd_pidfile:-"/var/run/ebusd/${hostname}.pid"} >X >Xcommand="%%PREFIX%%/bin/ebusd" >Xcommand_args="--pidfile ${pidfile} ${ebusd_args}" >X >Xrun_rc_command "$1" >ab585511a607147340a98d2997638499 >echo x - ebusd/files/patch-src_lib_ebus_device.h >sed 's/^X//' >ebusd/files/patch-src_lib_ebus_device.h << 'c6afb3a0b1babdcc9d9a2715d6fdd37c' >X--- src/lib/ebus/device.h.orig 2018-12-26 15:38:15 UTC >X+++ src/lib/ebus/device.h >X@@ -22,6 +22,7 @@ >X #include <unistd.h> >X #include <termios.h> >X #include <arpa/inet.h> >X+#include <netinet/in.h> >X #include <netdb.h> >X #include <iostream> >X #include <fstream> >c6afb3a0b1babdcc9d9a2715d6fdd37c >echo x - ebusd/files/patch-src_lib_ebus_device.cpp >sed 's/^X//' >ebusd/files/patch-src_lib_ebus_device.cpp << 'c068fd0c3ba1f3250c595cb7932b4d89' >X--- src/lib/ebus/device.cpp.orig 2018-12-26 15:38:15 UTC >X+++ src/lib/ebus/device.cpp >X@@ -30,6 +30,9 @@ >X #ifdef HAVE_LINUX_SERIAL >X # include <linux/serial.h> >X #endif >X+#ifdef HAVE_FREEBSD_UFTDI >X+# include <dev/usb/uftdiio.h> >X+#endif >X #include <errno.h> >X #ifdef HAVE_PPOLL >X # include <poll.h> >X@@ -192,7 +195,7 @@ result_t SerialDevice::open() { >X struct termios newSettings; >X >X // open file descriptor >X- m_fd = ::open(m_name, O_RDWR | O_NOCTTY); >X+ m_fd = ::open(m_name, O_RDWR | O_NOCTTY | O_NDELAY); >X >X if (m_fd < 0) { >X return RESULT_ERR_NOTFOUND; >X@@ -215,13 +218,24 @@ result_t SerialDevice::open() { >X } >X #endif >X >X+#ifdef HAVE_FREEBSD_UFTDI >X+ int param = 0; >X+ // flush tx/rx and set low latency on uftdi device >X+ if (ioctl(m_fd, UFTDIIOC_GET_LATENCY, ¶m) == 0) { >X+ ioctl(m_fd, UFTDIIOC_RESET_IO, ¶m); >X+ param = 1; >X+ ioctl(m_fd, UFTDIIOC_SET_LATENCY, ¶m); >X+ } >X+#endif >X+ >X // save current settings >X tcgetattr(m_fd, &m_oldSettings); >X >X // create new settings >X memset(&newSettings, 0, sizeof(newSettings)); >X >X- newSettings.c_cflag |= (B2400 | CS8 | CLOCAL | CREAD); >X+ cfsetspeed(&newSettings, B2400); >X+ newSettings.c_cflag |= (CS8 | CLOCAL | CREAD); >X newSettings.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); // non-canonical mode >X newSettings.c_iflag |= IGNPAR; // ignore parity errors >X newSettings.c_oflag &= ~OPOST; >X@@ -234,7 +248,10 @@ result_t SerialDevice::open() { >X tcflush(m_fd, TCIFLUSH); >X >X // activate new settings of serial device >X- tcsetattr(m_fd, TCSAFLUSH, &newSettings); >X+ if (tcsetattr(m_fd, TCSAFLUSH, &newSettings)) { >X+ close(); >X+ return RESULT_ERR_DEVICE; >X+ } >X >X // set serial device into blocking mode >X fcntl(m_fd, F_SETFL, fcntl(m_fd, F_GETFL) & ~O_NONBLOCK); >c068fd0c3ba1f3250c595cb7932b4d89 >echo x - ebusd/pkg-message >sed 's/^X//' >ebusd/pkg-message << '820d2a2ecff7d8b4c1994e6e6fc5f445' >XTo start ebusd as a daemon during startup, add >X >X ebusd_enable="YES" >X >Xto your /etc/rc.conf. >X >XExtra options can be found in startup script. >X >XTo be able to access serial port from the ebusd daemon, you might want to >Xadd the following line: >X >X add path 'ttyU0' mode 0660 group ebusd >X >Xto your local devfs.rules(5) configuration. >820d2a2ecff7d8b4c1994e6e6fc5f445 >exit >
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 Raw
Actions:
View
Attachments on
bug 239796
:
206468
|
206469
|
206473
|
207814
|
207815
|
207843
|
207845
|
207846
|
207847