summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
Diffstat (limited to 'pcr')
-rw-r--r--pcr/zoneminder/PKGBUILD238
-rw-r--r--pcr/zoneminder/httpd-zoneminder.conf4
-rw-r--r--pcr/zoneminder/zoneminder63
-rw-r--r--pcr/zoneminder/zoneminder-1.25-fixwarning.patch14
-rw-r--r--pcr/zoneminder/zoneminder-1.25-text.patch12
-rw-r--r--pcr/zoneminder/zoneminder-1.25.0-ffmpeg.patch130
-rw-r--r--pcr/zoneminder/zoneminder-1.25.0-gcc47.patch33
-rw-r--r--pcr/zoneminder/zoneminder-1.25.0-gcrypt.patch86
-rw-r--r--pcr/zoneminder/zoneminder-1.25.0-kernel35.patch21
-rw-r--r--pcr/zoneminder/zoneminder.install133
-rw-r--r--pcr/zoneminder/zoneminder.service15
11 files changed, 149 insertions, 600 deletions
diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD
index 232d15e6e..185842b80 100644
--- a/pcr/zoneminder/PKGBUILD
+++ b/pcr/zoneminder/PKGBUILD
@@ -1,202 +1,120 @@
-# Maintainer (Arch): Jacek Burghardt <jacek@hebe.us>
-# Maintainer (Arch): Vojtech Aschenbrenner <v@asch.cz>
-# Contributor (Arch): Jason Gardner <buhrietoe@gmail.com>
-# Contributor (Arch): Ross melin <rdmelin@gmail.com>
-# Maintainer: Márcio Silva <coadde@parabola.nu>
-# Contributor: André Silva <emulatorman@parabola.nu>
-
-# based of debian squeeze package
-
-_automake=1.14
+# Contributor (Arch): Troy Will <troydwill@gmail.com>
+# Contributor (Arch): /dev/rs0 </dev/rs0@secretco.de.com>
+# Contributor (Arch): Jacek Burghardt <jacek@hebe.us>
+# Contributor (Arch): Vojtech Aschenbrenner <v@asch.cz>
+# Contributor (Arch): Jason Gardner <buhrietoe@gmail.com>
+# Contributor (Arch): Ross melin <rdmelin@gmail.com>
+# Maintainer: Márcio Silva <coadde@parabola.nu>
+# Contributor: André Silva <emulatorman@parabola.nu>
+# Orginally based on a Debian Squeeze package
pkgname=zoneminder
-pkgver=1.25.0
-pkgrel=28
+pkgver=1.28.0
+pkgrel=1
pkgdesc='Capture, analyse, record and monitor video security cameras'
-arch=(
- mips64el
- x86_64
- i686
-)
-backup=etc/zm.conf
-url=http://www.$pkgname.com
-license=GPL2
-depends=(
- apache
- cambozola
- ffmpeg
- gnutls
- mariadb
- 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
+arch=('i686' 'x86_64' 'mips64el' 'arm')
+backup=('etc/zm.conf')
+url="https://github.com/ZoneMinder/ZoneMinder/releases"
+license=('GPL2')
+depends=('apache' 'cambozola' 'ffmpeg' 'gnutls' 'mariadb' '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' 'cmake')
+optdepends=('netpbm')
options=(!libtool)
install=$pkgname.install
-source=(
- http://www.$pkgname.com/downloads/ZoneMinder-$pkgver.tar.gz
- httpd-$pkgname.conf
- $pkgname.service
- sysctl-$pkgname.conf
- $pkgname-$pkgver-ffmpeg.patch
- $pkgname-$pkgver-gcrypt.patch
-)
-sha512sums=(
- 3e18993b0539729491052c97d8c94227ccc089eb40277c2f07682f30049033303c7cfe9734fdac6d33ae67df29c76eb72bf7fbb5dae8227e8831fa603b61c375
- 4ce0d8eba9d006d258f5b8a83920fc17f1f602b96518d37b7a47cd9b6eb84ef2587641a6ba839a469c3f0e33b46475866187279ae3f8be0d4054b074ee5d6b08
- cfb0eb87a989236c72741a496ddc6a73aa2696e5beaaca4836d3c231ddb24c7ef5e9f65e7afa49674f2115cbfa4a07c75486e1947ce294c816ddbb875f3b99cf
- 7330c179f1e2db815a675560d3d84648be02f7d0292f8cbe21d6033577fe688ed71ad23b5b8c9dc309395b45ebb554f9499e7a4b57091959b69679011fa59044
- 7fc2a4663c3103bef641be065bd7992a2b3dc0699f1b99dc2fdb34c1c48e58686e490d3ade523ef7c8e29b3f04109658eef652c26ff6ee3fb9aee65453bdb6c4
- 8c9e7debcaf60be1c2dda656f95e497f6812d704edc3ca4a1c915a3b3c9dc1749c91d96bc2d60db7d90d5edfd9e2dfc39010dfe4feabfecfffd27f1fffc3d675
-)
+source=(https://github.com/ZoneMinder/ZoneMinder/archive/v$pkgver.tar.gz
+ httpd-$pkgname.conf
+ $pkgname.service
+ sysctl-$pkgname.conf)
+sha512sums=('3e18993b0539729491052c97d8c94227ccc089eb40277c2f07682f30049033303c7cfe9734fdac6d33ae67df29c76eb72bf7fbb5dae8227e8831fa603b61c375'
+ '4ce0d8eba9d006d258f5b8a83920fc17f1f602b96518d37b7a47cd9b6eb84ef2587641a6ba839a469c3f0e33b46475866187279ae3f8be0d4054b074ee5d6b08'
+ 'cfb0eb87a989236c72741a496ddc6a73aa2696e5beaaca4836d3c231ddb24c7ef5e9f65e7afa49674f2115cbfa4a07c75486e1947ce294c816ddbb875f3b99cf'
+ '7330c179f1e2db815a675560d3d84648be02f7d0292f8cbe21d6033577fe688ed71ad23b5b8c9dc309395b45ebb554f9499e7a4b57091959b69679011fa59044')
prepare() {
cd $srcdir/ZoneMinder-$pkgver
- # Patch for automake
- sed -i "\|^am__api_version=| s|1[.]11|$_automake|;
- " configure
-
- # Patch for GCC
- sed -i 's|^#include [<]errno[.]h[>]$|#include <errno.h>\n#include <unistd.h>|;
- ' src/zm_logger.cpp
- sed -i 's|^#include [<]pthread[.]h[>]$|#include <pthread.h>\n#include <unistd.h>|;
- ' src/zm_thread.h
- sed -i 's|^#include [<]fcntl[.]h[>]$|#include <fcntl.h>\n#include <limits.h>|;
- ' src/zm_local_camera.cpp
-
- # Patch for type cast in linux-libre kernel 3.5 and for wrong type "suppported"
- sed -i 's|enum v4l2_buf_type type = v4l2_data[.]fmt[.]type|enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type|;
- s|suppported|supported|;
- ' src/zm_local_camera.cpp
-
- # configure crash on i686
- [[ $CARCH != i686 ]] && {
- # Patch for fixing warning
- sed -i 's|pdest[+][+] = ([*]blend_ptr)\[[*]pdest]\[[*]psrc[+][+]]|pdest = (*blend_ptr)[*pdest][*psrc++];\n pdest++|;
- ' src/zm_image.cpp
- }
-
- # Patch for support ffmpeg with <libavutil/mathematics.h>
- #sed -i 's|^extern "C" {|extern "C" {\n#ifdef _STDINT_H\n#undef _STDINT_H\n#endif\n#include <stdint.h>|;
- # s|^#include <libavutil/avutil[.]h>|#include <libavutil/avutil.h>\n#include <libavutil/mathematics.h>|;
- # ' src/zm_ffmpeg.h
-
- # Patch for support C library
- #sed -i '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 disable ZM_CHECK_FOR_UPDATES
sed -i '\|ZM_CHECK_FOR_UPDATES|,+1 s|yes|no|;
' scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in
# Patch for support html5 video and flv
- sed -i '\|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 h264|;
+ sed -i '\|ZM_MPEG_LIVE_FORMAT|,+1 s|swf|ogg|;
+ \|ZM_MPEG_REPLAY_FORMAT|,+1 s|swf|ogg|;
+ \|ZM_FFMPEG_FORMATS|,+1 s|mpg mpeg wmv asf avi[*] mov swf 3gp[*][*]|mpg mpeg wmv asf avi* mov flv swf 3gp** webm ogg matroska mp4 h264|;
' scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in
- # Patch for change path run dir and for change ZM name to ZoneMinder
- sed -i '\|ZM_PATH_SOCKS|,+1 s|TMP|RUN|;
- \|ZM_WEB_TITLE_PREFIX|,+1 s|"ZM"|"ZoneMinder"|;
+ # Patch for change ZM name to ZoneMinder
+ sed -i '\|ZM_WEB_TITLE_PREFIX|,+1 s|"ZM"|"ZoneMinder"|;
' scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in
- # Patch for v4l2 convert support
- sed -i '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
-
- # Patch for add more socket tries
- sed -i '\|^$max_socket_tries = | s|3|15|;
- ' web/ajax/stream.php
-
- # Patch for text
- sed -i 's|if ( fwrite( buffer, n_bytes, 1, stdout ) )|if ( fwrite( buffer, n_bytes, 1, stdout ) != 1 )|;
- ' src/zm_stream.cpp
-
- # Patch for remove HACK in Makefile.*
+ # Patch for remove HACK in Makefile.am
sed -i '\|This is a HACK|d;
\|^install-data-hook:$|,+5 d;
s| install-data-hook||;
\|^uninstall-hook:$|,+5 d;
s| uninstall-hook||;
- ' Makefile.{am,in}
-
- # Patch
- for _patch in ffmpeg gcrypt; do
- patch -Np1 -F99 -i $srcdir/$pkgname-$pkgver-$_patch.patch
- done
+ ' Makefile.am
}
build() {
cd $srcdir/ZoneMinder-$pkgver
- # ZM_RUNDIR need change to run dir
- export CPPFLAGS="$CPPFLAGS -D__STDC_CONSTANT_MACROS"\
- OPT_FFMPEG=yes\
- PATH_FFMPEG=/usr/bin/ffmpeg\
- ZM_LOGDIR=/var/log/$pkgname\
- ZM_RUNDIR=/tmp/$pkgname\
- ZM_SSL_LIB=libgcrypt\
- ZM_TMPDIR=/tmp/$pkgname
-
- ./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
+ cmake -DCMAKE_INSTALL_PREFIX=/usr \
+ -DZM_TARGET_DISTRO=arch \
+ -DZM_CGIDIR=/srv/http/cgi-bin \
+ -DZM_CONTENTDIR=/var/cache/$pkgname \
+ -DZM_LOGDIR=/var/log/$pkgname \
+ -DZM_RUNDIR=/run/$pkgname \
+ -DZM_SOCKDIR=/run/$pkgname \
+ -DZM_TMPDIR=/var/tmp \
+ -DZM_WEB_USER=http \
+ -DZM_WEB_GROUP=http \
+ -DZM_WEBDIR=/srv/http/$pkgname
+
make V=0
}
package() {
cd $srcdir/ZoneMinder-$pkgver
- make DESTDIR=$pkgdir install
- mkdir -vp $pkgdir/{etc/{httpd/conf/extra,sysctl.d},srv/http/{cgi-bin,$pkgname/socks},usr/{lib/systemd/system,share/{licenses/$pkgname,$pkgname/db}},var/{cache/$pkgname,log/$pkgname}}
- chown -vR http.http $pkgdir/{etc/zm.conf,srv/http/$pkgname/socks,var/{cache/$pkgname,log/$pkgname}}
- chmod -v 0700 $pkgdir/etc/zm.conf
+ make DESTDIR=$pkgdir install
+ # BEGIN CREATE_ZONEMINDER_DIRECTORIES
+ #mkdir -pv $pkgdir/{etc/{httpd/conf/extra,sysctl.d},srv/http/cgi-bin,usr/{lib/systemd/system,share/{licenses/$pkgname,$pkgname/db}}}
+ mkdir -pv $pkgdir/run/zm
+ chown -v http.http $pkgdir/run/zm
+ mkdir -pv $pkgdir/var/{cache/$pkgname,log/$pkgname}
+ mkdir -pv $pkgdir/srv/http/$pkgname/socks
+ chown -Rv http.http $pkgdir/{etc/zm.conf,var/{cache/$pkgname,log/$pkgname}}
+ chown -Rv http.http $pkgdir/srv/http/$pkgname/socks
+ chmod -v 0700 $pkgdir/etc/zm.conf
+ # END CREATE_ZONEMINDER_DIRECTORIES
+
+ # Make content directories in /var/cache/$pkgname and link them
for i in events images temp; do
- mv -v $pkgdir/srv/http/$pkgname/$i $pkgdir/var/cache/$pkgname/$i
- ln -vs /var/cache/$pkgname/$i $pkgdir/srv/http/$pkgname/$i
- chown -vh http.http $pkgdir/srv/http/$pkgname/$i
+ #mv -v $pkgdir/srv/http/$pkgname/$i $pkgdir/var/cache/$pkgname/$i
+ mkdir -v $pkgdir/var/cache/$pkgname/$i
+ #chown -v http.http $pkgdir/var/cache/$pkgname/$i
+ ln -sv /var/cache/$pkgbase/$i $pkgdir/srv/http/$pkgname/$i
+ chown -hv http.http $pkgdir/srv/http/$pkgname/$i
done
- ln -vs /srv/http/cgi-bin $pkgdir/srv/http/$pkgname
- chown -vh http.http $pkgdir/srv/http/{cgi-bin,$pkgname,$pkgname/cgi-bin}
+ # Create a link to the Zoneminder cgi binaries
+ ln -sv /srv/http/cgi-bin $pkgdir/srv/http/$pkgname
+
+ chown -hv http.http $pkgdir/srv/http/{cgi-bin,$pkgname,$pkgname/cgi-bin}
+ # Link Cambozola
ln -vs /usr/share/cambozola/cambozola.jar $pkgdir/srv/http/$pkgname
- install -vDm644 $srcdir/httpd-$pkgname.conf $pkgdir/etc/httpd/conf/extra
- install -vDm644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system
- install -vDm644 $srcdir/sysctl-$pkgname.conf $pkgdir/etc/sysctl.d
- install -vDm644 $srcdir/sysctl-$pkgname.conf $pkgdir/srv/http/$pkgname
- install -vDm644 COPYING $pkgdir/usr/share/licenses/$pkgname
- install -vDm644 db/zm*.sql $pkgdir/usr/share/$pkgname/db
+ # Install configuration files
+ #mkdir -pv $pkgdir/etc/httpd/conf/extra
+ install -vDm 644 $srcdir/httpd-$pkgname.conf $pkgdir/etc/httpd/conf/extra
+ #mkdir -pv $pkgdir/usr/lib/systemd/system
+ install -vDm 644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system
+ install -vDm 644 $srcdir/sysctl-$pkgname.conf $pkgdir/etc/sysctl.d
+ install -vDm 644 COPYING $pkgdir/usr/share/licenses/$pkgname
+ install -vDm 644 db/zm*.sql $pkgdir/usr/share/$pkgname/db
}
diff --git a/pcr/zoneminder/httpd-zoneminder.conf b/pcr/zoneminder/httpd-zoneminder.conf
index aeb089bc1..cdb7722dc 100644
--- a/pcr/zoneminder/httpd-zoneminder.conf
+++ b/pcr/zoneminder/httpd-zoneminder.conf
@@ -3,7 +3,7 @@
Alias /zm "/srv/http/zoneminder"
<Directory "/srv/http/zoneminder">
- Options -Indexes MultiViews FollowSymLinks
+ Options -Indexes +MultiViews +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
@@ -14,7 +14,7 @@ Alias /zm "/srv/http/zoneminder"
ScriptAlias /cgi-bin "/srv/http/cgi-bin"
<Directory "/srv/http/cgi-bin">
AllowOverride None
- Options ExecCGI FollowSymLinks
+ Options +ExecCGI +FollowSymLinks
Order allow,deny
Allow from all
</Directory>
diff --git a/pcr/zoneminder/zoneminder b/pcr/zoneminder/zoneminder
deleted file mode 100644
index c4cbf4d3f..000000000
--- a/pcr/zoneminder/zoneminder
+++ /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-1.25-fixwarning.patch b/pcr/zoneminder/zoneminder-1.25-fixwarning.patch
deleted file mode 100644
index 0d151d139..000000000
--- a/pcr/zoneminder/zoneminder-1.25-fixwarning.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -U 3 -H -d -r -N -- ZoneMinder-1.24.2/src/zm_image.cpp ZoneMinder-1.24.2-patch/src/zm_image.cpp
---- ZoneMinder-1.24.2/src/zm_image.cpp 2009-05-25 20:04:00.000000000 +0200
-+++ ZoneMinder-1.24.2-patch/src/zm_image.cpp 2009-07-04 16:31:45.000000000 +0200
-@@ -776,7 +776,8 @@
-
- while( pdest < (buffer+size) )
- {
-- *pdest++ = (*blend_ptr)[*pdest][*psrc++];
-+ *pdest = (*blend_ptr)[*pdest][*psrc++];
-+ pdest++;
- }
- }
- else
-
diff --git a/pcr/zoneminder/zoneminder-1.25-text.patch b/pcr/zoneminder/zoneminder-1.25-text.patch
deleted file mode 100644
index 90885f1b5..000000000
--- a/pcr/zoneminder/zoneminder-1.25-text.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- ZoneMinder-1.25.0/src/zm_stream.cpp 2009-05-08 09:47:27.000000000 -0400
-+++ ZoneMinder-1.25.0.ajs/src/zm_stream.cpp 2013-01-14 16:52:18.000000000 -0500
-@@ -262,7 +262,7 @@ bool StreamBase::sendTextFrame( const ch
- fprintf( stdout, "--ZoneMinderFrame\r\n" );
- fprintf( stdout, "Content-Length: %d\r\n", n_bytes );
- fprintf( stdout, "Content-Type: image/jpeg\r\n\r\n" );
-- if ( fwrite( buffer, n_bytes, 1, stdout ) )
-+ if ( fwrite( buffer, n_bytes, 1, stdout ) != 1 )
- {
- Error( "Unable to send stream text frame: %s", strerror(errno) );
- return( false );
-
diff --git a/pcr/zoneminder/zoneminder-1.25.0-ffmpeg.patch b/pcr/zoneminder/zoneminder-1.25.0-ffmpeg.patch
deleted file mode 100644
index 99d41ee33..000000000
--- a/pcr/zoneminder/zoneminder-1.25.0-ffmpeg.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-diff -Naur ZoneMinder-1.25.0-a/configure.ac ZoneMinder-1.25.0-b/configure.ac
---- ZoneMinder-1.25.0-a/configure.ac 2011-08-23 09:10:32.000000000 -0600
-+++ ZoneMinder-1.25.0-b/configure.ac 2013-05-06 11:17:33.860608307 -0600
-@@ -95,7 +95,7 @@
-
- LDFLAGS="${FFMPEG_LIBS} $LDFLAGS"
- CFLAGS="${FFMPEG_CFLAGS} $CFLAGS"
--CPPFLAGS="${FFMPEG_CFLAGS} $CPPFLAGS"
-+CPPFLAGS="${FFMPEG_CFLAGS} $CPPFLAGS -D__STDC_CONSTANT_MACROS"
-
- EXTRA_LIBS=
- AC_ARG_WITH(extralibs,
-@@ -275,8 +275,7 @@
- AC_CHECK_LIB(x264,x264_predict_16x16_init)
- 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_register_all,,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)
-diff -Naur ZoneMinder-1.25.0-a/src/zm_ffmpeg.h ZoneMinder-1.25.0-b/src/zm_ffmpeg.h
---- ZoneMinder-1.25.0-a/src/zm_ffmpeg.h 2011-06-24 10:05:07.000000000 -0600
-+++ ZoneMinder-1.25.0-b/src/zm_ffmpeg.h 2013-05-06 18:11:49.327274977 -0600
-@@ -43,6 +43,11 @@
- }
- #endif
-
-+#include <libavutil/avutil.h>
-+#include <libavcodec/avcodec.h>
-+#include <libavformat/avformat.h>
-+#include <libswscale/swscale.h>
-+
- #if FFMPEG_VERSION_INT == 0x000408
- #define ZM_FFMPEG_048 1
- #elif FFMPEG_VERSION_INT == 0x000409
-diff -Naur ZoneMinder-1.25.0-a/src/zm_ffmpeg_camera.cpp ZoneMinder-1.25.0-b/src/zm_ffmpeg_camera.cpp
---- ZoneMinder-1.25.0-a/src/zm_ffmpeg_camera.cpp 2011-06-21 01:40:13.000000000 -0600
-+++ ZoneMinder-1.25.0-b/src/zm_ffmpeg_camera.cpp 2013-05-06 19:57:08.453941643 -0600
-@@ -91,7 +91,7 @@
- Info( "Priming capture from %s", mPath.c_str() );
-
- // Open the input, not necessarily a file
-- if ( av_open_input_file( &mFormatContext, mPath.c_str(), NULL, 0, NULL ) !=0 )
-+ if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, NULL ) !=0 )
- Fatal( "Unable to open input %s due to: %s", mPath.c_str(), strerror(errno) );
-
- // Locate stream info from input
-@@ -122,7 +122,7 @@
- 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 -Naur ZoneMinder-1.25.0-a/src/zm_mpeg.cpp ZoneMinder-1.25.0-b/src/zm_mpeg.cpp
---- ZoneMinder-1.25.0-a/src/zm_mpeg.cpp 2011-05-15 14:39:06.000000000 -0600
-+++ ZoneMinder-1.25.0-b/src/zm_mpeg.cpp 2013-05-06 20:00:08.923941640 -0600
-@@ -130,7 +130,7 @@
- {
- /* set the output parameters (must be done even if no
- parameters). */
-- if ( av_set_parameters(ofc, NULL) < 0 )
-+ if ( avformat_write_header(ofc, NULL) < 0 )
- {
- Panic( "Invalid output format parameters" );
- }
-@@ -176,7 +176,7 @@
- }
-
- /* open the codec */
-- if ( avcodec_open(c, codec) < 0 )
-+ if ( avcodec_open2(c, codec, NULL) < 0 )
- {
- Panic( "Could not open codec" );
- }
-@@ -222,7 +222,7 @@
- if ( !(of->flags & AVFMT_NOFILE) )
- {
- #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1)
-- if ( avio_open(&ofc->pb, filename, URL_WRONLY) < 0 )
-+ if ( avio_open(&ofc->pb, filename, AVIO_FLAG_WRITE) < 0 )
- #else
- if ( url_fopen(&ofc->pb, filename, URL_WRONLY) < 0 )
- #endif
-@@ -241,7 +241,7 @@
- }
-
- /* 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 width, int height )
-diff -Naur ZoneMinder-1.25.0-a/src/zm_remote_camera_rtsp.cpp ZoneMinder-1.25.0-b/src/zm_remote_camera_rtsp.cpp
---- ZoneMinder-1.25.0-a/src/zm_remote_camera_rtsp.cpp 2011-06-21 03:19:10.000000000 -0600
-+++ ZoneMinder-1.25.0-b/src/zm_remote_camera_rtsp.cpp 2013-05-06 20:07:40.797274975 -0600
-@@ -145,7 +145,7 @@
- Panic( "Unable to locate codec %d decoder", codecContext->codec_id );
-
- // Open codec
-- if ( avcodec_open( codecContext, codec ) < 0 )
-+ if ( avcodec_open2( codecContext, codec, NULL ) < 0 )
- Panic( "Can't open codec" );
-
- picture = avcodec_alloc_frame();
-diff -Naur ZoneMinder-1.25.0-a/src/zm_sdp.h ZoneMinder-1.25.0-b/src/zm_sdp.h
---- ZoneMinder-1.25.0-a/src/zm_sdp.h 2011-05-15 14:39:06.000000000 -0600
-+++ ZoneMinder-1.25.0-b/src/zm_sdp.h 2013-05-06 20:23:28.237274974 -0600
-@@ -41,7 +41,7 @@
- int payloadType;
- const char payloadName[6];
- enum AVMediaType codecType;
-- enum CodecID codecId;
-+ enum AVCodecID codecId;
- int clockRate;
- int autoChannels;
- };
-@@ -50,7 +50,7 @@
- {
- const char payloadName[32];
- enum AVMediaType codecType;
-- enum CodecID codecId;
-+ enum AVCodecID codecId;
- //int clockRate;
- //int autoChannels;
- };
diff --git a/pcr/zoneminder/zoneminder-1.25.0-gcc47.patch b/pcr/zoneminder/zoneminder-1.25.0-gcc47.patch
deleted file mode 100644
index a083c6dbc..000000000
--- a/pcr/zoneminder/zoneminder-1.25.0-gcc47.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff -up ./src/zm_local_camera.cpp.gcc47 ./src/zm_local_camera.cpp
---- ./src/zm_local_camera.cpp.gcc47 2011-06-21 04:19:10.000000000 -0500
-+++ ./src/zm_local_camera.cpp 2012-01-19 13:43:49.142440717 -0600
-@@ -26,6 +26,7 @@
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
-+#include <limits.h>
- #include <unistd.h>
- #include <sys/mman.h>
- #include <errno.h>
-diff -up ./src/zm_logger.cpp.gcc47 ./src/zm_logger.cpp
---- ./src/zm_logger.cpp.gcc47 2011-06-28 06:07:35.000000000 -0500
-+++ ./src/zm_logger.cpp 2012-01-19 13:43:49.142440717 -0600
-@@ -33,6 +33,7 @@
- #include <signal.h>
- #include <stdarg.h>
- #include <errno.h>
-+#include <unistd.h>
-
- bool Logger::smInitialised = false;
- Logger *Logger::smInstance = 0;
-diff -up ./src/zm_thread.h.gcc47 ./src/zm_thread.h
---- ./src/zm_thread.h.gcc47 2012-01-19 13:44:43.082766722 -0600
-+++ ./src/zm_thread.h 2012-01-19 13:44:56.966335869 -0600
-@@ -21,6 +21,7 @@
- #define ZM_THREAD_H
-
- #include <pthread.h>
-+#include <unistd.h>
- #include "zm_exception.h"
- #include "zm_utils.h"
-
diff --git a/pcr/zoneminder/zoneminder-1.25.0-gcrypt.patch b/pcr/zoneminder/zoneminder-1.25.0-gcrypt.patch
deleted file mode 100644
index 21f197ec6..000000000
--- a/pcr/zoneminder/zoneminder-1.25.0-gcrypt.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-diff -up ./configure.ac.gcrypt ./configure.ac
---- ./configure.ac.gcrypt 2012-01-19 12:58:20.647123209 -0600
-+++ ./configure.ac 2012-01-19 13:12:34.186669577 -0600
-@@ -13,7 +13,7 @@ AC_ARG_VAR(ZM_DB_HOST,[Hostname where Zo
- AC_ARG_VAR(ZM_DB_NAME,[Name of ZoneMinder database, default zm])
- AC_ARG_VAR(ZM_DB_USER,[Name of ZoneMinder database user, default zmuser])
- AC_ARG_VAR(ZM_DB_PASS,[Password of ZoneMinder database user, default zmpass])
--AC_ARG_VAR(ZM_SSL_LIB,[Library to use for ssl functions, default gnutls])
-+AC_ARG_VAR(ZM_SSL_LIB,[Library to use for MD5 function, default libgcrypt])
- AC_ARG_VAR(ZM_MYSQL_ENGINE,[MySQL engine to use with database, default MyISAM])
- AC_ARG_VAR(ZM_RUNDIR,[Location of transient process files, default /var/run/zm])
- AC_ARG_VAR(ZM_TMPDIR,[Location of temporary files, default /tmp/zm])
-@@ -32,7 +32,7 @@ if test "$ZM_DB_PASS" == ""; then
- AC_SUBST(ZM_DB_PASS,[zmpass])
- fi
- if test "$ZM_SSL_LIB" == ""; then
-- AC_SUBST(ZM_SSL_LIB,gnutls)
-+ AC_SUBST(ZM_SSL_LIB,libgcrypt)
- fi
- if test "$ZM_MYSQL_ENGINE" == ""; then
- AC_SUBST(ZM_MYSQL_ENGINE,MyISAM)
-@@ -264,11 +264,10 @@ AC_CHECK_LIB(jpeg,jpeg_start_compress,,A
- AC_CHECK_LIB(pthread,pthread_create,,AC_MSG_ERROR(zm requires libpthread.a))
- AC_CHECK_LIB(dl,dlsym,,AC_MSG_ERROR(zm requires libdl.a))
- if test "$ZM_SSL_LIB" == "openssl"; then
--AC_CHECK_LIB(crypto,MD5,,AC_MSG_WARN([libcrypto.a is required for authenticated streaming - use ZM_SSL_LIB option to select gnutls instead]))
-+AC_CHECK_LIB(crypto,MD5,,AC_MSG_WARN([libcrypto.a is required for authenticated streaming - use ZM_SSL_LIB option to select libgcrypt instead]))
- else
--AC_CHECK_HEADERS(gcrypt.h,,AC_MSG_WARN(zm requires libgcrypt headers to be installed for gnutls),)
-+AC_CHECK_HEADERS(gcrypt.h,,AC_MSG_WARN(zm requires libgcrypt headers to be installed),)
- AC_CHECK_LIB(gcrypt,gcry_check_version,,AC_MSG_WARN([libgcrypt.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead]))
--AC_CHECK_LIB(gnutls-openssl,MD5,,AC_MSG_WARN([gnutls-openssl.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead]))
- fi
- AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for remote/network camera support))
- AC_CHECK_LIB(z,zlibVersion)
-@@ -320,9 +319,6 @@ AC_CHECK_DECLS(round,,,[#include <math.h
- if test "$ZM_SSL_LIB" == "openssl"; then
- AC_CHECK_DECLS(MD5,,AC_MSG_ERROR([zm requires openssl/md5.h - use ZM_SSL_LIB option to select gnutls instead]),[#include <stdlib.h>
- #include <openssl/md5.h>])
--else
--AC_CHECK_DECLS(MD5,,AC_MSG_ERROR([zm requires gnutls/openssl.h - use ZM_SSL_LIB option to select openssl instead]),[#include <stdlib.h>
--#include <gnutls/openssl.h>])
- fi
- AC_CHECK_DECLS(backtrace,,,[#include <execinfo.h>])
-
-diff -up ./src/zm_user.cpp.gcrypt ./src/zm_user.cpp
---- ./src/zm_user.cpp.gcrypt 2011-08-03 06:31:06.000000000 -0500
-+++ ./src/zm_user.cpp 2012-01-19 12:58:20.654122992 -0600
-@@ -140,6 +140,18 @@ User *zmLoadUser( const char *username,
- return( user );
- }
-
-+#ifdef HAVE_GCRYPT_H
-+#define HAVE_DECL_MD5 1
-+#define MD5_DIGEST_LENGTH 16
-+static unsigned char *MD5(const unsigned char *data, unsigned long len,
-+ unsigned char *md)
-+{
-+ gcry_md_hash_buffer(GCRY_MD_MD5, md, data, len);
-+
-+ return md;
-+}
-+#endif
-+
- // Function to validate an authentication string
- User *zmLoadAuthUser( const char *auth, bool use_remote_addr )
- {
-diff -up ./src/zm_user.h.gcrypt ./src/zm_user.h
---- ./src/zm_user.h.gcrypt 2010-11-11 06:11:07.000000000 -0600
-+++ ./src/zm_user.h 2012-01-19 13:14:11.200654694 -0600
-@@ -23,14 +23,11 @@
- #ifndef ZM_USER_H
- #define ZM_USER_H
-
--#if HAVE_LIBGNUTLS_OPENSSL
--#include <gnutls/openssl.h>
- #if HAVE_GCRYPT_H
- #include <gcrypt.h>
--#endif // HAVE_GCRYPT_H
- #elif HAVE_LIBCRYPTO
- #include <openssl/md5.h>
--#endif // HAVE_LIBGNUTLS_OPENSSL || HAVE_LIBCRYPTO
-+#endif // HAVE_GCRYPT_H || HAVE_LIBCRYPTO
-
- class User
- {
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 51bc1288d..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
-@@ -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
index 66109d5fa..1c8789a4a 100644
--- a/pcr/zoneminder/zoneminder.install
+++ b/pcr/zoneminder/zoneminder.install
@@ -5,13 +5,13 @@ pre_install() {
if [ -L /srv/http/zoneminder/events ]; then
l=$(readlink /srv/http/zoneminder/events)
if [ $l != /var/cache/zoneminder/events ]; then
- abort=true
+ abort=true
fi
fi
if [ -L /srv/http/zoneminder/images ]; then
l=$(readlink /srv/http/zoneminder/images)
if [ $l != /var/cache/zoneminder/images ]; then
- abort=true
+ abort=true
fi
fi
if [ $abort = true ]; then
@@ -41,49 +41,45 @@ post_install() {
mkdir -vm 0700 /tmp/zoneminder
chown -v http.http /tmp/zoneminder
fi
- sed -i '
- /^;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/;
- /^open_basedir/ s/:\/var\/cache\/zoneminder//;
- /^open_basedir/ s/:\/var\/cache\/zoneminder\///;
- /^open_basedir/ s/$/:\/var\/cache\/zoneminder/;
- ' /etc/php/php.ini
- sed -i '
- /^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
- gpasswd -a http video
+
+ # edit /etc/php.ini for Zoneminder
+ sed -e '
+ # Enable these libraries by removing the leading comment character
+ \|^;extension=mysql.so$| s|^;||;
+ \|^;extension=mysqli.so$| s|^;||;
+ \|^;extension=pdo_mysql.so$| s|^;||;
+ \|^;extension=gd.so$| s|^;||;
+ \|^;extension=gettext.so$| s|^;||;
+ \|^;extension=mcrypt.so$| s|^;||;
+ \|^;extension=session.so$| s|^;||;
+ \|^;extension=sockets.so$| s|^;||;
+ \|^;extension=openssl.so$| s|^;||;
+ \|^;extension=ftp.so$| s|^;||;
+ \|^;extension=zip.so$| s|^;||;
+
+ # Add zoneminder paths to open_basedir
+ s|^open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/$|&:/etc:/srv/http/zoneminder/|;
+ ' /etc/php/php.ini > /etc/php/php.ini.zoneminder
+
+ # edit /etc/httpd/conf/httpd.conf for Zoneminder
+ sed -e '
+ # Use mod_mpm_prefork instead of mod_mpm_event.so (FS#39218).
+ s|^LoadModule mpm_event_module modules/mod_mpm_event.so$|#&\nLoadModule mpm_prefork_module modules/mod_mpm_prefork.so|;
+
+ # Zoneminder requires cgi
+ \|^#LoadModule cgi_module modules/mod_cgi.so$| s|#||;
+
+ # libphp5
+ \|^LoadModule php5_module modules/libphp5.so$|d;
+ s|^#*LoadModule rewrite_module modules/mod_rewrite.so$|&\nLoadModule php5_module modules/libphp5.so|;
+ \|^Include /etc/httpd/conf/extra/php5_module.conf|d;
+ s|^Include conf/extra/httpd-default.conf$|&\nInclude /etc/httpd/conf/extra/php5_module.conf|;
+
+ # Include httpd-zoneminder.conf
+ \|^Include /etc/httpd/conf/extra/httpd-zoneminder.conf$|d;
+ s|^# Server-pool management (MPM specific)$|\nInclude /etc/httpd/conf/extra/httpd-zoneminder.conf\n&|;
+ ' /etc/httpd/conf/httpd.conf > /etc/httpd/conf/httpd.conf.zoneminder
+
cat << EOF
Note for mysql:
==> To run Zoneminder, you must install the database running mysql service (as root):
@@ -97,11 +93,6 @@ Note for mysql:
==> "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 for sysctl:
-==> You must uncomment that line in /etc/sysctl.d/sysctl-zoneminder.conf:
-==> "kernel.shmall = 524288000"
-==> "kernel.shmmax = 524288000"
-
Note for php:
==> You must uncomment that line in /etc/php/php.ini:
==> "extension=mysql.so"
@@ -115,11 +106,11 @@ Note for php:
==> "extension=openssl.so"
==> "extension=ftp.so"
==> "extension=zip.so"
-==> 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"
+==> check and add to open_basedir "/etc" and
+==> "/srv/http/zoneminder" like so
+==> "open_basedir = /home:/tmp:/usr/share/pear:/etc:/srv/http/zoneminder"
==> and set your timezone in php.ini:
-==> "date.timezone = <your_zone>/<your_city>"
+==> "date.timezone = <your_country>/<your_city>"
Note for apache:
==> You must edit /etc/httpd/conf/httpd.conf and add the line:
@@ -132,25 +123,22 @@ EOF
post_upgrade() {
post_install
- _mysqld=$(systemctl status mysqld.service | grep -o 'inactive (dead)')
- [[ _mysqld == 'inactive (dead)' ]] && systemctl start mysqld.service
/usr/bin/zmupdate.pl -f >/dev/null
- [[ _mysqld == 'inactive (dead)' ]] && systemctl stop mysqld.service
}
post_remove() {
- _zms=$(systemctl status zoneminder.service | grep -o 'active (running)')
- [[ _zms == 'active (running)' ]] && systemctl stop zoneminder.service
- [[ -d /tmp/zoneminder ]] && rm -vr /tmp/zoneminder
- sed -i '
- /^open_basedir/ s/:\/srv\/http\/zoneminder//;
- /^open_basedir/ s/:\/srv\/http\/zoneminder\///;
- /^open_basedir/ s/:\/var\/cache\/zoneminder\///
- ' /etc/php/php.ini
- sed -i '
- /^# ZoneMinder/d;
- /Include \/etc\/httpd\/conf\/extra\/httpd-zoneminder.conf/d;
- ' /etc/httpd/conf/httpd.conf
+ 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 (with password):
@@ -179,12 +167,9 @@ Note:
==> "extension=mysqli.so"
==> "extension=session.so"
==> "extension=sockets.so"
-==> "date.timezone = <my_zone>/<my_city>"
-
-==> Drop http user on video group if it isn't needed with others servers:
-==> gpasswd -d http video
+==> "date.timezone = <my_country>/<my_city>"
-==> Edit /etc/php/php.ini and remove "/etc", "/srv/http/zoneminder" and "/var/cache/zoneminder"
+==> 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".
diff --git a/pcr/zoneminder/zoneminder.service b/pcr/zoneminder/zoneminder.service
index 05cae6f91..83d992aa7 100644
--- a/pcr/zoneminder/zoneminder.service
+++ b/pcr/zoneminder/zoneminder.service
@@ -1,13 +1,18 @@
+# ZoneMinder systemd unit file
+# This file is intended to work with all distributions with Systemd
+
[Unit]
-Description=Capture, analyse, record and monitor video security cameras
-After=network.target remote-fs.target
-Required=mysqld.service
+Description=ZoneMinder CCTV recording and security system
+After=network.target mysqld.service httpd.service
+Requires=mysqld.service httpd.service
[Service]
+User=http
Type=forking
ExecStart=/usr/bin/zmpkg.pl start
-ExecRestart=/usr/bin/zmpkg.pl restart
-ExecStop=/usr/bin/zmpkg.pl stop
+ExecReload=/usr/bin/zmpkg.pl restart
+ExecStop=/bin/bash -c '[[ "$(/usr/bin/pgrep zmdc.pl)" > 0 ]] && /usr/bin/zmpkg.pl stop'
+PIDFile="/run/zm/zm.pid"
[Install]
WantedBy=multi-user.target