diff options
| author | leigh123linux <leigh123linux@googlemail.com> | 2017-03-13 17:29:47 +0000 |
|---|---|---|
| committer | leigh123linux <leigh123linux@googlemail.com> | 2017-03-13 17:29:47 +0000 |
| commit | d545e3e60715be5061aba301a71656cc0cdaa34d (patch) | |
| tree | 15a58cb047effbe7af933830bd52e164d6bc83c1 | |
| parent | 86057dbe5fb468d187c39942127ed5856a6cd805 (diff) | |
| download | motion-d545e3e60715be5061aba301a71656cc0cdaa34d.tar.gz motion-d545e3e60715be5061aba301a71656cc0cdaa34d.tar.xz motion-d545e3e60715be5061aba301a71656cc0cdaa34d.zip | |
Update to 4.0.1 release
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | api-update_copy-old-API-items.patch | 76 | ||||
| -rw-r--r-- | api-update_ffmpeg-2.9.patch | 202 | ||||
| -rw-r--r-- | api-update_libav10.patch | 51 | ||||
| -rw-r--r-- | motion-0002-there-is-no-bin-service-in-Fedora-use-systemctl.patch | 24 | ||||
| -rw-r--r-- | motion-version.patch | 13 | ||||
| -rw-r--r-- | motion.spec | 92 | ||||
| -rw-r--r-- | sources | 2 |
8 files changed, 40 insertions, 421 deletions
@@ -1 +1,2 @@ motion-3.3.0.tar.gz +/motion-release-4.0.1.tar.gz diff --git a/api-update_copy-old-API-items.patch b/api-update_copy-old-API-items.patch deleted file mode 100644 index b384c1f..0000000 --- a/api-update_copy-old-API-items.patch +++ /dev/null @@ -1,76 +0,0 @@ -Description: Copy old API items we still depend on - As per doc/APIchanges in libav/ffmpeg, URLContext/URLProtocol were dropped - from the public API of libavformat since 52.107.0. Pending a better solution - from motion upstream, we copy the definitions here. -Author: Ximin Luo <infinity0@pwned.gg> -Bug: https://github.com/sackmotion/motion/issues/16 - ---- a/ffmpeg.c -+++ b/ffmpeg.c -@@ -15,6 +15,66 @@ - #include "ffmpeg.h" - #include "motion.h" - -+#if LIBAVFORMAT_BUILD >= AV_VERSION_INT(52,107,0) -+/* -+ * URLContext, URLProtocol have been removed from avio.h -+ * -+ */ -+ -+typedef struct URLContext { -+ const AVClass *av_class; /**< information for av_log(). Set by url_open(). */ -+ struct URLProtocol *prot; -+ void *priv_data; -+ char *filename; /**< specified URL */ -+ int flags; -+ int max_packet_size; /**< if non zero, the stream is packetized with this max packet size */ -+ int is_streamed; /**< true if streamed (no seek possible), default = false */ -+ int is_connected; -+ AVIOInterruptCB interrupt_callback; -+ int64_t rw_timeout; /**< maximum time to wait for (network) read/write operation completion, in mcs */ -+} URLContext; -+ -+typedef struct URLProtocol { -+ const char *name; -+ int (*url_open)( URLContext *h, const char *url, int flags); -+ /** -+ * This callback is to be used by protocols which open further nested -+ * protocols. options are then to be passed to ffurl_open()/ffurl_connect() -+ * for those nested protocols. -+ */ -+ int (*url_open2)(URLContext *h, const char *url, int flags, AVDictionary **options); -+ -+ /** -+ * Read data from the protocol. -+ * If data is immediately available (even less than size), EOF is -+ * reached or an error occurs (including EINTR), return immediately. -+ * Otherwise: -+ * In non-blocking mode, return AVERROR(EAGAIN) immediately. -+ * In blocking mode, wait for data/EOF/error with a short timeout (0.1s), -+ * and return AVERROR(EAGAIN) on timeout. -+ * Checking interrupt_callback, looping on EINTR and EAGAIN and until -+ * enough data has been read is left to the calling function; see -+ * retry_transfer_wrapper in avio.c. -+ */ -+ int (*url_read)( URLContext *h, unsigned char *buf, int size); -+ int (*url_write)(URLContext *h, const unsigned char *buf, int size); -+ int64_t (*url_seek)( URLContext *h, int64_t pos, int whence); -+ int (*url_close)(URLContext *h); -+ struct URLProtocol *next; -+ int (*url_read_pause)(URLContext *h, int pause); -+ int64_t (*url_read_seek)(URLContext *h, int stream_index, -+ int64_t timestamp, int flags); -+ int (*url_get_file_handle)(URLContext *h); -+ int (*url_get_multi_file_handle)(URLContext *h, int **handles, -+ int *numhandles); -+ int (*url_shutdown)(URLContext *h, int flags); -+ int priv_data_size; -+ const AVClass *priv_data_class; -+ int flags; -+ int (*url_check)(URLContext *h, int mask); -+} URLProtocol; -+#endif -+ - #if LIBAVCODEC_BUILD > 4680 - /* - * FFmpeg after build 4680 doesn't have support for mpeg1 videos with diff --git a/api-update_ffmpeg-2.9.patch b/api-update_ffmpeg-2.9.patch deleted file mode 100644 index 28a2694..0000000 --- a/api-update_ffmpeg-2.9.patch +++ /dev/null @@ -1,202 +0,0 @@ -Description: Replace deprecated FFmpeg API -Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> -Forwarded: yes -Last-Update: 2015-11-02 - ---- a/configure.in -+++ b/configure.in -@@ -522,7 +522,7 @@ - # - - 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} -lavfilter -lavformat -lavcodec -lavutil -lm -lz" - TEMP_LDFLAGS="${TEMP_LDFLAGS} -L${FFMPEG_LIB}" - TEMP_CFLAGS="${TEMP_CFLAGS} -DHAVE_FFMPEG ${FFMPEG_CFLAGS}" - ---- a/ffmpeg.c -+++ b/ffmpeg.c -@@ -655,7 +655,7 @@ - } - - /* Set the picture format - need in ffmpeg starting round April-May 2005 */ -- c->pix_fmt = PIX_FMT_YUV420P; -+ c->pix_fmt = AV_PIX_FMT_YUV420P; - - /* Get a mutex lock. */ - pthread_mutex_lock(&global_lock); -@@ -692,10 +692,10 @@ - } - - /* Allocate the encoded raw picture. */ -- ffmpeg->picture = avcodec_alloc_frame(); -+ ffmpeg->picture = av_frame_alloc(); - - if (!ffmpeg->picture) { -- MOTION_LOG(ERR, TYPE_ENCODER, NO_ERRNO, "%s: avcodec_alloc_frame -" -+ MOTION_LOG(ERR, TYPE_ENCODER, NO_ERRNO, "%s: av_frame_alloc -" - " could not alloc frame"); - ffmpeg_cleanups(ffmpeg); - return NULL; -@@ -801,7 +801,7 @@ - #endif - avcodec_close(AVSTREAM_CODEC_PTR(ffmpeg->video_st)); - pthread_mutex_unlock(&global_lock); -- av_freep(&ffmpeg->picture); -+ av_frame_free(&ffmpeg->picture); - free(ffmpeg->video_outbuf); - } - -@@ -833,7 +833,7 @@ - pthread_mutex_lock(&global_lock); - avcodec_close(AVSTREAM_CODEC_PTR(ffmpeg->video_st)); - pthread_mutex_unlock(&global_lock); -- av_freep(&ffmpeg->picture); -+ av_frame_free(&ffmpeg->picture); - free(ffmpeg->video_outbuf); - } - -@@ -897,7 +897,7 @@ - if (picture) { - ret = ffmpeg_put_frame(ffmpeg, picture); - if (!ret) -- av_free(picture); -+ av_frame_free(&picture); - } - - return ret; -@@ -1009,7 +1009,7 @@ - { - AVFrame *picture; - -- picture = avcodec_alloc_frame(); -+ picture = av_frame_alloc(); - - if (!picture) { - MOTION_LOG(ERR, TYPE_ENCODER, SHOW_ERRNO, "%s: Could not alloc frame"); -@@ -1031,6 +1031,81 @@ - return picture; - } - -+AVFilterContext *buffersink_ctx; -+AVFilterContext *buffersrc_ctx; -+AVFilterGraph *filter_graph; -+AVFrame *filter_frame; -+int last_width = -1; -+int last_height = -1; -+enum AVPixelFormat last_pixfmt = AV_PIX_FMT_NONE; -+ -+static void delete_filter_graph() { -+ if (filter_graph) { -+ av_frame_free(&filter_frame); -+ avfilter_graph_free(&filter_graph); -+ } -+} -+ -+static int init_filter_graph(enum AVPixelFormat pixfmt, int width, int height) { -+ AVFilterInOut *inputs = NULL, *outputs = NULL; -+ char args[512]; -+ int res; -+ -+ delete_filter_graph(); -+ filter_graph = avfilter_graph_alloc(); -+ snprintf(args, sizeof(args), -+ "buffer=video_size=%dx%d:pix_fmt=%d:time_base=1/1:pixel_aspect=0/1[in];" -+ "[in]yadif[out];" -+ "[out]buffersink", -+ width, height, pixfmt); -+ res = avfilter_graph_parse2(filter_graph, args, &inputs, &outputs); -+ if (res < 0) -+ return res; -+ if(inputs || outputs) -+ return -1; -+ res = avfilter_graph_config(filter_graph, NULL); -+ if (res < 0) -+ return res; -+ -+ buffersrc_ctx = avfilter_graph_get_filter(filter_graph, "Parsed_buffer_0"); -+ buffersink_ctx = avfilter_graph_get_filter(filter_graph, "Parsed_buffersink_2"); -+ if (!buffersrc_ctx || !buffersink_ctx) -+ return -1; -+ filter_frame = av_frame_alloc(); -+ last_width = width; -+ last_height = height; -+ last_pixfmt = pixfmt; -+ -+ return 0; -+} -+ -+static int process_filter_graph(AVPicture *dst, const AVPicture *src, -+ enum AVPixelFormat pixfmt, int width, int height) { -+ int res; -+ -+ if (!filter_graph || width != last_width || -+ height != last_height || pixfmt != last_pixfmt) { -+ res = init_filter_graph(pixfmt, width, height); -+ if (res < 0) -+ return res; -+ } -+ -+ memcpy(filter_frame->data, src->data, sizeof(src->data)); -+ memcpy(filter_frame->linesize, src->linesize, sizeof(src->linesize)); -+ filter_frame->width = width; -+ filter_frame->height = height; -+ filter_frame->format = pixfmt; -+ res = av_buffersrc_add_frame(buffersrc_ctx, filter_frame); -+ if (res < 0) -+ return res; -+ res = av_buffersink_get_frame(buffersink_ctx, filter_frame); -+ if (res < 0) -+ return res; -+ av_picture_copy(dst, (const AVPicture *) filter_frame, pixfmt, width, height); -+ av_frame_unref(filter_frame); -+ -+ return 0; -+} - - /** - * ffmpeg_deinterlace -@@ -1057,8 +1132,8 @@ - picture.linesize[1] = width2; - picture.linesize[2] = width2; - -- /* We assume using 'PIX_FMT_YUV420P' always */ -- avpicture_deinterlace(&picture, &picture, PIX_FMT_YUV420P, width, height); -+ /* We assume using 'AV_PIX_FMT_YUV420P' always */ -+ process_filter_graph(&picture, &picture, AV_PIX_FMT_YUV420P, width, height); - - #if !defined(__SSE_MATH__) && (defined(__i386__) || defined(__x86_64__)) - __asm__ __volatile__ ( "emms"); - ---- a/ffmpeg.h -+++ b/ffmpeg.h -@@ -6,6 +6,9 @@ - - #ifdef FFMPEG_NEW_INCLUDES - #include <libavformat/avformat.h> -+#include <libavfilter/avfilter.h> -+#include <libavfilter/buffersrc.h> -+#include <libavfilter/buffersink.h> - #else - #include <avformat.h> - #endif ---- a/netcam_rtsp.c -+++ b/netcam_rtsp.c -@@ -233,7 +233,7 @@ - buffer = netcam->receiving; - buffer->used = 0; - -- AVFrame *frame = avcodec_alloc_frame(); -+ AVFrame *frame = av_frame_alloc(); - - AVPacket packet; - -@@ -268,7 +268,7 @@ - - // at this point, we are finished with the packet and frame, so free them. - av_free_packet(&packet); -- av_free(frame); -+ av_frame_free(&frame); - - struct timeval curtime; - diff --git a/api-update_libav10.patch b/api-update_libav10.patch deleted file mode 100644 index b33f0d8..0000000 --- a/api-update_libav10.patch +++ /dev/null @@ -1,51 +0,0 @@ -Description: Update for libav10 API -Author: Ximin Luo <infinity0@pwned.gg> -Bug: https://github.com/sackmotion/motion/pull/17 - ---- a/ffmpeg.c -+++ b/ffmpeg.c -@@ -434,7 +434,7 @@ - #endif - /* Manually override the codec id. */ - if (of) -- of->video_codec = CODEC_ID_MSMPEG4V2; -+ of->video_codec = AV_CODEC_ID_MSMPEG4V2; - - } else if (strcmp(codec, "swf") == 0) { - ext = ".swf"; -@@ -450,7 +450,7 @@ - #else - of = av_guess_format("flv", NULL, NULL); - #endif -- of->video_codec = CODEC_ID_FLV1; -+ of->video_codec = AV_CODEC_ID_FLV1; - } else if (strcmp(codec, "ffv1") == 0) { - ext = ".avi"; - #ifdef GUESS_NO_DEPRECATED -@@ -463,7 +463,7 @@ - * Requires strict_std_compliance to be <= -2 - */ - if (of) -- of->video_codec = CODEC_ID_FFV1; -+ of->video_codec = AV_CODEC_ID_FFV1; - - } else if (strcmp(codec, "mov") == 0) { - ext = ".mov"; -@@ -559,7 +559,7 @@ - - /* Create a new video stream and initialize the codecs. */ - ffmpeg->video_st = NULL; -- if (ffmpeg->oc->oformat->video_codec != CODEC_ID_NONE) { -+ if (ffmpeg->oc->oformat->video_codec != AV_CODEC_ID_NONE) { - #if defined FF_API_NEW_AVIO - ffmpeg->video_st = avformat_new_stream(ffmpeg->oc, NULL /* Codec */); - #else -@@ -586,7 +586,7 @@ - #else - c->codec_type = AVMEDIA_TYPE_VIDEO; - #endif -- is_mpeg1 = c->codec_id == CODEC_ID_MPEG1VIDEO; -+ is_mpeg1 = c->codec_id == AV_CODEC_ID_MPEG1VIDEO; - - if (strcmp(ffmpeg_video_codec, "ffv1") == 0) - c->strict_std_compliance = -2; diff --git a/motion-0002-there-is-no-bin-service-in-Fedora-use-systemctl.patch b/motion-0002-there-is-no-bin-service-in-Fedora-use-systemctl.patch deleted file mode 100644 index 6ac5d8a..0000000 --- a/motion-0002-there-is-no-bin-service-in-Fedora-use-systemctl.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0e81a85851b9c4aa495b2dd697120df5ca53d660 Mon Sep 17 00:00:00 2001 -From: Tomasz Torcz <tomek@pipebreaker.pl> -Date: Sat, 8 Dec 2012 10:38:42 +0100 -Subject: [PATCH] there is no "/bin/service" in Fedora, use systemctl - ---- - motion.logrotate | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/motion.logrotate b/motion.logrotate -index b97f2f3..75ad7c2 100644 ---- a/motion.logrotate -+++ b/motion.logrotate -@@ -5,6 +5,6 @@ - size 10M - create 0600 root root - postrotate -- /bin/service motion reload >/dev/null 2>&1 || true -+ /usr/bin/systemctl reload-or-try-restart motion.service >/dev/null 2>&1 || true - endscript - } --- -1.8.0.1 - diff --git a/motion-version.patch b/motion-version.patch deleted file mode 100644 index a6665ab..0000000 --- a/motion-version.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- motion-3.3.0/configure.orig 2015-11-18 19:50:57.389955732 +0000 -+++ motion-3.3.0/configure 2015-11-18 19:51:41.753452488 +0000 -@@ -577,8 +577,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='motion' - PACKAGE_TARNAME='motion' --PACKAGE_VERSION='trunkREVUNKNOWN' --PACKAGE_STRING='motion trunkREVUNKNOWN' -+PACKAGE_VERSION='3.3.0' -+PACKAGE_STRING='motion trunkREV561' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - diff --git a/motion.spec b/motion.spec index e6e65b6..5e945f4 100644 --- a/motion.spec +++ b/motion.spec @@ -19,30 +19,28 @@ # tar -pczf motion-3.3.0.tar.gz motion-3.3.0/ #v- -%global nextver 3.3.0 +%global nextver 4.0.1 Name: motion -Version: %{nextver}.trunkREV561 -Release: 3%{?dist} +Version: %{nextver} +Release: 1%{?dist} Summary: A motion detection system Group: Applications/Multimedia License: GPLv2+ URL: http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome -Source0: http://prdownloads.sourceforge.net/%{name}/%{name}-%{nextver}.tar.gz +Source0: https://github.com/Motion-Project/motion/archive/release-%{nextver}.tar.gz#/%{name}-release-%{nextver}.tar.gz Source1: motion.service Source2: motion.tmpfiles -Patch1: motion-0002-there-is-no-bin-service-in-Fedora-use-systemctl.patch -Patch2: motion-version.patch -# patches from Debian -# https://anonscm.debian.org/git/users/infinity0/motion.git/tree/debian/patches -Patch3: api-update_copy-old-API-items.patch -Patch4: api-update_ffmpeg-2.9.patch -Patch5: api-update_libav10.patch - -BuildRequires: libjpeg-devel zlib-devel ffmpeg-devel + +BuildRequires: libjpeg-devel +Buildrequires: zlib-devel +Buildrequires: ffmpeg-devel Buildrequires: pkgconfig(sqlite3) -BuildRequires: autoconf automake libtool +BuildRequires: autoconf +Buildrequires: automake +Buildrequires: libtool BuildRequires: systemd-units + #This requires comes from the startup script, it will be there until motion supports libv4l calls in the code Requires: libv4l Requires(pre): shadow-utils @@ -59,32 +57,28 @@ with a rather small footprint. This version is built with ffmpeg support but without MySQL and PostgreSQL support. %prep -%setup -q -n %{name}-%{nextver} -%patch1 -p1 -%patch3 -p1 -b .copy-old-API-items -%patch4 -p1 -b .ffmpeg-2.9 -%patch5 -p1 -b .libav10 +%setup -q -n %{name}-release-%{nextver} autoreconf -%patch2 -p1 -b .version %build -#export PKG_CONFIG_LIBDIR="%{_libdir}/ffmpeg-compat/pkgconfig" -%configure --sysconfdir=%{_sysconfdir}/%{name} \ +%configure \ --without-optimizecpu --with-ffmpeg --without-mysql --without-pgsql -make %{?_smp_mflags} +%make_build %install -make install DESTDIR=%{buildroot} -#Rename docdir -mv %{buildroot}/%{_docdir}/%{name}-%{nextver} %{buildroot}/%{_docdir}/%{name} -#We rename the configuration file +%make_install + +#We rename the configuration files mv %{buildroot}%{_sysconfdir}/%{name}/motion-dist.conf %{buildroot}%{_sysconfdir}/%{name}/motion.conf -#We move the logrotate configuration -mkdir %{buildroot}%{_sysconfdir}/logrotate.d -mv %{_builddir}/%{name}-%{nextver}/motion.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/motion -#We run as motion:video user, reflect that in logrotate config -sed -i 's|create 0600 root root|create 0600 motion video|g' %{buildroot}%{_sysconfdir}/logrotate.d/motion +mv %{buildroot}%{_sysconfdir}/%{name}/camera1-dist.conf %{buildroot}%{_sysconfdir}/%{name}/camera1.conf +mv %{buildroot}%{_sysconfdir}/%{name}/camera2-dist.conf %{buildroot}%{_sysconfdir}/%{name}/camera2.conf +mv %{buildroot}%{_sysconfdir}/%{name}/camera3-dist.conf %{buildroot}%{_sysconfdir}/%{name}/camera3.conf +mv %{buildroot}%{_sysconfdir}/%{name}/camera4-dist.conf %{buildroot}%{_sysconfdir}/%{name}/camera4.conf +#Delete COPYING from doc directory +rm %{buildroot}%{_datadir}/doc/motion/COPYING +#Remove init files +rm %{buildroot}%{_datadir}/%{name}/examples/motion.init-* #We change the PID file path to match the one in the startup script sed -i 's|/var/run/motion/motion.pid|/var/run/motion.pid|g' %{buildroot}%{_sysconfdir}/%{name}/motion.conf #We remove SQL directives in the configuration file, as we don't use them @@ -123,32 +117,22 @@ exit 0 # ownership at the same time as we switch to running as user find /var/motion -user root -group root -exec chown motion:video '{}' ';' -%clean -rm -rf %{buildroot} - %files -#Permissions are bogus upstream, we need to be sure to set them here -%defattr (-,root,root,-) +%doc CHANGELOG CREDITS README.md motion_guide.html *.jpg *.png +%license COPYING %dir %{_sysconfdir}/%{name} -%dir %{_datadir}/%{name}-%{nextver} -%dir %{_datadir}/%{name}-%{nextver}/examples -%doc CHANGELOG COPYING CREDITS README motion_guide.html INSTALL -%attr(0644,root,root) %{_datadir}/%{name}-%{nextver}/examples/motion-dist.conf -%attr(0755,root,root) %{_datadir}/%{name}-%{nextver}/examples/motion.init-Debian -%attr(0755,root,root) %{_datadir}/%{name}-%{nextver}/examples/motion.init-FreeBSD.sh -%attr(0755,root,root) %{_datadir}/%{name}-%{nextver}/examples/motion.init-Fedora -%attr(0644,root,root) %{_datadir}/%{name}-%{nextver}/examples/thread1.conf -%attr(0644,root,root) %{_datadir}/%{name}-%{nextver}/examples/thread2.conf -%attr(0644,root,root) %{_datadir}/%{name}-%{nextver}/examples/thread3.conf -%attr(0644,root,root) %{_datadir}/%{name}-%{nextver}/examples/thread4.conf -%attr(0644,root,root) %{_sysconfdir}/logrotate.d/motion -%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}/motion.conf -%attr(0755,root,root) %{_bindir}/motion -%attr(0644,root,root) %{_mandir}/man1/motion.1* -%attr(0755,root,root) %{_unitdir}/%{name}.service -%attr(0755,root,root) %{_tmpfilesdir}/%{name}.conf +%config(noreplace) %{_sysconfdir}/%{name}/*.conf +%{_bindir}/motion +%{_datadir}/%{name}/ +%{_mandir}/man1/motion.1* +%{_unitdir}/%{name}.service +%{_tmpfilesdir}/%{name}.conf %changelog +* Mon Mar 13 2017 Leigh Scott <leigh123linux@googlemail.com> - 4.0.1-1 +- Update to 4.0.1 release +- Clean up spec file + * Sat Jul 30 2016 Julian Sikorski <belegdol@fedoraproject.org> - 3.3.0.trunkREV561-3 - Rebuilt for ffmpeg-3.1.1 @@ -1 +1 @@ -354e96655725dff7bc935c0a193c02ed motion-3.3.0.tar.gz +5c87f90c4118d8cf0fb14700db69118f motion-release-4.0.1.tar.gz |
