Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=openjava.git;a=commitdiff;h=0f71f9c6d92b6c1193d930c7c80c45353b5345f0

commit 0f71f9c6d92b6c1193d930c7c80c45353b5345f0
Author: James Buren <[email protected]>
Date:   Fri Jun 8 19:18:40 2012 -0500

motion-3.2.12-4-x86_64
* convert to use systemd schema

diff --git a/source/xmultimedia-extra/motion/FrugalBuild 
b/source/xmultimedia-extra/motion/FrugalBuild
index a00dfa7..56e942f 100644
--- a/source/xmultimedia-extra/motion/FrugalBuild
+++ b/source/xmultimedia-extra/motion/FrugalBuild
@@ -4,24 +4,29 @@

pkgname=motion
pkgver=3.2.12
-pkgrel=3
+pkgrel=4
pkgdesc="A program that monitors the video signal from one or more cameras and 
is able to detect if a significant part of the picture has changed."
Finclude sourceforge
+backup=(etc/$pkgname.conf)
url="http://www.lavrsen.dk/twiki/bin/view/Motion/";
-depends=('libjpeg' 'ffmpeg>=0.8' 'zlib' 'libogg' 'libx11')
+depends=('libjpeg' 'ffmpeg>=0.8' 'zlib' 'libogg' 'libx11' 'v4l-utils')
groups=('xmultimedia-extra')
archs=('i686' 'x86_64')
-source=($source rc.motion README.Frugalware)
+source=($source rc.$pkgname $pkgname.service linux-headers.patch 
ffmpeg-0.8.patch README.Frugalware)
sha1sums=('dc59b36e45e7626baa65ce62c961af918fea76bd' \
'b253e7162ab1e8b1042aec5c7dfcc571679f1672' \
-          'b0598b9068e3e136d4a4864f5fc66749c787d7f6')
+          '97afd8df013505d69f55f9c8b9a5c6182f6b8043' \
+          'b373f23d53a6326aa36d5162d4176cfb48f4c1be' \
+          '10c657e9635d553010a4a5692bfccad3018fa7b9' \
+          '273c3474c61bca1cce8537477e520d947bcf4116')
+_F_sysvinit_units=($pkgname)
+_F_systemd_units=($pkgname=)
+Finclude systemd

build()
{
Fcd
-       Fsed 'include/avformat.h' 'include/libavformat/avformat.h' configure.in
-       Fsed '<avformat.h>' '<libavformat/avformat.h>' ffmpeg.h
-       Fsed 'avstring.h' 'libavutil/avstring.h' ffmpeg.c
+       Fpatchall
Fautoreconf
# DO NOT REMOVE THIS!!
Fmake --without-optimizecpu --without-mysql --without-pgsql
@@ -32,6 +37,16 @@ build()
Fmakeinstall
Fdoc README.Frugalware
Frcd2
+
+       Fmv /etc/motion-dist.conf /etc/motion.conf
+
+       Fmkdir /etc/tmpfiles.d
+        cat > $Fdestdir/etc/tmpfiles.d/motion.conf << EOF
+d $Flocalstatedir/run/motion/ 0755 root root -
+EOF
+
+       Ffile /lib/systemd/system/$pkgname.service
+       Fgenscriptlet
}

