summaryrefslogtreecommitdiff
path: root/pcr/zoneminder
diff options
context:
space:
mode:
authorMárcio Alexandre Silva Delgado <coadde@lavabit.com>2012-11-07 03:57:15 -0200
committerMárcio Alexandre Silva Delgado <coadde@lavabit.com>2012-11-07 03:57:15 -0200
commitf72e0535d2d61d406463f32a90de35f34ee65ca3 (patch)
treef60a6b86b0de35241080a9443ba787a068a08694 /pcr/zoneminder
parent40f6861122683cc6343edc9f369c1c7061590924 (diff)
zoneminder: change zoneminder-libav to default and drop standard and lts packages
Diffstat (limited to 'pcr/zoneminder')
-rw-r--r--pcr/zoneminder/PKGBUILD77
-rw-r--r--pcr/zoneminder/patch-ffmpeg-0.11.patch60
2 files changed, 35 insertions, 102 deletions
diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD
index 9e65ba88a..236ceca01 100644
--- a/pcr/zoneminder/PKGBUILD
+++ b/pcr/zoneminder/PKGBUILD
@@ -6,9 +6,10 @@
# based of debian squeeze package
+pkgbase=zoneminder
pkgname=zoneminder
pkgver=1.25.0
-pkgrel=23
+pkgrel=24
pkgdesc='Capture, analyse, record and monitor video security cameras'
arch=(
i686
@@ -18,14 +19,14 @@ arch=(
backup=(
etc/zm.conf
)
-url="http://www.$pkgname.com"
+url="http://www.$pkgbase.com"
license=(
GPL
)
depends=(
apache
cambozola
- ffmpeg-static
+ libav-static
gnutls
mariadb
perl-archive-zip
@@ -52,20 +53,18 @@ makedepends=(
optdepends=(
netpbm
)
-install=$pkgname.install
+install=$pkgbase.install
source=(
- http://www.$pkgname.com/downloads/ZoneMinder-$pkgver.tar.gz
- httpd-$pkgname.conf
- $pkgname
- $pkgname.service
- patch-ffmpeg-0.11.patch
+ http://www.$pkgbase.com/downloads/ZoneMinder-$pkgver.tar.gz
+ httpd-$pkgbase.conf
+ $pkgbase
+ $pkgbase.service
)
sha512sums=(
3e18993b0539729491052c97d8c94227ccc089eb40277c2f07682f30049033303c7cfe9734fdac6d33ae67df29c76eb72bf7fbb5dae8227e8831fa603b61c375
4ce0d8eba9d006d258f5b8a83920fc17f1f602b96518d37b7a47cd9b6eb84ef2587641a6ba839a469c3f0e33b46475866187279ae3f8be0d4054b074ee5d6b08
ab4e1d5ddaf4d9cd53d6ca59d7965902afd6a2dc830fbbafa270736c52c2b3563075fee860bb0276466f96e9dbfb71b259ac45a4ae2e4ead8eaec154a0159eb0
cfb0eb87a989236c72741a496ddc6a73aa2696e5beaaca4836d3c231ddb24c7ef5e9f65e7afa49674f2115cbfa4a07c75486e1947ce294c816ddbb875f3b99cf
- 382799ad6add1632d934544230520f942dae37913b58cfa19e0cb2b11e7002267b1fdb9aa535f2217bcccf0c85c4d754f316dc3980a3ca267e5b3f5500536024
)
build() {
@@ -73,10 +72,12 @@ build() {
# ZM_RUNDIR need change to run dir
export CPPFLAGS=-D__STDC_CONSTANT_MACROS\
- ZM_LOGDIR=/var/log/$pkgname\
- ZM_RUNDIR=/tmp/$pkgname\
+ OPT_FFMPEG=yes\
+ PATH_FFMPEG=/usr/bin/avconv-static\
+ ZM_LOGDIR=/var/log/$pkgbase\
+ ZM_RUNDIR=/tmp/$pkgbase\
ZM_SSL_LIB=gnutls\
- ZM_TMPDIR=/tmp/$pkgname
+ ZM_TMPDIR=/tmp/$pkgbase
# Patch for GCC 4.7.x
sed -i -e 's/^#include <errno.h>/#include <errno.h>\n#include <unistd.h>/'\
@@ -94,9 +95,14 @@ build() {
# Patch for support html5 video and flv
sed -i -e '/ZM_MPEG_LIVE_FORMAT/,+1 s/swf/webm/;/ZM_MPEG_REPLAY_FORMAT/,+1 s/swf/webm/;
- /ZM_FFMPEG_FORMATS/,+1 s/mpg mpeg wmv asf avi\* mov swf 3gp\*\*/mpg mpeg wmv asf avi\* mov flv swf 3gp\*\* webm ogg h254/'\
+ /ZM_FFMPEG_FORMATS/,+1 s/mpg mpeg wmv asf avi\* mov swf 3gp\*\*/mpg mpeg wmv asf avi\* mov flv swf 3gp\*\* webm ogg h264/'\
scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read
+ # Patch for enable video export
+ #sed -i -e '/ZM_OPT_FFMPEG/,+1 s/@OPT_FFMPEG@/yes/;
+ # /ZM_PATH_FFMPEG/,+1 s/@PATH_FFMPEG@/\/usr\/bin\/avconv-static/'\
+ # scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read
+
# Patch for change path run dir
sed -i -e '/ZM_PATH_SOCKS/,+1 s/TMP/RUN/'\
scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read
@@ -126,19 +132,6 @@ build() {
s/^AC_SUBST(ZM_CONFIG,"$SYSCONFDIR\/zm.conf")/AC_SUBST(ZM_CONFIG,"$SYSCONFDIR\/zm.conf")\n\nEXTRA_PERL_LIB="# Include from system perl paths only"\nPERL_MM_PARMS="INSTALLDIRS=vendor"/'\
configure.ac
- # Patch for support new ffmpeg
- patch -p1 < $srcdir/patch-ffmpeg-0.11.patch
-# sed -i -e 's/if ( av_open_input_file( \&mFormatContext, mPath.c_str(), NULL, 0, NULL ) !=0 )/if ( avformat_open_input( \&mFormatContext, mPath.c_str(), NULL, NULL ) !=0 )/;
-# s/if ( avcodec_open( mCodecContext, mCodec ) < 0 )/if ( avcodec_open2( mCodecContext, mCodec, NULL ) < 0 )/'\
-# src/zm_ffmpeg_camera.cpp
-# sed -i -e 's/if ( av_set_parameters(ofc, NULL) < 0 )/\/\*\n \* Removed in last ffmpeg\n \* if ( av_set_parameters(ofc, NULL) < 0 )/;
-# /Panic( "Invalid output format parameters" );/,+1 s/}/}\*/;
-# /if ( avio_open(&ofc->pb, filename, URL_WRONLY) < 0 )/ s/URL_WRONLY/AVIO_FLAG_WRITE/;
-# s/av_write_header(ofc);/avformat_write_header(ofc, NULL);/'\
-# src/zm_mpeg.cpp
- sed -i -e 's/avcodec_init/avcodec_open/'\
- configure{,.ac}
-
# Patch for support ffmpeg with <libavutil/mathematics.h> and C library
sed -i -e 's/^extern "C" {/extern "C" {\n#ifdef _STDINT_H\n#undef _STDINT_H\n#endif\n#include <stdint.h>/
s/^#include <libavutil\/avutil.h>/#include <libavutil\/avutil.h>\n#include <libavutil\/mathematics.h>/'\
@@ -163,10 +156,10 @@ build() {
--sysconfdir=/etc\
--with-cgidir=/srv/http/cgi-bin\
--with-extralibs='-L/usr/lib -L/usr/lib/mysql'\
- --with-ffmpeg=/usr\
+ --with-ffmpeg=/opt/libav-static\
--with-libarch=lib\
--with-mysql=/usr\
- --with-webdir=/srv/http/$pkgname\
+ --with-webdir=/srv/http/$pkgbase\
--with-webgroup=http\
--with-webhost=localhost\
--with-webuser=http
@@ -179,25 +172,25 @@ package() {
make DESTDIR=$pkgdir install
- mkdir -p $pkgdir/{etc/{httpd/conf/extra,rc.d},srv/http/{cgi-bin,$pkgname},usr/{lib/systemd/system,share/{license/$pkgname,$pkgname/db}},var/{cache/$pkgname,log/$pkgname}}
+ mkdir -p $pkgdir/{etc/{httpd/conf/extra,rc.d},srv/http/{cgi-bin,$pkgbase},usr/{lib/systemd/system,share/{license/$pkgbase,$pkgbase/db}},var/{cache/$pkgbase,log/$pkgbase}}
- chown -R http.http $pkgdir/{etc/zm.conf,var/{cache/$pkgname,log/$pkgname}}
+ chown -R http.http $pkgdir/{etc/zm.conf,var/{cache/$pkgbase,log/$pkgbase}}
chmod 0700 $pkgdir/etc/zm.conf
for i in events images temp; do
- mv $pkgdir/srv/http/$pkgname/$i $pkgdir/var/cache/$pkgname/$i
- ln -s /var/cache/$pkgname/$i $pkgdir/srv/http/$pkgname/$i
- chown -h http.http $pkgdir/srv/http/$pkgname/$i
+ mv $pkgdir/srv/http/$pkgbase/$i $pkgdir/var/cache/$pkgbase/$i
+ ln -s /var/cache/$pkgbase/$i $pkgdir/srv/http/$pkgbase/$i
+ chown -h http.http $pkgdir/srv/http/$pkgbase/$i
done
- ln -s /srv/http/cgi-bin $pkgdir/srv/http/$pkgname
- chown -h http.http $pkgdir/srv/http/{cgi-bin,$pkgname,$pkgname/cgi-bin}
+ ln -s /srv/http/cgi-bin $pkgdir/srv/http/$pkgbase
+ chown -h http.http $pkgdir/srv/http/{cgi-bin,$pkgbase,$pkgbase/cgi-bin}
- ln -s /usr/share/cambozola/cambozola.jar $pkgdir/srv/http/$pkgname
+ ln -s /usr/share/cambozola/cambozola.jar $pkgdir/srv/http/$pkgbase
- install -D -m 644 $srcdir/httpd-$pkgname.conf $pkgdir/etc/httpd/conf/extra
- install -D -m 644 $srcdir/$pkgname $pkgdir/etc/rc.d
- install -D -m 644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system
- install -D -m 644 COPYING $pkgdir/usr/share/license/$pkgname
- install -D -m 644 db/zm*.sql $pkgdir/usr/share/$pkgname/db
+ install -D -m 644 $srcdir/httpd-$pkgbase.conf $pkgdir/etc/httpd/conf/extra
+ install -D -m 644 $srcdir/$pkgbase $pkgdir/etc/rc.d
+ install -D -m 644 $srcdir/$pkgbase.service $pkgdir/usr/lib/systemd/system
+ install -D -m 644 COPYING $pkgdir/usr/share/license/$pkgbase
+ install -D -m 644 db/zm*.sql $pkgdir/usr/share/$pkgbase/db
}
diff --git a/pcr/zoneminder/patch-ffmpeg-0.11.patch b/pcr/zoneminder/patch-ffmpeg-0.11.patch
deleted file mode 100644
index ac56e4c69..000000000
--- a/pcr/zoneminder/patch-ffmpeg-0.11.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp
-index 42927f6..61df606 100644
---- a/src/zm_ffmpeg_camera.cpp
-+++ b/src/zm_ffmpeg_camera.cpp
-@@ -91,7 +91,7 @@ int FfmpegCamera::PrimeCapture()
- Info( "Priming capture from %s", mPath.c_str() );
-
- // Open the input, not necessarily a file
-- if ( av_open_input_file( &mFormatContext, mPath.c_str(), NULL, 0, NULL ) !=0 )
-+ if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, NULL ) !=0 )
- Fatal( "Unable to open input %s due to: %s", mPath.c_str(), strerror(errno) );
-
- // Locate stream info from input
-@@ -122,7 +122,7 @@ int FfmpegCamera::PrimeCapture()
- Fatal( "Can't find codec for video stream from %s", mPath.c_str() );
-
- // Open the codec
-- if ( avcodec_open( mCodecContext, mCodec ) < 0 )
-+ if ( avcodec_open2( mCodecContext, mCodec, NULL ) < 0 )
- Fatal( "Unable to open codec for video stream from %s", mPath.c_str() );
-
- // Allocate space for the native video frame
-
-diff --git a/src/zm_mpeg.cpp b/src/zm_mpeg.cpp
-index f5de2a4..d614346 100644
---- a/src/zm_mpeg.cpp
-+++ b/src/zm_mpeg.cpp
-@@ -130,10 +130,12 @@ void VideoStream::SetParameters()
- {
- /* set the output parameters (must be done even if no
- parameters). */
-- if ( av_set_parameters(ofc, NULL) < 0 )
-+ /*
-+ * Removed in last ffmpeg
-+ * if ( av_set_parameters(ofc, NULL) < 0 )
- {
- Panic( "Invalid output format parameters" );
-- }
-+ }*/
- //dump_format(ofc, 0, filename, 1);
- }
-
-@@ -222,7 +224,7 @@ void VideoStream::OpenStream()
- if ( !(of->flags & AVFMT_NOFILE) )
- {
- #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1)
-- if ( avio_open(&ofc->pb, filename, URL_WRONLY) < 0 )
-+ if ( avio_open(&ofc->pb, filename, AVIO_FLAG_WRITE) < 0 )
- #else
- if ( url_fopen(&ofc->pb, filename, URL_WRONLY) < 0 )
- #endif
-@@ -241,7 +243,7 @@ void VideoStream::OpenStream()
- }
-
- /* write the stream header, if any */
-- av_write_header(ofc);
-+ avformat_write_header(ofc, NULL);
- }
-
- VideoStream::VideoStream( const char *filename, const char *format, int bitrate, double frame_rate, int colours, int subpixelorder, int width, int height )