From 1187d7cb38d2700e4773d79b1a3d26fd46adf0df Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Tue, 11 Sep 2012 03:36:56 -0300 Subject: zoneminder: adding new package to [pcr] repo --- pcr/zoneminder/Controls_Orbit.sql | 3 + pcr/zoneminder/PKGBUILD | 114 ++++++++++++++++ pcr/zoneminder/arm-context.patch | 18 +++ pcr/zoneminder/customdb | 31 +++++ pcr/zoneminder/httpd-zm.conf | 18 +++ pcr/zoneminder/patch-ffmpeg-0.11.patch | 60 +++++++++ pcr/zoneminder/patch-libavcodec-detection.patch | 11 ++ pcr/zoneminder/zm.rc.d | 172 ++++++++++++++++++++++++ pcr/zoneminder/zmeventbackup | 48 +++++++ pcr/zoneminder/zminit.arch | 143 ++++++++++++++++++++ pcr/zoneminder/zoneminder-1.25.0-kernel35.patch | 21 +++ pcr/zoneminder/zoneminder.install | 57 ++++++++ 12 files changed, 696 insertions(+) create mode 100644 pcr/zoneminder/Controls_Orbit.sql create mode 100644 pcr/zoneminder/PKGBUILD create mode 100644 pcr/zoneminder/arm-context.patch create mode 100755 pcr/zoneminder/customdb create mode 100644 pcr/zoneminder/httpd-zm.conf create mode 100644 pcr/zoneminder/patch-ffmpeg-0.11.patch create mode 100644 pcr/zoneminder/patch-libavcodec-detection.patch create mode 100644 pcr/zoneminder/zm.rc.d create mode 100755 pcr/zoneminder/zmeventbackup create mode 100644 pcr/zoneminder/zminit.arch create mode 100644 pcr/zoneminder/zoneminder-1.25.0-kernel35.patch create mode 100644 pcr/zoneminder/zoneminder.install (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/Controls_Orbit.sql b/pcr/zoneminder/Controls_Orbit.sql new file mode 100644 index 000000000..23224e4aa --- /dev/null +++ b/pcr/zoneminder/Controls_Orbit.sql @@ -0,0 +1,3 @@ + +INSERT INTO `Controls` VALUES (7,'Orbit','Remote','mjpgStreamer',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,-7000,7000,200,200,1,100,100,0,0,1,-2000,2000,10,100,1,200,200,0,0,0,0); + diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD new file mode 100644 index 000000000..38e8732d6 --- /dev/null +++ b/pcr/zoneminder/PKGBUILD @@ -0,0 +1,114 @@ +# Maintainer: Vojtech Aschenbrenner +# Contributor: Jason Gardner +# Contributor: Ross melin + +pkgname=zoneminder +pkgver=1.25.0 +pkgrel=13 +pkgdesc="Capture, analyse, record and monitor video security cameras." +arch=('i686' 'x86_64' 'arm') +url="http://www.zoneminder.com" +license=('GPL') +depends=('cambozola' 'apache' 'php' 'php-gd' 'php-mcrypt' 'mysql' 'pcre' 'openssl' 'ffmpeg' 'perl-libwww' 'perl-date-manip' 'perl-unicode-map' 'perl-dbi' 'perl-dbd-mysql' 'perl-io-stringy' 'perl-mime-lite' 'perl-timedate' 'perl-x10' 'perl-time-modules' 'perl-net-smtp-ssl' 'perl-sys-mmap' 'perl-net-sftp-foreign' 'perl-mime-tools' 'perl-io-tty' 'sudo' 'libv4l' 'libjpeg' 'gnutls' 'php-apache') +makedepends=() +install=zoneminder.install +source=("http://www.zoneminder.com/downloads/ZoneMinder-${pkgver}.tar.gz" + zm.rc.d + Controls_Orbit.sql + zminit.arch + customdb + httpd-zm.conf + zmeventbackup + patch-ffmpeg-0.11.patch + patch-libavcodec-detection.patch + zoneminder-1.25.0-kernel35.patch + arm-context.patch) + +md5sums=('eaefa14befd482154970541252aa1a39' + '9fb81f81b056c18be6eef3f1c8e0dd6d' + '5033bc098bf497c8aed1fc1b3c9c5f9c' + 'f9720872736f26d17bc49d8725b75ae4' + '942f6641c744ffe7d64846a5c34d84f1' + 'e63262d1417105ae24c7a03d98b2c64c' + '1a6d7c43af79c786b27cc88f7ba7ed3e' + 'b872dd86926ab00c5d4733e7e38eaa9c' + '94bf5d95fe5429f7df458ddfbabf0c12' + '88bd124dfb841320cecb0a757b2a78c1' + 'b28c8eb392a7e7b6ef665817d7fe61f4') + +build() { + cd "$srcdir/ZoneMinder-$pkgver" + + # Patch for GCC 4.7.x + sed -i -e '1 s/^/#include \n/;' src/zm_logger.cpp + sed -i -e '1 s/^/#include \n/;' src/zm_thread.h + + # Patch for build/upgrade path + sed -i -e 's#ZM_PATH_BUILD=@PATH_BUILD@#ZM_PATH_BUILD=/srv/zoneminder/upgrade\nZM_PATH_UPDATE=/srv/zoneminder/upgrade#' zm.conf.in + + # Patch for support new ffmpeg + patch -p1 < ../patch-ffmpeg-0.11.patch + + # Patch for correct libavcodec detection + patch -p0 < ../patch-libavcodec-detection.patch + + # Patch for type cast in kernel3.5 + patch -p0 < ../zoneminder-1.25.0-kernel35.patch + + # Patch for ARM + if test "$CARCH" == arm; then + patch -p0 < ../arm-context.patch + fi + + # Add some more configs into DB + cat ../Controls_Orbit.sql >> db/zm_create.sql.in + + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --with-webuser=http \ + --with-webgroup=http \ + --with-mysql=/usr \ + --with-webdir=/srv/zoneminder/www \ + --with-cgidir=/srv/zoneminder/cgi-bin \ + --bindir=/srv/zoneminder/bin \ + ZM_SSL_LIB=openssl \ + CPPFLAGS=-D__STDC_CONSTANT_MACROS + + # chown line mucks everything up, we'll chown it in the install script + sed -i '/chown/d' Makefile + + # modify hard-coded paths + sed -i 's#/var/lib/zm#/srv/zoneminder/backup#' scripts/zmdbrestore.in + sed -i 's#/var/lib/zm#/srv/zoneminder/backup#' scripts/zmlogrotate.conf.in + sed -i 's#/var/lib/zm#/srv/zoneminder/backup#' scripts/zmdbbackup.in + + # Build it! + make || return 1 + make DESTDIR="$pkgdir" install || return 1 + + install -D -m 700 $startdir/src/zminit.arch $startdir/pkg/srv/zoneminder/bin/zminit + install -D -m 755 $startdir/src/zm.rc.d $startdir/pkg/etc/rc.d/zm + install -D -m 700 scripts/zmdbbackup $startdir/pkg/srv/zoneminder/bin/zmdbbackup + install -D -m 700 scripts/zmdbbackup $startdir/pkg/srv/zoneminder/bin/zmdbbackup + install -D -m 700 scripts/zmdbrestore $startdir/pkg/srv/zoneminder/bin/zmdbrestore + install -D -m 700 scripts/zmeventdump $startdir/pkg/srv/zoneminder/bin/zmeventdump + install -D -m 700 scripts/zmlogrotate.conf $startdir/pkg/etc/logrotate.d/zm + install -D -m 700 $startdir/src/zmeventbackup $startdir/pkg/etc/cron.hourly/zmeventbackup + + mkdir -p $startdir/pkg/etc/httpd/conf/extra/ + install -m 644 $startdir/src/httpd-zm.conf $startdir/pkg/etc/httpd/conf/extra/httpd-zm.conf + + install -D -m 700 $startdir/src/customdb $startdir/pkg/srv/zoneminder/upgrade/customdb + install -D db/zm*.sql $startdir/pkg/srv/zoneminder/upgrade/ + + mkdir -p $startdir/pkg/var/run/zm + + ### remove special files + find $startdir/pkg/ -name "perllocal.pod" \ + -o -name ".packlist" \ + -o -name "*.bs" \ + |xargs -i rm -f {} + +} + +# vim:set ft=sh ts=2 sw=2 et: diff --git a/pcr/zoneminder/arm-context.patch b/pcr/zoneminder/arm-context.patch new file mode 100644 index 000000000..a6fbb5328 --- /dev/null +++ b/pcr/zoneminder/arm-context.patch @@ -0,0 +1,18 @@ +--- src/zm_signal.cpp.orig 2012-08-30 13:24:16.479872021 -0700 ++++ src/zm_signal.cpp 2012-08-30 13:27:35.909871996 -0700 +@@ -82,13 +82,13 @@ + int trace_size = 0; + + #if HAVE_STRUCT_SIGCONTEXT_EIP +- Error( "Signal address is %p, from %p", (void *)context.cr2, (void *)context.eip ); ++ Error( "Signal address is %p, from %p", (void *)context.fault_address, (void *)context.eip ); + + trace_size = backtrace( trace, TRACE_SIZE ); + // overwrite sigaction with caller's address + trace[1] = (void *)context.eip; + #elif HAVE_STRUCT_SIGCONTEXT +- Error( "Signal address is %p, no eip", (void *)context.cr2 ); ++ Error( "Signal address is %p, no eip", (void *)context.fault_address ); + + trace_size = backtrace( trace, TRACE_SIZE ); + #else // HAVE_STRUCT_SIGCONTEXT diff --git a/pcr/zoneminder/customdb b/pcr/zoneminder/customdb new file mode 100755 index 000000000..afd295935 --- /dev/null +++ b/pcr/zoneminder/customdb @@ -0,0 +1,31 @@ +#!/bin/sh +DBHOST=$1 +DBNAME=$2 +USERNAME=$3 +PASSWORD=$4 + +ZM_PATH_ZMS=/cgi-bin/nph-zms +ZM_PATH_SOCKS=/srv/zoneminder/socks +ZM_PATH_LOGS=/var/log/zm +ZM_WEB_LIST_THUMBS=1 +ZM_WEB_MONTAGE_WIDTH=320 +ZM_WEB_MONTAGE_HEIGHT=240 +ZM_OPT_CAMBOZOLA=1 +ZM_OPT_MPEG=ffmpeg +ZM_PATH_FFMPEG=/usr/bin/ffmpeg +ZM_OPT_NETPBM=1 +ZM_EXTRA_DEBUG_LOG=/var/log/zm/zm_debug.log +ZM_OPT_USE_AUTH=0 + +sql=/tmp/$$ +echo "" >$sql +for n in ZM_PATH_ZMS ZM_PATH_SOCKS ZM_PATH_LOGS ZM_WEB_LIST_THUMBS ZM_WEB_MONTAGE_WIDTH ZM_WEB_MONTAGE_HEIGHT ZM_OPT_CAMBOZOLA ZM_OPT_MPEG ZM_PATH_FFMPEG ZM_OPT_NETPBM ZM_EXTRA_DEBUG_LOG ZM_OPT_USE_AUTH; do + eval "val=\$$n" + echo "UPDATE Config SET Value='$val' WHERE Name='$n';" >>$sql +done + +cat $sql | mysql --user=$USERNAME --password=$PASSWORD --host=$DBHOST $DBNAME +rm -f $sql + + +exit 0 diff --git a/pcr/zoneminder/httpd-zm.conf b/pcr/zoneminder/httpd-zm.conf new file mode 100644 index 000000000..ad24cbbe4 --- /dev/null +++ b/pcr/zoneminder/httpd-zm.conf @@ -0,0 +1,18 @@ +# /etc/httpd/conf/extra/httpd-zm.conf +# Config for zoneminder web app + +Alias /zm "/srv/zoneminder/www" + + Options -Indexes MultiViews FollowSymLinks + AllowOverride All + Order allow,deny + Allow from all + + +ScriptAlias /cgi-bin "/srv/zoneminder/cgi-bin" + + AllowOverride All + Options ExecCGI + Order allow,deny + Allow from all + diff --git a/pcr/zoneminder/patch-ffmpeg-0.11.patch b/pcr/zoneminder/patch-ffmpeg-0.11.patch new file mode 100644 index 000000000..8356fff83 --- /dev/null +++ b/pcr/zoneminder/patch-ffmpeg-0.11.patch @@ -0,0 +1,60 @@ +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 +@@ -108,7 +108,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 +@@ -139,7 +139,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 +@@ -167,10 +167,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); + } + +@@ -259,7 +261,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 +@@ -278,7 +280,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 ) \ No newline at end of file diff --git a/pcr/zoneminder/patch-libavcodec-detection.patch b/pcr/zoneminder/patch-libavcodec-detection.patch new file mode 100644 index 000000000..0aaa9bc23 --- /dev/null +++ b/pcr/zoneminder/patch-libavcodec-detection.patch @@ -0,0 +1,11 @@ +--- configure.ac~ 2012-07-15 22:27:11.195257379 +0100 ++++ configure.ac 2012-07-15 22:24:34.308268675 +0100 +@@ -276,7 +276,7 @@ + AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming)) + # Don't bother to warn about this one + AC_CHECK_LIB(avcore,av_image_copy,,) +-AC_CHECK_LIB(avcodec,avcodec_init,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) ++AC_CHECK_LIB(avcodec,avcodec_open,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) + AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) + AC_CHECK_LIB(avdevice,avdevice_register_all,,AC_MSG_WARN(libavdevice.a may be required for MPEG streaming)) + AC_CHECK_LIB(swscale,sws_scale,,,-lswscale) \ No newline at end of file diff --git a/pcr/zoneminder/zm.rc.d b/pcr/zoneminder/zm.rc.d new file mode 100644 index 000000000..99a1f1f22 --- /dev/null +++ b/pcr/zoneminder/zm.rc.d @@ -0,0 +1,172 @@ +#!/bin/bash + +# Source function library. +. /etc/rc.conf +. /etc/rc.d/functions + +prog=ZoneMinder +ZM_VERSION="1.25.0" +ZM_PATH_BIN="/srv/zoneminder/bin" +ZM_CONFIG="/etc/zm.conf" +command="$ZM_PATH_BIN/zmpkg.pl" + +loadconf() +{ + if [ -f $ZM_CONFIG ]; then + . $ZM_CONFIG + else + echo "ERROR: $ZM_CONFIG not found. +" + return 1 + fi +} + +# Check for old config and update if needed +checkcfg() +{ + # Check config + if [ "$ZM_DB_HOST" = "" -o "$ZM_DB_NAME" = "" -o "$ZM_DB_USER" = "" -o "$ZM_DB_PASS" = "" ]; then + echo "In $ZM_CONFIG there should not be null values. +" + return 1 + loadconf + fi +} + +checkdb() +{ + # Check database exisits and version + GetVer="select Value from Config where Name='ZM_DYN_DB_VERSION'" + OLD_VERSION=`echo $GetVer | mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` + if [ "$OLD_VERSION" = "" ]; then + GetVer="select Value from Config where Name='ZM_DYN_CURR_VERSION'" + OLD_VERSION=`echo $GetVer | mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` + if [ "$OLD_VERSION" = "" ]; then + echo "You must run $ZM_PATH_BIN/zminit manually +" + return 1 + fi + fi + RETVAL=$? + + if [ $RETVAL != 0 ]; then + tbls=`mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS -s -e 'show tables' $ZM_DB_NAME` + RETVAL=$? + if [ $RETVAL = 0 ]; then + echo "Initialize $prog database: +" + echo tbls | grep Config >/dev/null 2>&1 + RETVAL=$? + if [ $RETVAL != 0 ]; then + mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME < $ZM_PATH_UPDATE/zm_create.sql + RETVAL=$? + [ $RETVAL = 0 ] && stat_done + [ $RETVAL != 0 ] && stat_fail + echo + return $RETVAL + fi + ( cd $ZM_PATH_UPDATE; perl $ZM_PATH_BIN/zmupdate.pl -f ) + RETVAL=$? + [ $RETVAL = 0 ] && stat_done + [ $RETVAL != 0 ] && stat_fail + echo + return $RETVAL + else + echo "No access to ZoneMinder database. +Run $ZM_PATH_BIN/zminit manually. +" + return $RETVAL + fi + else + [ "$ZM_VERSION" = "$OLD_VERSION" ] && return 0 + echo "Upgrade %s database: " "$prog" + $ZM_PATH_BIN/zmupdate.pl --version=$OLD_VERSION --noi && ( cd $ZM_PATH_UPDATE; perl $ZM_PATH_BIN/zmupdate.pl -f ) + RETVAL=$? + [ $RETVAL = 0 ] && stat_done + [ $RETVAL != 0 ] && stat_fail + echo + return $RETVAL + fi +} + +start() +{ + loadconf || return $? + checkcfg || return $? + checkdb || return $? + stat_busy "Starting $prog" + [ -d /var/run/zm ] || mkdir -m 774 /var/run/zm + chown -R $ZM_WEB_USER:$ZM_WEB_GROUP /var/run/zm + GetPath="select Value from Config where Name='ZM_PATH_SOCKS'" + ZM_PATH_SOCK=`echo $GetPath | mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` + [ -d $ZM_PATH_SOCK ] || mkdir -m 774 -p $ZM_PATH_SOCK + sudo -u $ZM_WEB_USER test -O $ZM_PATH_SOCK \ + || chown -R $ZM_WEB_USER:$ZM_WEB_GROUP $ZM_PATH_SOCK + # Setup the log dir + [ -d /var/log/zm ] || mkdir /var/log/zm + for logs in zmaudit.log zmdc.log zmfilter.log zmpkg.log zmupdate.log zmwatch.log; do + touch /var/log/zm/$logs + done + chown -R $ZM_WEB_USER:$ZM_WEB_GROUP /var/log/zm + $command start + RETVAL=$? + [ $RETVAL = 0 ] && stat_done && add_daemon zm + [ $RETVAL != 0 ] && stat_fail + #[ $RETVAL = 0 ] && touch /var/lock/subsys/zm + return $RETVAL +} + +stop() +{ + stat_busy "Stopping $prog" + $command stop + RETVAL=$? + [ $RETVAL = 0 ] && stat_done && rm_daemon zm + [ $RETVAL != 0 ] && stat_fail + #[ $RETVAL = 0 ] && rm -f /var/lock/subsys/zm +} + +status() +{ + result=`$command status` + if [ "$result" = "running" ]; then + echo "ZoneMinder is running +" + RETVAL=0 + else + echo "ZoneMinder is stopped +" + RETVAL=1 + fi +} + +case "$1" in + 'start') + start + ;; + 'stop') + stop + ;; + 'restart') + stop + start + ;; + 'condrestart') + loadconf + checkcfg + result=`$ZM_PATH_BIN/zmdc.pl check` + if [ "$result" = "running" ]; then + $ZM_PATH_BIN/zmdc.pl shutdown > /dev/null + start + fi + ;; + 'status') + status + ;; + *) + echo "Usage: zm { start | stop | restart | condrestart | status } +" + RETVAL=1 + ;; +esac +exit $RETVAL diff --git a/pcr/zoneminder/zmeventbackup b/pcr/zoneminder/zmeventbackup new file mode 100755 index 000000000..a14ee22a1 --- /dev/null +++ b/pcr/zoneminder/zmeventbackup @@ -0,0 +1,48 @@ +#!/bin/bash +#=============================================================================== +# +# FILE: eventdump.sh +# +# USAGE: ./eventdump.sh +# +# DESCRIPTION: Uses mysqldump to create a .sql file for individual zm +# events to make Event table recovery possible by doing a +# 'find' search in ZoneMinder the events directory +# +# OPTIONS: --- +# REQUIREMENTS: --- mysqldump +# BUGS: --- +# NOTES: --- +# AUTHOR: Ross Melin +# COMPANY: +# VERSION: 1.0 +# CREATED: 03/06/2008 11:51:19 AM PST +# REVISION: --- +#=============================================================================== + +# Edit these to suit your configuration +ZM_CONFIG=/etc/zm.conf +MYSQLDUMP=/usr/bin/mysqldump +EVENTSDIR=/srv/zoneminder/www/events + +# The rest should not need editing + +# Get the mysql user and password +source $ZM_CONFIG +MYDUMPOPTS="--user=$ZM_DB_USER --password=$ZM_DB_PASS --skip-opt --compact --quick --no-create-info" + + +for tag in $(find $EVENTSDIR -amin -65 -name ".[0-9]*") + do + EVENT_PATH=$(echo $tag |cut -f 1 -d .) + EVENT_ID=$(echo $tag |cut -f 2 -d .) + # Dump the sql statements needed to reload the Events, Frames and Stats tables + + echo "-- ZM_DB_VERSION=$ZM_VERSION +" > $EVENT_PATH.sql + + $MYSQLDUMP $MYDUMPOPTS --where="Id=$EVENT_ID" zm Events >> $EVENT_PATH.sql + $MYSQLDUMP $MYDUMPOPTS --where="Eventid=$EVENT_ID" zm Frames >> $EVENT_PATH.sql + $MYSQLDUMP $MYDUMPOPTS --where="Eventid=$EVENT_ID" zm Stats >> $EVENT_PATH.sql + +done diff --git a/pcr/zoneminder/zminit.arch b/pcr/zoneminder/zminit.arch new file mode 100644 index 000000000..01b6658a7 --- /dev/null +++ b/pcr/zoneminder/zminit.arch @@ -0,0 +1,143 @@ +#!/bin/sh + + +ZM_CONFIG=/etc/zm.conf + + + +loadcfg() { + if [ -f $ZM_CONFIG ]; then + . $ZM_CONFIG + else + echo "ERROR: $ZM_CONFIG not found." + exit 1 + fi + } +chkmysql(){ + #FIXME + /etc/rc.d/mysqld restart || (echo "mysql is not availible" && exit 1 ) + } + +getmylogin(){ + echo "Enter MySQL Administrator username" + echo "(Default: root and password is blank)" + echo -n "MySQL Admin: " + read MYADMIN + echo -n "Password: " + read MYPASS + if [ "X$MYPASS" != "X" ]; then MYPASS="-p$MYPASS"; fi + echo "\q" |mysql -u $MYADMIN $MYPASS || exit 0 + + } + +checkdb() +{ + # Check database exisits and version + exists=$(echo "show databases" |mysql -u $MYADMIN "$MYPASS" |grep zm) + if [ "$exists" = "zm" ]; then + OLD_VERSION=$(echo "select Value from Config where Name = 'ZM_DYN_DB_VERSION';" | mysql -u $MYADMIN $MYPASS zm |grep -v '^Value') + + case $OLD_VERSION in + "") + echo "A zm database exists, but the version is unknown" + echo "Updating is unlikely to succeed" + ;; + "$ZM_VERSION") + echo "The zm database appears to be up to date" + echo "If this is incorrect, edit $ZM_CONFIG to reflect the current version" + ;; + *) + echo "A database fron zm-$OLD_VERSION exists already" + ;; + esac + + while [ true ] + do + echo "Choose one of the following options:" + echo "[U]pdate the database" + echo "[D]rop the old database and reinitialize" + echo "[E]xit and do nothing" + read OPTION + case $OPTION in + "U"|"u") + /etc/rc.d/zm restart + exit 0 + ;; + "D"|"d") + echo "drop database zm;"|mysql -u $MYADMIN $MYPASS + return + ;; + "E"|"e") + exit 0 + ;; + esac + done + fi +} + +checkcfg(){ +for n in ZM_DB_HOST ZM_DB_NAME ZM_DB_USER ZM_DB_PASS; do + eval "val=\$$n" + if [ "$val" = "" ]; then + echo "ERROR($ZM_CONFIG): $n should not be empty." + echo "Enter a $n for ZM to use the Database." + if [ "$n" = "ZM_DB_PASS" ]; then + echo -n "Will not echo on screen $n : " + stty -echo # Turns off screen echo. + read newval + stty echo # Restores screen echo. + echo "" + ### The following can be used to generate a random password + # randstr newval 16 + else + echo -n "$n : " + read newval + fi + cp $ZM_CONFIG /tmp/$$ && + sed 's/^'$n='.*$/'$n=$newval'/g' /tmp/$$ >$ZM_CONFIG + + fi +done + +if [ "$ZM_DB_HOST" = "localhost" ]; then + ClientHost=localhost +else + ClientHost=`hostname` +fi +} + +reloadcfg(){ +loadcfg +} + +initdb(){ +sql=/tmp/zm.crdb.sql +echo "" >$sql +chmod 600 $sql + +echo "CREATE DATABASE $ZM_DB_NAME;" >>$sql +echo "USE $ZM_DB_NAME;" >>$sql + +echo "GRANT all on $ZM_DB_NAME.* TO '$ZM_DB_USER'@'$ClientHost' IDENTIFIED BY '$ZM_DB_PASS';" >>$sql + +cat $sql | mysql -B -h $ZM_DB_HOST -u $MYADMIN $MYPASS +rm -f $sql + +cat $ZM_PATH_UPDATE/zm_create.sql | mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME +( cd $ZM_PATH_UPDATE; perl $ZM_PATH_BIN/zmupdate.pl -f ) + + $ZM_PATH_UPDATE/customdb $ZM_DB_HOST $ZM_DB_NAME $ZM_DB_USER $ZM_DB_PASS +} + + + +loadcfg +getmylogin +checkdb +checkcfg +reloadcfg +initdb + + + + diff --git a/pcr/zoneminder/zoneminder-1.25.0-kernel35.patch b/pcr/zoneminder/zoneminder-1.25.0-kernel35.patch new file mode 100644 index 000000000..51bc1288d --- /dev/null +++ b/pcr/zoneminder/zoneminder-1.25.0-kernel35.patch @@ -0,0 +1,21 @@ +diff -up ./src/zm_local_camera.cpp.kernel35 ./src/zm_local_camera.cpp +--- ./src/zm_local_camera.cpp.kernel35 2012-07-16 15:01:22.182614878 -0500 ++++ ./src/zm_local_camera.cpp 2012-07-16 15:02:16.491941730 -0500 +@@ -740,7 +740,7 @@ void LocalCamera::Terminate() + { + Debug( 3, "Terminating video stream" ); + //enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; +- enum v4l2_buf_type type = v4l2_data.fmt.type; ++ enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type; + if ( vidioctl( vid_fd, VIDIOC_STREAMOFF, &type ) < 0 ) + Error( "Failed to stop capture stream: %s", strerror(errno) ); + +@@ -1520,7 +1520,7 @@ int LocalCamera::PrimeCapture() + + Debug( 3, "Starting video stream" ); + //enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; +- enum v4l2_buf_type type = v4l2_data.fmt.type; ++ enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type; + if ( vidioctl( vid_fd, VIDIOC_STREAMON, &type ) < 0 ) + Fatal( "Failed to start capture stream: %s", strerror(errno) ); + } diff --git a/pcr/zoneminder/zoneminder.install b/pcr/zoneminder/zoneminder.install new file mode 100644 index 000000000..be449a5ca --- /dev/null +++ b/pcr/zoneminder/zoneminder.install @@ -0,0 +1,57 @@ +# zoneminder.install + +## arg 1: the new package version +post_install() { + ln -s /usr/share/cambozola/cambozola.jar /srv/zoneminder/www/ + chown -R http.http /srv/zoneminder + chown http.http /etc/zm.conf + mkdir /srv/zoneminder/backup + mkdir /srv/zoneminder/socks + cat << EOF +Note: +==> To initialize the ZoneMinder database run (as root) +==> /srv/zoneminder/bin/zminit +EOF + + cat << EOF +==> Check /etc/php/php.ini and make sure these are uncommented +==> extension=gd.so +==> extension=gettext.so +==> extension=mcrypt.so +==> extension=mysql.so +==> extension=mysqli.so +==> extension=session.so +==> extension=sockets.so +EOF + cat << EOF +==> Check /etc/php/php.ini and make sure short_open_tag = On +EOF + + + cat /etc/php/php.ini |grep "^open_basedir.*/etc/" | \ +grep "/srv/zoneminder/www">/dev/null || cat << EOF +==> You must edit /etc/php/php.ini and add to open_basedir "/etc/" and +==> "/srv/zoneminder/" like so +==> open_basedir = /home/:/tmp/:/usr/share/pear/:/etc/:/srv/zoneminder/ +==> Otherwise ZoneMinder will be unable to read /etc/zm.conf +==> or display its own web directory +EOF + + cat << EOF +Note: +==> You must edit /etc/httpd/conf/httpd.conf and uncomment/add the line +==> LoadModule php5_module modules/libphp5.so +==> You must also add these lines: +==> Include conf/extra/php5_module.conf +==> Include /etc/httpd/conf/extra/httpd-zm.conf +EOF + touch /srv/zoneminder/zm_backup.sql +} + + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + /srv/zoneminder/bin/zmupdate.pl -f >/dev/null +} +# vim:set ts=2 sw=2 et: -- cgit v1.2.3 From a6e0886d58c8e7537e2ffb600813f4420a4dd58c Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Tue, 11 Sep 2012 04:05:04 -0300 Subject: zoneminder: adding zm.service file --- pcr/zoneminder/PKGBUILD | 2 +- pcr/zoneminder/zm.service | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 pcr/zoneminder/zm.service (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index 38e8732d6..206651216 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -5,7 +5,7 @@ pkgname=zoneminder pkgver=1.25.0 pkgrel=13 -pkgdesc="Capture, analyse, record and monitor video security cameras." +pkgdesc="Capture, analyse, record and monitor video security cameras" arch=('i686' 'x86_64' 'arm') url="http://www.zoneminder.com" license=('GPL') diff --git a/pcr/zoneminder/zm.service b/pcr/zoneminder/zm.service new file mode 100644 index 000000000..ccf1f3334 --- /dev/null +++ b/pcr/zoneminder/zm.service @@ -0,0 +1,9 @@ +[Unit] +Description=Capture, analyse, record and monitor video security cameras + +[Service] +Type=forking +ExecStart=/usr/sbin/zm + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3 From 9d356c9ef46018ea8af083d1daf906d90fb97dc7 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Wed, 12 Sep 2012 16:26:14 -0300 Subject: zoneminder-1.25.0-13: fixing issues on PKGBUILD --- pcr/zoneminder/PKGBUILD | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index 206651216..f3528e91c 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -1,6 +1,8 @@ # Maintainer: Vojtech Aschenbrenner # Contributor: Jason Gardner # Contributor: Ross melin +# Maintainer (Parabola): Márcio Silva +# Maintainer (Parabola): André Silva pkgname=zoneminder pkgver=1.25.0 @@ -84,7 +86,7 @@ build() { # Build it! make || return 1 - make DESTDIR="$pkgdir" install || return 1 + make DESTDIR="$pkgdir" ZM_RUNDIR="$pkgdir/var/run" ZM_TMPDIR="$pkgdir/tmp" ZM_LOGDIR="$pkgdir/var/log" install || return 1 install -D -m 700 $startdir/src/zminit.arch $startdir/pkg/srv/zoneminder/bin/zminit install -D -m 755 $startdir/src/zm.rc.d $startdir/pkg/etc/rc.d/zm -- cgit v1.2.3 From baf66be2cc97d18928c1d8cce98e61748844fd4a Mon Sep 17 00:00:00 2001 From: Márcio Alexandre Silva Delgado Date: Wed, 12 Sep 2012 19:14:49 -0300 Subject: zoneminder: add mips64el to PKGBUILD --- pcr/zoneminder/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index f3528e91c..d07972e54 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -8,7 +8,7 @@ pkgname=zoneminder pkgver=1.25.0 pkgrel=13 pkgdesc="Capture, analyse, record and monitor video security cameras" -arch=('i686' 'x86_64' 'arm') +arch=('i686' 'x86_64' 'mips64el') url="http://www.zoneminder.com" license=('GPL') depends=('cambozola' 'apache' 'php' 'php-gd' 'php-mcrypt' 'mysql' 'pcre' 'openssl' 'ffmpeg' 'perl-libwww' 'perl-date-manip' 'perl-unicode-map' 'perl-dbi' 'perl-dbd-mysql' 'perl-io-stringy' 'perl-mime-lite' 'perl-timedate' 'perl-x10' 'perl-time-modules' 'perl-net-smtp-ssl' 'perl-sys-mmap' 'perl-net-sftp-foreign' 'perl-mime-tools' 'perl-io-tty' 'sudo' 'libv4l' 'libjpeg' 'gnutls' 'php-apache') -- cgit v1.2.3 From e138b1c3a294e1f72ed8c730b124fae16b5e4d04 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Thu, 13 Sep 2012 02:40:50 -0300 Subject: zoneminder-1.25.0-13: removing sudo dependency --- pcr/zoneminder/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index f3528e91c..ec19ae664 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -11,7 +11,7 @@ pkgdesc="Capture, analyse, record and monitor video security cameras" arch=('i686' 'x86_64' 'arm') url="http://www.zoneminder.com" license=('GPL') -depends=('cambozola' 'apache' 'php' 'php-gd' 'php-mcrypt' 'mysql' 'pcre' 'openssl' 'ffmpeg' 'perl-libwww' 'perl-date-manip' 'perl-unicode-map' 'perl-dbi' 'perl-dbd-mysql' 'perl-io-stringy' 'perl-mime-lite' 'perl-timedate' 'perl-x10' 'perl-time-modules' 'perl-net-smtp-ssl' 'perl-sys-mmap' 'perl-net-sftp-foreign' 'perl-mime-tools' 'perl-io-tty' 'sudo' 'libv4l' 'libjpeg' 'gnutls' 'php-apache') +depends=('cambozola' 'apache' 'php' 'php-gd' 'php-mcrypt' 'mysql' 'pcre' 'openssl' 'ffmpeg' 'perl-libwww' 'perl-date-manip' 'perl-unicode-map' 'perl-dbi' 'perl-dbd-mysql' 'perl-io-stringy' 'perl-mime-lite' 'perl-timedate' 'perl-x10' 'perl-time-modules' 'perl-net-smtp-ssl' 'perl-sys-mmap' 'perl-net-sftp-foreign' 'perl-mime-tools' 'perl-io-tty' 'libv4l' 'libjpeg' 'gnutls' 'php-apache') makedepends=() install=zoneminder.install source=("http://www.zoneminder.com/downloads/ZoneMinder-${pkgver}.tar.gz" -- cgit v1.2.3 From d8bf355818d6eb8182d9a3938bb2b7bdf7e7d61c Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Thu, 13 Sep 2012 02:55:26 -0300 Subject: zoneminder-1.25.0-14: updating revision --- pcr/zoneminder/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index 97f7ee9b7..334d32325 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -6,7 +6,7 @@ pkgname=zoneminder pkgver=1.25.0 -pkgrel=13 +pkgrel=14 pkgdesc="Capture, analyse, record and monitor video security cameras" arch=('i686' 'x86_64' 'mips64el') url="http://www.zoneminder.com" -- cgit v1.2.3 From f89037a7471edd92e5f4ab8068920bb51c7abe45 Mon Sep 17 00:00:00 2001 From: Márcio Alexandre Silva Delgado Date: Tue, 25 Sep 2012 13:18:26 -0300 Subject: zoneminder: updating package --- pcr/zoneminder/PKGBUILD | 179 ++++++++++--------- pcr/zoneminder/httpd-zm.conf | 18 +- pcr/zoneminder/patch-ffmpeg-0.11.patch | 12 +- pcr/zoneminder/zm.rc.d | 221 ++++++------------------ pcr/zoneminder/zoneminder-1.25.0-kernel35.patch | 4 +- pcr/zoneminder/zoneminder.install | 121 ++++++++----- pcr/zoneminder/zoneminder.service | 14 ++ 7 files changed, 258 insertions(+), 311 deletions(-) create mode 100644 pcr/zoneminder/zoneminder.service (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index 334d32325..c53cc2695 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -4,113 +4,110 @@ # Maintainer (Parabola): Márcio Silva # Maintainer (Parabola): André Silva +# based of debian squeeze package + pkgname=zoneminder pkgver=1.25.0 -pkgrel=14 -pkgdesc="Capture, analyse, record and monitor video security cameras" -arch=('i686' 'x86_64' 'mips64el') -url="http://www.zoneminder.com" -license=('GPL') -depends=('cambozola' 'apache' 'php' 'php-gd' 'php-mcrypt' 'mysql' 'pcre' 'openssl' 'ffmpeg' 'perl-libwww' 'perl-date-manip' 'perl-unicode-map' 'perl-dbi' 'perl-dbd-mysql' 'perl-io-stringy' 'perl-mime-lite' 'perl-timedate' 'perl-x10' 'perl-time-modules' 'perl-net-smtp-ssl' 'perl-sys-mmap' 'perl-net-sftp-foreign' 'perl-mime-tools' 'perl-io-tty' 'libv4l' 'libjpeg' 'gnutls' 'php-apache') -makedepends=() -install=zoneminder.install -source=("http://www.zoneminder.com/downloads/ZoneMinder-${pkgver}.tar.gz" - zm.rc.d - Controls_Orbit.sql - zminit.arch - customdb - httpd-zm.conf - zmeventbackup - patch-ffmpeg-0.11.patch - patch-libavcodec-detection.patch - zoneminder-1.25.0-kernel35.patch - arm-context.patch) - -md5sums=('eaefa14befd482154970541252aa1a39' - '9fb81f81b056c18be6eef3f1c8e0dd6d' - '5033bc098bf497c8aed1fc1b3c9c5f9c' - 'f9720872736f26d17bc49d8725b75ae4' - '942f6641c744ffe7d64846a5c34d84f1' - 'e63262d1417105ae24c7a03d98b2c64c' - '1a6d7c43af79c786b27cc88f7ba7ed3e' - 'b872dd86926ab00c5d4733e7e38eaa9c' - '94bf5d95fe5429f7df458ddfbabf0c12' - '88bd124dfb841320cecb0a757b2a78c1' - 'b28c8eb392a7e7b6ef665817d7fe61f4') - +pkgrel=15 +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 perl-dbd-mysql perl-dbi perl-libwww perl-mime-lite + perl-mime-tools perl-net-sftp-foreign perl-sys-mmap perl-time-modules perl-x10 php php-apache php-gd php-mcrypt +) +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 +) +md5sums=( + eaefa14befd482154970541252aa1a39 + 81c8be870260142e2633eedf73c72040 + 94bf5d95fe5429f7df458ddfbabf0c12 + 48a3c48394e18bf072f7b32730db18df + 831e3538facff18e27d402e36dbd6b8d + 034b61cda8849fc3001849e76ef26041 + 7487cc72ead82aea0bc78f2e4106ae1a +) build() { - cd "$srcdir/ZoneMinder-$pkgver" + cd $srcdir/ZoneMinder-$pkgver + + export CPPFLAGS=-D__STDC_CONSTANT_MACROS \ + ZM_SSL_LIB=gnutls # Patch for GCC 4.7.x sed -i -e '1 s/^/#include \n/;' src/zm_logger.cpp sed -i -e '1 s/^/#include \n/;' src/zm_thread.h - # Patch for build/upgrade path - sed -i -e 's#ZM_PATH_BUILD=@PATH_BUILD@#ZM_PATH_BUILD=/srv/zoneminder/upgrade\nZM_PATH_UPDATE=/srv/zoneminder/upgrade#' zm.conf.in - # Patch for support new ffmpeg - patch -p1 < ../patch-ffmpeg-0.11.patch + patch -p1 < $srcdir/patch-ffmpeg-0.11.patch # Patch for correct libavcodec detection - patch -p0 < ../patch-libavcodec-detection.patch + patch -p0 < $srcdir/patch-libavcodec-detection.patch # Patch for type cast in kernel3.5 - patch -p0 < ../zoneminder-1.25.0-kernel35.patch - - # Patch for ARM - if test "$CARCH" == arm; then - patch -p0 < ../arm-context.patch - fi - - # Add some more configs into DB - cat ../Controls_Orbit.sql >> db/zm_create.sql.in + patch -p0 < $srcdir/$pkgname-1.25.0-kernel35.patch ./configure --prefix=/usr \ + --build \ + --enable-crashtrace=yes \ + --enable-debug=yes \ + --enable-mmap=yes \ + --mandir=/usr/share/man \ --sysconfdir=/etc \ - --with-webuser=http \ + --with-cgidir=/usr/lib/$pkgname/cgi-bin \ + --with-ffmpeg=/usr \ + --with-libarch=lib \ + --with-mysql=/usr \ + --with-webdir=/usr/share/$pkgname \ --with-webgroup=http \ - --with-mysql=/usr \ - --with-webdir=/srv/zoneminder/www \ - --with-cgidir=/srv/zoneminder/cgi-bin \ - --bindir=/srv/zoneminder/bin \ - ZM_SSL_LIB=openssl \ - CPPFLAGS=-D__STDC_CONSTANT_MACROS - - # chown line mucks everything up, we'll chown it in the install script - sed -i '/chown/d' Makefile - - # modify hard-coded paths - sed -i 's#/var/lib/zm#/srv/zoneminder/backup#' scripts/zmdbrestore.in - sed -i 's#/var/lib/zm#/srv/zoneminder/backup#' scripts/zmlogrotate.conf.in - sed -i 's#/var/lib/zm#/srv/zoneminder/backup#' scripts/zmdbbackup.in - - # Build it! - make || return 1 - make DESTDIR="$pkgdir" ZM_RUNDIR="$pkgdir/var/run" ZM_TMPDIR="$pkgdir/tmp" ZM_LOGDIR="$pkgdir/var/log" install || return 1 - - install -D -m 700 $startdir/src/zminit.arch $startdir/pkg/srv/zoneminder/bin/zminit - install -D -m 755 $startdir/src/zm.rc.d $startdir/pkg/etc/rc.d/zm - install -D -m 700 scripts/zmdbbackup $startdir/pkg/srv/zoneminder/bin/zmdbbackup - install -D -m 700 scripts/zmdbbackup $startdir/pkg/srv/zoneminder/bin/zmdbbackup - install -D -m 700 scripts/zmdbrestore $startdir/pkg/srv/zoneminder/bin/zmdbrestore - install -D -m 700 scripts/zmeventdump $startdir/pkg/srv/zoneminder/bin/zmeventdump - install -D -m 700 scripts/zmlogrotate.conf $startdir/pkg/etc/logrotate.d/zm - install -D -m 700 $startdir/src/zmeventbackup $startdir/pkg/etc/cron.hourly/zmeventbackup - - mkdir -p $startdir/pkg/etc/httpd/conf/extra/ - install -m 644 $startdir/src/httpd-zm.conf $startdir/pkg/etc/httpd/conf/extra/httpd-zm.conf - - install -D -m 700 $startdir/src/customdb $startdir/pkg/srv/zoneminder/upgrade/customdb - install -D db/zm*.sql $startdir/pkg/srv/zoneminder/upgrade/ - - mkdir -p $startdir/pkg/var/run/zm - - ### remove special files - find $startdir/pkg/ -name "perllocal.pod" \ - -o -name ".packlist" \ - -o -name "*.bs" \ - |xargs -i rm -f {} - + --with-webuser=http + make V=0 } -# vim:set ft=sh ts=2 sw=2 et: +package() { + cd $srcdir/ZoneMinder-$pkgver + + make DESTDIR=$pkgdir \ + ZM_LOGDIR=$pkgdir/var/log/zm \ + ZM_RUNDIR=$pkgdir/run \ + ZM_TMPDIR=$pkgdir/tmp \ + install + + rmdir $pkgdir/run + rmdir $pkgdir/tmp + + 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 + + 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 + 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 + + 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 + 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 +} diff --git a/pcr/zoneminder/httpd-zm.conf b/pcr/zoneminder/httpd-zm.conf index ad24cbbe4..e48ea9fc6 100644 --- a/pcr/zoneminder/httpd-zm.conf +++ b/pcr/zoneminder/httpd-zm.conf @@ -1,16 +1,18 @@ # /etc/httpd/conf/extra/httpd-zm.conf # Config for zoneminder web app -Alias /zm "/srv/zoneminder/www" - - Options -Indexes MultiViews FollowSymLinks - AllowOverride All - Order allow,deny - Allow from all +Alias /zm "/usr/share/zoneminder" + + Options -Indexes MultiViews FollowSymLinks + AllowOverride All + Order allow,deny + Allow from all + # The code unfortunately uses short tags in many places + php_value short_open_tag 1 -ScriptAlias /cgi-bin "/srv/zoneminder/cgi-bin" - +ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin" + AllowOverride All Options ExecCGI Order allow,deny diff --git a/pcr/zoneminder/patch-ffmpeg-0.11.patch b/pcr/zoneminder/patch-ffmpeg-0.11.patch index 8356fff83..ac56e4c69 100644 --- a/pcr/zoneminder/patch-ffmpeg-0.11.patch +++ b/pcr/zoneminder/patch-ffmpeg-0.11.patch @@ -2,7 +2,7 @@ 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 -@@ -108,7 +108,7 @@ int FfmpegCamera::PrimeCapture() +@@ -91,7 +91,7 @@ int FfmpegCamera::PrimeCapture() Info( "Priming capture from %s", mPath.c_str() ); // Open the input, not necessarily a file @@ -11,7 +11,7 @@ index 42927f6..61df606 100644 Fatal( "Unable to open input %s due to: %s", mPath.c_str(), strerror(errno) ); // Locate stream info from input -@@ -139,7 +139,7 @@ int FfmpegCamera::PrimeCapture() +@@ -122,7 +122,7 @@ int FfmpegCamera::PrimeCapture() Fatal( "Can't find codec for video stream from %s", mPath.c_str() ); // Open the codec @@ -25,7 +25,7 @@ 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 -@@ -167,10 +167,12 @@ void VideoStream::SetParameters() +@@ -130,10 +130,12 @@ void VideoStream::SetParameters() { /* set the output parameters (must be done even if no parameters). */ @@ -40,7 +40,7 @@ index f5de2a4..d614346 100644 //dump_format(ofc, 0, filename, 1); } -@@ -259,7 +261,7 @@ void VideoStream::OpenStream() +@@ -222,7 +224,7 @@ void VideoStream::OpenStream() if ( !(of->flags & AVFMT_NOFILE) ) { #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) @@ -49,7 +49,7 @@ index f5de2a4..d614346 100644 #else if ( url_fopen(&ofc->pb, filename, URL_WRONLY) < 0 ) #endif -@@ -278,7 +280,7 @@ void VideoStream::OpenStream() +@@ -241,7 +243,7 @@ void VideoStream::OpenStream() } /* write the stream header, if any */ @@ -57,4 +57,4 @@ index f5de2a4..d614346 100644 + 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 ) \ No newline at end of file + VideoStream::VideoStream( const char *filename, const char *format, int bitrate, double frame_rate, int colours, int subpixelorder, int width, int height ) diff --git a/pcr/zoneminder/zm.rc.d b/pcr/zoneminder/zm.rc.d index 99a1f1f22..c4cbf4d3f 100644 --- a/pcr/zoneminder/zm.rc.d +++ b/pcr/zoneminder/zm.rc.d @@ -1,172 +1,63 @@ #!/bin/bash -# Source function library. +daemon_name=zm + . /etc/rc.conf . /etc/rc.d/functions -prog=ZoneMinder -ZM_VERSION="1.25.0" -ZM_PATH_BIN="/srv/zoneminder/bin" -ZM_CONFIG="/etc/zm.conf" -command="$ZM_PATH_BIN/zmpkg.pl" - -loadconf() -{ - if [ -f $ZM_CONFIG ]; then - . $ZM_CONFIG - else - echo "ERROR: $ZM_CONFIG not found. -" - return 1 - fi -} - -# Check for old config and update if needed -checkcfg() -{ - # Check config - if [ "$ZM_DB_HOST" = "" -o "$ZM_DB_NAME" = "" -o "$ZM_DB_USER" = "" -o "$ZM_DB_PASS" = "" ]; then - echo "In $ZM_CONFIG there should not be null values. -" - return 1 - loadconf - fi -} - -checkdb() -{ - # Check database exisits and version - GetVer="select Value from Config where Name='ZM_DYN_DB_VERSION'" - OLD_VERSION=`echo $GetVer | mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` - if [ "$OLD_VERSION" = "" ]; then - GetVer="select Value from Config where Name='ZM_DYN_CURR_VERSION'" - OLD_VERSION=`echo $GetVer | mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` - if [ "$OLD_VERSION" = "" ]; then - echo "You must run $ZM_PATH_BIN/zminit manually -" - return 1 - fi - fi - RETVAL=$? - - if [ $RETVAL != 0 ]; then - tbls=`mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS -s -e 'show tables' $ZM_DB_NAME` - RETVAL=$? - if [ $RETVAL = 0 ]; then - echo "Initialize $prog database: -" - echo tbls | grep Config >/dev/null 2>&1 - RETVAL=$? - if [ $RETVAL != 0 ]; then - mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME < $ZM_PATH_UPDATE/zm_create.sql - RETVAL=$? - [ $RETVAL = 0 ] && stat_done - [ $RETVAL != 0 ] && stat_fail - echo - return $RETVAL - fi - ( cd $ZM_PATH_UPDATE; perl $ZM_PATH_BIN/zmupdate.pl -f ) - RETVAL=$? - [ $RETVAL = 0 ] && stat_done - [ $RETVAL != 0 ] && stat_fail - echo - return $RETVAL - else - echo "No access to ZoneMinder database. -Run $ZM_PATH_BIN/zminit manually. -" - return $RETVAL - fi - else - [ "$ZM_VERSION" = "$OLD_VERSION" ] && return 0 - echo "Upgrade %s database: " "$prog" - $ZM_PATH_BIN/zmupdate.pl --version=$OLD_VERSION --noi && ( cd $ZM_PATH_UPDATE; perl $ZM_PATH_BIN/zmupdate.pl -f ) - RETVAL=$? - [ $RETVAL = 0 ] && stat_done - [ $RETVAL != 0 ] && stat_fail - echo - return $RETVAL - fi -} - -start() -{ - loadconf || return $? - checkcfg || return $? - checkdb || return $? - stat_busy "Starting $prog" - [ -d /var/run/zm ] || mkdir -m 774 /var/run/zm - chown -R $ZM_WEB_USER:$ZM_WEB_GROUP /var/run/zm - GetPath="select Value from Config where Name='ZM_PATH_SOCKS'" - ZM_PATH_SOCK=`echo $GetPath | mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` - [ -d $ZM_PATH_SOCK ] || mkdir -m 774 -p $ZM_PATH_SOCK - sudo -u $ZM_WEB_USER test -O $ZM_PATH_SOCK \ - || chown -R $ZM_WEB_USER:$ZM_WEB_GROUP $ZM_PATH_SOCK - # Setup the log dir - [ -d /var/log/zm ] || mkdir /var/log/zm - for logs in zmaudit.log zmdc.log zmfilter.log zmpkg.log zmupdate.log zmwatch.log; do - touch /var/log/zm/$logs - done - chown -R $ZM_WEB_USER:$ZM_WEB_GROUP /var/log/zm - $command start - RETVAL=$? - [ $RETVAL = 0 ] && stat_done && add_daemon zm - [ $RETVAL != 0 ] && stat_fail - #[ $RETVAL = 0 ] && touch /var/lock/subsys/zm - return $RETVAL -} - -stop() -{ - stat_busy "Stopping $prog" - $command stop - RETVAL=$? - [ $RETVAL = 0 ] && stat_done && rm_daemon zm - [ $RETVAL != 0 ] && stat_fail - #[ $RETVAL = 0 ] && rm -f /var/lock/subsys/zm -} - -status() -{ - result=`$command status` - if [ "$result" = "running" ]; then - echo "ZoneMinder is running -" - RETVAL=0 - else - echo "ZoneMinder is stopped -" - RETVAL=1 - fi -} - case "$1" in - 'start') - start - ;; - 'stop') - stop - ;; - 'restart') - stop - start - ;; - 'condrestart') - loadconf - checkcfg - result=`$ZM_PATH_BIN/zmdc.pl check` - if [ "$result" = "running" ]; then - $ZM_PATH_BIN/zmdc.pl shutdown > /dev/null - start - fi - ;; - 'status') - status - ;; - *) - echo "Usage: zm { start | stop | restart | condrestart | status } -" - RETVAL=1 - ;; + start) + stat_busy "Starting Zoneminder" + /usr/bin/zmfix -a + if /usr/bin/zmpkg.pl start >/dev/null ; then + add_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Stopping Zoneminder" + if /usr/bin/zmpkg.pl stop >/dev/null ; then + rm_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + reload) + stat_busy "Reloading Zoneminder" + if /usr/bin/zmpkg.pl graceful >/dev/null ; then + add_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + restart) + stat_busy "Restarting Zoneminder" + if /usr/bin/zmpkg.pl restart >/dev/null ; then + add_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + status) + stat_busy "Checking Zoneminder status"; + ck_status $daemon_name + ;; + + *) + echo "usage: $0 {start|stop|reload|restart|status}" esac -exit $RETVAL + +exit 0 diff --git a/pcr/zoneminder/zoneminder-1.25.0-kernel35.patch b/pcr/zoneminder/zoneminder-1.25.0-kernel35.patch index 51bc1288d..9939dc5c3 100644 --- a/pcr/zoneminder/zoneminder-1.25.0-kernel35.patch +++ b/pcr/zoneminder/zoneminder-1.25.0-kernel35.patch @@ -1,7 +1,7 @@ diff -up ./src/zm_local_camera.cpp.kernel35 ./src/zm_local_camera.cpp --- ./src/zm_local_camera.cpp.kernel35 2012-07-16 15:01:22.182614878 -0500 +++ ./src/zm_local_camera.cpp 2012-07-16 15:02:16.491941730 -0500 -@@ -740,7 +740,7 @@ void LocalCamera::Terminate() +@@ -739,7 +739,7 @@ void LocalCamera::Terminate() { Debug( 3, "Terminating video stream" ); //enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; @@ -10,7 +10,7 @@ diff -up ./src/zm_local_camera.cpp.kernel35 ./src/zm_local_camera.cpp if ( vidioctl( vid_fd, VIDIOC_STREAMOFF, &type ) < 0 ) Error( "Failed to stop capture stream: %s", strerror(errno) ); -@@ -1520,7 +1520,7 @@ int LocalCamera::PrimeCapture() +@@ -1519,7 +1519,7 @@ int LocalCamera::PrimeCapture() Debug( 3, "Starting video stream" ); //enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; diff --git a/pcr/zoneminder/zoneminder.install b/pcr/zoneminder/zoneminder.install index be449a5ca..3ade5355e 100644 --- a/pcr/zoneminder/zoneminder.install +++ b/pcr/zoneminder/zoneminder.install @@ -1,57 +1,100 @@ -# zoneminder.install +pre_install() { + set -e + abort=false + if [ -L /usr/share/zoneminder/events ]; then + l=$(readlink /usr/share/zoneminder/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 != /var/cache/zoneminder/images ]; then + abort=true + fi + fi + 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 +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 + exit 1 + fi + exit 0 +} -## arg 1: the new package version post_install() { - ln -s /usr/share/cambozola/cambozola.jar /srv/zoneminder/www/ - chown -R http.http /srv/zoneminder - chown http.http /etc/zm.conf - mkdir /srv/zoneminder/backup - mkdir /srv/zoneminder/socks + mkdir /usr/share/zoneminder/backup + mkdir /usr/share/zoneminder/socks cat << EOF Note: -==> To initialize the ZoneMinder database run (as root) -==> /srv/zoneminder/bin/zminit -EOF +==> 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" - cat << EOF -==> Check /etc/php/php.ini and make sure these are uncommented -==> extension=gd.so -==> extension=gettext.so -==> extension=mcrypt.so -==> extension=mysql.so -==> extension=mysqli.so -==> extension=session.so -==> extension=sockets.so -EOF - cat << EOF -==> Check /etc/php/php.ini and make sure short_open_tag = On -EOF +Note: +==> You must uncomment that line in /etc/php/php.ini: +==> "extension=mysql.so" +==> check and make sure these are uncommented: +==> "extension=gd.so" +==> "extension=gettext.so" +==> "extension=mcrypt.so" +==> "extension=mysqli.so" +==> "extension=session.so" +==> "extension=sockets.so" +==> Check /etc/php/php.ini and make sure short_open_tag = On +==> or ZoneMinder will not work. - cat /etc/php/php.ini |grep "^open_basedir.*/etc/" | \ -grep "/srv/zoneminder/www">/dev/null || cat << EOF -==> You must edit /etc/php/php.ini and add to open_basedir "/etc/" and -==> "/srv/zoneminder/" like so -==> open_basedir = /home/:/tmp/:/usr/share/pear/:/etc/:/srv/zoneminder/ +==> 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 ==> Otherwise ZoneMinder will be unable to read /etc/zm.conf ==> or display its own web directory -EOF - cat << EOF Note: -==> You must edit /etc/httpd/conf/httpd.conf and uncomment/add the line +==> You must edit /etc/httpd/conf/httpd.conf and add the line: ==> LoadModule php5_module modules/libphp5.so -==> You must also add these lines: -==> Include conf/extra/php5_module.conf +==> and: ==> Include /etc/httpd/conf/extra/httpd-zm.conf EOF - touch /srv/zoneminder/zm_backup.sql } - -## arg 1: the new package version -## arg 2: the old package version post_upgrade() { - /srv/zoneminder/bin/zmupdate.pl -f >/dev/null + /usr/bin/zmupdate.pl -f >/dev/null +} + +post_remove() { + cat << EOF +Note: +==> To clean Zoneminder mysql database, run as root: +==> "echo 'delete from user where User="zmuser";' | mysql --defaults-file=/etc/mysql/my.cnf -p mysql" +==> "echo 'delete from db where User="zmuser";' | mysql --defaults-file=/etc/mysql/my.cnf -p mysql" +==> "mysqladmin --defaults-file=/etc/mysql/my.cnf -p -f drop zm" + +==> 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/httpd-zm.conf" + +==> Disable php with mysql if it isn't needed with others servers, +==> comment that lines in /etc/php/php.ini: +==> "extension=mysql.so" +==> "extension=gd.so" +==> "extension=gettext.so" +==> "extension=mcrypt.so" +==> "extension=mysqli.so" +==> "extension=session.so" +==> "extension=sockets.so" + +==> edit /etc/php/php.ini and remove "/etc" and "/usr/share/zoneminder" +==> in the open_basedir. +EOF } -# vim:set ts=2 sw=2 et: diff --git a/pcr/zoneminder/zoneminder.service b/pcr/zoneminder/zoneminder.service new file mode 100644 index 000000000..ba41e8926 --- /dev/null +++ b/pcr/zoneminder/zoneminder.service @@ -0,0 +1,14 @@ +[Unit] +Description=Capture, analyse, record and monitor video security cameras +After=network.target remote-fs.target +Required=mysqld.service + +[Service] +Type=forking +PIDFile=/run/zm.pid +ExecStart=/usr/bin/zmpkg.pl start +ExecRestart=/usr/bin/zmpkg.pl restart +ExecStop=/usr/bin/zmpkg.pl stop + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3 From faab3d43d0f1e705cfd16a7953f6a7f5b5a1642c Mon Sep 17 00:00:00 2001 From: Márcio Alexandre Silva Delgado Date: Tue, 25 Sep 2012 19:00:25 -0300 Subject: zoneminder: updating package --- pcr/zoneminder/PKGBUILD | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index c53cc2695..91c6c9175 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -2,21 +2,23 @@ # Contributor: Jason Gardner # Contributor: Ross melin # Maintainer (Parabola): Márcio Silva -# Maintainer (Parabola): André Silva +# Contributor (Parabola): André Silva # based of debian squeeze package pkgname=zoneminder pkgver=1.25.0 -pkgrel=15 +pkgrel=16 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 perl-dbd-mysql perl-dbi perl-libwww perl-mime-lite - perl-mime-tools perl-net-sftp-foreign perl-sys-mmap perl-time-modules perl-x10 php php-apache php-gd php-mcrypt + apache cambozola ffmpeg 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 ) makedepends=(netpbm) install=$pkgname.install -- cgit v1.2.3 From 96f0aa328d7def18d65a49e621abd06ad06105e9 Mon Sep 17 00:00:00 2001 From: Márcio Alexandre Silva Delgado Date: Wed, 3 Oct 2012 19:09:13 -0300 Subject: zoneminder and ffmpeg-static: updating packages --- pcr/ffmpeg-static/PKGBUILD | 4 +- pcr/zoneminder/PKGBUILD | 108 +++++++++++++++++----------- pcr/zoneminder/httpd-zm.conf | 16 ++--- pcr/zoneminder/patch-ffmpeg-configure.patch | 26 +++++++ pcr/zoneminder/zoneminder.install | 35 +++++---- 5 files changed, 118 insertions(+), 71 deletions(-) create mode 100644 pcr/zoneminder/patch-ffmpeg-configure.patch (limited to 'pcr/zoneminder') 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 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 \n/;' src/zm_logger.cpp - sed -i -e '1 s/^/#include \n/;' src/zm_thread.h + sed -i -e 's/^#include /#include \n#include /' src/zm_logger.cpp + sed -i -e 's/^#include /#include \n#include /' 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 and C library + sed -i -e 's/^extern "C" {/extern "C" {\n#ifdef _STDINT_H\n#undef _STDINT_H\n#endif\n#include / + s/^#include /#include \n#include /'\ + 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" - +Alias /zm "/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 ScriptAlias /zm/cgi-bin "/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 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 } -- cgit v1.2.3 From 3f0e156548a72a447c089113ddf888a5dc51403a Mon Sep 17 00:00:00 2001 From: Márcio Alexandre Silva Delgado Date: Fri, 19 Oct 2012 19:52:28 -0200 Subject: zoneminder: updating package --- pcr/zoneminder/PKGBUILD | 84 ++++++++++++++++++++++++--------------- pcr/zoneminder/httpd-zm.conf | 8 ++-- pcr/zoneminder/zoneminder.install | 44 +++++++++++++++----- 3 files changed, 92 insertions(+), 44 deletions(-) (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index bb850eec2..64c3f94b0 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -8,7 +8,7 @@ pkgname=zoneminder pkgver=1.25.0 -pkgrel=17 +pkgrel=19 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) @@ -31,7 +31,7 @@ source=( ) md5sums=( eaefa14befd482154970541252aa1a39 - 25ad042b501aaad98cbe4e05ca0a96c2 + 72380d8793a784ec24cb6809aea4a739 034b61cda8849fc3001849e76ef26041 7487cc72ead82aea0bc78f2e4106ae1a 81c8be870260142e2633eedf73c72040 @@ -39,27 +39,49 @@ md5sums=( build() { cd $srcdir/ZoneMinder-$pkgver - export CPPFLAGS=-D__STDC_CONSTANT_MACROS \ + export CPPFLAGS=-D__STDC_CONSTANT_MACROS\ ZM_SSL_LIB=gnutls # Patch for GCC 4.7.x - sed -i -e 's/^#include /#include \n#include /' src/zm_logger.cpp - sed -i -e 's/^#include /#include \n#include /' src/zm_thread.h + sed -i -e 's/^#include /#include \n#include /'\ + src/zm_logger.cpp || read + sed -i -e 's/^#include /#include \n#include /'\ + src/zm_thread.h || read + + # Patch for automake 1.12 + sed -i -e '/am__api_version=/ s/1.11/1.12/'\ + configure || read # 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 + sed -i -e '/ZM_CHECK_FOR_UPDATES/,+1 s/yes/no/'\ + scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read # 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 + scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read + + # Patch for change path + sed -i -e '/ZM_PATH_SOCKS/,+1 s/tmp\/zm/run/; + /ZM_PATH_LOGS/,+1 s/zm/zonemider/; + /ZM_PATH_SWAP/,+1 s/zm/zonemider/'\ + scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read + + # Patch for v4l1 compat + sed -i -e "s/$ENV{SHELL} = \'\/bin\/sh\' if exists $ENV{SHELL};/$ENV{SHELL} = \'\/bin\/sh\' if exists $ENV{SHELL};\n$ENV{LD_PRELOAD} = \'\/usr\/lib\/libv4l\/v4l1compat.so\' ;/"\ + scripts/zmdc.pl.in || read + + # Patch for add more socket tries + sed -i -e '/$max_socket_tries/ s/3/15/'\ + web/ajax/stream.php || read # Patch for wrong "suppported" - sed -i -e 's/suppported/supported/' src/zm_local_camera.cpp + sed -i -e 's/suppported/supported/'\ + src/zm_local_camera.cpp || read # 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 + src/zm_local_camera.cpp || read # Patch for drop custom perl install paths sed -i -e '/# Slight hack for non-standard perl install paths/,+10 d; @@ -93,22 +115,22 @@ build() { / ( 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' \ + / ( 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=no \ - --enable-debug=no \ - --enable-mmap=yes \ - --sysconfdir=/etc \ - --with-cgidir=/usr/lib/$pkgname/cgi-bin \ - --with-ffmpeg=/usr \ - --with-libarch=lib \ - --with-mysql=/usr \ - --with-webdir=/usr/share/$pkgname/www \ - --with-webgroup=http \ - --with-webhost=localhost \ + ./configure --prefix=/usr\ + --enable-crashtrace=no\ + --enable-debug=no\ + --enable-mmap=yes\ + --sysconfdir=/etc\ + --with-cgidir=/srv/http/cgi-bin\ + --with-extralibs='-L/usr/lib -L/usr/lib/mysql'\ + --with-ffmpeg=/usr\ + --with-libarch=lib\ + --with-mysql=/usr\ + --with-webdir=/srv/http/$pkgname\ + --with-webgroup=http\ + --with-webhost=localhost\ --with-webuser=http make V=0 @@ -117,22 +139,22 @@ build() { package() { cd $srcdir/ZoneMinder-$pkgver - make DESTDIR=$pkgdir install + make DESTDIR=$pkgdir RUNDIR=$pkdir/run ZM_RUNDIR=$pkgdir/run install - 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,rc.d},srv/http/{cgi-bin,$pkgname},usr/{lib/systemd/system,share/{license/$pkgname,$pkgname/db}},var/{cache/$pkgname,log/$pkgname}} - chown -R http.http $pkgdir/{etc/zm.conf,var/{cache/$pkgname,log/zm}} + chown -R http.http $pkgdir/{etc/zm.conf,var/{cache/$pkgname,log/$pkgname}} for i in events images temp; do - mv $pkgdir/usr/share/$pkgname/www/$i $pkgdir/var/cache/$pkgname/$i - ln -s /var/cache/$pkgname/$i $pkgdir/usr/share/$pkgname/www/$i + mv $pkgdir/srv/http/$pkgname/$i $pkgdir/var/cache/$pkgname/$i + ln -s /var/cache/$pkgname/$i $pkgdir/srv/http/$pkgname/$i done - ln -s /usr/lib/$pkgname/cgi-bin $pkgdir/usr/share/$pkgname/www - ln -s /usr/share/cambozola/cambozola.jar $pkgdir/usr/share/$pkgname/www + ln -s /srv/http/cgi-bin $pkgdir/srv/http/$pkgname + ln -s /usr/share/cambozola/cambozola.jar $pkgdir/srv/http/$pkgname 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 + install -D -m 644 $srcdir/zm.rc.d $pkgdir/etc/rc.d/${pkgname}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 diff --git a/pcr/zoneminder/httpd-zm.conf b/pcr/zoneminder/httpd-zm.conf index 8c6356aec..aeb089bc1 100644 --- a/pcr/zoneminder/httpd-zm.conf +++ b/pcr/zoneminder/httpd-zm.conf @@ -1,8 +1,8 @@ # /etc/httpd/conf/extra/httpd-zm.conf # Config for zoneminder web app -Alias /zm "/usr/share/zoneminder/www" - +Alias /zm "/srv/http/zoneminder" + Options -Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny @@ -11,8 +11,8 @@ Alias /zm "/usr/share/zoneminder/www" php_value short_open_tag On -ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin" - +ScriptAlias /cgi-bin "/srv/http/cgi-bin" + AllowOverride None Options ExecCGI FollowSymLinks Order allow,deny diff --git a/pcr/zoneminder/zoneminder.install b/pcr/zoneminder/zoneminder.install index 922aaad9b..5e62cc23e 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/www/events ]; then - l=$(readlink /usr/share/zoneminder/www/events) + if [ -L /srv/http/zoneminder/events ]; then + l=$(readlink /srv/http/zoneminder/events) if [ $l != /var/cache/zoneminder/events ]; then abort=true fi fi - if [ -L /usr/share/zoneminder/www/images ]; then - l=$(readlink /usr/share/zoneminder/www/images ) + if [ -L /srv/http/zoneminder/images ]; then + l=$(readlink /srv/http/zoneminder/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/www for the images and/or events directory, which could +/srv/http/zoneminder 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,8 +26,13 @@ EOF } post_install() { - mkdir /usr/share/zoneminder/www/backup - mkdir /usr/share/zoneminder/www/socks + if [ -d /var/log/zoneminder ]; then + mkdir -m 0755 /var/log/zoneminder + chown http.http /var/log/zoneminder + else + chmod 0755 /var/log/zoneminder + chown http.http /var/log/zoneminder + fi cat << EOF Note: ==> To run Zoneminder, you must install the database running mysql service (as root): @@ -50,9 +55,10 @@ Note: ==> 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/www" +==> "open_basedir = /home:/tmp:/usr/share/pear:/etc:/srv/http/zoneminder" ==> Otherwise ZoneMinder will be unable to read /etc/zm.conf ==> or display its own web directory +==> And set your timezone in php.ini: date.timezone = / Note: ==> You must edit /etc/httpd/conf/httpd.conf and add the line: @@ -65,9 +71,22 @@ EOF post_upgrade() { /usr/bin/zmupdate.pl -f >/dev/null + if [ -d /var/log/zoneminder ]; then + mkdir -m 0755 /var/log/zoneminder + chown http.http /var/log/zoneminder + else + chmod 0755 /var/log/zoneminder + chown http.http /var/log/zoneminder + fi } post_remove() { + if [ -d /run/zoneminder ]; then + rm -vr /run/zoneminder + fi + if [ -d /tmp/zoneminder ]; then + rm -vr /tmp/zoneminder + fi cat << EOF Note: ==> To clean Zoneminder mysql database, run as root: @@ -79,6 +98,8 @@ Note: ==> 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" + +==> Remove ==> "Include /etc/httpd/conf/extra/httpd-zm.conf" ==> Disable php with mysql if it isn't needed with others servers, @@ -90,8 +111,13 @@ Note: ==> "extension=mysqli.so" ==> "extension=session.so" ==> "extension=sockets.so" +==> "date.timezone = /" -==> edit /etc/php/php.ini and remove "/etc" and "/usr/share/zoneminder/www" +==> Edit /etc/php/php.ini and remove "/etc" and "/usr/share/zoneminder/www" ==> in the open_basedir. + +==> Remove log files and 'zonemider' directory in "/var/log/zoneminder" + +==> Backup and remove events images and temp dirs in "/var/cache/zoneminder" EOF } -- cgit v1.2.3 From b4ce63a23bfc79192dfc546c4196ec651dd31393 Mon Sep 17 00:00:00 2001 From: Márcio Alexandre Silva Delgado Date: Sun, 21 Oct 2012 19:50:41 -0200 Subject: zoneminder: fixing package --- pcr/zoneminder/PKGBUILD | 99 +++++++++++++------ pcr/zoneminder/httpd-zm.conf | 20 ---- pcr/zoneminder/httpd-zoneminder.conf | 20 ++++ pcr/zoneminder/patch-ffmpeg-configure.patch | 26 ----- pcr/zoneminder/patch-libavcodec-detection.patch | 11 --- pcr/zoneminder/zm.rc.d | 63 ------------- pcr/zoneminder/zoneminder | 63 +++++++++++++ pcr/zoneminder/zoneminder-1.25.0-kernel35.patch | 21 ----- pcr/zoneminder/zoneminder.install | 120 +++++++++++++++++------- pcr/zoneminder/zoneminder.service | 1 - 10 files changed, 239 insertions(+), 205 deletions(-) delete mode 100644 pcr/zoneminder/httpd-zm.conf create mode 100644 pcr/zoneminder/httpd-zoneminder.conf delete mode 100644 pcr/zoneminder/patch-ffmpeg-configure.patch delete mode 100644 pcr/zoneminder/patch-libavcodec-detection.patch delete mode 100644 pcr/zoneminder/zm.rc.d create mode 100644 pcr/zoneminder/zoneminder delete mode 100644 pcr/zoneminder/zoneminder-1.25.0-kernel35.patch (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index 64c3f94b0..e5e54537b 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -8,39 +8,75 @@ pkgname=zoneminder pkgver=1.25.0 -pkgrel=19 +pkgrel=20 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) +arch=( + i686 + x86_64 + mips64el +) +backup=( + etc/zm.conf +) +url="http://www.$pkgname.com" +license=( + GPL +) depends=( - 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 + 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 +) +makedepends=( + netpbm +) +optdepends=( + netpbm ) -makedepends=(netpbm) install=$pkgname.install source=( http://www.$pkgname.com/downloads/ZoneMinder-$pkgver.tar.gz - httpd-zm.conf - zm.rc.d + httpd-$pkgname.conf + $pkgname $pkgname.service patch-ffmpeg-0.11.patch ) -md5sums=( - eaefa14befd482154970541252aa1a39 - 72380d8793a784ec24cb6809aea4a739 - 034b61cda8849fc3001849e76ef26041 - 7487cc72ead82aea0bc78f2e4106ae1a - 81c8be870260142e2633eedf73c72040 +sha512sums=( + 3e18993b0539729491052c97d8c94227ccc089eb40277c2f07682f30049033303c7cfe9734fdac6d33ae67df29c76eb72bf7fbb5dae8227e8831fa603b61c375 + 4ce0d8eba9d006d258f5b8a83920fc17f1f602b96518d37b7a47cd9b6eb84ef2587641a6ba839a469c3f0e33b46475866187279ae3f8be0d4054b074ee5d6b08 + ab4e1d5ddaf4d9cd53d6ca59d7965902afd6a2dc830fbbafa270736c52c2b3563075fee860bb0276466f96e9dbfb71b259ac45a4ae2e4ead8eaec154a0159eb0 + cfb0eb87a989236c72741a496ddc6a73aa2696e5beaaca4836d3c231ddb24c7ef5e9f65e7afa49674f2115cbfa4a07c75486e1947ce294c816ddbb875f3b99cf + 382799ad6add1632d934544230520f942dae37913b58cfa19e0cb2b11e7002267b1fdb9aa535f2217bcccf0c85c4d754f316dc3980a3ca267e5b3f5500536024 ) + build() { cd $srcdir/ZoneMinder-$pkgver + # ZM_RUNDIR need change to run dir export CPPFLAGS=-D__STDC_CONSTANT_MACROS\ - ZM_SSL_LIB=gnutls + ZM_LOGDIR=/var/log/$pkgname\ + ZM_RUNDIR=/tmp/$pkgname\ + ZM_SSL_LIB=gnutls\ + ZM_TMPDIR=/tmp/$pkgname # Patch for GCC 4.7.x sed -i -e 's/^#include /#include \n#include /'\ @@ -61,13 +97,15 @@ build() { /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 || read - # Patch for change path - sed -i -e '/ZM_PATH_SOCKS/,+1 s/tmp\/zm/run/; - /ZM_PATH_LOGS/,+1 s/zm/zonemider/; - /ZM_PATH_SWAP/,+1 s/zm/zonemider/'\ + # Patch for change path run dir + sed -i -e '/ZM_PATH_SOCKS/,+1 s/TMP/RUN/'\ + scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read + + # Patch for change ZM name to ZoneMinder + sed -i -e '/ZM_WEB_TITLE_PREFIX/,+1 s/"ZM"/"ZoneMinder"/'\ scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read - # Patch for v4l1 compat + # Patch for v4l1 compat support sed -i -e "s/$ENV{SHELL} = \'\/bin\/sh\' if exists $ENV{SHELL};/$ENV{SHELL} = \'\/bin\/sh\' if exists $ENV{SHELL};\n$ENV{LD_PRELOAD} = \'\/usr\/lib\/libv4l\/v4l1compat.so\' ;/"\ scripts/zmdc.pl.in || read @@ -139,11 +177,12 @@ build() { package() { cd $srcdir/ZoneMinder-$pkgver - make DESTDIR=$pkgdir RUNDIR=$pkdir/run ZM_RUNDIR=$pkgdir/run install + 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}} chown -R http.http $pkgdir/{etc/zm.conf,var/{cache/$pkgname,log/$pkgname}} + chmod 0700 $pkgdir/etc/zm.conf for i in events images temp; do mv $pkgdir/srv/http/$pkgname/$i $pkgdir/var/cache/$pkgname/$i @@ -153,9 +192,9 @@ package() { ln -s /srv/http/cgi-bin $pkgdir/srv/http/$pkgname ln -s /usr/share/cambozola/cambozola.jar $pkgdir/srv/http/$pkgname - 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/${pkgname}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-$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 } diff --git a/pcr/zoneminder/httpd-zm.conf b/pcr/zoneminder/httpd-zm.conf deleted file mode 100644 index aeb089bc1..000000000 --- a/pcr/zoneminder/httpd-zm.conf +++ /dev/null @@ -1,20 +0,0 @@ -# /etc/httpd/conf/extra/httpd-zm.conf -# Config for zoneminder web app - -Alias /zm "/srv/http/zoneminder" - - Options -Indexes MultiViews FollowSymLinks - AllowOverride None - Order allow,deny - Allow from all - # The code unfortunately uses short tags in many places - php_value short_open_tag On - - -ScriptAlias /cgi-bin "/srv/http/cgi-bin" - - AllowOverride None - Options ExecCGI FollowSymLinks - Order allow,deny - Allow from all - diff --git a/pcr/zoneminder/httpd-zoneminder.conf b/pcr/zoneminder/httpd-zoneminder.conf new file mode 100644 index 000000000..aeb089bc1 --- /dev/null +++ b/pcr/zoneminder/httpd-zoneminder.conf @@ -0,0 +1,20 @@ +# /etc/httpd/conf/extra/httpd-zm.conf +# Config for zoneminder web app + +Alias /zm "/srv/http/zoneminder" + + Options -Indexes MultiViews FollowSymLinks + AllowOverride None + Order allow,deny + Allow from all + # The code unfortunately uses short tags in many places + php_value short_open_tag On + + +ScriptAlias /cgi-bin "/srv/http/cgi-bin" + + AllowOverride None + Options ExecCGI FollowSymLinks + Order allow,deny + Allow from all + diff --git a/pcr/zoneminder/patch-ffmpeg-configure.patch b/pcr/zoneminder/patch-ffmpeg-configure.patch deleted file mode 100644 index ba1674a4a..000000000 --- a/pcr/zoneminder/patch-ffmpeg-configure.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- 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/patch-libavcodec-detection.patch b/pcr/zoneminder/patch-libavcodec-detection.patch deleted file mode 100644 index 0aaa9bc23..000000000 --- a/pcr/zoneminder/patch-libavcodec-detection.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- configure.ac~ 2012-07-15 22:27:11.195257379 +0100 -+++ configure.ac 2012-07-15 22:24:34.308268675 +0100 -@@ -276,7 +276,7 @@ - AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming)) - # Don't bother to warn about this one - AC_CHECK_LIB(avcore,av_image_copy,,) --AC_CHECK_LIB(avcodec,avcodec_init,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) -+AC_CHECK_LIB(avcodec,avcodec_open,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) - AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) - AC_CHECK_LIB(avdevice,avdevice_register_all,,AC_MSG_WARN(libavdevice.a may be required for MPEG streaming)) - AC_CHECK_LIB(swscale,sws_scale,,,-lswscale) \ No newline at end of file diff --git a/pcr/zoneminder/zm.rc.d b/pcr/zoneminder/zm.rc.d deleted file mode 100644 index c4cbf4d3f..000000000 --- a/pcr/zoneminder/zm.rc.d +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -daemon_name=zm - -. /etc/rc.conf -. /etc/rc.d/functions - -case "$1" in - start) - stat_busy "Starting Zoneminder" - /usr/bin/zmfix -a - if /usr/bin/zmpkg.pl start >/dev/null ; then - add_daemon $daemon_name - stat_done - else - stat_fail - exit 1 - fi - ;; - - stop) - stat_busy "Stopping Zoneminder" - if /usr/bin/zmpkg.pl stop >/dev/null ; then - rm_daemon $daemon_name - stat_done - else - stat_fail - exit 1 - fi - ;; - - reload) - stat_busy "Reloading Zoneminder" - if /usr/bin/zmpkg.pl graceful >/dev/null ; then - add_daemon $daemon_name - stat_done - else - stat_fail - exit 1 - fi - ;; - - restart) - stat_busy "Restarting Zoneminder" - if /usr/bin/zmpkg.pl restart >/dev/null ; then - add_daemon $daemon_name - stat_done - else - stat_fail - exit 1 - fi - ;; - - status) - stat_busy "Checking Zoneminder status"; - ck_status $daemon_name - ;; - - *) - echo "usage: $0 {start|stop|reload|restart|status}" -esac - -exit 0 diff --git a/pcr/zoneminder/zoneminder b/pcr/zoneminder/zoneminder new file mode 100644 index 000000000..c4cbf4d3f --- /dev/null +++ b/pcr/zoneminder/zoneminder @@ -0,0 +1,63 @@ +#!/bin/bash + +daemon_name=zm + +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + start) + stat_busy "Starting Zoneminder" + /usr/bin/zmfix -a + if /usr/bin/zmpkg.pl start >/dev/null ; then + add_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Stopping Zoneminder" + if /usr/bin/zmpkg.pl stop >/dev/null ; then + rm_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + reload) + stat_busy "Reloading Zoneminder" + if /usr/bin/zmpkg.pl graceful >/dev/null ; then + add_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + restart) + stat_busy "Restarting Zoneminder" + if /usr/bin/zmpkg.pl restart >/dev/null ; then + add_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + status) + stat_busy "Checking Zoneminder status"; + ck_status $daemon_name + ;; + + *) + echo "usage: $0 {start|stop|reload|restart|status}" +esac + +exit 0 diff --git a/pcr/zoneminder/zoneminder-1.25.0-kernel35.patch b/pcr/zoneminder/zoneminder-1.25.0-kernel35.patch deleted file mode 100644 index 9939dc5c3..000000000 --- a/pcr/zoneminder/zoneminder-1.25.0-kernel35.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up ./src/zm_local_camera.cpp.kernel35 ./src/zm_local_camera.cpp ---- ./src/zm_local_camera.cpp.kernel35 2012-07-16 15:01:22.182614878 -0500 -+++ ./src/zm_local_camera.cpp 2012-07-16 15:02:16.491941730 -0500 -@@ -739,7 +739,7 @@ void LocalCamera::Terminate() - { - Debug( 3, "Terminating video stream" ); - //enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; -- enum v4l2_buf_type type = v4l2_data.fmt.type; -+ enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type; - if ( vidioctl( vid_fd, VIDIOC_STREAMOFF, &type ) < 0 ) - Error( "Failed to stop capture stream: %s", strerror(errno) ); - -@@ -1519,7 +1519,7 @@ int LocalCamera::PrimeCapture() - - Debug( 3, "Starting video stream" ); - //enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; -- enum v4l2_buf_type type = v4l2_data.fmt.type; -+ enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type; - if ( vidioctl( vid_fd, VIDIOC_STREAMON, &type ) < 0 ) - Fatal( "Failed to start capture stream: %s", strerror(errno) ); - } diff --git a/pcr/zoneminder/zoneminder.install b/pcr/zoneminder/zoneminder.install index 5e62cc23e..899e2a5d1 100644 --- a/pcr/zoneminder/zoneminder.install +++ b/pcr/zoneminder/zoneminder.install @@ -8,7 +8,7 @@ pre_install() { fi fi if [ -L /srv/http/zoneminder/images ]; then - l=$(readlink /srv/http/zoneminder/images ) + l=$(readlink /srv/http/zoneminder/images) if [ $l != /var/cache/zoneminder/images ]; then abort=true fi @@ -26,23 +26,73 @@ EOF } post_install() { - if [ -d /var/log/zoneminder ]; then - mkdir -m 0755 /var/log/zoneminder + if [[ -d /var/log/zoneminder ]]; then + chmod 0755 /var/log/zoneminder chown http.http /var/log/zoneminder else - chmod 0755 /var/log/zoneminder + mkdir -m 0755 /var/log/zoneminder chown http.http /var/log/zoneminder fi + if [[ -d /tmp/zoneminder ]]; then + chmod 0700 /tmp/zoneminder + chown http.http /tmp/zoneminder + else + mkdir -m 0700 /tmp/zoneminder + chown http.http /tmp/zoneminder + fi + sed -i -e ' + /^;extension=mysql.so/ s/^;//; + /^#extension=mysql.so/ s/^#//; + /^;extension=mysqli.so/ s/^;//; + /^#extension=mysqli.so/ s/^#//; + /^;extension=gd.so/ s/^;//; + /^#extension=gd.so/ s/^#//; + /^;extension=gettext.so/ s/^;//; + /^#extension=gettext.so/ s/^#//; + /^;extension=mcrypt.so/ s/^;//; + /^#extension=mcrypt.so/ s/^#//; + /^;extension=session.so/ s/^;//; + /^#extension=session.so/ s/^#//; + /^;extension=sockets.so/ s/^;//; + /^#extension=sockets.so/ s/^#//; + /^;extension=openssl.so/ s/^;//; + /^#extension=openssl.so/ s/^#//; + /^;extension=ftp.so/ s/^;//; + /^#extension=ftp.so/ s/^#//; + /^;extension=zip.so/ s/^;//; + /^#extension=zip.so/ s/^#//; + /^;open_basedir/ s/^;//; + /^#open_basedir/ s/^#//; + /^open_basedir/ s/:\/etc//; + /^open_basedir/ s/:\/etc\///; + /^open_basedir/ s/$/:\/etc/; + /^open_basedir/ s/:\/srv\/http\/zoneminder//; + /^open_basedir/ s/:\/srv\/http\/zoneminder\///; + /^open_basedir/ s/$/:\/srv\/http\/zoneminder/; + ' /etc/php/php.ini || read + sed -i -e ' + /^LoadModule php5_module modules\/libphp5.so/d; + /^LoadModule rewrite_module modules\/mod_rewrite.so/ s/$/\nLoadModule php5_module modules\/libphp5.so/; + /^# PHP 5/d; + /^# ZoneMinder/d; + /^Include \/etc\/httpd\/conf\/extra\/php5_module.conf/d; + /^Include \/etc\/httpd\/conf\/extra\/httpd-zoneminder.conf/d; + /^Include conf\/extra\/httpd-default.conf/ s/$/\n\n# PHP 5\n\Include \/etc\/httpd\/conf\/extra\/php5_module.conf\n\n# ZoneMinder\nInclude \/etc\/httpd\/conf\/extra\/httpd-zoneminder.conf/; + ' /etc/httpd/conf/httpd.conf || read cat << EOF -Note: +Note for mysql: ==> 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: +==> and add Zoneminder database typing (with passsword): ==> "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" +==> (or without passsword): +==> "mysqladmin --defaults-file=/etc/mysql/my.cnf -f reload" +==> "cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/my.cnf" +==> "echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/my.cnf mysql" -Note: +Note for php: ==> You must uncomment that line in /etc/php/php.ini: ==> "extension=mysql.so" ==> check and make sure these are uncommented: @@ -52,55 +102,59 @@ Note: ==> "extension=mysqli.so" ==> "extension=session.so" ==> "extension=sockets.so" - -==> You must edit /etc/php/php.ini and add to open_basedir "/etc" and -==> "/usr/share/zoneminder" like so +==> "extension=openssl.so" +==> "extension=ftp.so" +==> "extension=zip.so" +==> check and add to open_basedir "/etc" and +==> "/srv/http/zoneminder" like so ==> "open_basedir = /home:/tmp:/usr/share/pear:/etc:/srv/http/zoneminder" -==> Otherwise ZoneMinder will be unable to read /etc/zm.conf -==> or display its own web directory -==> And set your timezone in php.ini: date.timezone = / +==> and set your timezone in php.ini: +==> "date.timezone = /" -Note: +Note for apache: ==> You must edit /etc/httpd/conf/httpd.conf and add the line: ==> "LoadModule php5_module modules/libphp5.so" ==> and: ==> "Include /etc/httpd/conf/extra/php5_module.conf" -==> "Include /etc/httpd/conf/extra/httpd-zm.conf" +==> "Include /etc/httpd/conf/extra/httpd-zoneminder.conf" EOF } post_upgrade() { + post_install /usr/bin/zmupdate.pl -f >/dev/null - if [ -d /var/log/zoneminder ]; then - mkdir -m 0755 /var/log/zoneminder - chown http.http /var/log/zoneminder - else - chmod 0755 /var/log/zoneminder - chown http.http /var/log/zoneminder - fi } post_remove() { - if [ -d /run/zoneminder ]; then - rm -vr /run/zoneminder - fi - if [ -d /tmp/zoneminder ]; then + if [[ -d /tmp/zoneminder ]]; then rm -vr /tmp/zoneminder fi + sed -i -e ' + /^open_basedir/ s/:\/srv\/http\/zoneminder//; + /^open_basedir/ s/:\/srv\/http\/zoneminder\///; + ' /etc/php/php.ini || read + sed -i -e ' + /^# ZoneMinder/d; + /Include \/etc\/httpd\/conf\/extra\/httpd-zoneminder.conf/d; + ' /etc/httpd/conf/httpd.conf || read cat << EOF Note: -==> To clean Zoneminder mysql database, run as root: +==> To clean Zoneminder mysql database, run as root (with password): ==> "echo 'delete from user where User="zmuser";' | mysql --defaults-file=/etc/mysql/my.cnf -p mysql" ==> "echo 'delete from db where User="zmuser";' | mysql --defaults-file=/etc/mysql/my.cnf -p mysql" ==> "mysqladmin --defaults-file=/etc/mysql/my.cnf -p -f drop zm" +==> (or without password): +==> "echo 'delete from user where User="zmuser";' | mysql --defaults-file=/etc/mysql/my.cnf mysql" +==> "echo 'delete from db where User="zmuser";' | mysql --defaults-file=/etc/mysql/my.cnf mysql" +==> "mysqladmin --defaults-file=/etc/mysql/my.cnf -f drop zm" ==> 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" -==> Remove -==> "Include /etc/httpd/conf/extra/httpd-zm.conf" +==> Remove line in /etc/httpd/conf/httpd.conf: +==> "Include /etc/httpd/conf/extra/httpd-zoneminder.conf" ==> Disable php with mysql if it isn't needed with others servers, ==> comment that lines in /etc/php/php.ini: @@ -113,11 +167,11 @@ Note: ==> "extension=sockets.so" ==> "date.timezone = /" -==> Edit /etc/php/php.ini and remove "/etc" and "/usr/share/zoneminder/www" -==> in the open_basedir. +==> Edit /etc/php/php.ini and remove "/etc" and "/srv/http/zoneminder" +==> in the "open_basedir". -==> Remove log files and 'zonemider' directory in "/var/log/zoneminder" +==> Remove log files and "zonemider" directory in "/var/log/zoneminder". -==> Backup and remove events images and temp dirs in "/var/cache/zoneminder" +==> Backup and remove "events", "images" and "temp" dirs in "/var/cache/zoneminder". EOF } diff --git a/pcr/zoneminder/zoneminder.service b/pcr/zoneminder/zoneminder.service index ba41e8926..05cae6f91 100644 --- a/pcr/zoneminder/zoneminder.service +++ b/pcr/zoneminder/zoneminder.service @@ -5,7 +5,6 @@ Required=mysqld.service [Service] Type=forking -PIDFile=/run/zm.pid ExecStart=/usr/bin/zmpkg.pl start ExecRestart=/usr/bin/zmpkg.pl restart ExecStop=/usr/bin/zmpkg.pl stop -- cgit v1.2.3 From dc0e4891b14c9112d374bad83ec5d21a55db57e2 Mon Sep 17 00:00:00 2001 From: Márcio Alexandre Silva Delgado Date: Sun, 21 Oct 2012 20:00:54 -0200 Subject: zoneminder: drop old files --- pcr/zoneminder/Controls_Orbit.sql | 3 - pcr/zoneminder/arm-context.patch | 18 ----- pcr/zoneminder/customdb | 31 --------- pcr/zoneminder/zm.service | 9 --- pcr/zoneminder/zmeventbackup | 48 ------------- pcr/zoneminder/zminit.arch | 143 -------------------------------------- 6 files changed, 252 deletions(-) delete mode 100644 pcr/zoneminder/Controls_Orbit.sql delete mode 100644 pcr/zoneminder/arm-context.patch delete mode 100755 pcr/zoneminder/customdb delete mode 100644 pcr/zoneminder/zm.service delete mode 100755 pcr/zoneminder/zmeventbackup delete mode 100644 pcr/zoneminder/zminit.arch (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/Controls_Orbit.sql b/pcr/zoneminder/Controls_Orbit.sql deleted file mode 100644 index 23224e4aa..000000000 --- a/pcr/zoneminder/Controls_Orbit.sql +++ /dev/null @@ -1,3 +0,0 @@ - -INSERT INTO `Controls` VALUES (7,'Orbit','Remote','mjpgStreamer',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,-7000,7000,200,200,1,100,100,0,0,1,-2000,2000,10,100,1,200,200,0,0,0,0); - diff --git a/pcr/zoneminder/arm-context.patch b/pcr/zoneminder/arm-context.patch deleted file mode 100644 index a6fbb5328..000000000 --- a/pcr/zoneminder/arm-context.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- src/zm_signal.cpp.orig 2012-08-30 13:24:16.479872021 -0700 -+++ src/zm_signal.cpp 2012-08-30 13:27:35.909871996 -0700 -@@ -82,13 +82,13 @@ - int trace_size = 0; - - #if HAVE_STRUCT_SIGCONTEXT_EIP -- Error( "Signal address is %p, from %p", (void *)context.cr2, (void *)context.eip ); -+ Error( "Signal address is %p, from %p", (void *)context.fault_address, (void *)context.eip ); - - trace_size = backtrace( trace, TRACE_SIZE ); - // overwrite sigaction with caller's address - trace[1] = (void *)context.eip; - #elif HAVE_STRUCT_SIGCONTEXT -- Error( "Signal address is %p, no eip", (void *)context.cr2 ); -+ Error( "Signal address is %p, no eip", (void *)context.fault_address ); - - trace_size = backtrace( trace, TRACE_SIZE ); - #else // HAVE_STRUCT_SIGCONTEXT diff --git a/pcr/zoneminder/customdb b/pcr/zoneminder/customdb deleted file mode 100755 index afd295935..000000000 --- a/pcr/zoneminder/customdb +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -DBHOST=$1 -DBNAME=$2 -USERNAME=$3 -PASSWORD=$4 - -ZM_PATH_ZMS=/cgi-bin/nph-zms -ZM_PATH_SOCKS=/srv/zoneminder/socks -ZM_PATH_LOGS=/var/log/zm -ZM_WEB_LIST_THUMBS=1 -ZM_WEB_MONTAGE_WIDTH=320 -ZM_WEB_MONTAGE_HEIGHT=240 -ZM_OPT_CAMBOZOLA=1 -ZM_OPT_MPEG=ffmpeg -ZM_PATH_FFMPEG=/usr/bin/ffmpeg -ZM_OPT_NETPBM=1 -ZM_EXTRA_DEBUG_LOG=/var/log/zm/zm_debug.log -ZM_OPT_USE_AUTH=0 - -sql=/tmp/$$ -echo "" >$sql -for n in ZM_PATH_ZMS ZM_PATH_SOCKS ZM_PATH_LOGS ZM_WEB_LIST_THUMBS ZM_WEB_MONTAGE_WIDTH ZM_WEB_MONTAGE_HEIGHT ZM_OPT_CAMBOZOLA ZM_OPT_MPEG ZM_PATH_FFMPEG ZM_OPT_NETPBM ZM_EXTRA_DEBUG_LOG ZM_OPT_USE_AUTH; do - eval "val=\$$n" - echo "UPDATE Config SET Value='$val' WHERE Name='$n';" >>$sql -done - -cat $sql | mysql --user=$USERNAME --password=$PASSWORD --host=$DBHOST $DBNAME -rm -f $sql - - -exit 0 diff --git a/pcr/zoneminder/zm.service b/pcr/zoneminder/zm.service deleted file mode 100644 index ccf1f3334..000000000 --- a/pcr/zoneminder/zm.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Capture, analyse, record and monitor video security cameras - -[Service] -Type=forking -ExecStart=/usr/sbin/zm - -[Install] -WantedBy=multi-user.target diff --git a/pcr/zoneminder/zmeventbackup b/pcr/zoneminder/zmeventbackup deleted file mode 100755 index a14ee22a1..000000000 --- a/pcr/zoneminder/zmeventbackup +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -#=============================================================================== -# -# FILE: eventdump.sh -# -# USAGE: ./eventdump.sh -# -# DESCRIPTION: Uses mysqldump to create a .sql file for individual zm -# events to make Event table recovery possible by doing a -# 'find' search in ZoneMinder the events directory -# -# OPTIONS: --- -# REQUIREMENTS: --- mysqldump -# BUGS: --- -# NOTES: --- -# AUTHOR: Ross Melin -# COMPANY: -# VERSION: 1.0 -# CREATED: 03/06/2008 11:51:19 AM PST -# REVISION: --- -#=============================================================================== - -# Edit these to suit your configuration -ZM_CONFIG=/etc/zm.conf -MYSQLDUMP=/usr/bin/mysqldump -EVENTSDIR=/srv/zoneminder/www/events - -# The rest should not need editing - -# Get the mysql user and password -source $ZM_CONFIG -MYDUMPOPTS="--user=$ZM_DB_USER --password=$ZM_DB_PASS --skip-opt --compact --quick --no-create-info" - - -for tag in $(find $EVENTSDIR -amin -65 -name ".[0-9]*") - do - EVENT_PATH=$(echo $tag |cut -f 1 -d .) - EVENT_ID=$(echo $tag |cut -f 2 -d .) - # Dump the sql statements needed to reload the Events, Frames and Stats tables - - echo "-- ZM_DB_VERSION=$ZM_VERSION -" > $EVENT_PATH.sql - - $MYSQLDUMP $MYDUMPOPTS --where="Id=$EVENT_ID" zm Events >> $EVENT_PATH.sql - $MYSQLDUMP $MYDUMPOPTS --where="Eventid=$EVENT_ID" zm Frames >> $EVENT_PATH.sql - $MYSQLDUMP $MYDUMPOPTS --where="Eventid=$EVENT_ID" zm Stats >> $EVENT_PATH.sql - -done diff --git a/pcr/zoneminder/zminit.arch b/pcr/zoneminder/zminit.arch deleted file mode 100644 index 01b6658a7..000000000 --- a/pcr/zoneminder/zminit.arch +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/sh - - -ZM_CONFIG=/etc/zm.conf - - - -loadcfg() { - if [ -f $ZM_CONFIG ]; then - . $ZM_CONFIG - else - echo "ERROR: $ZM_CONFIG not found." - exit 1 - fi - } -chkmysql(){ - #FIXME - /etc/rc.d/mysqld restart || (echo "mysql is not availible" && exit 1 ) - } - -getmylogin(){ - echo "Enter MySQL Administrator username" - echo "(Default: root and password is blank)" - echo -n "MySQL Admin: " - read MYADMIN - echo -n "Password: " - read MYPASS - if [ "X$MYPASS" != "X" ]; then MYPASS="-p$MYPASS"; fi - echo "\q" |mysql -u $MYADMIN $MYPASS || exit 0 - - } - -checkdb() -{ - # Check database exisits and version - exists=$(echo "show databases" |mysql -u $MYADMIN "$MYPASS" |grep zm) - if [ "$exists" = "zm" ]; then - OLD_VERSION=$(echo "select Value from Config where Name = 'ZM_DYN_DB_VERSION';" | mysql -u $MYADMIN $MYPASS zm |grep -v '^Value') - - case $OLD_VERSION in - "") - echo "A zm database exists, but the version is unknown" - echo "Updating is unlikely to succeed" - ;; - "$ZM_VERSION") - echo "The zm database appears to be up to date" - echo "If this is incorrect, edit $ZM_CONFIG to reflect the current version" - ;; - *) - echo "A database fron zm-$OLD_VERSION exists already" - ;; - esac - - while [ true ] - do - echo "Choose one of the following options:" - echo "[U]pdate the database" - echo "[D]rop the old database and reinitialize" - echo "[E]xit and do nothing" - read OPTION - case $OPTION in - "U"|"u") - /etc/rc.d/zm restart - exit 0 - ;; - "D"|"d") - echo "drop database zm;"|mysql -u $MYADMIN $MYPASS - return - ;; - "E"|"e") - exit 0 - ;; - esac - done - fi -} - -checkcfg(){ -for n in ZM_DB_HOST ZM_DB_NAME ZM_DB_USER ZM_DB_PASS; do - eval "val=\$$n" - if [ "$val" = "" ]; then - echo "ERROR($ZM_CONFIG): $n should not be empty." - echo "Enter a $n for ZM to use the Database." - if [ "$n" = "ZM_DB_PASS" ]; then - echo -n "Will not echo on screen $n : " - stty -echo # Turns off screen echo. - read newval - stty echo # Restores screen echo. - echo "" - ### The following can be used to generate a random password - # randstr newval 16 - else - echo -n "$n : " - read newval - fi - cp $ZM_CONFIG /tmp/$$ && - sed 's/^'$n='.*$/'$n=$newval'/g' /tmp/$$ >$ZM_CONFIG - - fi -done - -if [ "$ZM_DB_HOST" = "localhost" ]; then - ClientHost=localhost -else - ClientHost=`hostname` -fi -} - -reloadcfg(){ -loadcfg -} - -initdb(){ -sql=/tmp/zm.crdb.sql -echo "" >$sql -chmod 600 $sql - -echo "CREATE DATABASE $ZM_DB_NAME;" >>$sql -echo "USE $ZM_DB_NAME;" >>$sql - -echo "GRANT all on $ZM_DB_NAME.* TO '$ZM_DB_USER'@'$ClientHost' IDENTIFIED BY '$ZM_DB_PASS';" >>$sql - -cat $sql | mysql -B -h $ZM_DB_HOST -u $MYADMIN $MYPASS -rm -f $sql - -cat $ZM_PATH_UPDATE/zm_create.sql | mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME -( cd $ZM_PATH_UPDATE; perl $ZM_PATH_BIN/zmupdate.pl -f ) - - $ZM_PATH_UPDATE/customdb $ZM_DB_HOST $ZM_DB_NAME $ZM_DB_USER $ZM_DB_PASS -} - - - -loadcfg -getmylogin -checkdb -checkcfg -reloadcfg -initdb - - - - -- cgit v1.2.3 From ade106c6633f8cc142ae3de92e2dc651fe0491fd Mon Sep 17 00:00:00 2001 From: Márcio Alexandre Silva Delgado Date: Tue, 30 Oct 2012 21:36:16 -0200 Subject: zoneminder: fixing package --- pcr/zoneminder/PKGBUILD | 5 ++++- pcr/zoneminder/zoneminder.install | 20 ++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index e5e54537b..a008bcc6c 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -8,7 +8,7 @@ pkgname=zoneminder pkgver=1.25.0 -pkgrel=20 +pkgrel=21 pkgdesc='Capture, analyse, record and monitor video security cameras' arch=( i686 @@ -187,9 +187,12 @@ package() { 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 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 /usr/share/cambozola/cambozola.jar $pkgdir/srv/http/$pkgname install -D -m 644 $srcdir/httpd-$pkgname.conf $pkgdir/etc/httpd/conf/extra diff --git a/pcr/zoneminder/zoneminder.install b/pcr/zoneminder/zoneminder.install index 899e2a5d1..ecacf6437 100644 --- a/pcr/zoneminder/zoneminder.install +++ b/pcr/zoneminder/zoneminder.install @@ -69,6 +69,9 @@ post_install() { /^open_basedir/ s/:\/srv\/http\/zoneminder//; /^open_basedir/ s/:\/srv\/http\/zoneminder\///; /^open_basedir/ s/$/:\/srv\/http\/zoneminder/; + /^open_basedir/ s/:\/var\/cache\/zoneminder//; + /^open_basedir/ s/:\/var\/cache\/zoneminder\///; + /^open_basedir/ s/$/:\/var\/cache\/zoneminder/; ' /etc/php/php.ini || read sed -i -e ' /^LoadModule php5_module modules\/libphp5.so/d; @@ -79,6 +82,7 @@ post_install() { /^Include \/etc\/httpd\/conf\/extra\/httpd-zoneminder.conf/d; /^Include conf\/extra\/httpd-default.conf/ s/$/\n\n# PHP 5\n\Include \/etc\/httpd\/conf\/extra\/php5_module.conf\n\n# ZoneMinder\nInclude \/etc\/httpd\/conf\/extra\/httpd-zoneminder.conf/; ' /etc/httpd/conf/httpd.conf || read + gpasswd -a http video cat << EOF Note for mysql: ==> To run Zoneminder, you must install the database running mysql service (as root): @@ -105,11 +109,11 @@ Note for php: ==> "extension=openssl.so" ==> "extension=ftp.so" ==> "extension=zip.so" -==> check and add to open_basedir "/etc" and -==> "/srv/http/zoneminder" like so -==> "open_basedir = /home:/tmp:/usr/share/pear:/etc:/srv/http/zoneminder" +==> check and add to open_basedir "/etc", +==> "/srv/http/zoneminder" and "/var/cache/zoneminder" like so +==> "open_basedir = /home:/tmp:/usr/share/pear:/etc:/srv/http/zoneminder:/var/cache/zoneminder" ==> and set your timezone in php.ini: -==> "date.timezone = /" +==> "date.timezone = /" Note for apache: ==> You must edit /etc/httpd/conf/httpd.conf and add the line: @@ -132,6 +136,7 @@ post_remove() { sed -i -e ' /^open_basedir/ s/:\/srv\/http\/zoneminder//; /^open_basedir/ s/:\/srv\/http\/zoneminder\///; + /^open_basedir/ s/:\/var\/cache\/zoneminder\/// ' /etc/php/php.ini || read sed -i -e ' /^# ZoneMinder/d; @@ -165,9 +170,12 @@ Note: ==> "extension=mysqli.so" ==> "extension=session.so" ==> "extension=sockets.so" -==> "date.timezone = /" +==> "date.timezone = /" -==> Edit /etc/php/php.ini and remove "/etc" and "/srv/http/zoneminder" +==> Drop http user on video group if it isn't needed with others servers: +==> gpasswd -d http video + +==> Edit /etc/php/php.ini and remove "/etc", "/srv/http/zoneminder" and "/var/cache/zoneminder" ==> in the "open_basedir". ==> Remove log files and "zonemider" directory in "/var/log/zoneminder". -- cgit v1.2.3 From f04b38505e16df19b6f29a51051729359b7f49af Mon Sep 17 00:00:00 2001 From: Márcio Alexandre Silva Delgado Date: Fri, 2 Nov 2012 16:52:07 -0200 Subject: zoneminder: fixing package --- pcr/zoneminder/PKGBUILD | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pcr/zoneminder') diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD index a008bcc6c..c69e6fa97 100644 --- a/pcr/zoneminder/PKGBUILD +++ b/pcr/zoneminder/PKGBUILD @@ -8,7 +8,7 @@ pkgname=zoneminder pkgver=1.25.0 -pkgrel=21 +pkgrel=22 pkgdesc='Capture, analyse, record and monitor video security cameras' arch=( i686 @@ -105,8 +105,8 @@ build() { sed -i -e '/ZM_WEB_TITLE_PREFIX/,+1 s/"ZM"/"ZoneMinder"/'\ scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read - # Patch for v4l1 compat support - sed -i -e "s/$ENV{SHELL} = \'\/bin\/sh\' if exists $ENV{SHELL};/$ENV{SHELL} = \'\/bin\/sh\' if exists $ENV{SHELL};\n$ENV{LD_PRELOAD} = \'\/usr\/lib\/libv4l\/v4l1compat.so\' ;/"\ + # Patch for v4l2 convert support + sed -i -e "s/$ENV{SHELL} = \'\/bin\/sh\' if exists $ENV{SHELL};/$ENV{SHELL} = \'\/bin\/sh\' if exists $ENV{SHELL};\n$ENV{LD_PRELOAD} = \'\/usr\/lib\/libv4l\/v4l2convert.so\' ;/"\ scripts/zmdc.pl.in || read # Patch for add more socket tries -- cgit v1.2.3