aboutsummaryrefslogtreecommitdiff
path: root/multimedia/motion
diff options
context:
space:
mode:
authorJason E. Hale <jhale@FreeBSD.org>2016-12-16 23:40:47 +0000
committerJason E. Hale <jhale@FreeBSD.org>2016-12-16 23:40:47 +0000
commitcce364bb5bda3fdac1299cdeb1915693a7755e72 (patch)
tree7cb3e6ba0fd2c082bf6f89bc7ca39f1eb4ddb004 /multimedia/motion
parent5020966c3bbc5e4fd5d7fbf3590646ce15991316 (diff)
downloadports-cce364bb5bda3fdac1299cdeb1915693a7755e72.tar.gz
ports-cce364bb5bda3fdac1299cdeb1915693a7755e72.zip
Update to 4.0.1
Project has moved to Github and is under active development Add support for Sqlite 3 database Convert to options helpers Move 3 line pkg-plist into the Makefile
Notes
Notes: svn path=/head/; revision=428697
Diffstat (limited to 'multimedia/motion')
-rw-r--r--multimedia/motion/Makefile125
-rw-r--r--multimedia/motion/distinfo5
-rw-r--r--multimedia/motion/files/patch-conf.c254
-rw-r--r--multimedia/motion/files/patch-configure.ac11
-rw-r--r--multimedia/motion/files/patch-configure.in78
-rw-r--r--multimedia/motion/files/patch-netcam.c13
-rw-r--r--multimedia/motion/files/patch-track.c50
-rw-r--r--multimedia/motion/files/patch-video__freebsd.c20
-rw-r--r--multimedia/motion/files/patch-webhttpd.c45
-rw-r--r--multimedia/motion/files/pkg-message.in26
-rw-r--r--multimedia/motion/pkg-descr2
-rw-r--r--multimedia/motion/pkg-plist3
12 files changed, 480 insertions, 152 deletions
diff --git a/multimedia/motion/Makefile b/multimedia/motion/Makefile
index 06d1575147ff..017db3d9dac2 100644
--- a/multimedia/motion/Makefile
+++ b/multimedia/motion/Makefile
@@ -2,110 +2,99 @@
# $FreeBSD$
PORTNAME= motion
-PORTVERSION= 3.2.12
-PORTREVISION= 5
+PORTVERSION= 4.0.1
+DISTVERSIONPREFIX= release-
CATEGORIES= multimedia
-MASTER_SITES= SF/${PORTNAME}/${PORTNAME}%20-%20${PORTVERSION:R}/${PORTVERSION}
MAINTAINER= ports@FreeBSD.org
COMMENT= Motion detection application
-LICENSE= GPLv2
+LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/COPYING
-OPTIONS_DEFINE= FFMPEG MYSQL PGSQL DOCS EXAMPLES
-OPTIONS_SINGLE= VIDEO
-OPTIONS_SINGLE_VIDEO= BKTR PWCBSD
-OPTIONS_DEFAULT= BKTR FFMPEG
-VIDEO_DESC= Video capture driver. Choose one of BKTR or PWCBSD
-BKTR_DESC= BKTR based TV capture cards
-PWCBSD_DESC= PWCBSD based Webcams
+USE_GITHUB= yes
+GH_ACCOUNT= Motion-Project
-USES= autoreconf gmake jpeg
+USES= autoreconf gmake jpeg localbase pkgconfig
GNU_CONFIGURE= yes
+CONFIGURE_ARGS= --without-linuxthreads \
+ --without-jpeg-mmx
+
+KMODDIR?= /boot/modules
+.if ${KMODDIR} == /boot/kernel
+KMODDIR= /boot/modules
+.endif
USE_RC_SUBR= ${PORTNAME}
SUB_FILES= pkg-message
-CPPFLAGS+= -I${LOCALBASE}/include
-LDFLAGS+= -L${LOCALBASE}/lib
-
-PORTDOCS= CHANGELOG CREDITS README README.FreeBSD \
+PLIST_FILES= bin/motion \
+ man/man1/motion.1.gz \
+ "@sample etc/motion.conf.sample"
+PORTDOCS= CHANGELOG CREDITS README.md README.FreeBSD \
motion_guide.html
-PORTEXAMPLES= motion-dist.conf thread1.conf thread2.conf \
- thread3.conf thread4.conf
+PORTEXAMPLES= camera1-dist.conf camera2-dist.conf \
+ camera3-dist.conf camera4-dist.conf
-.include <bsd.port.options.mk>
+OPTIONS_DEFINE= DOCS EXAMPLES FFMPEG MYSQL PGSQL SQLITE3
+OPTIONS_SINGLE= VIDEO
+OPTIONS_SINGLE_VIDEO= BKTR PWCBSD
+OPTIONS_DEFAULT= BKTR FFMPEG
+VIDEO_DESC= Video capture driver
-.if ${PORT_OPTIONS:MBKTR}
-CONFIGURE_ARGS+=--with-bktr
-.else
-CONFIGURE_ARGS+=--without-bktr
-.endif
+BKTR_DESC= BKTR based TV capture cards
+BKTR_CONFIGURE_WITH= bktr
-.if ${PORT_OPTIONS:MPWCBSD}
-# Location /boot/modules is hard coded in the pwc port, so use it here too
-KMODDIR= /boot/modules
-BUILD_DEPENDS+= v4l_compat>=1.0.20060801:multimedia/v4l_compat
-RUN_DEPENDS+= ${KMODDIR}/pwc.ko:multimedia/pwcbsd
-CONFIGURE_ARGS+=--with-pwcbsd
-.else
-CONFIGURE_ARGS+=--without-pwcbsd
-.endif
+PWCBSD_DESC= PWCBSD based Webcams
+PWCBSD_BUILD_DEPENDS= v4l_compat>=1.0.20060801:multimedia/v4l_compat
+PWCBSD_RUN_DEPENDS= ${KMODDIR}/pwc.ko:multimedia/pwcbsd
+PWCBSD_CONFIGURE_WITH= pwcbsd
-CONFIGURE_ARGS+=--without-linuxthreads
+FFMPEG_LIB_DEPENDS= libavformat.so:multimedia/ffmpeg
+FFMPEG_CONFIGURE_ON= --with-ffmpeg=${LOCALBASE}
+FFMPEG_CONFIGURE_OFF= --without-ffmpeg
-.if ${PORT_OPTIONS:MFFMPEG}
-LIB_DEPENDS+= libavformat0.so:multimedia/ffmpeg0
-CONFIGURE_ARGS+=--with-ffmpeg=${LOCALBASE}
-.else
-CONFIGURE_ARGS+=--without-ffmpeg
-.endif
+MYSQL_USES= mysql
+MYSQL_CONFIGURE_ON= --with-mysql-lib=${LOCALBASE}/lib/mysql \
+ --with-mysql-include=${LOCALBASE}/include/mysql
+MYSQL_CONFIGURE_OFF= --without-mysql
-.if ${PORT_OPTIONS:MMYSQL}
-USE_MYSQL= yes
-CONFIGURE_ARGS+=--with-mysql-lib=${LOCALBASE}/lib/mysql \
- --with-mysql-include=${LOCALBASE}/include/mysql
-.else
-CONFIGURE_ARGS+=--without-mysql
-.endif
+PGSQL_USES= pgsql
+PGSQL_CONFIGURE_ON= --with-pgsql-lib=${LOCALBASE}/lib \
+ --with-pgsql-include=${LOCALBASE}/include
+PGSQL_CONFIGURE_OFF= --without-pgsql
-.if ${PORT_OPTIONS:MPGSQL}
-USES+= pgsql
-CONFIGURE_ARGS+=--with-pgsql-lib=${LOCALBASE}/lib \
- --with-pgsql-include=${LOCALBASE}/include
-.else
-CONFIGURE_ARGS+=--without-pgsql
-.endif
+SQLITE3_USES= sqlite:3
+SQLITE3_CONFIGURE_WITH= sqlite3
.include <bsd.port.pre.mk>
+.if ${JPEG_PORT} == "graphics/jpeg-turbo"
+CONFIGURE_ARGS+= --with-jpeg-turbo=${LOCALBASE}
+.endif
+
post-patch:
@${REINPLACE_CMD} -e \
- 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/configure.in
-# Resolve name collision with jpeg-8
- @${REINPLACE_CMD} -e \
- 's|jpeg_mem_dest|local_jpeg_mem_dest|' ${WRKSRC}/picture.c
+ 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/configure.ac
# Fix pidfile path
@${REINPLACE_CMD} -e \
's|/run/motion|/run|' ${WRKSRC}/motion-dist.conf.in
+# Fix warnings about mismatched format specifiers (Fixed upstream in dbd7282)
+ @${REINPLACE_CMD} -e \
+ 's|%hd|%d|g;s|%hu|%u|g;s|%Zu|%zu|g' ${WRKSRC}/webhttpd.c ${WRKSRC}/stream.c
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/motion ${STAGEDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/motion.1 ${STAGEDIR}${MANPREFIX}/man/man1
${INSTALL_DATA} ${WRKSRC}/motion-dist.conf \
${STAGEDIR}${PREFIX}/etc/motion.conf.sample
-.if ${PORT_OPTIONS:MDOCS}
+
+do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
-.for f in ${PORTDOCS}
- ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}
-.endfor
-.endif
-.if ${PORT_OPTIONS:MEXAMPLES}
+ ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
+
+do-install-EXAMPLES-on:
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
-.for f in ${PORTEXAMPLES}
- ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${EXAMPLESDIR}
-.endfor
-.endif
+ ${INSTALL_DATA} ${PORTEXAMPLES:S|^|${WRKSRC}/|} ${STAGEDIR}${EXAMPLESDIR}
.include <bsd.port.post.mk>
diff --git a/multimedia/motion/distinfo b/multimedia/motion/distinfo
index 3eae335f198f..abe6c1400847 100644
--- a/multimedia/motion/distinfo
+++ b/multimedia/motion/distinfo
@@ -1,2 +1,3 @@
-SHA256 (motion-3.2.12.tar.gz) = a597f8d7ec0bf3c5fb62722c4eead59717fe01c2ae0d256c642027cea74b2f0a
-SIZE (motion-3.2.12.tar.gz) = 425729
+TIMESTAMP = 1481857527
+SHA256 (Motion-Project-motion-release-4.0.1_GH0.tar.gz) = 2f67669a09ce0481ecd987028dae1c5cb135dfdc3c254c06ab7c9ca0c6c183f0
+SIZE (Motion-Project-motion-release-4.0.1_GH0.tar.gz) = 444779
diff --git a/multimedia/motion/files/patch-conf.c b/multimedia/motion/files/patch-conf.c
new file mode 100644
index 000000000000..35246ed670fc
--- /dev/null
+++ b/multimedia/motion/files/patch-conf.c
@@ -0,0 +1,254 @@
+Convert old GNU field designator syntax to C99 syntax to remove some
+annoying warnings. Fixed upstream in a870946, mostly.
+
+--- conf.c.orig 2016-10-25 01:39:24 UTC
++++ conf.c
+@@ -49,131 +49,131 @@ char *get_current_dir_name(void)
+ #define stripnewline(x) {if ((x)[strlen(x)-1]=='\n') (x)[strlen(x) - 1] = 0; }
+
+ struct config conf_template = {
+- camera_name: NULL,
+- width: DEF_WIDTH,
+- height: DEF_HEIGHT,
+- quality: DEF_QUALITY,
+- camera_id: 0,
+- rotate_deg: 0,
+- max_changes: DEF_CHANGES,
+- threshold_tune: 0,
+- output_pictures: "on",
+- motion_img: 0,
+- emulate_motion: 0,
+- event_gap: DEF_EVENT_GAP,
+- max_movie_time: DEF_MAXMOVIETIME,
+- snapshot_interval: 0,
+- locate_motion_mode: "off",
+- locate_motion_style: "box",
+- input: IN_DEFAULT,
+- norm: 0,
+- frame_limit: DEF_MAXFRAMERATE,
+- quiet: 1,
+- picture_type: "jpeg",
+- noise: DEF_NOISELEVEL,
+- noise_tune: 1,
+- minimum_frame_time: 0,
+- lightswitch: 0,
+- autobright: 0,
+- brightness: 0,
+- contrast: 0,
+- saturation: 0,
+- hue: 0,
+- power_line_frequency: -1,
+- roundrobin_frames: 1,
+- roundrobin_skip: 1,
+- pre_capture: 0,
+- post_capture: 0,
+- switchfilter: 0,
+- ffmpeg_output: 0,
+- extpipe: NULL,
+- useextpipe: 0,
+- ffmpeg_output_debug: 0,
+- ffmpeg_bps: DEF_FFMPEG_BPS,
+- ffmpeg_vbr: DEF_FFMPEG_VBR,
+- ffmpeg_video_codec: DEF_FFMPEG_CODEC,
++ .camera_name = NULL,
++ .width = DEF_WIDTH,
++ .height = DEF_HEIGHT,
++ .quality = DEF_QUALITY,
++ .camera_id = 0,
++ .rotate_deg = 0,
++ .max_changes = DEF_CHANGES,
++ .threshold_tune = 0,
++ .output_pictures = "on",
++ .motion_img = 0,
++ .emulate_motion = 0,
++ .event_gap = DEF_EVENT_GAP,
++ .max_movie_time = DEF_MAXMOVIETIME,
++ .snapshot_interval = 0,
++ .locate_motion_mode = "off",
++ .locate_motion_style = "box",
++ .input = IN_DEFAULT,
++ .norm = 0,
++ .frame_limit = DEF_MAXFRAMERATE,
++ .quiet = 1,
++ .picture_type = "jpeg",
++ .noise = DEF_NOISELEVEL,
++ .noise_tune = 1,
++ .minimum_frame_time = 0,
++ .lightswitch = 0,
++ .autobright = 0,
++ .brightness = 0,
++ .contrast = 0,
++ .saturation = 0,
++ .hue = 0,
++ .power_line_frequency = -1,
++ .roundrobin_frames = 1,
++ .roundrobin_skip = 1,
++ .pre_capture = 0,
++ .post_capture = 0,
++ .switchfilter = 0,
++ .ffmpeg_output = 0,
++ .extpipe = NULL,
++ .useextpipe = 0,
++ .ffmpeg_output_debug = 0,
++ .ffmpeg_bps = DEF_FFMPEG_BPS,
++ .ffmpeg_vbr = DEF_FFMPEG_VBR,
++ .ffmpeg_video_codec = DEF_FFMPEG_CODEC,
+ #ifdef HAVE_SDL
+- sdl_threadnr: 0,
++ .sdl_threadnr = 0,
+ #endif
+- ipv6_enabled: 0,
+- stream_port: 0,
+- stream_quality: 50,
+- stream_motion: 0,
+- stream_maxrate: 1,
+- stream_localhost: 1,
+- stream_limit: 0,
+- stream_auth_method: 0,
+- stream_authentication: NULL,
+- stream_preview_scale: 25,
+- stream_preview_newline: 0,
+- webcontrol_port: 0,
+- webcontrol_localhost: 1,
+- webcontrol_html_output: 1,
+- webcontrol_authentication: NULL,
+- frequency: 0,
+- tuner_number: 0,
+- timelapse: 0,
+- timelapse_mode: DEF_TIMELAPSE_MODE,
++ .ipv6_enabled = 0,
++ .stream_port = 0,
++ .stream_quality = 50,
++ .stream_motion = 0,
++ .stream_maxrate = 1,
++ .stream_localhost = 1,
++ .stream_limit = 0,
++ .stream_auth_method = 0,
++ .stream_authentication = NULL,
++ .stream_preview_scale = 25,
++ .stream_preview_newline = 0,
++ .webcontrol_port = 0,
++ .webcontrol_localhost = 1,
++ .webcontrol_html_output = 1,
++ .webcontrol_authentication = NULL,
++ .frequency = 0,
++ .tuner_number = 0,
++ .timelapse = 0,
++ .timelapse_mode = DEF_TIMELAPSE_MODE,
+ #if (defined(BSD))
+- tuner_device: NULL,
++ .tuner_device = NULL,
+ #endif
+- video_device: VIDEO_DEVICE,
+- v4l2_palette: DEF_PALETTE,
+- vidpipe: NULL,
+- filepath: NULL,
+- imagepath: DEF_IMAGEPATH,
+- moviepath: DEF_MOVIEPATH,
+- snappath: DEF_SNAPPATH,
+- timepath: DEF_TIMEPATH,
+- on_event_start: NULL,
+- on_event_end: NULL,
+- mask_file: NULL,
+- smart_mask_speed: 0,
++ .video_device = VIDEO_DEVICE,
++ .v4l2_palette = DEF_PALETTE,
++ .vidpipe = NULL,
++ .filepath = NULL,
++ .imagepath = DEF_IMAGEPATH,
++ .moviepath = DEF_MOVIEPATH,
++ .snappath = DEF_SNAPPATH,
++ .timepath = DEF_TIMEPATH,
++ .on_event_start = NULL,
++ .on_event_end = NULL,
++ .mask_file = NULL,
++ .smart_mask_speed = 0,
+ #if defined(HAVE_MYSQL) || defined(HAVE_PGSQL) || defined(HAVE_SQLITE3)
+- sql_log_image: 1,
+- sql_log_snapshot: 1,
+- sql_log_movie: 0,
+- sql_log_timelapse: 0,
+- sql_query: DEF_SQL_QUERY,
+- database_type: NULL,
+- database_dbname: NULL,
+- database_host: "localhost",
+- database_user: NULL,
+- database_password: NULL,
+- database_port: 0,
+- database_busy_timeout: 0,
++ .sql_log_image = 1,
++ .sql_log_snapshot = 1,
++ .sql_log_movie = 0,
++ .sql_log_timelapse = 0,
++ .sql_query = DEF_SQL_QUERY,
++ .database_type = NULL,
++ .database_dbname = NULL,
++ .database_host = "localhost",
++ .database_user = NULL,
++ .database_password = NULL,
++ .database_port = 0,
++ .database_busy_timeout = 0,
+ #endif /* defined(HAVE_MYSQL) || defined(HAVE_PGSQL) || define(HAVE_SQLITE3) */
+- on_picture_save: NULL,
+- on_motion_detected: NULL,
+- on_area_detected: NULL,
+- on_movie_start: NULL,
+- on_movie_end: NULL,
+- on_camera_lost: NULL,
+- motionvidpipe: NULL,
+- netcam_url: NULL,
+- netcam_userpass: NULL,
+- netcam_keepalive: "off",
+- netcam_proxy: NULL,
+- netcam_tolerant_check: 0,
+- rtsp_uses_tcp: 1,
++ .on_picture_save = NULL,
++ .on_motion_detected = NULL,
++ .on_area_detected = NULL,
++ .on_movie_start = NULL,
++ .on_movie_end = NULL,
++ .on_camera_lost = NULL,
++ .motionvidpipe = NULL,
++ .netcam_url = NULL,
++ .netcam_userpass = NULL,
++ .netcam_keepalive = "off",
++ .netcam_proxy = NULL,
++ .netcam_tolerant_check = 0,
++ .rtsp_uses_tcp = 1,
+ #ifdef HAVE_MMAL
+- mmalcam_name: NULL,
+- mmalcam_control_params: NULL,
++ .mmalcam_name = NULL,
++ .mmalcam_control_params = NULL,
+ #endif
+- text_changes: 0,
+- text_left: NULL,
+- text_right: DEF_TIMESTAMP,
+- text_event: DEF_EVENTSTAMP,
+- text_double: 0,
+- despeckle_filter: NULL,
+- area_detect: NULL,
+- minimum_motion_frames: 1,
+- exif_text: NULL,
+- pid_file: NULL,
+- log_file: NULL,
+- log_level: LEVEL_DEFAULT+10,
+- log_type_str: NULL,
+- camera_dir: sysconfdir"/conf.d"
++ .text_changes = 0,
++ .text_left = NULL,
++ .text_right = DEF_TIMESTAMP,
++ .text_event = DEF_EVENTSTAMP,
++ .text_double = 0,
++ .despeckle_filter = NULL,
++ .area_detect = NULL,
++ .minimum_motion_frames = 1,
++ .exif_text = NULL,
++ .pid_file = NULL,
++ .log_file = NULL,
++ .log_level = LEVEL_DEFAULT+10,
++ .log_type_str = NULL,
++ .camera_dir = sysconfdir"/conf.d"
+ };
+
+
diff --git a/multimedia/motion/files/patch-configure.ac b/multimedia/motion/files/patch-configure.ac
new file mode 100644
index 000000000000..3f410068b73d
--- /dev/null
+++ b/multimedia/motion/files/patch-configure.ac
@@ -0,0 +1,11 @@
+--- configure.ac.orig 2016-10-25 01:39:24 UTC
++++ configure.ac
+@@ -790,7 +790,7 @@ SUPPORTED_V4L2_old=false
+ if test "${V4L}" = "no"; then
+ AC_MSG_CHECKING(for V42L support)
+ AC_MSG_RESULT(skipping)
+-else
++elif test "${BKTR}" = "no"; then
+ AC_CHECK_TYPE([struct v4l2_buffer],
+ [SUPPORTED_V4L2=true],
+ [SUPPORTED_V4L2=false],
diff --git a/multimedia/motion/files/patch-configure.in b/multimedia/motion/files/patch-configure.in
deleted file mode 100644
index 62bfcee6caba..000000000000
--- a/multimedia/motion/files/patch-configure.in
+++ /dev/null
@@ -1,78 +0,0 @@
---- configure.in.orig 2010-06-01 10:48:23.000000000 +0400
-+++ configure.in 2013-12-01 13:32:23.000000000 +0400
-@@ -316,7 +316,7 @@
- #
- else if test "${FFMPEG_DIR}" = "yes"; then
- # AUTODETECT STATIC/SHARED LIB
-- AC_MSG_CHECKING(for ffmpeg autodetecting)
-+ AC_MSG_CHECKING(for ffmpeg autodetecting libraries)
-
- if test -f /usr/lib64/libavcodec.a -o -f /usr/lib64/libavcodec.so && test -f /usr/lib64/libavformat.a -o -f /usr/lib64/libavformat.so ; then
- AC_MSG_RESULT(found in /usr/lib64)
-@@ -347,11 +347,11 @@
- echo ""
- fi
- else
-- AC_MSG_CHECKING(for ffmpeg in -> [${FFMPEG_DIR}] <-)
-- if test -f ${FFMPEG_DIR}/lib/libavcodec.a -o -f ${FFMPEG_DIR}/lib/libavcodec.so && test -f ${FFMPEG_DIR}/lib/libavformat.a -o -f ${FFMPEG_DIR}/lib/libavformat.so ; then
-+ AC_MSG_CHECKING(for ffmpeg libraries in -> [${FFMPEG_DIR}] <-)
-+ if test -f ${FFMPEG_DIR}/lib/ffmpeg0/libavcodec0.a -o -f ${FFMPEG_DIR}/lib/ffmpeg0/libavcodec0.so && test -f ${FFMPEG_DIR}/lib/ffmpeg0/libavformat0.a -o -f ${FFMPEG_DIR}/lib/ffmpeg0/libavformat0.so ; then
- AC_MSG_RESULT(found)
- FFMPEG_OK="found"
-- FFMPEG_LIB="${FFMPEG_DIR}/lib"
-+ FFMPEG_LIB="${FFMPEG_DIR}/lib/ffmpeg0"
- elif test -f ${FFMPEG_DIR}/libavcodec.a -o -f ${FFMPEG_DIR}/libavcodec.so && test -f ${FFMPEG_DIR}/libavformat.a -o -f ${FFMPEG_DIR}/libavformat.so ; then
- AC_MSG_RESULT(found)
- FFMPEG_LIB="${FFMPEG_DIR}"
-@@ -389,12 +389,12 @@
- elif test -f ${FFMPEG_DIR}/include/ffmpeg/avformat.h; then
- AC_MSG_RESULT(found ${FFMPEG_DIR}/include/ffmpeg/avformat.h)
- FFMPEG_CFLAGS="-I${FFMPEG_DIR}/include/ffmpeg"
-- elif test -f ${FFMPEG_DIR}/include/libavformat/avformat.h; then
-- AC_MSG_RESULT(found ${FFMPEG_DIR}/include/libavformat/avformat.h)
-- FFMPEG_CFLAGS="-I${FFMPEG_DIR}/include -DFFMPEG_NEW_INCLUDES"
-- elif test -f ${FFMPEG_DIR}/include/ffmpeg/libavformat/avformat.h; then
-- AC_MSG_RESULT(found ${FFMPEG_DIR}/include/ffmpeg/libavformat/avformat.h)
-- FFMPEG_CFLAGS="-I${FFMPEG_DIR}/include/ffmpeg -DFFMPEG_NEW_INCLUDES"
-+# elif test -f ${FFMPEG_DIR}/include/libavformat/avformat.h; then
-+# AC_MSG_RESULT(found ${FFMPEG_DIR}/include/libavformat/avformat.h)
-+# FFMPEG_CFLAGS="-I${FFMPEG_DIR}/include -DFFMPEG_NEW_INCLUDES"
-+ elif test -f ${FFMPEG_DIR}/include/ffmpeg0/libavformat/avformat.h; then
-+ AC_MSG_RESULT(found ${FFMPEG_DIR}/include/ffmpeg0/libavformat/avformat.h)
-+ FFMPEG_CFLAGS="-I${FFMPEG_DIR}/include/ffmpeg0 -DFFMPEG_NEW_INCLUDES"
- else
- AC_MSG_RESULT(not found)
- FFMPEG_OK="no_found"
-@@ -413,9 +413,9 @@
- #
-
- if test "${FFMPEG_OK}" = "found"; then
-- TEMP_LIBS="$TEMP_LIBS -L${FFMPEG_LIB} -lavformat -lavcodec -lavutil -lm -lz"
-+ TEMP_LIBS="$TEMP_LIBS -L${FFMPEG_LIB} -lavformat0 -lavcodec0 -lavutil0 -lm -lz"
- TEMP_LDFLAGS="${TEMP_LDFLAGS} -L${FFMPEG_LIB}"
-- TEMP_CFLAGS="${TEMP_CFLAGS} -DHAVE_FFMPEG ${FFMPEG_CFLAGS}"
-+ TEMP_CFLAGS="-DHAVE_FFMPEG ${FFMPEG_CFLAGS} ${TEMP_CFLAGS}"
-
- FFMPEG_OBJ="ffmpeg.o"
- AC_SUBST(FFMPEG_OBJ)
-@@ -751,7 +751,7 @@
- if test "${V4L}" = "no"; then
- AC_MSG_CHECKING(for V42L support)
- AC_MSG_RESULT(skipping)
--else
-+elif test "${BKTR}" = "no"; then
- AC_CHECK_TYPE([struct v4l2_buffer],
- [SUPPORTED_V4L2=true],
- [SUPPORTED_V4L2=false],
-@@ -1067,6 +1067,11 @@
- LIBS="${TEMP_LIBS}"
- LDFLAGS="${TEMP_LDFLAGS}"
-
-+AC_CHECK_FUNC(avformat_alloc_context, AC_DEFINE([have_avformat_alloc_context],1,[Define to 1 if you have avformat_alloc_context support]))
-+AC_CHECK_FUNC(av_avformat_alloc_context, AC_DEFINE([have_av_avformat_alloc_context],1,[Define to 1 if you have av_avformat_alloc_context support]))
-+AC_CHECK_FUNC(av_register_protocol2, AC_DEFINE([have_av_register_protocol2],1,[Define to 1 if you have av_register_protocol2 support]))
-+AC_CHECK_FUNC(av_register_protocol, AC_DEFINE([have_av_register_protocol],1,[Define to 1 if you have av_register_protocol support]))
-+
- #
- # Add the right exec path for rc scripts
- #
diff --git a/multimedia/motion/files/patch-netcam.c b/multimedia/motion/files/patch-netcam.c
new file mode 100644
index 000000000000..6ef89148a628
--- /dev/null
+++ b/multimedia/motion/files/patch-netcam.c
@@ -0,0 +1,13 @@
+Fix sockaddr type mismatch warnings (Fixed upstream in dbd7282)
+
+--- netcam.c.orig 2016-10-25 01:39:24 UTC
++++ netcam.c
+@@ -948,7 +948,7 @@ 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));
+ back_err = errno; /* Save the errno from connect */
+
+ /* If the connect failed with anything except EINPROGRESS, error. */
diff --git a/multimedia/motion/files/patch-track.c b/multimedia/motion/files/patch-track.c
new file mode 100644
index 000000000000..7b0fb5d288c1
--- /dev/null
+++ b/multimedia/motion/files/patch-track.c
@@ -0,0 +1,50 @@
+Convert old GNU field designator syntax to C99 syntax to remove some
+annoying warnings. Fixed upstream in a870946.
+
+--- track.c.orig 2016-10-25 01:39:24 UTC
++++ track.c
+@@ -17,25 +17,25 @@
+
+
+ struct trackoptions track_template = {
+- dev: -1, /* dev open */
+- port: NULL, /* char *port */
+- motorx: 0, /* int motorx */
+- motory: 0, /* int motory */
+- maxx: 0, /* int maxx; */
+- maxy: 0, /* int maxy; */
+- minx: 0, /* int minx; */
+- miny: 0, /* int miny; */
+- homex: 128, /* int homex; */
+- homey: 128, /* int homey; */
+- motorx_reverse: 0, /* int reversed x servo; */
+- motory_reverse: 0, /* int reversed y servo; */
+- speed: TRACK_SPEED, /* speed */
+- stepsize: TRACK_STEPSIZE, /* stepsize */
+- active: 0, /* auto tracking active */
+- minmaxfound: 0, /* flag for minmax values stored for pwc based camera */
+- step_angle_x: 10, /* UVC step angle in degrees X-axis that camera moves during auto tracking */
+- step_angle_y: 10, /* UVC step angle in degrees Y-axis that camera moves during auto tracking */
+- move_wait: 10 /* number of frames to disable motion detection after camera moving */
++ .dev = -1, /* dev open */
++ .port = NULL, /* char *port */
++ .motorx = 0, /* int motorx */
++ .motory = 0, /* int motory */
++ .maxx = 0, /* int maxx; */
++ .maxy = 0, /* int maxy; */
++ .minx = 0, /* int minx; */
++ .miny = 0, /* int miny; */
++ .homex = 128, /* int homex; */
++ .homey = 128, /* int homey; */
++ .motorx_reverse = 0, /* int reversed x servo; */
++ .motory_reverse = 0, /* int reversed y servo; */
++ .speed = TRACK_SPEED, /* speed */
++ .stepsize = TRACK_STEPSIZE, /* stepsize */
++ .active = 0, /* auto tracking active */
++ .minmaxfound = 0, /* flag for minmax values stored for pwc based camera */
++ .step_angle_x = 10, /* UVC step angle in degrees X-axis that camera moves during auto tracking */
++ .step_angle_y = 10, /* UVC step angle in degrees Y-axis that camera moves during auto tracking */
++ .move_wait = 10 /* number of frames to disable motion detection after camera moving */
+ };
+
+
diff --git a/multimedia/motion/files/patch-video__freebsd.c b/multimedia/motion/files/patch-video__freebsd.c
new file mode 100644
index 000000000000..b0c67aa5bde4
--- /dev/null
+++ b/multimedia/motion/files/patch-video__freebsd.c
@@ -0,0 +1,20 @@
+Comment out unused struct to avoid warnings.
+
+--- video_freebsd.c.orig 2016-10-25 01:39:24 UTC
++++ video_freebsd.c
+@@ -41,6 +41,7 @@
+
+ #define array_elem(x) (sizeof(x) / sizeof((x)[0]))
+
++/*
+ static const struct camparam_st {
+ int min, max, range, drv_min, drv_range, def;
+ } CamParams[] = {
+@@ -58,6 +59,7 @@ static const struct camparam_st {
+ BT848_CHROMAREGMIN, (BT848_CHROMAREGMAX - BT848_CHROMAREGMIN + 1),
+ BT848_CHROMACENTER, },
+ };
++*/
+
+ #define BRIGHT 0
+ #define CONTR 1
diff --git a/multimedia/motion/files/patch-webhttpd.c b/multimedia/motion/files/patch-webhttpd.c
new file mode 100644
index 000000000000..1fdd28b35534
--- /dev/null
+++ b/multimedia/motion/files/patch-webhttpd.c
@@ -0,0 +1,45 @@
+Fix warnings about mismatched format specifiers (Fixed upstream in dbd7282)
+Fix sockaddr type mismatch warnings (Fixed upstream in dbd7282)
+
+--- webhttpd.c.orig 2016-10-25 01:39:24 UTC
++++ webhttpd.c
+@@ -2067,7 +2067,7 @@ static unsigned int handle_get(int clien
+ //Send the webcontrol section if applicable
+ if (cnt[0]->conf.webcontrol_html_output) {
+ send_template_ini_client(client_socket, ini_template);
+- sprintf(res, "<b>Motion "VERSION" Running [%hu] Cameras</b><br>\n"
++ sprintf(res, "<b>Motion "VERSION" Running [%d] Cameras</b><br>\n"
+ "<a href='/0/'>All</a>\n", i);
+ send_template(client_socket, res);
+
+@@ -2079,7 +2079,7 @@ static unsigned int handle_get(int clien
+ send_template(client_socket, res);
+ counter = 0;
+ }
+- sprintf(res, "<a href='/%hu/'>Camera %d%s%s</a>\n", y, cnt[y]->conf.camera_id,
++ sprintf(res, "<a href='/%d/'>Camera %d%s%s</a>\n", y, cnt[y]->conf.camera_id,
+ cnt[y]->conf.camera_name ? " -- " : "",
+ cnt[y]->conf.camera_name ? cnt[y]->conf.camera_name : "");
+ send_template(client_socket, res);
+@@ -2112,10 +2112,10 @@ static unsigned int handle_get(int clien
+ send_template_end_client(client_socket);
+ } else {
+ send_template_ini_client_raw(client_socket);
+- sprintf(res, "Motion "VERSION" Running [%hu] Cameras\n0\n", i);
++ sprintf(res, "Motion "VERSION" Running [%d] Cameras\n0\n", i);
+ send_template_raw(client_socket, res);
+ for (y = 1; y < i; y++) {
+- sprintf(res, "%hu\n", y);
++ sprintf(res, "%d\n", y);
+ send_template_raw(client_socket, res);
+ }
+ }
+@@ -2571,7 +2571,7 @@ static int acceptnonblocking(int serverf
+
+ if (select(serverfd + 1, &fds, NULL, NULL, &tm) > 0) {
+ if (FD_ISSET(serverfd, &fds)) {
+- if ((curfd = accept(serverfd, &client, &client_len)) > 0)
++ if ((curfd = accept(serverfd, (struct sockaddr *)&client, &client_len)) > 0)
+ return curfd;
+ }
+ }
diff --git a/multimedia/motion/files/pkg-message.in b/multimedia/motion/files/pkg-message.in
index 778e01e35132..ef83fc9e8a6a 100644
--- a/multimedia/motion/files/pkg-message.in
+++ b/multimedia/motion/files/pkg-message.in
@@ -4,6 +4,31 @@ To use the motion service properly, you should edit
%%PREFIX%%/etc/motion.conf
according to your needs.
+
+To set up your capture device (if using BKTR):
+
+ 1. Load the bktr modules
+
+ Type as root:
+ kldload bktr_mem.ko
+ kldload bktr.ko
+
+ You can setup this in your /boot/loader.conf adding:
+ bktr_mem_load="YES"
+ bktr_load="YES"
+
+ 2. Configure your card settings (tuner type, format, and card)
+
+ Type as root:
+ sysctl hw.bt848.card=1 ( Miro pctv )
+ sysctl hw.bt848.tuner=10 ( PHILIPS_FR1216_PAL )
+ sysctl hw.bt848.format=0 ( PAL )
+
+ or add to /etc/sysctl.conf adding:
+ hw.bt848.card=1
+ hw.bt848.tuner=10
+ hw.bt848.format=0
+
To automatically start the service at boot time,
add the following line to /etc/rc.conf:
@@ -12,4 +37,5 @@ add the following line to /etc/rc.conf:
Then, to start the service right now without reboot, execute
service motion start
+
****************************************************************
diff --git a/multimedia/motion/pkg-descr b/multimedia/motion/pkg-descr
index cbe23468b808..85095a8b55fb 100644
--- a/multimedia/motion/pkg-descr
+++ b/multimedia/motion/pkg-descr
@@ -3,4 +3,4 @@ capture devices that supports bktr(4) with composite and svideo inputs. Tuner
support is not yet implemented. Latest port versions supports webcams supported
by pwcbsd.
-WWW: http://motion.sourceforge.net/
+WWW: https://motion-project.github.io/
diff --git a/multimedia/motion/pkg-plist b/multimedia/motion/pkg-plist
deleted file mode 100644
index ac8f5c1e66e3..000000000000
--- a/multimedia/motion/pkg-plist
+++ /dev/null
@@ -1,3 +0,0 @@
-bin/motion
-man/man1/motion.1.gz
-@sample etc/motion.conf.sample