summaryrefslogtreecommitdiff
path: root/community/motion
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-07-10 00:01:37 +0000
committerroot <root@rshg054.dnsready.net>2012-07-10 00:01:37 +0000
commit0615a909b089a81d068ae10517ceff31dabfece1 (patch)
tree6e5d23671bbee08a27827c126237a47ff9d9c0da /community/motion
parent78eac58df0ec18da4bfd73868668dcaea99fd008 (diff)
Tue Jul 10 00:01:37 UTC 2012
Diffstat (limited to 'community/motion')
-rw-r--r--community/motion/PKGBUILD23
-rw-r--r--community/motion/ffmpeg-compat.patch172
2 files changed, 184 insertions, 11 deletions
diff --git a/community/motion/PKGBUILD b/community/motion/PKGBUILD
index 55b4fd07f..962c4ae28 100644
--- a/community/motion/PKGBUILD
+++ b/community/motion/PKGBUILD
@@ -1,37 +1,39 @@
-# $Id: PKGBUILD 70406 2012-05-05 14:52:58Z spupykin $
+# $Id: PKGBUILD 73478 2012-07-08 09:30:42Z ibiru $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
pkgname=motion
pkgver=3.2.12
-pkgrel=4
+pkgrel=6
pkgdesc="A software motion detector which grabs images from video4linux devices and/or from webcams"
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome"
-depends=('ffmpeg' 'libjpeg' 'v4l-utils')
+depends=('libjpeg' 'v4l-utils' 'ffmpeg-compat')
backup=('etc/motion/motion.conf')
options=('!makeflags')
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz
rc.motion
ffmpeg-0.8.patch
- linux-headers.patch)
+ linux-headers.patch
+ ffmpeg-compat.patch)
md5sums=('1ba0065ed50509aaffb171594c689f46'
'2e8c53c4980edddd420f08fdd572c9be'
'd36687710837d69fbce4608b1345fa34'
- 'd8c3c4fdded5cfbd729710475559a21d')
-sha1sums=('dc59b36e45e7626baa65ce62c961af918fea76bd'
- '47536a115d4df7497f6e6c616b76ea98e3372e29'
- '6912448db0711f85322505ee6f8052f8f98ae634'
- '6f33dab895ae398cc5e7017cbf5dc5d728f3ca9e')
+ 'd8c3c4fdded5cfbd729710475559a21d'
+ 'e85c596292aceb425fcf17e5072e2fff')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
+ export PKG_CONFIG_PATH=/usr/lib/ffmpeg-compat/pkgconfig:$PKG_CONFIG_PATH
patch -Np1 -i $srcdir/ffmpeg-0.8.patch
patch -Np1 -i $srcdir/linux-headers.patch
+ patch -Np1 -i $srcdir/ffmpeg-compat.patch
+ autoreconf
./configure --prefix=/usr \
--without-pgsql \
--without-mysql \
- --sysconfdir=/etc/motion
+ --sysconfdir=/etc/motion \
+ --with-ffmpeg
make
}
@@ -39,6 +41,5 @@ package(){
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
mv "${pkgdir}/etc/motion/motion-dist.conf" "${pkgdir}/etc/motion/motion.conf"
-
install -Dm755 "${srcdir}/rc.motion" "${pkgdir}/etc/rc.d/motion"
}
diff --git a/community/motion/ffmpeg-compat.patch b/community/motion/ffmpeg-compat.patch
new file mode 100644
index 000000000..278166e18
--- /dev/null
+++ b/community/motion/ffmpeg-compat.patch
@@ -0,0 +1,172 @@
+diff -wbBur motion-3.2.12/configure.in motion-3.2.12.q/configure.in
+--- motion-3.2.12/configure.in 2010-06-01 10:48:23.000000000 +0400
++++ motion-3.2.12.q/configure.in 2012-06-20 13:51:42.000000000 +0400
+@@ -290,163 +290,11 @@
+ fi
+
+
+-#
+-# Check for libavcodec and libavformat from ffmpeg
+-#
+-FFMPEG_DIR="yes"
+-FFMPEG_OK="no_found"
+-FFMPEG_OBJ=""
+-AC_ARG_WITH(ffmpeg,
+-[ --with-ffmpeg[=DIR] Specify the prefix for the install path for
+- libavcodec/libavformat (part of ffmpeg) be able to
+- encode mpeg movies realtime.
+- If this is not specified motion will try to find
+- the libraries in /usr and /usr/local.
+- ],
+-FFMPEG_DIR="$withval"
+-)
+-#
+-# --without-ffmpeg or with-ffmpeg=no
+-#
+-if test "${FFMPEG_DIR}" = "no"; then
+- AC_MSG_CHECKING(for ffmpeg)
+- AC_MSG_RESULT(skipping)
+-#
+-# with-ffmpeg=<dir> or nothing
+-#
+-else if test "${FFMPEG_DIR}" = "yes"; then
+- # AUTODETECT STATIC/SHARED LIB
+- AC_MSG_CHECKING(for ffmpeg autodetecting)
+-
+- 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)
+- FFMPEG_OK="found"
+- FFMPEG_LIB="/usr/lib64"
+- FFMPEG_DIR="/usr"
+- elif test -f /usr/lib/libavcodec.a -o -f /usr/lib/libavcodec.so && test -f /usr/lib/libavformat.a -o -f /usr/lib/libavformat.so ; then
+- AC_MSG_RESULT(found in /usr/lib)
+- FFMPEG_OK="found"
+- FFMPEG_LIB="/usr/lib"
+- FFMPEG_DIR="/usr"
+- elif test -f /usr/local/lib/libavcodec.a -o -f /usr/local/lib/libavcodec.so && test -f /usr/local/lib/libavformat.a -o -f /usr/local/lib/libavformat.so ; then
+- AC_MSG_RESULT(found in /usr/local/lib)
+- FFMPEG_OK="found"
+- FFMPEG_LIB="/usr/local/lib"
+- FFMPEG_DIR="/usr/local"
+- else
+- AC_MSG_RESULT(not found)
+- echo ""
+- echo "**********************************************"
+- echo "* libavcodec.a or libavcodec.so or *"
+- echo "* libavformat.a or libavformat.so not found: *"
+- echo "* ALL FFMPEG FEATURES DISABLED *"
+- echo "* *"
+- echo "* Please read the Motion Guide for help: *"
+- echo "* http://motion.sourceforge.net *"
+- echo "**********************************************"
+- 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_RESULT(found)
+- FFMPEG_OK="found"
+- FFMPEG_LIB="${FFMPEG_DIR}/lib"
+- 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}"
+- FFMPEG_OK="found"
+- else
+- AC_MSG_RESULT(not found)
+- if test "${FFMPEG_OK}" != "found"; then
+- echo ""
+- echo "**********************************************"
+- echo "* libavcodec.a or libavcodec.so or *"
+- echo "* libavformat.a or libavformat.so not found: *"
+- echo "* ALL FFMPEG FEATURES DISABLED *"
+- echo "* *"
+- echo "* Please read the Motion Guide for help: *"
+- echo "* http://motion.sourceforge.net *"
+- echo "**********************************************"
+- echo ""
+- fi
+- fi
+-fi
+-
+-#
+-# Now check for ffmpeg headers ( avformat.h ) if ffmpeg libs were found
+-#
+-
+-if test "${FFMPEG_OK}" = "found"; then
+- AC_MSG_CHECKING(for ffmpeg headers in ${FFMPEG_DIR})
+-
+- if test -f ${FFMPEG_DIR}/include/avformat.h; then
+- AC_MSG_RESULT(found ${FFMPEG_DIR}/include/avformat.h)
+- FFMPEG_CFLAGS="-I${FFMPEG_DIR}/include"
+- elif test -f ${FFMPEG_DIR}/avformat.h; then
+- AC_MSG_RESULT(found ${FFMPEG_DIR}/avformat.h)
+- FFMPEG_CFLAGS="-I${FFMPEG_DIR}"
+- 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"
+- else
+- AC_MSG_RESULT(not found)
+- FFMPEG_OK="no_found"
+- echo "**********************************************"
+- echo "* avformat.h not found: *"
+- echo "* ALL FFMPEG FEATURES DISABLED *"
+- echo "* *"
+- echo "* Please read the Motion Guide for help: *"
+- echo "* http://motion.sourceforge.net *"
+- echo "**********************************************"
+- echo ""
+- fi
+-
+-#
+-# If ffmpeg libs and headers have been found
+-#
+-
+- if test "${FFMPEG_OK}" = "found"; then
+- TEMP_LIBS="$TEMP_LIBS -L${FFMPEG_LIB} -lavformat -lavcodec -lavutil -lm -lz"
+- TEMP_LDFLAGS="${TEMP_LDFLAGS} -L${FFMPEG_LIB}"
+- TEMP_CFLAGS="${TEMP_CFLAGS} -DHAVE_FFMPEG ${FFMPEG_CFLAGS}"
+-
+- FFMPEG_OBJ="ffmpeg.o"
+- AC_SUBST(FFMPEG_OBJ)
+-
+- AC_MSG_CHECKING([file_protocol is defined in ffmpeg ?])
+- saved_CFLAGS=$CFLAGS
+- saved_LIBS=$LIBS
+- CFLAGS="${FFMPEG_CFLAGS}"
+- LIBS="$TEMP_LIBS"
+-
+- AC_COMPILE_IFELSE(
+- [
+- #include <avformat.h>
+- URLProtocol test_file_protocol;
+- int main(void){
+- test_file_protocol.url_read = file_protocol.url_read;
+- return 0;
+- }
+- ],
+- [AC_MSG_RESULT(yes)],
+- [
+- AC_MSG_RESULT(no)
+- TEMP_CFLAGS="${TEMP_CFLAGS} -DHAVE_FFMPEG_NEW"
+- ]
+- )
+- CFLAGS=$saved_CFLAGS
+- LIBS=$saved_LIBS
+- fi
+-fi
+-fi
+-
++TEMP_CFLAGS+=" `pkg-config --cflags libavformat libavcodec` -DHAVE_FFMPEG -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW"
++TEMP_LIBS+=" `pkg-config --libs libavformat libavcodec` -lavutil -Wl,-rpath /usr/lib/ffmpeg-compat"
++FFMPEG_OK=found
++FFMPEG_OBJ="ffmpeg.o"
++AC_SUBST(FFMPEG_OBJ)
+
+ #
+ # Check Mysql