From 4e79ff96c1c3927ede4f6f65cef2bc2233e5f4e2 Mon Sep 17 00:00:00 2001 From: sthen Date: Thu, 29 Mar 2018 19:31:00 +0000 Subject: [PATCH] update to motion-4.1.1 --- multimedia/motion/Makefile | 25 +++++++++---------- multimedia/motion/distinfo | 4 +-- multimedia/motion/patches/patch-Makefile_in | 23 +++++++++++++++++ multimedia/motion/patches/patch-configure_ac | 14 +++++++++++ multimedia/motion/patches/patch-event_c | 23 +++++++++++++++++ .../motion/patches/patch-motion-dist_conf_in | 9 ++++--- multimedia/motion/patches/patch-motion_c | 14 +++++++++++ multimedia/motion/patches/patch-track_c | 21 ++++++++-------- multimedia/motion/patches/patch-video_v4l2_c | 17 +++++++++++++ multimedia/motion/pkg/PLIST | 20 ++++++++------- 10 files changed, 132 insertions(+), 38 deletions(-) create mode 100644 multimedia/motion/patches/patch-Makefile_in create mode 100644 multimedia/motion/patches/patch-configure_ac create mode 100644 multimedia/motion/patches/patch-event_c create mode 100644 multimedia/motion/patches/patch-motion_c create mode 100644 multimedia/motion/patches/patch-video_v4l2_c diff --git a/multimedia/motion/Makefile b/multimedia/motion/Makefile index d8fe73e8e9d..0c00bc219f7 100644 --- a/multimedia/motion/Makefile +++ b/multimedia/motion/Makefile @@ -1,12 +1,11 @@ -# $OpenBSD: Makefile,v 1.15 2018/01/11 19:27:04 rpe Exp $ +# $OpenBSD: Makefile,v 1.16 2018/03/29 19:31:00 sthen Exp $ +V= 4.1.1 COMMENT= motion detection software for video GH_ACCOUNT= Motion-Project GH_PROJECT= motion -GH_COMMIT= 9b4c16cae0ea77950cc156a9c82947ac51825f68 -V= 3.4.1 -REVISION= 5 +GH_TAGNAME= release-$V DISTNAME= motion-$V CATEGORIES= multimedia @@ -18,10 +17,13 @@ MAINTAINER= Stuart Henderson # GPL (according to source files, v2 only. website says v2+). PERMIT_PACKAGE_CDROM= Yes -WANTLIB += SDL avcodec avformat avutil c jpeg m pthread sqlite3 swscale +WANTLIB += avcodec avdevice avformat avutil c jpeg m pthread sqlite3 swscale FLAVOR?= -FLAVORS= bktr mysql pgsql +FLAVORS= mysql pgsql + +FLAVOR_COMMA= ${FLAVOR_EXT:S/-/,/g} +SUBST_VARS= FLAVOR_COMMA LIB_DEPENDS= databases/sqlite3 \ graphics/jpeg \ @@ -40,10 +42,6 @@ CONFIGURE_ARGS= --without-optimizecpu \ LDFLAGS="-L${LOCALBASE}/lib" \ CPPFLAGS="-I${LOCALBASE}/include" -.if ${FLAVOR:L:Mbktr} -CONFIGURE_ARGS+= --without-v4l -.endif - .if ${FLAVOR:L:Mmysql} LIB_DEPENDS+= databases/mariadb WANTLIB+= lib/mysql/mysqlclient z @@ -61,9 +59,6 @@ CONFIGURE_ARGS+= --without-pgsql NO_TEST= Yes -post-extract: - printf '#!/bin/sh\necho -n "$V-Git-${GH_COMMIT:C/[0-9a-f]{33}$//}"\n' > ${WRKSRC}/version.sh - post-patch: cd ${WRKSRC} && AUTOCONF_VERSION=${AUTOCONF_VERSION} \ AUTOMAKE_VERSION=${AUTOMAKE_VERSION} autoreconf -fiv @@ -72,6 +67,10 @@ pre-configure: perl -pi -e s,/usr/local/etc,${SYSCONFDIR},g \ ${WRKSRC}/motion-dist.conf.in +post-install: + cd ${PREFIX}/share/examples/motion; \ + rm -f motion.init-{Fedora,Debian,FreeBSD.sh} motion.service + .include .if ${ARCH:Mamd64} diff --git a/multimedia/motion/distinfo b/multimedia/motion/distinfo index fc681466fe8..448564f204f 100644 --- a/multimedia/motion/distinfo +++ b/multimedia/motion/distinfo @@ -1,2 +1,2 @@ -SHA256 (motion-3.4.1-9b4c16ca.tar.gz) = kU6defhInQp1gPFmhb5x9RvxriQAgtiTNLoztn4Qwao= -SIZE (motion-3.4.1-9b4c16ca.tar.gz) = 387288 +SHA256 (motion-4.1.1.tar.gz) = IHS5Nb3+KPhMLDIzJ0sGkIM2d48wO7E1MNQpnD+KpOI= +SIZE (motion-4.1.1.tar.gz) = 447795 diff --git a/multimedia/motion/patches/patch-Makefile_in b/multimedia/motion/patches/patch-Makefile_in new file mode 100644 index 00000000000..d02169017ca --- /dev/null +++ b/multimedia/motion/patches/patch-Makefile_in @@ -0,0 +1,23 @@ +$OpenBSD: patch-Makefile_in,v 1.1 2018/03/29 19:31:00 sthen Exp $ + +Index: Makefile.in +--- Makefile.in.orig ++++ Makefile.in +@@ -103,7 +103,7 @@ pre-mobject-info: + ################################################################################ + %.o: @top_srcdir@/%.c + @echo -e "\tCompiling $< into $@..." +- @$(CC) -c $(CFLAGS) -I@top_builddir@ $< -o $@ ++ $(CC) -c $(CFLAGS) -I@top_builddir@ $< -o $@ + + ################################################################################ + # Include the dependency file if it exists. # +@@ -122,7 +122,7 @@ endif + ################################################################################ + $(DEPEND_FILE): *.h $(SRC) + @echo "Generating dependencies, please wait..." +- @$(CC) $(CFLAGS) -I@top_builddir@ -M $(SRC) > .tmp ++ $(CC) $(CFLAGS) -I@top_builddir@ -M $(SRC) > .tmp + @mv -f .tmp $(DEPEND_FILE) + @echo + diff --git a/multimedia/motion/patches/patch-configure_ac b/multimedia/motion/patches/patch-configure_ac new file mode 100644 index 00000000000..fa891e21b86 --- /dev/null +++ b/multimedia/motion/patches/patch-configure_ac @@ -0,0 +1,14 @@ +$OpenBSD: patch-configure_ac,v 1.4 2018/03/29 19:31:00 sthen Exp $ + +Index: configure.ac +--- configure.ac.orig ++++ configure.ac +@@ -106,7 +106,7 @@ if test "x${BKTR}" = "xyes"; then + fi + fi + if test "${V4L2}" = "yes"; then +- AC_CHECK_HEADERS(linux/videodev2.h,[V4L2="yes"],[V4L2="no"]) ++ AC_CHECK_HEADERS(sys/videoio.h,[V4L2="yes"],[V4L2="no"]) + fi + + if test "x${V4L2}" = "xyes"; then diff --git a/multimedia/motion/patches/patch-event_c b/multimedia/motion/patches/patch-event_c new file mode 100644 index 00000000000..bec568c5857 --- /dev/null +++ b/multimedia/motion/patches/patch-event_c @@ -0,0 +1,23 @@ +$OpenBSD: patch-event_c,v 1.1 2018/03/29 19:31:00 sthen Exp $ + +Index: event.c +--- event.c.orig ++++ event.c +@@ -353,7 +353,7 @@ static void event_stream_put(struct context *cnt, + } + + +-#if defined(HAVE_V4L2) && !defined(__FreeBSD__) ++#if defined(HAVE_V4L2) && !defined(__FreeBSD__) && !defined(__OpenBSD__) + static void event_vlp_putpipe(struct context *cnt, + motion_event type ATTRIBUTE_UNUSED, + struct image_data *img_data, char *dummy ATTRIBUTE_UNUSED, void *devpipe, +@@ -1022,7 +1022,7 @@ struct event_handlers event_handlers[] = { + EVENT_IMAGE_SNAPSHOT, + event_image_snapshot + }, +-#if defined(HAVE_V4L2) && !defined(__FreeBSD__) ++#if defined(HAVE_V4L2) && !defined(__FreeBSD__) && !defined(__OpenBSD__) + { + EVENT_IMAGE, + event_vlp_putpipe diff --git a/multimedia/motion/patches/patch-motion-dist_conf_in b/multimedia/motion/patches/patch-motion-dist_conf_in index 16886c0c7d9..e3e19301b60 100644 --- a/multimedia/motion/patches/patch-motion-dist_conf_in +++ b/multimedia/motion/patches/patch-motion-dist_conf_in @@ -1,7 +1,8 @@ -$OpenBSD: patch-motion-dist_conf_in,v 1.2 2015/01/30 20:58:18 sthen Exp $ ---- motion-dist.conf.in.orig Mon Jan 26 00:12:50 2015 -+++ motion-dist.conf.in Fri Jan 30 20:45:21 2015 -@@ -74,7 +74,7 @@ v4l2_palette 17 +$OpenBSD: patch-motion-dist_conf_in,v 1.3 2018/03/29 19:31:00 sthen Exp $ +Index: motion-dist.conf.in +--- motion-dist.conf.in.orig ++++ motion-dist.conf.in +@@ -49,7 +49,7 @@ v4l2_palette 17 # The video input to be used (default: -1) # Should normally be set to 0 or 1 for video/TV cards, and -1 for USB cameras # Set to 0 for uvideo(4) on OpenBSD diff --git a/multimedia/motion/patches/patch-motion_c b/multimedia/motion/patches/patch-motion_c new file mode 100644 index 00000000000..b2ca25b806d --- /dev/null +++ b/multimedia/motion/patches/patch-motion_c @@ -0,0 +1,14 @@ +$OpenBSD: patch-motion_c,v 1.3 2018/03/29 19:31:00 sthen Exp $ + +Index: motion.c +--- motion.c.orig ++++ motion.c +@@ -1071,7 +1071,7 @@ static int motion_init(struct context *cnt) + /* create a reference frame */ + alg_update_reference_frame(cnt, RESET_REF_FRAME); + +-#if defined(HAVE_V4L2) && !defined(__FreeBSD__) ++#if defined(HAVE_V4L2) && !defined(__FreeBSD__) && !defined(__OpenBSD__) + /* open video loopback devices if enabled */ + if (cnt->conf.vidpipe) { + MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "Opening video loopback device for normal pictures"); diff --git a/multimedia/motion/patches/patch-track_c b/multimedia/motion/patches/patch-track_c index 7899a4a762b..1e1511df042 100644 --- a/multimedia/motion/patches/patch-track_c +++ b/multimedia/motion/patches/patch-track_c @@ -1,15 +1,16 @@ -$OpenBSD: patch-track_c,v 1.3 2015/11/20 11:57:19 sthen Exp $ ---- track.c.orig Thu Nov 19 18:38:24 2015 -+++ track.c Thu Nov 19 18:39:44 2015 -@@ -6,7 +6,11 @@ - * This program is published under the GNU Public license - */ - #ifdef MOTION_V4L2 +$OpenBSD: patch-track_c,v 1.4 2018/03/29 19:31:00 sthen Exp $ +Index: track.c +--- track.c.orig ++++ track.c +@@ -9,7 +9,11 @@ + #include "motion.h" + + #ifdef HAVE_V4L2 +#if defined(HAVE_LINUX_VIDEODEV_H) #include +#elif defined(HAVE_SYS_VIDEOIO_H) +#include +#endif - #endif /* MOTION_V4L2 */ - #include - #include "motion.h" + #include "pwc-ioctl.h" + #endif + diff --git a/multimedia/motion/patches/patch-video_v4l2_c b/multimedia/motion/patches/patch-video_v4l2_c new file mode 100644 index 00000000000..4cd6f5e905a --- /dev/null +++ b/multimedia/motion/patches/patch-video_v4l2_c @@ -0,0 +1,17 @@ +$OpenBSD: patch-video_v4l2_c,v 1.1 2018/03/29 19:31:00 sthen Exp $ + +Index: video_v4l2.c +--- video_v4l2.c.orig ++++ video_v4l2.c +@@ -23,7 +23,11 @@ + + #ifdef HAVE_V4L2 + ++#ifdef __OpenBSD__ ++#include ++#else + #include ++#endif + + /* video4linux stuff */ + #define NORM_DEFAULT 0 diff --git a/multimedia/motion/pkg/PLIST b/multimedia/motion/pkg/PLIST index 7ba29125d46..08f2b81894f 100644 --- a/multimedia/motion/pkg/PLIST +++ b/multimedia/motion/pkg/PLIST @@ -1,4 +1,5 @@ -@comment $OpenBSD: PLIST,v 1.4 2015/11/20 11:57:19 sthen Exp $ +@comment $OpenBSD: PLIST,v 1.5 2018/03/29 19:31:00 sthen Exp $ +@pkgpath multimedia/motion,bktr${FLAVOR_COMMA} @newgroup _motion:704 @newuser _motion:704:_motion:daemon:motion user:/nonexistent:/sbin/nologin @bin bin/motion @@ -7,17 +8,18 @@ share/doc/motion/ share/doc/motion/CHANGELOG share/doc/motion/COPYING share/doc/motion/CREDITS -share/doc/motion/README +share/doc/motion/README.md +share/doc/motion/mask1.png share/doc/motion/motion_guide.html +share/doc/motion/normal.jpg +share/doc/motion/outputmotion1.jpg +share/doc/motion/outputnormal1.jpg share/examples/motion/ +share/examples/motion/camera1-dist.conf +share/examples/motion/camera2-dist.conf +share/examples/motion/camera3-dist.conf +share/examples/motion/camera4-dist.conf share/examples/motion/motion-dist.conf @sample ${SYSCONFDIR}/motion/ @sample ${SYSCONFDIR}/motion/motion.conf -@comment share/examples/motion/motion.init-Debian -@comment share/examples/motion/motion.init-Fedora -@comment share/examples/motion/motion.init-FreeBSD.sh -share/examples/motion/thread1-dist.conf -share/examples/motion/thread2-dist.conf -share/examples/motion/thread3-dist.conf -share/examples/motion/thread4-dist.conf @rcscript ${RCDIR}/motion