From a423f2620eb19f4605c84af7b57e1571fc6c2e0e Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 18 Jun 2021 12:12:01 -0500 Subject: [PATCH] Allow cakephp cache engine to be set during build --- CMakeLists.txt | 6 ++++++ distros/redhat/zoneminder.spec | 12 +++++------- web/api/app/Config/bootstrap.php.in | 2 +- web/api/app/Plugin/Crud | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 700c80a20..920a0e43f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,8 +189,14 @@ set(ZM_MANPAGE_DEST_PREFIX "share/man" CACHE PATH "Relative path used to install ZoneMinder's Man pages into a non-standard folder. Most Linux users will not need to change this. BSD users may need to set this.") +set(ZM_CAKEPHP_CACHE "Apc" CACHE STRING + "Set the CakePHP cache engine, default: Apc") # Reassign some variables if a target distro has been specified +if(ZM_TARGET_DISTRO MATCHES "^fc") + set(ZM_CAKEPHP_CACHE "Memcached") +endif() + if((ZM_TARGET_DISTRO MATCHES "^el") OR (ZM_TARGET_DISTRO MATCHES "^fc")) set(ZM_RUNDIR "/var/run/zoneminder") set(ZM_SOCKDIR "/var/lib/zoneminder/sock") diff --git a/distros/redhat/zoneminder.spec b/distros/redhat/zoneminder.spec index 0d3537e88..dde459933 100644 --- a/distros/redhat/zoneminder.spec +++ b/distros/redhat/zoneminder.spec @@ -17,11 +17,6 @@ # This will tell zoneminder's cmake process we are building against a known distro %global zmtargetdistro %{?rhel:el%{rhel}}%{!?rhel:fc%{fedora}} -# Fedora needs apcu backwards compatibility module -%if 0%{?fedora} -%global with_apcu_bc 1 -%endif - # Newer php's keep json functions in a subpackage %if 0%{?fedora} || 0%{?rhel} >= 8 %global with_php_json 1 @@ -116,8 +111,8 @@ Requires: php-mysqli Requires: php-common Requires: php-gd %{?with_php_json:Requires: php-json} -Requires: php-pecl-apcu -%{?with_apcu_bc:Requires: php-pecl-apcu-bc} +%{?fedora:Requires: php-pecl-memcached} +%{?rhel:Requires: php-pecl-apcu} Requires: cambozola Requires: net-tools Requires: psmisc @@ -425,6 +420,9 @@ ln -sf %{_sysconfdir}/zm/www/zoneminder.nginx.conf %{_sysconfdir}/zm/www/zonemin %dir %attr(755,nginx,nginx) %{_localstatedir}/log/zoneminder %changelog +* Fri Jun 18 2021 Andrew Bauer - 1.36.4-2 +- apcu-bc deprecated on fedora, use memcached instead + * Tue Jun 08 2021 Andrew Bauer - 1.36.4-1 - 1.36.4 release diff --git a/web/api/app/Config/bootstrap.php.in b/web/api/app/Config/bootstrap.php.in index 894b3ec00..9751abd60 100644 --- a/web/api/app/Config/bootstrap.php.in +++ b/web/api/app/Config/bootstrap.php.in @@ -23,7 +23,7 @@ */ // Setup a 'default' cache configuration for use in the application. -Cache::config('default', array('engine' => 'Apc')); +Cache::config('default', array('engine' => '@ZM_CAKEPHP_CACHE@')); /** * The settings below can be used to set additional paths to models, views and controllers. diff --git a/web/api/app/Plugin/Crud b/web/api/app/Plugin/Crud index 14292374c..0bd63fb46 160000 --- a/web/api/app/Plugin/Crud +++ b/web/api/app/Plugin/Crud @@ -1 +1 @@ -Subproject commit 14292374ccf1328f2d5db20897bd06f99ba4d938 +Subproject commit 0bd63fb464957080ead342db58ca9e01532cf1ef