summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-01-25 07:15:23 +0100
committerAndreas Grapentin <andreas@grapentin.org>2018-01-25 08:33:24 +0100
commit4ba771bb1d8bd3ee9c08f2ba65b3b3b615377b67 (patch)
tree1b44f13d4962eb8c3d9f0d096aa763d73e593062 /pcr
parentd970f0c8379bf0fdcae34c3ee161d74cf7f60eef (diff)
downloadabslibre-4ba771bb1d8bd3ee9c08f2ba65b3b3b615377b67.tar.gz
abslibre-4ba771bb1d8bd3ee9c08f2ba65b3b3b615377b67.tar.bz2
abslibre-4ba771bb1d8bd3ee9c08f2ba65b3b3b615377b67.zip
pcr/zoneminder: updated to 1.30.4
Diffstat (limited to 'pcr')
-rw-r--r--pcr/zoneminder/PKGBUILD248
-rw-r--r--pcr/zoneminder/fabs.patch11
-rw-r--r--pcr/zoneminder/httpd-zoneminder.conf6
-rw-r--r--pcr/zoneminder/log.txt23
-rw-r--r--pcr/zoneminder/sysctl-zoneminder.conf3
-rw-r--r--pcr/zoneminder/uio.patch22
-rw-r--r--pcr/zoneminder/zm_rtp_ctrl.h.quick_fix_for_gcc6.diff4
-rw-r--r--pcr/zoneminder/zoneminder-tmpfile.conf1
-rw-r--r--pcr/zoneminder/zoneminder.install235
-rw-r--r--pcr/zoneminder/zoneminder.service7
10 files changed, 298 insertions, 262 deletions
diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD
index 9ecf77051..ba6c7bc02 100644
--- a/pcr/zoneminder/PKGBUILD
+++ b/pcr/zoneminder/PKGBUILD
@@ -1,120 +1,150 @@
-# 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@hyperbola.info>
+# Maintainer (AUR): Mesmer <mesmer@fisica.if.uff.br>
+# Contributor (AUR): Troy Will <troydwill at gmail dot com>
+# Contributor (AUR): /dev/rs0 </dev/rs0@secretco.de.com>
+# Contributor (AUR): Jacek Burghardt <jacek@hebe.us>
+# Contributor (AUR): Vojtech Aschenbrenner <v@asch.cz>
+# Contributor (AUR): Jason Gardner <buhrietoe@gmail.com>
+# Contributor (AUR): Ross melin <rdmelin@gmail.com>
+# Contributor (AUR): Charles Spence IV <cspence@unomaha.edu>
+# Contributor (AUR): Joe Julian <me@joejulian.name>
+# Contributor: Márcio Silva <coadde@hyperbola.info>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Orginally based on a Debian Squeeze package
+# parabola changes and rationale:
+# - corrected license
+# - renamed tarball to avoid collisions
+
+_pkgname=zoneminder
pkgname=zoneminder
-pkgver=1.28.0
+pkgver=1.30.4
pkgrel=1
pkgdesc='Capture, analyse, record and monitor video security cameras'
-arch=('i686' 'x86_64' 'armv7h')
-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' 'php' 'php-apache' 'php-gd' 'php-mcrypt')
-makedepends=('netpbm' 'cmake')
-optdepends=('netpbm')
-options=(!libtool)
-install=$pkgname.install
-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 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|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 ZM name to ZoneMinder
- sed -i '\|ZM_WEB_TITLE_PREFIX|,+1 s|"ZM"|"ZoneMinder"|;
- ' scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in
-
- # 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
+arch=( i686 x86_64 armv7h )
+backup=( etc/zm.conf )
+url="https://github.com/$pkgname/$pkgname/releases"
+license=( GPL2 )
+depends=(
+ mariadb perl-dbd-mysql perl-dbi
+ apache php php-apache php-gd php-mcrypt perl-php-serialization
+ perl-libwww perl-net-sftp-foreign
+ ffmpeg vlc perl-sys-mmap
+ gnutls polkit
+ perl-expect perl-archive-zip perl-date-manip
+ perl-mime-lite perl-mime-tools
+)
+makedepends=(
+ cmake netpbm git
+)
+optdepends=(
+ 'php-apcu-bci: Bring back the API for android control'
+ netpbm
+ cambozola
+ perl-time-modules
+ perl-x10
+ perl-astro-suntime
+)
+install=$_pkgname.install
+
+source=(
+ $pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/$pkgver.tar.gz
+ httpd-zoneminder.conf
+ zoneminder.service
+ uio.patch
+ fabs.patch
+ zoneminder-tmpfile.conf
+)
+sha256sums=('879f57fdb1e013b3f17b1b0e87c5935683dad14922951d5f29d1370c1e490f2e'
+ 'ff7382b38ac07dadead0ad4d583e3dbcf8da4aaa06b76d048ee334f69f95db67'
+ '043d77a995553c533d62f48db4b719d29cf6c7074f215d866130e97be57ed646'
+ 'd1816cac69be5e807d22c37fcbe6fef99e38151a5c71233b875c0ebf101fb460'
+ 'fd20faed09eaf825933c2a87b1d04febf99d183b2b36b0041df1e2b2990c49c2'
+ 'cc8af737c3c07750fc71317c81999376e4bbb39da883780164a8747b3d7c95a7')
+
+
+prepare () {
+ cd $srcdir/$pkgname-$pkgver/web/api/app/Plugin/
+ if [ ! -d "crud" ]; then
+ git clone -b 3.0 https://github.com/FriendsOfCake/crud.git
+ mkdir -p Crud
+ mv crud/* Crud
+ fi
+ patch $srcdir/$pkgname-$pkgver/src/zm_image.cpp < $srcdir/fabs.patch
+ patch $srcdir/$pkgname-$pkgver/src/zm_comms.h < $srcdir/uio.patch
}
build() {
- cd $srcdir/ZoneMinder-$pkgver
-
- 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
-}
-
+ cd $srcdir/$pkgname-$pkgver
+
+ cmake -DCMAKE_INSTALL_PREFIX=/usr \
+ -DZM_PERL_SUBPREFIX=/lib/perl5 \
+ -DZM_WEBDIR=/srv/http/zoneminder \
+ -DZM_CGIDIR=/srv/http/cgi-bin \
+ -DZM_WEB_USER=http \
+ -DZM_CONTENTDIR=/var/cache/zoneminder \
+ -DZM_LOGDIR=/var/log/zoneminder \
+ -DZM_RUNDIR=/run/zoneminder \
+ -DZM_TMPDIR=/var/lib/zoneminder/temp \
+ -DZM_SOCKDIR=/var/lib/zoneminder/sock .
+
+ make V=0
+}
+
package() {
- cd $srcdir/ZoneMinder-$pkgver
-
- 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
- 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
-
- # 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 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
+
+ cd $srcdir/$pkgname-$pkgver
+
+ DESTDIR=$pkgdir make install
+
+ # Change Polkit directory permissions to Arch Linux policy
+ chmod -v 700 $pkgdir/usr/share/polkit-1/rules.d/
+ chown -v polkitd $pkgdir/usr/share/polkit-1/rules.d/
+
+ # BEGIN CREATE_ZONEMINDER_DIRECTORIES
+ mkdir -pv $pkgdir/var/{cache/zoneminder,log/zoneminder}
+ chown -Rv http.http $pkgdir/var/{cache/zoneminder,log/zoneminder}
+
+ # corresponds to -DZM_SOCKDIR=/var/lib/zoneminder/sock
+ mkdir -pv $pkgdir/var/lib/zoneminder/sock
+ chown -v http.http $pkgdir/var/lib/zoneminder/sock
+
+ # corresponds to -DZM_TMPDIR=/var/lib/zoneminder/temp
+ mkdir -pv $pkgdir/var/lib/zoneminder/temp
+ chown -v http.http $pkgdir/var/lib/zoneminder/temp
+
+ chown -v http.http $pkgdir/etc/zm.conf
+ chmod 0700 $pkgdir/etc/zm.conf
+ # END CREATE_ZONEMINDER_DIRECTORIES
+
+ # Make content directories in /var/cache/zoneminder and to link them in /srv/http/zoneminder
+ for i in events images temp; do
+ mkdir $pkgdir/var/cache/$_pkgname/$i
+ chown -v http.http $pkgdir/var/cache/$_pkgname/$i
+ ln -s /var/cache/$_pkgname/$i $pkgdir/srv/http/$_pkgname/$i
+ chown -v --no-dereference http.http $pkgdir/srv/http/$_pkgname/$i
+ done
+
+ # Create a link to the Zoneminder cgi binaries
+ ln -sv /srv/http/cgi-bin $pkgdir/srv/http/$_pkgname
+
+ chown -h http.http $pkgdir/srv/http/{cgi-bin,$_pkgname,$_pkgname/cgi-bin}
+
+ # Link Cambozola
+ # ln -s /usr/share/cambozola/cambozola.jar $pkgdir/srv/http/$_pkgname
+
+ # Install configuration files
+ mkdir -p $pkgdir/etc/httpd/conf/extra
+ install -D -m 644 $srcdir/httpd-$_pkgname.conf $pkgdir/etc/httpd/conf/extra
+
+ mkdir -p $pkgdir/usr/lib/systemd/system
+ 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
+
+ mkdir -p $pkgdir/usr/share/doc/$_pkgname
+ # install -D -m 644 $srcdir/README $pkgdir/usr/share/doc/$_pkgname
+
+ install -Dm644 ../zoneminder-tmpfile.conf "$pkgdir"/usr/lib/tmpfiles.d/zoneminder.conf
+
}
diff --git a/pcr/zoneminder/fabs.patch b/pcr/zoneminder/fabs.patch
new file mode 100644
index 000000000..b0a62e3db
--- /dev/null
+++ b/pcr/zoneminder/fabs.patch
@@ -0,0 +1,11 @@
+--- src/ZoneMinder-1.30.4/src/zm_image.cpp 2017-06-17 04:20:45.808503543 -0300
++++ src/ZoneMinder-1.30.4/src/zm_image.cpp.2 2017-06-17 04:20:40.221794330 -0300
+@@ -1659,7 +1659,7 @@
+ uint8_t *psrc = images[j]->buffer+c;
+
+ #ifndef SOLARIS
+- if ( (unsigned)abs((*psrc)-RGB_VAL(ref_colour,c)) >= RGB_VAL(threshold,c) )
++ if ( (unsigned)fabs((*psrc)-RGB_VAL(ref_colour,c)) >= RGB_VAL(threshold,c) )
+ #else
+ if ( (unsigned)std::abs((*psrc)-RGB_VAL(ref_colour,c)) >= RGB_VAL(threshold,c) )
+ #endif
diff --git a/pcr/zoneminder/httpd-zoneminder.conf b/pcr/zoneminder/httpd-zoneminder.conf
index cdb7722dc..41b364f13 100644
--- a/pcr/zoneminder/httpd-zoneminder.conf
+++ b/pcr/zoneminder/httpd-zoneminder.conf
@@ -1,4 +1,4 @@
-# /etc/httpd/conf/extra/httpd-zm.conf
+# /etc/httpd/conf/extra/httpd-zoneminder.conf
# Config for zoneminder web app
Alias /zm "/srv/http/zoneminder"
@@ -7,8 +7,8 @@ Alias /zm "/srv/http/zoneminder"
AllowOverride None
Order allow,deny
Allow from all
- # The code unfortunately uses short tags in many places
- php_value short_open_tag On
+ # Provide PHP directory and file access, see http://php.net/manual/en/ini.core.php#ini.open-basedir
+ php_admin_value open_basedir "/tmp/:/etc/zm.conf:/srv/http/zoneminder/:/var/cache/zoneminder/:/var/lib/zoneminder/:/var/log/zoneminder/"
</Directory>
ScriptAlias /cgi-bin "/srv/http/cgi-bin"
diff --git a/pcr/zoneminder/log.txt b/pcr/zoneminder/log.txt
new file mode 100644
index 000000000..09e54b17e
--- /dev/null
+++ b/pcr/zoneminder/log.txt
@@ -0,0 +1,23 @@
+==> Making package: zoneminder 1.30.4-1 (Fri Sep 15 20:35:45 UTC 2017)
+==> Checking runtime dependencies...
+==> Missing dependencies:
+ -> mariadb
+ -> perl-dbd-mysql
+ -> perl-dbi
+ -> apache
+ -> php
+ -> php-apache
+ -> php-gd
+ -> php-mcrypt
+ -> perl-libwww
+ -> vlc
+ -> perl-archive-zip
+ -> perl-date-manip
+ -> perl-mime-lite
+ -> perl-mime-tools
+==> Checking buildtime dependencies...
+==> Missing dependencies:
+ -> netpbm
+==> ERROR: Could not resolve all dependencies.
+
+==> ERROR: An unknown error has occurred. Exiting...
diff --git a/pcr/zoneminder/sysctl-zoneminder.conf b/pcr/zoneminder/sysctl-zoneminder.conf
deleted file mode 100644
index ec1407dee..000000000
--- a/pcr/zoneminder/sysctl-zoneminder.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-# For Zoneminder Monitor
-#kernel.shmall = 524288000
-#kernel.shmmax = 524288000
diff --git a/pcr/zoneminder/uio.patch b/pcr/zoneminder/uio.patch
new file mode 100644
index 000000000..a892e29b1
--- /dev/null
+++ b/pcr/zoneminder/uio.patch
@@ -0,0 +1,22 @@
+--- src/ZoneMinder-1.30.4/src/zm_comms.h 2017-05-09 14:54:48.000000000 +0000
++++ src/ZoneMinder-1.30.4/src/zm_comms.fix.h 2017-09-15 20:49:46.992445289 +0000
+@@ -21,7 +21,6 @@
+ #define ZM_COMMS_H
+
+ #include "zm_exception.h"
+-
+ #include <string.h>
+ #include <unistd.h>
+ #include <netdb.h>
+@@ -31,11 +30,9 @@
+ #include <set>
+ #include <vector>
+
+-#if defined(BSD)
+ #include <sys/uio.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+-#endif
+
+ class CommsException : public Exception
+ {
diff --git a/pcr/zoneminder/zm_rtp_ctrl.h.quick_fix_for_gcc6.diff b/pcr/zoneminder/zm_rtp_ctrl.h.quick_fix_for_gcc6.diff
new file mode 100644
index 000000000..ae076e72f
--- /dev/null
+++ b/pcr/zoneminder/zm_rtp_ctrl.h.quick_fix_for_gcc6.diff
@@ -0,0 +1,4 @@
+126c126
+< struct Bye
+---
+> struct
diff --git a/pcr/zoneminder/zoneminder-tmpfile.conf b/pcr/zoneminder/zoneminder-tmpfile.conf
new file mode 100644
index 000000000..84362b52b
--- /dev/null
+++ b/pcr/zoneminder/zoneminder-tmpfile.conf
@@ -0,0 +1 @@
+d /run/zoneminder 0755 http http -
diff --git a/pcr/zoneminder/zoneminder.install b/pcr/zoneminder/zoneminder.install
index 1c8789a4a..d16779e3b 100644
--- a/pcr/zoneminder/zoneminder.install
+++ b/pcr/zoneminder/zoneminder.install
@@ -1,145 +1,98 @@
-#!/usr/bin/bash
-pre_install() {
- set -e
- abort=false
- 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 /srv/http/zoneminder/images ]; then
- l=$(readlink /srv/http/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
-/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
- exit 1
- fi
- exit 0
-}
-
post_install() {
- if [[ -d /var/log/zoneminder ]]; then
- chmod -v 0755 /var/log/zoneminder
- chown -v http.http /var/log/zoneminder
- else
- mkdir -vm 0755 /var/log/zoneminder
- chown -v http.http /var/log/zoneminder
- fi
- if [[ -d /tmp/zoneminder ]]; then
- chmod -v 0700 /tmp/zoneminder
- chown -v http.http /tmp/zoneminder
- else
- mkdir -vm 0700 /tmp/zoneminder
- chown -v http.http /tmp/zoneminder
- fi
- # 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
+ systemd-tmpfiles --create zoneminder.conf
- # 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
+ # edit /etc/php.ini for Zoneminder
+ sed -e '
+ # Enable these libraries by removing the leading comment character
+ \|^;extension=ftp.so$| s|^;||;
+ \|^;extension=gd.so$| s|^;||;
+ \|^;extension=gettext.so$| s|^;||;
+ \|^;extension=mcrypt.so$| s|^;||;
+ \|^;extension=openssl.so$| s|^;||;
+ \|^;extension=pdo_mysql.so$| s|^;||;
+ \|^;extension=sockets.so$| s|^;||;
+ \|^;extension=zip.so$| s|^;||;
+ ' /etc/php/php.ini > /tmp/php.ini.zoneminder
- cat << EOF
-Note for mysql:
-==> To run Zoneminder, you must install the database running mysql service (as root):
-==> "systemctl start mysqld.service"
-==> 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"
+ # 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 needs Apache configured to permit CGI execution
+ \|^\t#LoadModule cgi_module modules/mod_cgi.so$| s|\t#|\t|;
+
+ # libphp7
+ \|^LoadModule php7_module modules/libphp7.so$|d;
+ s|^#*LoadModule rewrite_module modules/mod_rewrite.so$|&\nLoadModule php7_module modules/libphp7.so|;
+ \|^Include /etc/httpd/conf/extra/php7_module.conf|d;
+ s|^Include conf/extra/httpd-default.conf$|&\nInclude /etc/httpd/conf/extra/php7_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 > /tmp/httpd.conf.zoneminder
+
+ cat << EOF
-Note for php:
-==> 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"
-==> "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"
-==> and set your timezone in php.ini:
-==> "date.timezone = <your_country>/<your_city>"
+ Zoneminder database setup:
+ --------------------------
+ Zoneminder operation requires a database named 'zm' which is defined in /usr/share/zoneminder/db/zm_create.sql
+
+ Create the Zoneminder database (with a password):
+ "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 a password):
+ "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"
+
+ PHP configuration
+ -----------------
+ * Check and make sure these are uncommented in /etc/php/php.ini:
+ extension=ftp.so
+ extension=gd.so
+ extension=gettext.so
+ extension=mcrypt.so
+ extension=openssl.so
+ extension=pdo_mysql.so
+ extension=sockets.so
+ extension=zip.so
+ * Set your timezone in php.ini:
+ date.timezone = <your_country>/<your_city>
+
+ Apache configuration
+ --------------------
+ Edit /etc/httpd/conf/httpd.conf and add the line:
+ "LoadModule php7_module modules/libphp7.so"
+ and:
+ "Include /etc/httpd/conf/extra/php7_module.conf"
+ "Include /etc/httpd/conf/extra/httpd-zoneminder.conf"
-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-zoneminder.conf"
EOF
}
post_upgrade() {
- post_install
- /usr/bin/zmupdate.pl -f >/dev/null
+ post_install
+ /usr/bin/zmupdate.pl -f >/dev/null
}
post_remove() {
- 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
+ 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
+ cat << EOF
Note:
==> 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"
@@ -152,27 +105,25 @@ 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"
+==> "LoadModule php7_module modules/libphp7.so"
+==> "Include /etc/httpd/conf/extra/php7_module.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:
-==> "extension=mysql.so"
-==> "extension=gd.so"
-==> "extension=gettext.so"
-==> "extension=mcrypt.so"
-==> "extension=mysqli.so"
-==> "extension=session.so"
-==> "extension=sockets.so"
-==> "date.timezone = <my_country>/<my_city>"
-
-==> Edit /etc/php/php.ini and remove "/etc" and "/srv/http/zoneminder"
-==> in the "open_basedir".
+ # extension=ftp.so
+ # extension=gd.so
+ # extension=gettext.so
+ # extension=mcrypt.so
+ # extension=openssl.so
+ # extension=pdo_mysql.so
+ # extension=sockets.so
+ # extension=zip.so
+ # "date.timezone = <my_country>/<my_city>"
-==> Remove log files and "zonemider" directory in "/var/log/zoneminder".
+==> Remove log files and "zoneminder" directory in "/var/log/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 83d992aa7..48268f139 100644
--- a/pcr/zoneminder/zoneminder.service
+++ b/pcr/zoneminder/zoneminder.service
@@ -1,6 +1,3 @@
-# ZoneMinder systemd unit file
-# This file is intended to work with all distributions with Systemd
-
[Unit]
Description=ZoneMinder CCTV recording and security system
After=network.target mysqld.service httpd.service
@@ -11,8 +8,8 @@ User=http
Type=forking
ExecStart=/usr/bin/zmpkg.pl start
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"
+ExecStop=/usr/bin/zmpkg.pl stop
+PIDFile=/run/zoneminder/zm.pid
[Install]
WantedBy=multi-user.target