# optimization OK
diff --git a/source/xmultimedia-extra/motion/README.Frugalware 
b/source/xmultimedia-extra/motion/README.Frugalware
index 3cfccd1..42c1692 100644
--- a/source/xmultimedia-extra/motion/README.Frugalware
+++ b/source/xmultimedia-extra/motion/README.Frugalware
@@ -1,5 +1,2 @@
You should edit the settings: videodevice, input, norm,
frequency, width, height and target_dir in '/etc/motion.conf'
-
-If the file already exists, it wont be overwritten by the package
-while upgrading. You can refer '/etc/motion-dist.conf' for configuring motion.
diff --git a/source/xmultimedia-extra/motion/ffmpeg-0.8.patch 
b/source/xmultimedia-extra/motion/ffmpeg-0.8.patch
new file mode 100644
index 0000000..cb02080
--- /dev/null
+++ b/source/xmultimedia-extra/motion/ffmpeg-0.8.patch
@@ -0,0 +1,114 @@
+diff -ur a/ffmpeg.c b/ffmpeg.c
+--- a/ffmpeg.c 2012-06-09 01:52:01.017467719 -0500
++++ b/ffmpeg.c 2012-06-09 01:53:41.127096599 -0500
+@@ -14,7 +14,7 @@
+
+ #include "ffmpeg.h"
+ #include "motion.h"
+-
++#include <libavformat/avformat.h>
+ #if LIBAVCODEC_BUILD > 4680
+ /* FFmpeg after build 4680 doesn't have support for mpeg1 videos with
+  * non-standard framerates. Previous builds contained a broken hack
+@@ -228,10 +228,12 @@
+     mpeg1_file_protocol.url_close = file_protocol.url_close;
+
+     /* Register the append file protocol. */
+-#if LIBAVFORMAT_BUILD >= (52<<16 | 31<<8)
+-    av_register_protocol(&mpeg1_file_protocol);
++#ifdef have_av_register_protocol2
++        av_register_protocol2(&mpeg1_file_protocol, 
sizeof(mpeg1_file_protocol));
++#elif defined have_av_register_protocol
++          av_register_protocol(&mpeg1_file_protocol);
+ #else
+-    register_protocol(&mpeg1_file_protocol);
++#   warning av_register_protocolXXX missing
+ #endif
+ }
+
+@@ -244,7 +246,7 @@
+     const char *ext;
+     AVOutputFormat *of = NULL;
+
+-    /* Here, we use guess_format to automatically setup the codec information.
++    /* Here, we use av_guess_format to automatically setup the codec 
information.
+      * If we are using msmpeg4, manually set that codec here.
+      * We also dynamically add the file extension to the filename here. This 
was
+      * done to support both mpeg1 and mpeg4 codecs since they have different 
extensions.
+@@ -258,7 +260,7 @@
+         /* We use "mpeg1video" for raw mpeg1 format. Using "mpeg" would
+          * result in a muxed output file, which isn't appropriate here.
+          */
+-        of = guess_format("mpeg1video", NULL, NULL);
++        of = av_guess_format("mpeg1video", NULL, NULL);
+         if (of) {
+             /* But we want the trailer to be correctly written. */
+             of->write_trailer = mpeg1_write_trailer;
+@@ -270,24 +272,24 @@
+ #endif
+     } else if (strcmp(codec, "mpeg4") == 0) {
+         ext = ".avi";
+-        of = guess_format("avi", NULL, NULL);
++        of = av_guess_format("avi", NULL, NULL);
+     } else if (strcmp(codec, "msmpeg4") == 0) {
+         ext = ".avi";
+-        of = guess_format("avi", NULL, NULL);
++        of = av_guess_format("avi", NULL, NULL);
+         if (of) {
+             /* Manually override the codec id. */
+             of->video_codec = CODEC_ID_MSMPEG4V2;
+         }
+     } else if (strcmp(codec, "swf") == 0) {
+         ext = ".swf";
+-        of = guess_format("swf", NULL, NULL);
++        of = av_guess_format("swf", NULL, NULL);
+     } else if (strcmp(codec, "flv") == 0) {
+         ext = ".flv";
+-        of = guess_format("flv", NULL, NULL);
++        of = av_guess_format("flv", NULL, NULL);
+         of->video_codec = CODEC_ID_FLV1;
+     } else if (strcmp(codec, "ffv1") == 0) {
+         ext = ".avi";
+-        of = guess_format("avi", NULL, NULL);
++        of = av_guess_format("avi", NULL, NULL);
+         if (of) {
+             /* Use the FFMPEG Lossless Video codec (experimental!).
+                Requires strict_std_compliance to be <= -2 */
+@@ -295,7 +297,7 @@
+         }
+     } else if (strcmp(codec, "mov") == 0) {
+         ext = ".mov";
+-        of = guess_format("mov", NULL, NULL);
++        of = av_guess_format("mov", NULL, NULL);
+     } else {
+         motion_log(LOG_ERR, 0, "ffmpeg_video_codec option value %s is not 
supported", codec);
+         return NULL;
+@@ -377,7 +379,7 @@
+
+     ffmpeg->c     = c = AVSTREAM_CODEC_PTR(ffmpeg->video_st);
+     c->codec_id   = ffmpeg->oc->oformat->video_codec;
+-    c->codec_type = CODEC_TYPE_VIDEO;
++    c->codec_type = AVMEDIA_TYPE_VIDEO;
+     is_mpeg1      = c->codec_id == CODEC_ID_MPEG1VIDEO;
+
+     if (strcmp(ffmpeg_video_codec, "ffv1") == 0)
+@@ -646,7 +648,7 @@
+     if (ffmpeg->oc->oformat->flags & AVFMT_RAWPICTURE) {
+         /* raw video case. The API will change slightly in the near future 
for that */
+ #ifdef FFMPEG_AVWRITEFRAME_NEWAPI
+-        pkt.flags |= PKT_FLAG_KEY;
++        pkt.flags |= AV_PKT_FLAG_KEY;
+         pkt.data = (uint8_t *)pic;
+         pkt.size = sizeof(AVPicture);
+         ret = av_write_frame(ffmpeg->oc, &pkt);
+@@ -667,7 +669,7 @@
+ #ifdef FFMPEG_AVWRITEFRAME_NEWAPI
+             pkt.pts = AVSTREAM_CODEC_PTR(ffmpeg->video_st)->coded_frame->pts;
+             if (AVSTREAM_CODEC_PTR(ffmpeg->video_st)->coded_frame->key_frame) 
{
+-                pkt.flags |= PKT_FLAG_KEY;
++                pkt.flags |= AV_PKT_FLAG_KEY;
+             }
+             pkt.data = ffmpeg->video_outbuf;
+             pkt.size = out_size;
+Only in b: ffmpeg.c.orig
+Only in b: ffmpeg.c.rej
diff --git a/source/xmultimedia-extra/motion/linux-headers.patch 
b/source/xmultimedia-extra/motion/linux-headers.patch
new file mode 100644
index 0000000..ab99ee6
--- /dev/null
+++ b/source/xmultimedia-extra/motion/linux-headers.patch
@@ -0,0 +1,35 @@
+diff -urN motion-3.2.12-OLD/motion.h motion-3.2.12-NEW/motion.h
+--- motion-3.2.12-OLD/motion.h 2010-05-31 23:48:23.000000000 -0700
++++ motion-3.2.12-NEW/motion.h 2011-08-30 02:11:08.000000000 -0700
+@@ -40,7 +40,7 @@
+
+ #define _LINUX_TIME_H 1
+ #if !defined(WITHOUT_V4L) && !defined(BSD)
+-#include <linux/videodev.h>
++#include <libv4l1-videodev.h>
+ #endif
+
+ #include <pthread.h>
+diff -urN motion-3.2.12-OLD/track.c motion-3.2.12-NEW/track.c
+--- motion-3.2.12-OLD/track.c  2010-05-31 23:48:23.000000000 -0700
++++ motion-3.2.12-NEW/track.c  2011-08-30 23:05:09.000000000 -0700
+@@ -11,6 +11,7 @@
+ #include "motion.h"
+
+ #ifndef WITHOUT_V4L
++#include <linux/videodev2.h>
+ #include "pwc-ioctl.h"
+ #endif
+
+diff -urN motion-3.2.12-OLD/video.h motion-3.2.12-NEW/video.h
+--- motion-3.2.12-OLD/video.h  2010-05-31 23:48:23.000000000 -0700
++++ motion-3.2.12-NEW/video.h  2011-08-30 02:11:12.000000000 -0700
+@@ -12,7 +12,7 @@
+
+ #define _LINUX_TIME_H 1
+ #ifndef WITHOUT_V4L
+-#include <linux/videodev.h>
++#include <libv4l1-videodev.h>
+ #include <sys/mman.h>
+ #include "pwc-ioctl.h"
+ #endif
diff --git a/source/xmultimedia-extra/motion/motion.install 
b/source/xmultimedia-extra/motion/motion.install
deleted file mode 100644
index aa63724..0000000
--- a/source/xmultimedia-extra/motion/motion.install
+++ /dev/null
@@ -1,19 +0,0 @@
-post_install()
-{
-       [ ! -f /etc/motion.conf ] && cp /etc/motion-dist.conf /etc/motion.conf
-  echo ""
-  echo "==> Configure motion by editing /etc/motion.conf before running motion"
-}
-
-post_upgrade()
-{
-  post_install
-}
-
-
-op=$1
-shift
-
-$op $*
-
-# vim: ft=sh
diff --git a/source/xmultimedia-extra/motion/motion.service 
b/source/xmultimedia-extra/motion/motion.service
new file mode 100644
index 0000000..9ba40a9
--- /dev/null
+++ b/source/xmultimedia-extra/motion/motion.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=motion
+After=syslog.target
+
+[Service]
+ExecStart=/usr/bin/motion
+PIDFile=/var/run/motion/motion.pid
+Type=forking
+
+[Install]
+WantedBy=multi-user.target
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to