From db293944c30dc56d6a8547cbec6a26967d012295 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sat, 21 Apr 2018 18:49:35 -0500 Subject: [PATCH 1/8] Update startpackpack.sh --- utils/packpack/startpackpack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/packpack/startpackpack.sh b/utils/packpack/startpackpack.sh index a58cc084f..a5f8c2787 100755 --- a/utils/packpack/startpackpack.sh +++ b/utils/packpack/startpackpack.sh @@ -341,7 +341,7 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${TRAVIS}" != "true" ]; then baseurl="https://${DEPLOYHOST}/el/${DIST}/x86_64/" reporpm="zmrepo" # Let repoquery determine the full url and filename to the latest zmrepo package - dlurl=`repoquery --archlist=noarch --repofrompath=zmpackpack,${baseurl} --repoid=zmpackpack --qf="%{location}" ${reporpm} 2> /dev/null` + dlurl=$(repoquery --archlist=noarch --repofrompath=zmpackpack,${baseurl} --repoid=zmpackpack --qf="%{location}" ${reporpm} 2>&1) else reporpm="rpmfusion-free-release" dlurl="https://download1.rpmfusion.org/free/${OS}/${reporpm}-${DIST}.noarch.rpm" From 4f7e0fedad103361839963deba207685acff1ec4 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sat, 21 Apr 2018 18:50:46 -0500 Subject: [PATCH 2/8] Update startpackpack.sh --- utils/packpack/startpackpack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/packpack/startpackpack.sh b/utils/packpack/startpackpack.sh index a5f8c2787..7f576077c 100755 --- a/utils/packpack/startpackpack.sh +++ b/utils/packpack/startpackpack.sh @@ -341,7 +341,7 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${TRAVIS}" != "true" ]; then baseurl="https://${DEPLOYHOST}/el/${DIST}/x86_64/" reporpm="zmrepo" # Let repoquery determine the full url and filename to the latest zmrepo package - dlurl=$(repoquery --archlist=noarch --repofrompath=zmpackpack,${baseurl} --repoid=zmpackpack --qf="%{location}" ${reporpm} 2>&1) + dlurl="$(repoquery --archlist=noarch --repofrompath=zmpackpack,${baseurl} --repoid=zmpackpack --qf="%{location}" ${reporpm} 2>&1)" else reporpm="rpmfusion-free-release" dlurl="https://download1.rpmfusion.org/free/${OS}/${reporpm}-${DIST}.noarch.rpm" From 35dcedb2ad180d859acff77aab90c6921a62d0b2 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sat, 21 Apr 2018 20:55:21 -0500 Subject: [PATCH 3/8] fix ftbs on el7 adds compiler support for PRIu64 --- src/zm_event.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index 927399670..2008132ef 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "zm.h" #include "zm_db.h" From f13d174ea5e313ae6770200ad6790354c8f16605 Mon Sep 17 00:00:00 2001 From: Andy Bauer Date: Sat, 21 Apr 2018 21:49:04 -0500 Subject: [PATCH 4/8] remove support for el6 from the buildsystem --- .travis.yml | 2 -- utils/packpack/startpackpack.sh | 27 +++------------------------ 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index 74f686caf..78167f860 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,8 +35,6 @@ env: global: - SMPFLAGS=-j4 matrix: - - OS=el DIST=6 - - OS=el DIST=6 ARCH=i386 DOCKER_REPO=knnniggett/packpack - OS=el DIST=7 - OS=fedora DIST=26 DOCKER_REPO=knnniggett/packpack - OS=fedora DIST=27 DOCKER_REPO=knnniggett/packpack diff --git a/utils/packpack/startpackpack.sh b/utils/packpack/startpackpack.sh index 7f576077c..91e671f2e 100755 --- a/utils/packpack/startpackpack.sh +++ b/utils/packpack/startpackpack.sh @@ -19,20 +19,7 @@ checksanity () { exit 1 fi done - - if [ "${OS}" == "el" ] && [ "${DIST}" == "6" ]; then - type repoquery 2>&1 > /dev/null - - if [ $? -ne 0 ]; then - echo - echo "ERROR: The script cannot find the required command \"reqoquery\"." - echo "This command is required in order to build ZoneMinder on el6." - echo "Please install the \"yum-utils\" package then try again." - echo - exit 1 - fi - fi - + # Verify OS & DIST environment variables have been set before calling this script if [ -z "${OS}" ] || [ -z "${DIST}" ]; then echo "ERROR: both OS and DIST environment variables must be set" @@ -336,16 +323,8 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${TRAVIS}" != "true" ]; then rm -rf web/api/app/Plugin/Crud mkdir web/api/app/Plugin/Crud - # We use zmrepo to build el6 only. All other redhat distros use rpm fusion - if [ "${OS}" == "el" ] && [ "${DIST}" == "6" ]; then - baseurl="https://${DEPLOYHOST}/el/${DIST}/x86_64/" - reporpm="zmrepo" - # Let repoquery determine the full url and filename to the latest zmrepo package - dlurl="$(repoquery --archlist=noarch --repofrompath=zmpackpack,${baseurl} --repoid=zmpackpack --qf="%{location}" ${reporpm} 2>&1)" - else - reporpm="rpmfusion-free-release" - dlurl="https://download1.rpmfusion.org/free/${OS}/${reporpm}-${DIST}.noarch.rpm" - fi + reporpm="rpmfusion-free-release" + dlurl="https://download1.rpmfusion.org/free/${OS}/${reporpm}-${DIST}.noarch.rpm" # Give our downloaded repo rpm a common name so redhat_package.mk can find it if [ -n "$dlurl" ] && [ $? -eq 0 ]; then From 02f8493b394ec4f3c2e0f9fe5d931c634387ff16 Mon Sep 17 00:00:00 2001 From: Andy Bauer Date: Sun, 22 Apr 2018 07:25:06 -0500 Subject: [PATCH 5/8] rpm packaging - remove support for sysvinit aka el6 --- CMakeLists.txt | 2 +- distros/redhat/CMakeLists.txt | 36 ++-- distros/redhat/readme/README.Redhat6 | 180 ------------------ distros/redhat/sysvinit/zoneminder.in | 121 ------------ .../redhat/sysvinit/zoneminder.logrotate.in | 7 - distros/redhat/zoneminder.spec | 85 ++------- 6 files changed, 28 insertions(+), 403 deletions(-) delete mode 100644 distros/redhat/readme/README.Redhat6 delete mode 100644 distros/redhat/sysvinit/zoneminder.in delete mode 100644 distros/redhat/sysvinit/zoneminder.logrotate.in diff --git a/CMakeLists.txt b/CMakeLists.txt index b24bc6fa8..c847e06a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,7 +207,7 @@ set(ZM_PERL_SEARCH_PATH "" CACHE PATH where ZM_PERL_MM_PARMS has been modified such that ZoneMinder's Perl modules are installed outside Perl's default search path.") set(ZM_TARGET_DISTRO "" CACHE STRING - "Build ZoneMinder for a specific distribution. Currently, valid names are: fc24, fc25, el6, el7, OS13, FreeBSD") + "Build ZoneMinder for a specific distribution. Currently, valid names are: fc27, fc26, el7, OS13, FreeBSD") set(ZM_SYSTEMD "OFF" CACHE BOOL "Set to ON to force building ZM with systemd support. default: OFF") diff --git a/distros/redhat/CMakeLists.txt b/distros/redhat/CMakeLists.txt index ba8aba9c0..e42c5db61 100644 --- a/distros/redhat/CMakeLists.txt +++ b/distros/redhat/CMakeLists.txt @@ -14,24 +14,18 @@ if((NOT ZM_TARGET_DISTRO MATCHES "^fc") AND (ZM_WEB_USER STREQUAL "nginx")) endif((NOT ZM_TARGET_DISTRO MATCHES "^fc") AND (ZM_WEB_USER STREQUAL "nginx")) # Configure the zoneminder service files -if(ZM_TARGET_DISTRO STREQUAL "el6") - configure_file(sysvinit/zoneminder.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.sysvinit @ONLY) - configure_file(sysvinit/zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY) +configure_file(systemd/zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY) +if(ZM_WEB_USER STREQUAL "nginx") + configure_file(nginx/zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY) + configure_file(nginx/zoneminder.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.conf @ONLY) + configure_file(nginx/zoneminder.tmpfiles.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.tmpfiles @ONLY) + configure_file(nginx/zoneminder.php-fpm.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.php-fpm.conf @ONLY) + configure_file(nginx/README.Fedora ${CMAKE_CURRENT_SOURCE_DIR}/readme/README.Fedora COPYONLY) +else(ZM_WEB_USER STREQUAL "nginx") + configure_file(systemd/zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY) configure_file(apache/zoneminder.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.conf @ONLY) -else(ZM_TARGET_DISTRO STREQUAL "el6") - configure_file(systemd/zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY) - if(ZM_WEB_USER STREQUAL "nginx") - configure_file(nginx/zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY) - configure_file(nginx/zoneminder.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.conf @ONLY) - configure_file(nginx/zoneminder.tmpfiles.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.tmpfiles @ONLY) - configure_file(nginx/zoneminder.php-fpm.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.php-fpm.conf @ONLY) - configure_file(nginx/README.Fedora ${CMAKE_CURRENT_SOURCE_DIR}/readme/README.Fedora COPYONLY) - else(ZM_WEB_USER STREQUAL "nginx") - configure_file(systemd/zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY) - configure_file(apache/zoneminder.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.conf @ONLY) - configure_file(systemd/zoneminder.tmpfiles.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.tmpfiles @ONLY) - endif(ZM_WEB_USER STREQUAL "nginx") -endif(ZM_TARGET_DISTRO STREQUAL "el6") + configure_file(systemd/zoneminder.tmpfiles.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.tmpfiles @ONLY) +endif(ZM_WEB_USER STREQUAL "nginx") # Unpack jscalendar & move files into position message(STATUS "Unpacking and Installing jscalendar...") @@ -74,10 +68,6 @@ if(ZM_WEB_USER STREQUAL "nginx") install(FILES zoneminder.php-fpm.conf DESTINATION /etc/php-fpm.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME zoneminder.conf) endif(ZM_WEB_USER STREQUAL "nginx") -if(ZM_TARGET_DISTRO STREQUAL "el6") - install(FILES zoneminder.sysvinit DESTINATION /etc/rc.d/init.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) -else(ZM_TARGET_DISTRO STREQUAL "el6") - install(FILES zoneminder.service DESTINATION /usr/lib/systemd/system PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) - install(FILES zoneminder.tmpfiles DESTINATION /usr/lib/tmpfiles.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) -endif(ZM_TARGET_DISTRO STREQUAL "el6") +install(FILES zoneminder.service DESTINATION /usr/lib/systemd/system PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) +install(FILES zoneminder.tmpfiles DESTINATION /usr/lib/tmpfiles.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) diff --git a/distros/redhat/readme/README.Redhat6 b/distros/redhat/readme/README.Redhat6 deleted file mode 100644 index 95c063b10..000000000 --- a/distros/redhat/readme/README.Redhat6 +++ /dev/null @@ -1,180 +0,0 @@ -What's New -========== - -1. See the ZoneMinder release notes for a list of new features: - https://github.com/ZoneMinder/zoneminder/releases - -2. ***EOL NOTICE*** - It has become increasingly difficult to maintain the ZoneMinder project such - that it remains compatible with EL6 distros. The version of php shipped with - EL6 distros and the version of ffmpeg which will build against EL6 are too - old. It is with regret that I must announce our plans to stop supporting - ZoneMinder on EL6 distros soon. Your best option is to upgrade to an EL7 - distro or another distro with newer php & ffmpeg packages. Please note that - replacing core packages, such as php, will not be supported by us. You are - on your own should you choose to go down that path. - -3. The php package that ships with CentOS 6 does not support the new ZoneMinder - API. If you require API functionality (such as using a mobile app) then you - should consider an upgrade to CentOS 7 or use Fedora. - -New installs -============ - -1. Unless you are already using MySQL server, you need to ensure that - the server is confired to start during boot and properly secured - by running: - - sudo yum install mysql-server - sudo service mysqld start - /usr/bin/mysql_secure_installation - sudo chkconfig mysqld on - -2. Using the password for the root account set during the previous step, you - will need to create the ZoneMinder database and configure a database - account for ZoneMinder to use: - - mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql - mysql -uroot -p -e "grant all on zm.* to \ - 'zmuser'@localhost identified by 'zmpass';" - mysqladmin -uroot -p reload - - The database account credentials, zmuser/zmpass, are arbitrary. Set them to - anything that suits your environment. - -3. If you have chosen to change the zoneminder database account credentials to - something other than zmuser/zmpass, you must now create a config file under - /etc/zm/conf.d and set your credentials there. For example, create the file - /etc/zm/conf.d/zm-db-user.conf and add the following content to it: - - ZM_DB_USER = {username of the sql account you want to use} - ZM_DB_PASS = {password of the sql account you want to use} - - Once the file has been saved, set proper file & ownership permissions on it: - - sudo chown root:apache *.conf - sudo chmod 640 *.conf - -4. Edit /etc/php.ini, uncomment the date.timezone line, and add your local - timezone. PHP will complain loudly if this is not set, or if it is set - incorrectly, and these complaints will show up in the zoneminder logging - system as errors - - If you are not sure of the proper timezone specification to use, look at - http://php.net/date.timezone - -5. Configure the web server - - This package uses the HTTPS protocol by default to access the web portal, - using rhe default self signed certificate on your system. Requests using - HTTP will auto-redirect to HTTPS. - - Inspect the web server configuration file and verify it meets your needs: - - /etc/zm/www/zoneminder.conf - - If you are running other web enabled services then you may need to edit - this file to suite. See README.https to learn about other alternatives. - - When in doubt, proceed with the default: - - sudo ln -s /etc/zm/www/zoneminder.conf /etc/httpd/conf.d/ - sudo dnf install mod_ssl - -6. Configure the web server to start automatically: - - sudo chkconfig httpd on - sudo service httpd start - -7. This package will automatically configure and install an SELinux policy - called local_zoneminder. A copy of this policy is in the documentation - folder. - - It is still possible to run into SELinux issues, however. If this is case, - you can disable SELinux permanently by editing the following: - - /etc/selinux/conf - - Change SELINUX line from "enforcing" to "disabled". This change will not - take effect until a reboot, however. To avoid a reboot, execute the - following from the commandline: - - sudo setenforce 0 - -8. Finally, you may start the ZoneMinder service: - - sudo service zoneminder start - - Then point your web browser to http:///zm - -9. Optionally configure the firewall - - All Redhat distros ship with the firewall enabled. That means you will not - be able to access the ZoneMinder web console from a remote machine until - changes are made to the firewall. - - What follows are a set of minimal commands to allow remote access to the - ZoneMinder web console and also allow ZoneMinder's ONVIF discovery to - work. The following commands do not put any restrictions on which remote - machine(s) have access to the listed ports or services. - - sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT - sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT - sudo iptables -A INPUT -p udp --dport 3702 -j ACCEPT - iptables-save | sudo tee /etc/sysconfig/iptables - - Additional changes to the firewall may be required, depending on your - security requirements and how you use the system. It is up to you to verify - these commands are sufficient. - -10. Access the ZoneMinder web console - - You may now access the ZoneMinder web console from your web browser using - an appropriate url. Here are some examples: - - http://localhost/zm (works from the local machine only) - http://{machine name}/zm (works only if dns is configured for your network) - http://{ip address}/zm - -Upgrades -======== - -1. Conf.d folder support has been added to ZoneMinder 1.31.0. Any custom - changes previously made to zm.conf must now be made in one or more custom - config files, created under the conf.d folder. Do this now. See - /etc/zm/conf.d/README for details. Once you recreate any custom config changes - under the conf.d folder, they will remain in place indefinitely. - -2. Verify permissions of the zmuser account. - - Over time, the database account permissions required for normal operation - have increased. Verify the zmuser database account has been granted all - permission to the ZoneMinder database: - - mysql -uroot -p -e "show grants for zmuser@localhost;" - - See step 2 of the Installation section to add missing permissions. - -3. Verify the ZoneMinder Apache configuration file in the folder - /etc/zm/www. You will have a file called "zoneminder.conf" and there - may also be a file called "zoneminder.conf.rpmnew". If the rpmnew file - exists, inspect it and merge anything new in that file with zoneminder.conf. - Verify the SSL REquirements meet your needs. Read README.https if necessary. - -4. Upgrade the database before starting ZoneMinder. - - Most upgrades can be performed by executing the following command: - - sudo zmupdate.pl - - Recent versions of ZoneMinder don't require any parameters added to the - zmupdate command. However, if ZoneMinder complains, you may need to call - zmupdate in the following manner: - - sudo zmupdate.pl --user=root --pass= --version= - -5. Now restart the web server then start zoneminder: - - sudo service httpd restart - sudo service zoneminder start - diff --git a/distros/redhat/sysvinit/zoneminder.in b/distros/redhat/sysvinit/zoneminder.in deleted file mode 100644 index f1c6c47c6..000000000 --- a/distros/redhat/sysvinit/zoneminder.in +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/sh -# description: ZoneMinder is the top Linux video camera security and surveillance solution. ZoneMinder is intended for use in single or multi-camera video security applications.Copyright: Philip Coombes, Corey DeLasaux 2003-2008 -# chkconfig: - 99 00 -# processname: zmpkg.pl - -# Source function library. -. /etc/rc.d/init.d/functions - -prog=ZoneMinder -ZM_CONFIG="@ZM_CONFIG@" -pidfile="@ZM_RUNDIR@" -LOCKFILE=/var/lock/subsys/zm - -loadconf() -{ - if [ -f $ZM_CONFIG ]; then - . $ZM_CONFIG - else - echo "ERROR: $ZM_CONFIG not found." - return 1 - fi -} - -loadconf -command="$ZM_PATH_BIN/zmpkg.pl" - -start() -{ -# Commenting out as it is not needed. Leaving as a placeholder for future use. -# zmupdate || return $? - loadconf || return $? - #Make sure the directory for our PID folder exists or create one. - [ ! -d $pidfile ] \ - && mkdir -m 774 $pidfile \ - && chown $ZM_WEB_USER:$ZM_WEB_GROUP $pidfile - #Make sure the folder for the socks file exists or create one - GetPath="select Value from Config where Name='ZM_PATH_SOCKS'" - dbHost=`echo $ZM_DB_HOST | cut -d: -f1` - dbPort=`echo $ZM_DB_HOST | cut -d: -s -f2` - if [ "$dbPort" = "" ] - then - ZM_PATH_SOCK=`echo $GetPath | mysql -B -h$ZM_DB_HOST -u$ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` - else - ZM_PATH_SOCK=`echo $GetPath | mysql -B -h$dbHost -P$dbPort -u$ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` - fi - [ ! -d $ZM_PATH_SOCK ] \ - && mkdir -m 774 $ZM_PATH_SOCK \ - && chown $ZM_WEB_USER:$ZM_WEB_GROUP $ZM_PATH_SOCK - echo -n $"Starting $prog: " - $command start - RETVAL=$? - [ $RETVAL = 0 ] && success || failure - echo - [ $RETVAL = 0 ] && touch $LOCKFILE - return $RETVAL -} - -stop() -{ - loadconf - echo -n $"Stopping $prog: " - $command stop - RETVAL=$? - [ $RETVAL = 0 ] && success || failure - echo - [ $RETVAL = 0 ] && rm -f $LOCKFILE -} - -zmstatus() -{ - loadconf - result=`$command status` - if [ "$result" = "running" ]; then - echo "ZoneMinder is running" - $ZM_PATH_BIN/zmu -l - RETVAL=0 - else - echo "ZoneMinder is stopped" - RETVAL=1 - fi -} - -zmupdate() -{ - if [ -x $ZM_PATH_BIN/zmupdate.pl ]; then - $ZM_PATH_BIN/zmupdate.pl -f - fi -} - - -case "$1" in - 'start') - start - ;; - 'stop') - stop - ;; - 'restart') - stop - start - ;; - 'condrestart') - loadconf - result=`$ZM_PATH_BIN/zmdc.pl check` - if [ "$result" = "running" ]; then - $ZM_PATH_BIN/zmdc.pl shutdown > /dev/null - rm -f $LOCKFILE - start - fi - ;; - 'status') - status httpd - status mysqld - zmstatus - ;; - *) - echo "Usage: $0 { start | stop | restart | condrestart | status }" - RETVAL=1 - ;; -esac -exit $RETVAL diff --git a/distros/redhat/sysvinit/zoneminder.logrotate.in b/distros/redhat/sysvinit/zoneminder.logrotate.in deleted file mode 100644 index daf0b908f..000000000 --- a/distros/redhat/sysvinit/zoneminder.logrotate.in +++ /dev/null @@ -1,7 +0,0 @@ -@ZM_LOGDIR@/*log -{ - weekly - notifempty - missingok - create 660 @WEB_USER@ @WEB_GROUP@ -} diff --git a/distros/redhat/zoneminder.spec b/distros/redhat/zoneminder.spec index d69469cd0..120a3a705 100644 --- a/distros/redhat/zoneminder.spec +++ b/distros/redhat/zoneminder.spec @@ -22,13 +22,6 @@ %global with_apcu_bc 1 %endif -# Include files for SysV init or systemd -%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 -%global with_init_systemd 1 -%else -%global with_init_sysv 1 -%endif - %global readme_suffix %{?rhel:Redhat%{?rhel}}%{!?rhel:Fedora} %global _hardened_build 1 @@ -49,12 +42,10 @@ Source0: https://github.com/ZoneMinder/ZoneMinder/archive/%{version}.tar.gz#/zon Source1: https://github.com/ZoneMinder/crud/archive/v%{crud_version}.tar.gz#/crud-%{crud_version}.tar.gz Source2: https://github.com/ZoneMinder/CakePHP-Enum-Behavior/archive/%{ceb_version}.tar.gz#/cakephp-enum-behavior-%{ceb_version}.tar.gz -%{?with_init_systemd:BuildRequires: systemd-devel} -%{?with_init_systemd:BuildRequires: mariadb-devel} -%{?with_init_systemd:BuildRequires: perl-podlators} -%{?with_init_systemd:BuildRequires: polkit-devel} -%{?with_init_sysv:BuildRequires: mysql-devel} -%{?el6:BuildRequires: epel-rpm-macros} +BuildRequires: systemd-devel +BuildRequires: mariadb-devel +BuildRequires: perl-podlators +BuildRequires: polkit-devel BuildRequires: cmake >= 2.8.7 BuildRequires: gnutls-devel BuildRequires: bzip2-devel @@ -119,19 +110,10 @@ Requires: perl(LWP::Protocol::https) Requires: ca-certificates Requires: zip -%{?with_init_systemd:Requires(post): systemd} -%{?with_init_systemd:Requires(post): systemd-sysv} -%{?with_init_systemd:Requires(preun): systemd} -%{?with_init_systemd:Requires(postun): systemd} - -%{?with_init_sysv:Requires(post): /sbin/chkconfig} -%{?with_init_sysv:Requires(post): %{_bindir}/checkmodule} -%{?with_init_sysv:Requires(post): %{_bindir}/semodule_package} -%{?with_init_sysv:Requires(post): %{_sbindir}/semodule} -%{?with_init_sysv:Requires(preun): /sbin/chkconfig} -%{?with_init_sysv:Requires(preun): /sbin/service} -%{?with_init_sysv:Requires(preun): %{_sbindir}/semodule} -%{?with_init_sysv:Requires(postun): /sbin/service} +Requires(post): systemd +Requires(post): systemd-sysv +Requires(preun): systemd +Requires(postun): systemd Requires(post): %{_bindir}/gpasswd Requires(post): %{_bindir}/less @@ -192,24 +174,10 @@ find %{buildroot}%{_datadir}/zoneminder/www/api \( -name cake -or -name cake.php %{__ln_s} ../../../../../../../..%{_sysconfdir}/pki/tls/certs/ca-bundle.crt %{buildroot}%{_datadir}/zoneminder/www/api/lib/Cake/Config/cacert.pem %post -%if 0%{?with_init_sysv} -/sbin/chkconfig --add zoneminder -/sbin/chkconfig zoneminder on - -# Create and load zoneminder selinux policy module -echo -e "\nCreating and installing a ZoneMinder SELinux policy module. Please wait.\n" -%{_bindir}/checkmodule -M -m -o %{_docdir}/%{name}-%{version}/local_zoneminder.mod %{_docdir}/%{name}-%{version}/local_zoneminder.te > /dev/null 2>&1 || : -%{_bindir}/semodule_package -o %{_docdir}/%{name}-%{version}/local_zoneminder.pp -m %{_docdir}/%{name}-%{version}/local_zoneminder.mod > /dev/null 2>&1 || : -%{_sbindir}/semodule -i %{_docdir}/%{name}-%{version}/local_zoneminder.pp > /dev/null 2>&1 || : - -%endif - -%if 0%{?with_init_systemd} # Initial installation if [ $1 -eq 1 ] ; then %systemd_post %{name}.service fi -%endif # Upgrade from a previous version of zoneminder if [ $1 -eq 2 ] ; then @@ -263,34 +231,11 @@ EOF %endif %preun -%if 0%{?with_init_sysv} -if [ $1 -eq 0 ]; then - /sbin/service zoneminder stop > /dev/null 2>&1 || : - /sbin/chkconfig --del zoneminder - echo -e "\nRemoving ZoneMinder SELinux policy module. Please wait.\n" - %{_sbindir}/semodule -r local_zoneminder.pp -fi -%endif - -%if 0%{?with_init_systemd} %systemd_preun %{name}.service -%endif %postun -%if 0%{?with_init_sysv} -if [ $1 -ge 1 ]; then - /sbin/service zoneminder condrestart > /dev/null 2>&1 || : -fi - -# Remove the doc folder. -rm -rf %{_docdir}/%{name}-%{version} -%endif - -%if 0%{?with_init_systemd} %systemd_postun_with_restart %{name}.service -%endif -%if 0%{?with_init_systemd} %triggerun -- zoneminder < 1.25.0-4 # Save the current service runlevel info # User must manually run systemd-sysv-convert --apply zoneminder @@ -300,7 +245,6 @@ rm -rf %{_docdir}/%{name}-%{version} # Run these because the SysV package being removed won't do them /sbin/chkconfig --del zoneminder >/dev/null 2>&1 || : /bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || : -%endif %files %license COPYING @@ -325,18 +269,11 @@ rm -rf %{_docdir}/%{name}-%{version} %config(noreplace) %{_sysconfdir}/php-fpm.d/zoneminder.conf %endif -%if 0%{?with_init_systemd} %{_tmpfilesdir}/zoneminder.conf %{_unitdir}/zoneminder.service %{_datadir}/polkit-1/actions/com.zoneminder.systemctl.policy %{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules %{_bindir}/zmsystemctl.pl -%endif - -%if 0%{?with_init_sysv} -%doc distros/redhat/misc/local_zoneminder.te -%attr(755,root,root) %{_initrddir}/zoneminder -%endif %{_bindir}/zma %{_bindir}/zmaudit.pl @@ -380,6 +317,12 @@ rm -rf %{_docdir}/%{name}-%{version} %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/run/zoneminder %changelog +* Sun Apr 22 2017 Andrew Bauer - 1.31.42-1 +- Remove support for sysvinit a.k.a. el6 +- use desktop-file-install for new zoneminder.desktop file +- add new web cache folder +- 1.31.42 development snapshot + * Tue May 09 2017 Andrew Bauer - 1.30.4-1 - modify autosetup macro parameters - modify requirements for php-pecl-acpu-bc package From 93263c40b463c18a2f546a21b174954314fdc3eb Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sun, 22 Apr 2018 07:30:28 -0500 Subject: [PATCH 6/8] Remove mention of el6 from readthedocs --- docs/installationguide/redhat.rst | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docs/installationguide/redhat.rst b/docs/installationguide/redhat.rst index fbbb7a5d8..327089380 100644 --- a/docs/installationguide/redhat.rst +++ b/docs/installationguide/redhat.rst @@ -45,8 +45,6 @@ The following notes are based on real problems which have occurred by those who How to Install ZoneMinder ------------------------- -These instructions apply to all redhat distros and compatible clones, except for RHEL/CentOS 6. - ZoneMinder releases are now being hosted at RPM Fusion. New users should navigate the `RPM Fusion site `_ then follow the instructions to enable that repo. RHEL/CentOS users must also navaigate to the `EPEL Site `_ and enable that repo as well. Once enabled, install ZoneMinder from the commandline: :: @@ -57,13 +55,6 @@ Note that RHEL/CentOS 7 users should use yum instead of dnf. Once ZoneMinder has been installed, it is critically important that you read the README file under /usr/share/doc/zoneminder. ZoneMinder will not run without completing the steps outlined in the README. -How to Install ZoneMinder on RHEL/CentOS 6 ------------------------------------------- - -We continue to encounter build problems, caused by the age of this distro. It is unforuntate, but we can see the writing on the wall. We do not have a date set, but the end of the line for this distros is near. - -Please be advised that we do not recommend any new ZoneMinder installations using CentOS 6. However, for the time being, ZoneMinder rpms will continue to be hosted at `zmrepo `_. - How to Install Nightly Development Builds ----------------------------------------- From 600b66e27c5ea600cc682a223b010e1cee37ee42 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Mon, 23 Apr 2018 07:41:36 -0500 Subject: [PATCH 7/8] Update zoneminder.spec --- distros/redhat/zoneminder.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/redhat/zoneminder.spec b/distros/redhat/zoneminder.spec index 120a3a705..9ef5b2606 100644 --- a/distros/redhat/zoneminder.spec +++ b/distros/redhat/zoneminder.spec @@ -317,7 +317,7 @@ EOF %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/run/zoneminder %changelog -* Sun Apr 22 2017 Andrew Bauer - 1.31.42-1 +* Sun Apr 22 2018 Andrew Bauer - 1.31.42-1 - Remove support for sysvinit a.k.a. el6 - use desktop-file-install for new zoneminder.desktop file - add new web cache folder From 0a24f8550affc3fd591e656303ea585dfcf58712 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Mon, 23 Apr 2018 08:59:31 -0500 Subject: [PATCH 8/8] Update path to zmtriggers.sql ZM_PATH_DATA is not configured as a make macro. Use @PKGDATADIR@ instead. --- db/zm_create.sql.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 9c237b8a0..0dad55059 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -891,7 +891,7 @@ INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('4 Wide', '{ "default":{ INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('5 Wide', '{ "default":{"float":"left", "width":"19%","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); -- We generally don't alter triggers, we drop and re-create them, so let's keep them in a separate file that we can just source in update scripts. -source @ZM_PATH_DATA@/db/triggers.sql +source @PKGDATADIR@/db/triggers.sql -- -- Apply the initial configuration --