summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO66
-rw-r--r--PKGBUILD261
-rw-r--r--zoneminder-httpd.conf16
-rw-r--r--zoneminder-nginx.conf2
-rw-r--r--zoneminder-php.ini3
-rw-r--r--zoneminder-tmpfile.conf2
-rw-r--r--zoneminder.install286
-rw-r--r--zoneminder.service16
8 files changed, 206 insertions, 446 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 952f8be85f37..0dc9d66bb4b3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,72 +1,76 @@
pkgbase = zoneminder
pkgdesc = A full-featured, open source, state-of-the-art video surveillance software system
- pkgver = 1.32.3
+ pkgver = 1.36.33
pkgrel = 2
- url = https://zoneminder.com/
+ url = https://www.zoneminder.com/
install = zoneminder.install
- arch = x86_64
- license = GPL2
+ arch = any
+ license = GPL-2.0-only
makedepends = cmake
depends = polkit
depends = ffmpeg
- depends = libmp4v2
depends = php-apcu
depends = php-fpm
depends = php-gd
+ depends = php-intl
depends = perl-archive-zip
depends = perl-data-dump
depends = perl-date-manip
+ depends = perl-datetime
depends = perl-dbd-mysql
depends = perl-device-serialport
depends = perl-file-slurp
depends = perl-image-info
- depends = perl-json-any
depends = perl-libwww
depends = perl-mime-lite
depends = perl-mime-tools
+ depends = perl-net-sftp-foreign
depends = perl-number-bytes-human
+ depends = perl-php-serialization
+ depends = perl-sys-cpu
depends = perl-sys-meminfo
depends = perl-sys-mmap
- depends = perl-class-load
+ depends = perl-uri-encode
depends = perl-data-uuid
+ depends = perl-io-interface
depends = perl-io-socket-multicast
depends = perl-soap-wsdl
+ depends = perl-xml-libxml
depends = perl-xml-parser
depends = perl-lwp-protocol-https
depends = perl-json-maybexs
- depends = perl-net-sftp-foreign
- depends = perl-php-serialization
- depends = perl-sys-cpu
- depends = perl-uri-encode
- depends = nginx-mainline
- depends = fcgiwrap
- depends = spawn-fcgi
- depends = multiwatch
- depends = mariadb
- optdepends = apache: alternative web server
- optdepends = vlc: provides libvlc (may achieve better performance with some camera models)
+ depends = perl-crypt-eksblowfish
+ depends = perl-data-entropy
+ depends = libjwt
+ optdepends = mariadb
+ optdepends = apache
+ optdepends = nginx
+ optdepends = fcgiwrap: required if using nginx
+ optdepends = spawn-fcgi: required if using nginx
+ optdepends = multiwatch: required if using nginx
+ optdepends = pod2man: required for Docker support
+ optdepends = zmeventnotification: machine learning powered recognition engine & event notification server
+ optdepends = vlc: provides libvlc, which may achieve better performance with some camera models
+ optdepends = libvncserver
conflicts = zoneminder-git
backup = etc/nginx/sites-available/zoneminder.conf
backup = etc/httpd/conf/extra/zoneminder.conf
backup = etc/php/conf.d/zoneminder.ini
- source = https://github.com/ZoneMinder/ZoneMinder/archive/1.32.3.tar.gz
- source = https://github.com/FriendsOfCake/crud/archive/v3.2.0.tar.gz
- source = https://github.com/ZoneMinder/CakePHP-Enum-Behavior/archive/1.0-zm.tar.gz
+ source = https://github.com/ZoneMinder/zoneminder/archive/refs/tags/1.36.33.tar.gz
+ source = https://github.com/ZoneMinder/CakePHP-Enum-Behavior/archive/refs/tags/1.0-zm.tar.gz
+ source = https://github.com/FriendsOfCake/crud/archive/refs/tags/v3.2.0.tar.gz
+ source = https://github.com/ZoneMinder/RtspServer/archive/055d81fe1293429e496b19104a9ed3360755a440.zip
source = zoneminder-nginx.conf
source = zoneminder-httpd.conf
source = zoneminder-php.ini
- source = zoneminder.service
- source = zoneminder-tmpfile.conf
source = fcgiwrap-multiwatch.service
- sha256sums = 9a7e61c529a6269ff0344403369b160b8c8da48615c4172377c465da0b0074b1
- sha256sums = 55be29e1eccb44d4ad0db8b23c37cec50f5341f8e498583d472ed1f0493876e3
+ sha256sums = cd0f44c7238bcfd10579d665b271f6af81b61f5cbd8cbbc2ff5d7839232e267e
sha256sums = dbd231e97b950c698f0f501d6a53c7291c9985e766b09e3afe00cfe69a969f44
- sha256sums = be503e5cedf42383122a1f96a6e00e25d473f8c1c536c000db748dbde12c88b0
- sha256sums = 0753527da658bb4025509c03923f21f7995cedb09008d64f1568fd1d5c2ec46b
- sha256sums = 479f290d3c92938cd929020ad140d613814b912b4302c2758be6446ebfb8a4ac
- sha256sums = 3e4de227e3154dffa887f2286c339ab3cf456f6d74a400b2786192b7e2b129c0
- sha256sums = b69ac1deaaf3cf84b4ae4dbab794e1b062823de817f1e3a816ccf5438db440c0
+ sha256sums = 55be29e1eccb44d4ad0db8b23c37cec50f5341f8e498583d472ed1f0493876e3
+ sha256sums = fad0f1646f65f1518dfde3390e6c907319bc67b61f2e04f5d5ac4144ab61131d
+ sha256sums = c60e855428a56cc327214aa13d02a70011bf3b63a94a0d845b1c5ea1fab28ad2
+ sha256sums = 1f0d2276861065caf0b6c030ba27a6edb6a2988c7a1ac0fdf4e8fcb856972715
+ sha256sums = 8e1131dd6bf3796f5bcc9422c96ef77388d7ab0d8e8fc17f6b8dd1e8acc2442a
sha256sums = e95f9bef77aef647dd633bd9ad75dc099b6d7184684e133f2f20702de83a6260
pkgname = zoneminder
-
diff --git a/PKGBUILD b/PKGBUILD
index f7d49d8208b2..24c8b7bb4e29 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,178 +6,157 @@
# Contributor: Vojtech Aschenbrenner <v@asch.cz>
# Contributor: Jason Gardner <buhrietoe@gmail.com>
# Contributor: Ross melin <rdmelin@gmail.com>
-# Contributor (Parabola): Márcio Silva <coadde@lavabit.com>
-# Contributor (Parabola): André Silva <emulatorman@lavabit.com>
+# Contributor: (Parabola): Márcio Silva <coadde@lavabit.com>
+# Contributor: (Parabola): André Silva <emulatorman@lavabit.com>
# Contributor: Charles Spence IV <cspence@unomaha.edu>
# Contributor: Joe Julian <me@joejulian.name>
# Orginally based on a Debian Squeeze package
-
-
-### Important notes for version 1.32.x ###
-#
-# 1) git-clone for CakePHP and Crud sources was replaced with published precompiled packages, as follows:
-# - CakePHP-Enum-Behaviour is pulled from the ZoneMinder repo, because a change is needed that has not yet been merged upstream.
-# - Crud is pulled from its official repo, since Pull Request #582 has been merged as required by the ZoneMinder devs.
-#
-# 2) By default, ZoneMinder now runs at localhost:8095 instead of localhost/zm (this can be changed by editing the provided conf files).
-#
-# 3) Apache was switched out in favor of Nginx, but remains as an optional dependency.
-
-
-#######################################################################################################################
-# #
-# If you're upgrading from a release older than 1.32.0: #
-# #
-# Due to the many breaking changes in new releases (both upstream and in the packaging), it's recommended to backup #
-# any existing ZoneMinder databases and perform a clean installation. Failure to do so may have very weird results. #
-# #
-#######################################################################################################################
-
-
pkgname=zoneminder
-pkgver=1.32.3
+pkgver=1.36.33
pkgrel=2
pkgdesc='A full-featured, open source, state-of-the-art video surveillance software system'
-arch=('x86_64')
-url='https://zoneminder.com/'
-license=('GPL2')
-depends=('polkit' 'ffmpeg' 'libmp4v2'
- 'php-apcu' 'php-fpm' 'php-gd'
- 'perl-archive-zip' 'perl-data-dump' 'perl-date-manip' 'perl-dbd-mysql' 'perl-device-serialport' 'perl-file-slurp' 'perl-image-info'
- 'perl-json-any' 'perl-libwww' 'perl-mime-lite' 'perl-mime-tools' 'perl-number-bytes-human' 'perl-sys-meminfo' 'perl-sys-mmap'
- # Needed for ONVIF support
- 'perl-class-load' 'perl-data-uuid' 'perl-io-socket-multicast' 'perl-soap-wsdl' 'perl-xml-parser'
- # Needed for SSL support
+arch=('any')
+url='https://www.zoneminder.com/'
+license=('GPL-2.0-only')
+depends=('polkit' 'ffmpeg'
+ 'php-apcu' 'php-fpm' 'php-gd' 'php-intl'
+ 'perl-archive-zip' 'perl-data-dump' 'perl-date-manip' 'perl-datetime' 'perl-dbd-mysql' 'perl-device-serialport' 'perl-file-slurp'
+ 'perl-image-info' 'perl-libwww' 'perl-mime-lite' 'perl-mime-tools' 'perl-net-sftp-foreign' 'perl-number-bytes-human' 'perl-php-serialization'
+ 'perl-sys-cpu' 'perl-sys-meminfo' 'perl-sys-mmap' 'perl-uri-encode'
+ # Required for ONVIF support
+ 'perl-data-uuid' 'perl-io-interface' 'perl-io-socket-multicast' 'perl-soap-wsdl' 'perl-xml-libxml' 'perl-xml-parser'
+ # Required for TLS support
'perl-lwp-protocol-https'
- # Apparently needed for Telemetry support
- 'perl-json-maybexs'
- # Unverified dependencies. So far not installing them hasn't raised any red flags, but I can't be 100% sure whether they're leftovers from
- # previous ZoneMinder incarnations or if they're needed for proper operation during runtime, so for the time being I'm leaving them in.
- 'perl-net-sftp-foreign' 'perl-php-serialization' 'perl-sys-cpu' 'perl-uri-encode'
-
- # Remove the following line if you don't need Nginx
- 'nginx-mainline' 'fcgiwrap' 'spawn-fcgi' 'multiwatch'
-
- # Remove the following line if you don't need MariaDB
- 'mariadb'
-
+ # Required for telemetry support
+ 'perl-json-maybexs'
+ # Required for encryption support
+ 'perl-crypt-eksblowfish' 'perl-data-entropy'
+ # Required for the JWT-based API
+ 'libjwt'
)
makedepends=('cmake')
-optdepends=('apache: alternative web server'
- 'vlc: provides libvlc (may achieve better performance with some camera models)')
+optdepends=('mariadb'
+ 'apache'
+ 'nginx'
+ 'fcgiwrap: required if using nginx'
+ 'spawn-fcgi: required if using nginx'
+ 'multiwatch: required if using nginx'
+ 'pod2man: required for Docker support'
+ 'zmeventnotification: machine learning powered recognition engine & event notification server'
+ 'vlc: provides libvlc, which may achieve better performance with some camera models'
+ 'libvncserver')
conflicts=('zoneminder-git')
-backup=("etc/nginx/sites-available/$pkgname.conf"
- "etc/httpd/conf/extra/$pkgname.conf"
- "etc/php/conf.d/$pkgname.ini")
-install=$pkgname.install
-source=("https://github.com/ZoneMinder/ZoneMinder/archive/$pkgver.tar.gz"
- "https://github.com/FriendsOfCake/crud/archive/v3.2.0.tar.gz"
- "https://github.com/ZoneMinder/CakePHP-Enum-Behavior/archive/1.0-zm.tar.gz"
- "zoneminder-nginx.conf"
- "zoneminder-httpd.conf"
- "zoneminder-php.ini"
- "zoneminder.service"
- "zoneminder-tmpfile.conf"
- "fcgiwrap-multiwatch.service")
-sha256sums=('9a7e61c529a6269ff0344403369b160b8c8da48615c4172377c465da0b0074b1'
- '55be29e1eccb44d4ad0db8b23c37cec50f5341f8e498583d472ed1f0493876e3'
+backup=("etc/nginx/sites-available/${pkgname}.conf"
+ "etc/httpd/conf/extra/${pkgname}.conf"
+ "etc/php/conf.d/${pkgname}.ini")
+install=${pkgname}.install
+source=("https://github.com/ZoneMinder/zoneminder/archive/refs/tags/${pkgver}.tar.gz"
+ 'https://github.com/ZoneMinder/CakePHP-Enum-Behavior/archive/refs/tags/1.0-zm.tar.gz'
+ 'https://github.com/FriendsOfCake/crud/archive/refs/tags/v3.2.0.tar.gz'
+ 'https://github.com/ZoneMinder/RtspServer/archive/055d81fe1293429e496b19104a9ed3360755a440.zip'
+ 'zoneminder-nginx.conf'
+ 'zoneminder-httpd.conf'
+ 'zoneminder-php.ini'
+ 'fcgiwrap-multiwatch.service')
+sha256sums=('cd0f44c7238bcfd10579d665b271f6af81b61f5cbd8cbbc2ff5d7839232e267e'
'dbd231e97b950c698f0f501d6a53c7291c9985e766b09e3afe00cfe69a969f44'
- # zoneminder-nginx.conf
- 'be503e5cedf42383122a1f96a6e00e25d473f8c1c536c000db748dbde12c88b0'
- # zoneminder-httpd.conf
- '0753527da658bb4025509c03923f21f7995cedb09008d64f1568fd1d5c2ec46b'
- # zoneminder-php.ini
- '479f290d3c92938cd929020ad140d613814b912b4302c2758be6446ebfb8a4ac'
- # zoneminder.service
- '3e4de227e3154dffa887f2286c339ab3cf456f6d74a400b2786192b7e2b129c0'
- # zoneminder-tmpfile.conf
- 'b69ac1deaaf3cf84b4ae4dbab794e1b062823de817f1e3a816ccf5438db440c0'
- # fcgiwrap-multiwatch.service
+ '55be29e1eccb44d4ad0db8b23c37cec50f5341f8e498583d472ed1f0493876e3'
+ 'fad0f1646f65f1518dfde3390e6c907319bc67b61f2e04f5d5ac4144ab61131d'
+ 'c60e855428a56cc327214aa13d02a70011bf3b63a94a0d845b1c5ea1fab28ad2'
+ '1f0d2276861065caf0b6c030ba27a6edb6a2988c7a1ac0fdf4e8fcb856972715'
+ '8e1131dd6bf3796f5bcc9422c96ef77388d7ab0d8e8fc17f6b8dd1e8acc2442a'
'e95f9bef77aef647dd633bd9ad75dc099b6d7184684e133f2f20702de83a6260')
prepare () {
- cd $pkgname-$pkgver
-
- # Move extra PHP plugins into place
- cp -R $srcdir/crud-3.2.0/* web/api/app/Plugin/Crud
- cp -R $srcdir/CakePHP-Enum-Behavior-1.0-zm/* web/api/app/Plugin/CakePHP-Enum-Behavior
-
+ cd ${pkgname}-${pkgver}
+
# Fix the launcher
- sed -i 's|localhost/zm|localhost:8095|g' misc/$pkgname.desktop.in
+ sed -i 's|localhost/zm|localhost:8095|g' misc/${pkgname}.desktop.in
+
+ # Tweak the systemd service file
+ sed -i 's|After=network.target mysqld.service httpd.service|After=network.target mysqld.service httpd.service nginx.service|g' misc/${pkgname}.service.in
+ sed -i 's|Requires=mysqld.service httpd.service|Wants=mysqld.service httpd.service nginx.service|g' misc/${pkgname}.service.in
+
+ # Move third-party plugins into place
+ mv ../CakePHP-Enum-Behavior-1.0-zm/* web/api/app/Plugin/CakePHP-Enum-Behavior
+ mv ../crud-3.2.0/* web/api/app/Plugin/Crud
+ mv ../RtspServer-055d81fe1293429e496b19104a9ed3360755a440/* dep/RtspServer
+
}
build() {
- cd $pkgname-$pkgver
-
+ cd ${pkgname}-${pkgver}
+
cmake -DCMAKE_INSTALL_PREFIX=/usr \
- -DZM_CONFIG_DIR=/etc/$pkgname \
- -DZM_CONFIG_SUBDIR=/etc/$pkgname/conf.d \
- -DZM_RUNDIR=/run/$pkgname \
- -DZM_SOCKDIR=/run/$pkgname \
- -DZM_LOGDIR=/var/log/$pkgname \
- -DZM_TMPDIR=/var/tmp/$pkgname \
- -DZM_CONTENTDIR=/var/lib/$pkgname \
- -DZM_CACHEDIR=/var/lib/$pkgname/cache \
- -DZM_WEBDIR=/srv/$pkgname/www \
- -DZM_CGIDIR=/srv/$pkgname/cgi-bin \
+ -DLIBJWT_LIBRARY=/usr/lib/libjwt.so \
+ -DZM_CONFIG_DIR=/etc/${pkgname} \
+ -DZM_CONFIG_SUBDIR=/etc/${pkgname}/conf.d \
+ -DZM_RUNDIR=/run/${pkgname} \
+ -DZM_SOCKDIR=/run/${pkgname} \
+ -DZM_LOGDIR=/var/log/${pkgname} \
+ -DZM_TMPDIR=/var/tmp/${pkgname} \
+ -DZM_CONTENTDIR=/var/lib/${pkgname} \
+ -DZM_CACHEDIR=/var/lib/${pkgname}/cache \
+ -DZM_WEBDIR=/usr/share/webapps/${pkgname}/www \
+ -DZM_CGIDIR=/usr/share/webapps/${pkgname}/cgi-bin \
-DZM_WEB_USER=http .
make
}
-
+
package() {
- cd $pkgname-$pkgver
+ cd ${pkgname}-${pkgver}
+
+ make DESTDIR=${pkgdir} install
- make DESTDIR=$pkgdir install
-
# Set Polkit directory permissions in accordance with Arch policy
- chmod 750 $pkgdir/usr/share/polkit-1/rules.d
- chown root:polkitd $pkgdir/usr/share/polkit-1/rules.d
-
+ chmod 750 ${pkgdir}/usr/share/polkit-1/rules.d
+ chown root:polkitd ${pkgdir}/usr/share/polkit-1/rules.d
+
# Create ZM_LOGDIR
- install -dm775 -o http -g http $pkgdir/var/log/$pkgname
-
+ install -dm755 -o http -g http ${pkgdir}/var/log/${pkgname}
+
# Create ZM_CONTENTDIR and its subfolders
- install -dm775 -o http -g http $pkgdir/var/lib/$pkgname/{cache,events,images}
-
+ install -dm775 -o http -g http ${pkgdir}/var/lib/${pkgname}/{cache,events,images}
+
# Link ZM_CGIDIR and ZM_CACHEDIR inside ZM_WEBDIR and set correct permissions
- ln -sf /srv/$pkgname/cgi-bin $pkgdir/srv/$pkgname/www
- ln -sf /var/lib/$pkgname/cache $pkgdir/srv/$pkgname/www
- chown -Rh http:http $pkgdir/srv/$pkgname
-
+ ln -sf /usr/share/webapps/${pkgname}/cgi-bin ${pkgdir}/usr/share/webapps/${pkgname}/www
+ ln -sf /var/lib/${pkgname}/cache ${pkgdir}/usr/share/webapps/${pkgname}/www
+ chown -Rh http:http ${pkgdir}/usr/share/webapps/${pkgname}
+
# Link ZM_WEBDIR/api/app/tmp to ZM_TMPDIR
- ln -sf /var/tmp/$pkgname $pkgdir/srv/$pkgname/www/api/app/tmp
-
+ ln -sf /var/tmp/${pkgname} ${pkgdir}/usr/share/webapps/${pkgname}/www/api/app/tmp
+
# Temporary fix for hardcoded /zm/ links (credit goes to @Kubax on AUR)
- ln -sf /srv/$pkgname/www $pkgdir/srv/$pkgname/www/zm
-
+ ln -sf /usr/share/webapps/${pkgname}/www ${pkgdir}/usr/share/webapps/${pkgname}/www/zm
+
# Set correct permissions for ZM_CONFIG_DIR & ZM_CONFIG_SUBDIR
- chmod -R 755 $pkgdir/etc/$pkgname
- chmod 644 $pkgdir/etc/$pkgname/zm.conf
- chmod 644 $pkgdir/etc/$pkgname/conf.d/*
-
- # Install Nginx conf file
- install -Dm644 $srcdir/$pkgname-nginx.conf $pkgdir/etc/nginx/sites-available/$pkgname.conf
-
- # Install Apache conf file
- install -Dm644 $srcdir/$pkgname-httpd.conf $pkgdir/etc/httpd/conf/extra/$pkgname.conf
-
- # Install PHP-FPM ini file
- install -Dm644 $srcdir/$pkgname-php.ini $pkgdir/etc/php/conf.d/$pkgname.ini
-
- # Install systemd service
- install -Dm644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
-
- # Install systemd tmpfile
- install -Dm644 $srcdir/$pkgname-tmpfile.conf $pkgdir/usr/lib/tmpfiles.d/$pkgname.conf
-
- # Install fcgiwrap-multiwatch service
- install -Dm644 $srcdir/fcgiwrap-multiwatch.service $pkgdir/usr/lib/systemd/system/fcgiwrap-multiwatch.service
-
- # Install logrotate conf file
- install -Dm644 misc/logrotate.conf $pkgdir/etc/logrotate.d/$pkgname
-
- # Copy default database schemas
- install -Dm644 db/zm*.sql $pkgdir/usr/share/$pkgname/db
+ chmod -R 755 ${pkgdir}/etc/${pkgname}
+ chmod 644 ${pkgdir}/etc/${pkgname}/zm.conf
+ chmod 644 ${pkgdir}/etc/${pkgname}/conf.d/*
+
+ # Nginx
+ install -Dm644 $srcdir/${pkgname}-nginx.conf ${pkgdir}/etc/nginx/sites-available/${pkgname}.conf
+
+ # Apache
+ install -Dm644 $srcdir/${pkgname}-httpd.conf ${pkgdir}/etc/httpd/conf/extra/${pkgname}.conf
+
+ # php.ini extension
+ install -Dm644 $srcdir/${pkgname}-php.ini ${pkgdir}/etc/php/conf.d/${pkgname}.ini
+
+ # fcgiwrap-multiwatch service
+ install -Dm644 $srcdir/fcgiwrap-multiwatch.service ${pkgdir}/usr/lib/systemd/system/fcgiwrap-multiwatch.service
+
+ # systemd service
+ install -Dm644 misc/${pkgname}.service ${pkgdir}/usr/lib/systemd/system/${pkgname}.service
+
+ # systemd tmpfile
+ install -Dm644 misc/${pkgname}-tmpfiles.conf ${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf
+
+ # logrotate conf file
+ install -Dm644 misc/logrotate.conf ${pkgdir}/etc/logrotate.d/${pkgname}
+
+ # database schemas
+ install -Dm644 db/zm*.sql ${pkgdir}/usr/share/${pkgname}/db
}
diff --git a/zoneminder-httpd.conf b/zoneminder-httpd.conf
index 45ec9d93ecc2..7ddfedc69e76 100644
--- a/zoneminder-httpd.conf
+++ b/zoneminder-httpd.conf
@@ -1,15 +1,15 @@
Listen 8095
<VirtualHost *:8095>
- DocumentRoot /srv/zoneminder/www
+ DocumentRoot /usr/share/webapps/zoneminder/www
# PHP handler
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost/"
</FilesMatch>
- ScriptAlias /cgi-bin /srv/zoneminder/cgi-bin
- <Directory /srv/zoneminder/cgi-bin>
+ ScriptAlias /cgi-bin /usr/share/webapps/zoneminder/cgi-bin
+ <Directory /usr/share/webapps/zoneminder/cgi-bin>
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AllowOverride None
Require all granted
@@ -22,32 +22,32 @@ Listen 8095
Require all granted
</Directory>
- <Directory /srv/zoneminder/www>
+ <Directory /usr/share/webapps/zoneminder/www>
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted
DirectoryIndex index.php
</Directory>
- <Directory /srv/zoneminder/www/api>
+ <Directory /usr/share/webapps/zoneminder/www/api>
RewriteEngine On
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
RewriteBase /api
</Directory>
- <Directory /srv/zoneminder/www/api/app>
+ <Directory /usr/share/webapps/zoneminder/www/api/app>
RewriteEngine On
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
RewriteBase /api
</Directory>
- <Directory /srv/zoneminder/www/api/app/webroot>
+ <Directory /usr/share/webapps/zoneminder/www/api/app/webroot>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteBase /api
</Directory>
-</VirtualHost> \ No newline at end of file
+</VirtualHost>
diff --git a/zoneminder-nginx.conf b/zoneminder-nginx.conf
index 824146f66dc1..b1d394a33e3c 100644
--- a/zoneminder-nginx.conf
+++ b/zoneminder-nginx.conf
@@ -1,7 +1,7 @@
server {
listen 8095;
- root /srv/zoneminder/www;
+ root /usr/share/webapps/zoneminder/www;
index index.php;
diff --git a/zoneminder-php.ini b/zoneminder-php.ini
index 2aecc0e1a701..468193b3d9da 100644
--- a/zoneminder-php.ini
+++ b/zoneminder-php.ini
@@ -2,9 +2,8 @@ extension=apcu
extension=ftp
extension=gd
extension=gettext
+extension=intl
extension=pdo_mysql
extension=sockets
extension=sysvsem
extension=zip
-
-date.timezone = PLACEHOLDER
diff --git a/zoneminder-tmpfile.conf b/zoneminder-tmpfile.conf
deleted file mode 100644
index c2e27aa1e62c..000000000000
--- a/zoneminder-tmpfile.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-D /run/zoneminder 0775 http http
-D /var/tmp/zoneminder 0775 http http
diff --git a/zoneminder.install b/zoneminder.install
index e96d3c15a0b6..986c99774847 100644
--- a/zoneminder.install
+++ b/zoneminder.install
@@ -1,254 +1,50 @@
post_install() {
echo
-
- systemctl daemon-reload
-
- ### Nginx & Apache ###
-
- # If Nginx is installed and either is active, or is inactive but Apache is not installed, we prefer Nginx.
- if [[ "$(pacman -Qs nginx)" = *"local/nginx"* ]] && { [ "$(systemctl is-active nginx)" = "active" ] || [[ "$(pacman -Qs apache)" != *"local/apache"* ]] ; }
- then
- # Ensure the main conf file is present
- if [ -f /etc/nginx/nginx.conf ]
- then
- # Configure Nginx with the folder structure used in Debian-based distributions
- if ( ! grep -q 'sites-enabled' /etc/nginx/nginx.conf )
- then
- sed -i 's|http {|http {\'$'\n include sites-enabled/*.conf;|g' /etc/nginx/nginx.conf
- fi
-
- # Create the sites-enabled folder if it's not already created
- if [ ! -d /etc/nginx/sites-enabled ]
- then
- mkdir -p /etc/nginx/sites-enabled
- fi
-
- # Enable ZoneMinder's server block if it's not already enabled
- if [ ! -f /etc/nginx/sites-enabled/zoneminder.conf ]
- then
- ln -sf /etc/nginx/sites-{available,enabled}/zoneminder.conf
- fi
-
- # (Re)start Nginx
- systemctl is-active --quiet nginx && systemctl stop nginx
- systemctl start nginx
- else
- echo "ERROR: Nginx was detected but file '/etc/nginx/nginx.conf' was not found. Something seems broken."
- echo
- fi
- # Else, if Nginx either is not installed, or is installed and inactive but Apache is also installed (no matter if it's active or not), we prefer Apache.
- elif [[ "$(pacman -Qs apache)" = *"local/apache"* ]]
- then
- # Ensure the main conf file is present
- if [ -f /etc/httpd/conf/httpd.conf ]
- then
- # Enable mod_proxy
- sed -i 's|#LoadModule proxy_module modules/mod_proxy.so|LoadModule proxy_module modules/mod_proxy.so|g' /etc/httpd/conf/httpd.conf
- # Enable mod_proxy_fcgi
- sed -i 's|#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so|LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so|g' /etc/httpd/conf/httpd.conf
- # Enable mod_rewrite
- sed -i 's|#LoadModule rewrite_module modules/mod_rewrite.so|LoadModule rewrite_module modules/mod_rewrite.so|g' /etc/httpd/conf/httpd.conf
- # Enable mod_cgid
- sed -i 's|#LoadModule cgid_module modules/mod_cgid.so|LoadModule cgid_module modules/mod_cgid.so|g' /etc/httpd/conf/httpd.conf
-
- # Enable ZoneMinder's VirtualHost if it's not already enabled
- if ( ! grep -q 'zoneminder.conf' /etc/httpd/conf/httpd.conf )
- then
- echo "Include conf/extra/zoneminder.conf" >> /etc/httpd/conf/httpd.conf
- fi
-
- # (Re)start Apache
- systemctl is-active --quiet httpd && systemctl stop httpd
- systemctl start httpd
- else
- echo "ERROR: Apache was detected but file '/etc/httpd/conf/httpd.conf' was not found. Something seems broken."
- echo
- fi
- # Else, if neither of them is installed, we inform the user that something is seriously messed up.
- else
- echo "WARNING: Neither Nginx nor Apache were detected in your system. I hope you know what you're doing."
- echo
- fi
-
- ### fcgiwrap ###
-
- # By default fcgiwrap is configured to launch in 10 instances via spawn-fcgi and multiwatch. This should be
- # enough for ZoneMinder to operate with 3 cameras. If you need more than 10 simultaneous CGI threads, edit the
- # provided fcgiwrap-multiwatch.service file and increase the number of instances to whatever suits your needs.
-
- if [[ "$(pacman -Qs fcgiwrap)" = *"local/fcgiwrap"* ]]
- then
- systemctl is-active --quiet fcgiwrap.socket && systemctl stop fcgiwrap.socket
- systemctl is-active --quiet fcgiwrap && systemctl stop fcgiwrap
- systemctl is-active --quiet fcgiwrap-multiwatch && systemctl stop fcgiwrap-multiwatch
- systemctl start fcgiwrap-multiwatch
- fi
-
- ### PHP-FPM ###
-
- # To avoid modifying the global 'php.ini' file, this package uses a separate 'conf.d/zoneminder.ini' in order to apply
- # some PHP settings that ZoneMinder needs to function properly, namely to load some PHP modules and to set the correct
- # timezone.
- #
- # This has the side effect that any further changes to these specific PHP settings that have been overriden (i.e. to change
- # the timezone or to disable one of the modules) will either need to be made inside 'conf.d/zoneminder.ini', or that file
- # will have to be modified so it no longer overrides them.
- #
- # Modifying the global 'php.ini' on its own will have NO EFFECT as far as these settings are concerned.
-
- # Set local timezone in /etc/php/conf.d/zoneminder.ini
- sed -i 's|PLACEHOLDER|'`timedatectl | grep "Time zone" | tr -s ' ' | cut -f4 -d ' '`'|g' /etc/php/conf.d/zoneminder.ini
-
- if [[ "$(pacman -Qs php-fpm)" = *"local/php-fpm"* ]]
- then
- systemctl is-active --quiet php-fpm && systemctl stop php-fpm
- systemctl start php-fpm
- fi
-
- ### MariaDB ###
-
- # If MariaDB is installed
- if [[ "$(pacman -Qs mariadb)" = *"local/mariadb "* ]]
- then
- # Initialize MariaDB's default database if it's not already initialized
- if [ ! -d /var/lib/mysql/mysql ]
- then
- # Stop MariaDB if it's active
- systemctl is-active --quiet mariadb && systemctl stop mariadb
- mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql 2> /dev/null
- fi
-
- # Start MariaDB if it's not already active
- systemctl is-active --quiet mariadb || systemctl start mariadb
-
- # Create ZoneMinder's database & user if they do not exist
- if [ ! -d /var/lib/mysql/zm ]
- then
- # Check for database root password
- if [[ "$(mysql -uroot -e "select * from mysql.user;" 2>&1)" = *"Access denied"* ]]
- then
- # If a database root password is set
- echo "* Secure MariaDB installation found, please enter the database root password."
- echo
- mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
- echo
- echo "* Enter the password one more time..."
- echo
- mysql -uroot -p -e "grant select,insert,update,delete,create,drop,alter,index,lock tables,alter routine,create routine,trigger,execute on zm.* to 'zmuser'@localhost identified by 'zmpass';"
- echo
- else
- # If a database root password is not set
- mysql -uroot < /usr/share/zoneminder/db/zm_create.sql
- mysql -uroot -e "grant select,insert,update,delete,create,drop,alter,index,lock tables,alter routine,create routine,trigger,execute on zm.* to 'zmuser'@localhost identified by 'zmpass';"
- fi
- fi
- fi
-
- ### ZoneMinder ###
-
- systemctl is-active --quiet zoneminder && systemctl stop zoneminder
- systemd-tmpfiles --create
- systemctl start --quiet zoneminder &&
- {
- echo "---------------"
- echo
-
- if [[ "$(systemctl is-active nginx)" = active ]] || [[ "$(systemctl is-active httpd)" = active ]]
- then
- echo "ZoneMinder is listening at http://localhost:8095"
- echo
- else
- echo "WARNING: ZoneMinder is running, but no web server has been configured."
- echo
- fi
- echo
- }
+ echo " ZoneMinder has been installed but some additional steps are required:"
+ echo
+ echo "1) You will need to install a MySQL-compatible database server and create a database and user"
+ echo " for ZoneMinder's use."
+ echo
+ echo "2) You will need to install a web server and configure it to serve ZoneMinder's web interface,"
+ echo " located at /usr/share/webapps/zoneminder/. Premade configurations are provided for Apache and"
+ echo " Nginx; you can find them at /etc/httpd/conf/extra for Apache and /etc/nginx/sites-available for"
+ echo " Nginx."
+ echo
+ echo "3) If you choose to use Nginx, you will also need to install fcgiwrap, spawn-fcgi and multiwatch"
+ echo " and then start the following systemd service (provided by this package):"
+ echo
+ echo " * fcgiwrap-multiwatch.service"
+ echo
+ echo "4) After the previous steps are complete, you will also need to refresh systemd's tmpfiles."
+ echo
+ echo
+ echo " More information on how to setup and use ZoneMinder can be obtained at the following links:"
+ echo
+ echo " * https://wiki.archlinux.org/title/ZoneMinder"
+ echo " * https://zoneminder.readthedocs.io/en/latest/"
+ echo
}
post_upgrade() {
- # Parse zm.conf and all custom configuration files
- . /etc/zoneminder/zm.conf
- for CONF in /etc/zoneminder/conf.d/*.conf; do
- . $CONF
- done
-
- # Check if we're running a local database server
- if [ "$ZM_DB_HOST" = "localhost" ] || [[ "$ZM_DB_HOST" = "127.0.0.1"* ]]; then
- systemctl daemon-reload
-
- # Make sure MariaDB is running before we attempt to use the updater
- systemctl is-active --quiet mariadb || systemctl start mariadb
-
- # Make sure ZoneMinder is *not* running before we attempt to use the updater
- systemctl is-active --quiet zoneminder && systemctl stop zoneminder
-
- echo
- echo "---------------"
-
- # Temporary solution to apply new privileges on preexisting user & database
- # Check for database root password
- if [[ "$(mysql -uroot -e "select * from mysql.user;" 2>&1)" = *"Access denied"* ]]
- then
- # If a database root password is set
- echo
- echo "* Secure MariaDB installation found, please enter the database root password."
- echo
- mysql -uroot -p -e "grant select,insert,update,delete,create,drop,alter,index,lock tables,alter routine,create routine,trigger,execute on zm.* to 'zmuser'@localhost identified by 'zmpass';"
- else
- # If a database root password is not set
- mysql -uroot -e "grant select,insert,update,delete,create,drop,alter,index,lock tables,alter routine,create routine,trigger,execute on zm.* to 'zmuser'@localhost identified by 'zmpass';"
- fi
-
- # Run the updater
- /usr/bin/zmupdate.pl --nointeractive
- /usr/bin/zmupdate.pl --nointeractive --freshen > /dev/null 2>&1
-
- # Update PTZ control presets
- /usr/bin/zmcamtool.pl --import > /dev/null 2>&1
-
- systemctl start zoneminder
- else
- echo
- echo "---------------"
- echo
- echo "Multiserver setup detected, database update skipped."
- fi
-
- post_install
+ echo
+ echo "ZoneMinder's database needs to be updated. As the root user, run the following:"
+ echo
+ echo "/usr/bin/zmupdate.pl --nointeractive"
+ echo "/usr/bin/zmupdate.pl --nointeractive --freshen > /dev/null 2>&1"
+ echo
+ echo "To also update the PTZ camera control presets, run the following:"
+ echo
+ echo "/usr/bin/zmcamtool.pl --import > /dev/null 2>&1"
+ echo
}
post_remove() {
- systemctl daemon-reload && systemctl is-active --quiet zoneminder && systemctl stop zoneminder
-
- # Disable ZoneMinder's Apache VirtualHost
- if [ -f /etc/httpd/conf/httpd.conf ]
- then
- sed -i '/zoneminder.conf/d' /etc/httpd/conf/httpd.conf
- fi
-
- # Disable ZoneMinder's Nginx server block
- if [ -h /etc/nginx/sites-enabled/zoneminder.conf ]
- then
- rm /etc/nginx/sites-enabled/zoneminder.conf
-
- # If the sites-enabled directory is empty, remove it as well and also remove reference in nginx.conf
- if [ -z "$(ls -A /etc/nginx/sites-enabled)" ]
- then
- rm -r /etc/nginx/sites-enabled
- sed -i '/sites-enabled/d' /etc/nginx/nginx.conf
- fi
- fi
-
- # Notify user about ZoneMinder's database and user not being removed
- if [ -d /var/lib/mysql/zm ]
- then
- echo
- echo "ZoneMinder's database and user have been left intact. You can remove them by running the following:"
- echo
- echo "mysql -uroot -p -e \"drop database zm;\""
- echo "mysql -uroot -p -e \"drop user 'zmuser'@localhost;\""
- echo
- echo "If you haven't yet configured a password for the database root user, omit the '-p' option."
- echo
- fi
+ echo
+ echo "ZoneMinder's database and user have been left intact. You can remove them by running the following:"
+ echo
+ echo "mysql -uroot -p -e \"drop database zm;\""
+ echo "mysql -uroot -p -e \"drop user 'zmuser'@localhost;\""
+ echo
+ echo "If you haven't yet configured a password for the database root user, omit the '-p' option."
+ echo
}
diff --git a/zoneminder.service b/zoneminder.service
deleted file mode 100644
index 46ec4b2452df..000000000000
--- a/zoneminder.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=ZoneMinder - CCTV Monitoring and Recording System
-After=network.target mariadb.service
-Wants=mariadb.service
-
-[Service]
-User=http
-Type=forking
-ExecStart=/usr/bin/zmpkg.pl start
-ExecReload=/usr/bin/zmpkg.pl restart
-ExecStop=/usr/bin/zmpkg.pl stop
-PIDFile=/run/zoneminder/zm.pid
-Environment=TZ=:/etc/localtime
-
-[Install]
-WantedBy=multi-user.target