diff options
author | Márcio Alexandre Silva Delgado <coadde@lavabit.com> | 2012-10-03 19:09:13 -0300 |
---|---|---|
committer | Márcio Alexandre Silva Delgado <coadde@lavabit.com> | 2012-10-03 19:09:13 -0300 |
commit | 96f0aa328d7def18d65a49e621abd06ad06105e9 (patch) | |
tree | 448b97881fc9ee5f74fa3c6c189d69cb25f3ec4b | |
parent | ef76c46b8cdc53619641624481bd342cfad46fca (diff) |
zoneminder and ffmpeg-static: updating packages
-rw-r--r-- | pcr/ffmpeg-static/PKGBUILD | 4 | ||||
-rw-r--r-- | pcr/zoneminder/PKGBUILD | 108 | ||||
-rw-r--r-- | pcr/zoneminder/httpd-zm.conf | 16 | ||||
-rw-r--r-- | pcr/zoneminder/patch-ffmpeg-configure.patch | 26 | ||||
-rw-r--r-- | pcr/zoneminder/zoneminder.install | 35 |
5 files changed, 118 insertions, 71 deletions
diff --git a/pcr/ffmpeg-static/PKGBUILD b/pcr/ffmpeg-static/PKGBUILD index 592c4a7bf..67ce115bb 100644 --- a/pcr/ffmpeg-static/PKGBUILD +++ b/pcr/ffmpeg-static/PKGBUILD @@ -5,7 +5,7 @@ # Maintainer (Parabola): Márcio Silva <coadde@lavabit.com> pkgname=ffmpeg-static -pkgver=0.11.2 +pkgver=1.0 pkgrel=1 epoch=1 pkgdesc='Complete and free Internet live audio and video broadcasting solution for GNU/Linux, with static library' @@ -17,7 +17,7 @@ makedepends=(yasm libvdpau) provides=(${pkgname%-static}) conflicts=(${pkgname%-static}) source=(http://${pkgname%-static}.org/releases/${pkgname%-static}-$pkgver.tar.bz2) -md5sums=(93c1908022567b321df74db7214da6ac) +md5sums=(3ed526cea20c1bffb5a37f7730f710bd) build() { cd ${pkgname%-static}-$pkgver diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index 91c6c9175..bb850eec2 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -8,14 +8,14 @@ pkgname=zoneminder pkgver=1.25.0 -pkgrel=16 +pkgrel=17 pkgdesc='Capture, analyse, record and monitor video security cameras' arch=(i686 x86_64 mips64el) backup=(etc/zm.conf etc/httpd/conf/extra/httpd-zm.conf) url=http://www.$pkgname.com license=(GPL) depends=( - apache cambozola ffmpeg gnutls mysql perl-archive-zip perl-date-manip + apache cambozola ffmpeg-static gnutls mysql perl-archive-zip perl-date-manip perl-dbd-mysql perl-dbi perl-expect perl-libwww perl-mime-lite perl-mime-tools perl-php-serialization perl-net-sftp-foreign perl-sys-mmap perl-time-modules perl-x10 php php-apache php-gd php-mcrypt @@ -24,21 +24,17 @@ makedepends=(netpbm) install=$pkgname.install source=( http://www.$pkgname.com/downloads/ZoneMinder-$pkgver.tar.gz - patch-ffmpeg-0.11.patch - patch-libavcodec-detection.patch - $pkgname-1.25.0-kernel35.patch httpd-zm.conf zm.rc.d $pkgname.service + patch-ffmpeg-0.11.patch ) md5sums=( eaefa14befd482154970541252aa1a39 - 81c8be870260142e2633eedf73c72040 - 94bf5d95fe5429f7df458ddfbabf0c12 - 48a3c48394e18bf072f7b32730db18df - 831e3538facff18e27d402e36dbd6b8d + 25ad042b501aaad98cbe4e05ca0a96c2 034b61cda8849fc3001849e76ef26041 7487cc72ead82aea0bc78f2e4106ae1a + 81c8be870260142e2633eedf73c72040 ) build() { cd $srcdir/ZoneMinder-$pkgver @@ -47,65 +43,93 @@ build() { ZM_SSL_LIB=gnutls # Patch for GCC 4.7.x - sed -i -e '1 s/^/#include <unistd.h>\n/;' src/zm_logger.cpp - sed -i -e '1 s/^/#include <unistd.h>\n/;' src/zm_thread.h + sed -i -e 's/^#include <errno.h>/#include <errno.h>\n#include <unistd.h>/' src/zm_logger.cpp + sed -i -e 's/^#include <pthread.h>/#include <pthread.h>\n#include <unistd.h>/' src/zm_thread.h - # Patch for support new ffmpeg - patch -p1 < $srcdir/patch-ffmpeg-0.11.patch + # Patch for disable ZM_CHECK_FOR_UPDATES + sed -i -e '/ZM_CHECK_FOR_UPDATES/,+1 s/yes/no/' scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in + + # 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/'\ + scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in - # Patch for correct libavcodec detection - patch -p0 < $srcdir/patch-libavcodec-detection.patch + # Patch for wrong "suppported" + sed -i -e 's/suppported/supported/' src/zm_local_camera.cpp - # Patch for type cast in kernel3.5 - patch -p0 < $srcdir/$pkgname-1.25.0-kernel35.patch + # Patch for type cast in linux-libre kernel 3.5 + sed -i -e 's/enum v4l2_buf_type type = v4l2_data.fmt.type;/enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type;/'\ + src/zm_local_camera.cpp + + # Patch for drop custom perl install paths + sed -i -e '/# Slight hack for non-standard perl install paths/,+10 d; + 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>/'\ + src/zm_ffmpeg.h + sed -i -e 's/^AM_CONFIG_HEADER(config.h)/AM_CONFIG_HEADER(config.h)\n\nAC_SUBST([AM_CXXFLAGS], [-D__STDC_CONSTANT_MACROS])/; + s/^AC_CHECK_HEADERS(mysql\/mysql.h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),)/AC_CHECK_HEADERS(mysql\/mysql.h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),)\nAC_LANG_PUSH([C])/; + s/^AC_CHECK_HEADERS(libswscale\/swscale.h,,,)/AC_CHECK_HEADERS(libswscale\/swscale.h,,,)\nAC_LANG_POP([C])/'\ + configure.ac + + # Patch for wrong install run, tmp and log dir + sed -i -e '/ install-data-hook/d;/install-data-hook:/d;/# Yes, you are correct. This is a HACK!/d; + / ( cd $(DESTDIR)$(sysconfdir); chown $(webuser):$(webgroup) $(sysconf_DATA); chmod 600 $(sysconf_DATA) )/d; + / ( if ! test -e $(ZM_RUNDIR); then mkdir -p $(ZM_RUNDIR); fi; if test "$(ZM_RUNDIR)" != "\/var\/run"; then chown $(webuser):$(webgroup) $(ZM_RUNDIR); chmod u+w $(ZM_RUNDIR); fi )/d; + / ( if ! test -e $(ZM_TMPDIR); then mkdir -m 700 -p $(ZM_TMPDIR); fi; if test "$(ZM_TMPDIR)" != "\/tmp"; then chown $(webuser):$(webgroup) $(ZM_TMPDIR); chmod u+w $(ZM_TMPDIR); fi )/d; + / ( if ! test -e $(ZM_LOGDIR); then mkdir -p $(ZM_LOGDIR); fi; if test "$(ZM_LOGDIR)" != "\/var\/log"; then chown $(webuser):$(webgroup) $(ZM_LOGDIR); chmod u+w $(ZM_LOGDIR); fi )/,+1 d' \ + Makefile.{am,in} ./configure --prefix=/usr \ --build \ - --enable-crashtrace=yes \ - --enable-debug=yes \ + --enable-crashtrace=no \ + --enable-debug=no \ --enable-mmap=yes \ - --mandir=/usr/share/man \ --sysconfdir=/etc \ --with-cgidir=/usr/lib/$pkgname/cgi-bin \ --with-ffmpeg=/usr \ --with-libarch=lib \ --with-mysql=/usr \ - --with-webdir=/usr/share/$pkgname \ + --with-webdir=/usr/share/$pkgname/www \ --with-webgroup=http \ + --with-webhost=localhost \ --with-webuser=http + make V=0 } package() { cd $srcdir/ZoneMinder-$pkgver - make DESTDIR=$pkgdir \ - ZM_LOGDIR=$pkgdir/var/log/zm \ - ZM_RUNDIR=$pkgdir/run \ - ZM_TMPDIR=$pkgdir/tmp \ - install + make DESTDIR=$pkgdir install - rmdir $pkgdir/run - rmdir $pkgdir/tmp + mkdir -p $pkgdir/{etc/{httpd/conf/extra,rc.d},usr/{lib/{systemd/system,$pkgname/cgi-bin},share/{license/$pkgname,$pkgname/{db,www}}},var/{cache/$pkgname,log/zm}} - mkdir -p $pkgdir/etc/httpd/conf/extra - mkdir -p $pkgdir/etc/rc.d - mkdir -p $pkgdir/usr/lib/systemd/system - mkdir -p $pkgdir/usr/share/license/$pkgname - mkdir -p $pkgdir/usr/share/$pkgname/db - mkdir -p $pkgdir/var/cache/$pkgname + chown -R http.http $pkgdir/{etc/zm.conf,var/{cache/$pkgname,log/zm}} for i in events images temp; do - mv $pkgdir/usr/share/$pkgname/$i $pkgdir/var/cache/$pkgname/$i - ln -s /var/cache/$pkgname/$i $pkgdir/usr/share/$pkgname/$i + mv $pkgdir/usr/share/$pkgname/www/$i $pkgdir/var/cache/$pkgname/$i + ln -s /var/cache/$pkgname/$i $pkgdir/usr/share/$pkgname/www/$i done - ln -s /usr/lib/$pkgname/cgi-bin $pkgdir/usr/share/$pkgname - ln -s /usr/share/cambozola/cambozola.jar $pkgdir/usr/share/$pkgname - - chown http.http $pkgdir/etc/zm.conf - chown -R http.http $pkgdir/var/cache/$pkgname - chown http.http $pkgdir/var/log/zm + ln -s /usr/lib/$pkgname/cgi-bin $pkgdir/usr/share/$pkgname/www + ln -s /usr/share/cambozola/cambozola.jar $pkgdir/usr/share/$pkgname/www install -D -m 644 $srcdir/httpd-zm.conf $pkgdir/etc/httpd/conf/extra install -D -m 644 $srcdir/zm.rc.d $pkgdir/etc/rc.d/zm diff --git a/pcr/zoneminder/httpd-zm.conf b/pcr/zoneminder/httpd-zm.conf index e48ea9fc6..8c6356aec 100644 --- a/pcr/zoneminder/httpd-zm.conf +++ b/pcr/zoneminder/httpd-zm.conf @@ -1,20 +1,20 @@ # /etc/httpd/conf/extra/httpd-zm.conf # Config for zoneminder web app -Alias /zm "/usr/share/zoneminder" -<Directory "/usr/share/zoneminder"> +Alias /zm "/usr/share/zoneminder/www" +<Directory "/usr/share/zoneminder/www"> Options -Indexes MultiViews FollowSymLinks - AllowOverride All + AllowOverride None Order allow,deny Allow from all # The code unfortunately uses short tags in many places - php_value short_open_tag 1 + php_value short_open_tag On </Directory> ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin" <Directory "/usr/lib/zoneminder/cgi-bin"> - AllowOverride All - Options ExecCGI - Order allow,deny - Allow from all + AllowOverride None + Options ExecCGI FollowSymLinks + Order allow,deny + Allow from all </Directory> diff --git a/pcr/zoneminder/patch-ffmpeg-configure.patch b/pcr/zoneminder/patch-ffmpeg-configure.patch new file mode 100644 index 000000000..ba1674a4a --- /dev/null +++ b/pcr/zoneminder/patch-ffmpeg-configure.patch @@ -0,0 +1,26 @@ +--- configure.old 2011-08-23 12:10:37.000000000 -0300 ++++ configure 2012-09-26 16:23:33.211940267 -0300 +@@ -3026,8 +3026,8 @@ + fi + + +-FFMPEG_LIBS="-L${FFMPEG_PREFIX}/${LIB_ARCH}" +-FFMPEG_CFLAGS="-I${FFMPEG_PREFIX}/include" ++FFMPEG_LIBS=`pkg-config --cflags libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswscale` ++FFMPEG_CFLAGS=`pkg-config --cflags libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswscale` + + + +--- configure.ac.old 2011-08-23 12:10:32.000000000 -0300 ++++ configure.ac 2012-09-26 18:16:44.146848335 -0300 +@@ -88,8 +88,8 @@ + e.g. --with-ffmpeg=/usr/local]) + ) + AC_SUBST(FFMPEG_PREFIX) +-FFMPEG_LIBS="-L${FFMPEG_PREFIX}/${LIB_ARCH}" +-FFMPEG_CFLAGS="-I${FFMPEG_PREFIX}/include" ++FFMPEG_LIBS=`pkg-config --libs libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswscale` ++FFMPEG_CFLAGS=`pkg-config --libs libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswscale` + AC_SUBST(FFMPEG_LIBS) + AC_SUBST(FFMPEG_CFLAGS) + diff --git a/pcr/zoneminder/zoneminder.install b/pcr/zoneminder/zoneminder.install index 3ade5355e..922aaad9b 100644 --- a/pcr/zoneminder/zoneminder.install +++ b/pcr/zoneminder/zoneminder.install @@ -1,14 +1,14 @@ pre_install() { set -e abort=false - if [ -L /usr/share/zoneminder/events ]; then - l=$(readlink /usr/share/zoneminder/events) + if [ -L /usr/share/zoneminder/www/events ]; then + l=$(readlink /usr/share/zoneminder/www/events) if [ $l != /var/cache/zoneminder/events ]; then abort=true fi fi - if [ -L /usr/share/zoneminder/images ]; then - l=$(readlink /usr/share/zoneminder/images ) + if [ -L /usr/share/zoneminder/www/images ]; then + l=$(readlink /usr/share/zoneminder/www/images ) if [ $l != /var/cache/zoneminder/images ]; then abort=true fi @@ -16,7 +16,7 @@ pre_install() { if [ $abort = true ]; then cat >&2 << EOF Aborting installation of zoneminder due to non-default symlinks in -/usr/share/zoneminder for the images and/or events directory, which could +/usr/share/zoneminder/www for the images and/or events directory, which could result in loss of data. Please move your data in each of these directories to /var/cache/zoneminder before installing zoneminder from the package. EOF @@ -26,18 +26,16 @@ EOF } post_install() { - mkdir /usr/share/zoneminder/backup - mkdir /usr/share/zoneminder/socks + mkdir /usr/share/zoneminder/www/backup + mkdir /usr/share/zoneminder/www/socks cat << EOF Note: ==> To run Zoneminder, you must install the database running mysql service (as root): ==> "rc.d start mysqld" (in initscripts) or "systemctl start mysqld.service" (in systemd) ==> and add Zoneminder database typing: -==> mysqladmin --defaults-file=/etc/mysql/my.cnf -p -f reload -==> cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/my.cnf -p -==> echo 'grant lock tables, alter,select,insert,update,delete on zm.*'"\ -==> "' to 'zmuser'@localhost identified by "zmpass";' | -==> mysql --defaults-file=/etc/mysql/my.cnf -p mysql" +==> "mysqladmin --defaults-file=/etc/mysql/my.cnf -p -f reload" +==> "cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/my.cnf -p" +==> "echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/my.cnf -p mysql" Note: ==> You must uncomment that line in /etc/php/php.ini: @@ -50,20 +48,18 @@ Note: ==> "extension=session.so" ==> "extension=sockets.so" -==> Check /etc/php/php.ini and make sure short_open_tag = On -==> or ZoneMinder will not work. - ==> You must edit /etc/php/php.ini and add to open_basedir "/etc" and ==> "/usr/share/zoneminder" like so -==> open_basedir = /home:/tmp:/usr/share/pear:/etc:/usr/share/zoneminder +==> "open_basedir = /home:/tmp:/usr/share/pear:/etc:/usr/share/zoneminder/www" ==> Otherwise ZoneMinder will be unable to read /etc/zm.conf ==> or display its own web directory Note: ==> You must edit /etc/httpd/conf/httpd.conf and add the line: -==> LoadModule php5_module modules/libphp5.so +==> "LoadModule php5_module modules/libphp5.so" ==> and: -==> Include /etc/httpd/conf/extra/httpd-zm.conf +==> "Include /etc/httpd/conf/extra/php5_module.conf" +==> "Include /etc/httpd/conf/extra/httpd-zm.conf" EOF } @@ -82,6 +78,7 @@ Note: ==> Disable http with php if it isn't needed with others servers, ==> comment or remove that lines in /etc/httpd/conf/httpd.conf: ==> "LoadModule php5_module modules/libphp5.so" +==> "Include /etc/httpd/conf/extra/php5_module.conf" ==> "Include /etc/httpd/conf/extra/httpd-zm.conf" ==> Disable php with mysql if it isn't needed with others servers, @@ -94,7 +91,7 @@ Note: ==> "extension=session.so" ==> "extension=sockets.so" -==> edit /etc/php/php.ini and remove "/etc" and "/usr/share/zoneminder" +==> edit /etc/php/php.ini and remove "/etc" and "/usr/share/zoneminder/www" ==> in the open_basedir. EOF } |