aboutsummaryrefslogtreecommitdiff
path: root/multimedia/motion/files
diff options
context:
space:
mode:
authorJason E. Hale <jhale@FreeBSD.org>2017-01-30 00:09:53 +0000
committerJason E. Hale <jhale@FreeBSD.org>2017-01-30 00:09:53 +0000
commit0a3f2e2222a1f3f28b8e9f43e6c615b8e5fb4f49 (patch)
tree31354005dc9a684d4b8fe92ff6f71c0051902aba /multimedia/motion/files
parentf421b382a20e51a4e04f5bddc880cff5df5dbe4f (diff)
downloadports-0a3f2e2222a1f3f28b8e9f43e6c615b8e5fb4f49.tar.gz
ports-0a3f2e2222a1f3f28b8e9f43e6c615b8e5fb4f49.zip
- Fix an issue where netcams were not connecting [1]
- When motion was updated to 4.x, it was overlooked that the default search path for the configuration files was changed. This was causing existing configurations to not be read. Fix the port to install default configuration in correct location and add an UPDATING message giving users the proper instructions on where to place their existing conf files. [2] - Create an empty ${ETCDIR}/conf.d directory that can optionally be used to dump camera configs in instead of creating separate lines for each one in motion.conf - Add some missing PORTDOCS and install with the correct mode - Make the VIDEO options OPTIONS_RADIO instead of OPTIONS_SINGLE to allow for netcam only support (suggested in [2]) - Fix bad logic in configure.ac that was causing V4L to not be dectected when the PWCBSD option was enabled PR: 216189 [1] Reported by: Charles P <charlespigott@googlemail.com> Patched by: <anthony@ury.org.uk> Obtained from: upstream PR: 216466 [2] Reported by: <bakhur@inbox.ru>, tdb@ Pointy hat to: jhale MFH: 2017Q1 (blanket)
Notes
Notes: svn path=/head/; revision=432815
Diffstat (limited to 'multimedia/motion/files')
-rw-r--r--multimedia/motion/files/motion.in2
-rw-r--r--multimedia/motion/files/patch-configure.ac2
-rw-r--r--multimedia/motion/files/patch-netcam.c50
-rw-r--r--multimedia/motion/files/pkg-message.in2
4 files changed, 50 insertions, 6 deletions
diff --git a/multimedia/motion/files/motion.in b/multimedia/motion/files/motion.in
index 84288a5fb0c3..b556007fc39b 100644
--- a/multimedia/motion/files/motion.in
+++ b/multimedia/motion/files/motion.in
@@ -21,6 +21,6 @@ load_rc_config $name
command=%%PREFIX%%/bin/${name}
pidfile="/var/run/${name}.pid"
-required_files=%%PREFIX%%/etc/${name}.conf
+required_files=%%ETCDIR%%/${name}.conf
run_rc_command "$1"
diff --git a/multimedia/motion/files/patch-configure.ac b/multimedia/motion/files/patch-configure.ac
index 3f410068b73d..5b912fefb47a 100644
--- a/multimedia/motion/files/patch-configure.ac
+++ b/multimedia/motion/files/patch-configure.ac
@@ -5,7 +5,7 @@
AC_MSG_CHECKING(for V42L support)
AC_MSG_RESULT(skipping)
-else
-+elif test "${BKTR}" = "no"; then
++elif test "${PWCBSD}" = "yes"; then
AC_CHECK_TYPE([struct v4l2_buffer],
[SUPPORTED_V4L2=true],
[SUPPORTED_V4L2=false],
diff --git a/multimedia/motion/files/patch-netcam.c b/multimedia/motion/files/patch-netcam.c
index 6ef89148a628..017c09692cad 100644
--- a/multimedia/motion/files/patch-netcam.c
+++ b/multimedia/motion/files/patch-netcam.c
@@ -1,13 +1,57 @@
-Fix sockaddr type mismatch warnings (Fixed upstream in dbd7282)
+Fix netcam getaddrinfo/connect usage (Fixed upstream in be2328a)
--- netcam.c.orig 2016-10-25 01:39:24 UTC
+++ netcam.c
-@@ -948,7 +948,7 @@ static int netcam_connect(netcam_context
+@@ -840,8 +840,7 @@ static void netcam_disconnect(netcam_con
+ */
+ static int netcam_connect(netcam_context_ptr netcam, int err_flag)
+ {
+- struct sockaddr_in6 server; /* For connect */
+- struct addrinfo *ai; /* For getaddrinfo */
++ struct addrinfo *ai;
+ int ret;
+ int saveflags;
+ int back_err;
+@@ -851,8 +850,11 @@ static int netcam_connect(netcam_context
+ fd_set fd_w;
+ struct timeval selecttime;
+
++ char port[15];
++ sprintf(port,"%u",netcam->connect_port);
++
+ /* Lookup the hostname given in the netcam URL. */
+- if ((ret = getaddrinfo(netcam->connect_host, NULL, NULL, &ai)) != 0) {
++ if ((ret = getaddrinfo(netcam->connect_host, port, NULL, &ai)) != 0) {
+ if (!err_flag)
+ MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO, "%s: getaddrinfo() failed (%s): %s",
+ netcam->connect_host, gai_strerror(ret));
+@@ -920,16 +922,6 @@ static int netcam_connect(netcam_context
+ netcam->sock);
+
+ /*
+- * Fill the hostname details into the 'server' structure and
+- * attempt to connect to the remote server.
+- */
+- memset(&server, 0, sizeof(server));
+- memcpy(&server, ai->ai_addr, sizeof(server));
+- server.sin6_family = ai->ai_family;
+- server.sin6_port = htons(netcam->connect_port);
+- freeaddrinfo(ai);
+-
+- /*
+ * We set the socket non-blocking and then use a 'select'
+ * system call to control the timeout.
+ */
+@@ -948,9 +940,11 @@ static int netcam_connect(netcam_context
}
/* Now the connect call will return immediately. */
- ret = connect(netcam->sock, &server, sizeof(server));
-+ ret = connect(netcam->sock, (struct sockaddr *)&server, sizeof(server));
++ ret = connect(netcam->sock, ai->ai_addr, ai->ai_addrlen);
back_err = errno; /* Save the errno from connect */
++ freeaddrinfo(ai);
++
/* If the connect failed with anything except EINPROGRESS, error. */
+ if ((ret < 0) && (back_err != EINPROGRESS)) {
+ if (!err_flag)
diff --git a/multimedia/motion/files/pkg-message.in b/multimedia/motion/files/pkg-message.in
index ef83fc9e8a6a..8d9fceba10f8 100644
--- a/multimedia/motion/files/pkg-message.in
+++ b/multimedia/motion/files/pkg-message.in
@@ -1,7 +1,7 @@
****************************************************************
To use the motion service properly, you should edit
- %%PREFIX%%/etc/motion.conf
+ %%ETCDIR%%/motion.conf
according to your needs.