Merge pull request #1563 from SteveGilvarry/feature-h264-videostorage
Merge Master to feature-h264-videostorage
This commit is contained in:
commit
d9292319fd
|
@ -147,10 +147,10 @@ set(ZM_PERL_SEARCH_PATH "" CACHE PATH
|
||||||
where ZM_PERL_MM_PARMS has been modified such that ZoneMinder's Perl modules are
|
where ZM_PERL_MM_PARMS has been modified such that ZoneMinder's Perl modules are
|
||||||
installed outside Perl's default search path.")
|
installed outside Perl's default search path.")
|
||||||
set(ZM_TARGET_DISTRO "" CACHE STRING
|
set(ZM_TARGET_DISTRO "" CACHE STRING
|
||||||
"Build ZoneMinder for a specific distribution. Currently, valid names are: f22, f23, el6, el7, OS13")
|
"Build ZoneMinder for a specific distribution. Currently, valid names are: f23, f24, el6, el7, OS13, FreeBSD")
|
||||||
|
|
||||||
# Reassign some variables if a target distro has been specified
|
# Reassign some variables if a target distro has been specified
|
||||||
if((ZM_TARGET_DISTRO STREQUAL "f22") OR (ZM_TARGET_DISTRO STREQUAL "f23"))
|
if((ZM_TARGET_DISTRO STREQUAL "f23") OR (ZM_TARGET_DISTRO STREQUAL "f24"))
|
||||||
set(ZM_RUNDIR "/var/run/zoneminder")
|
set(ZM_RUNDIR "/var/run/zoneminder")
|
||||||
set(ZM_SOCKDIR "/var/lib/zoneminder/sock")
|
set(ZM_SOCKDIR "/var/lib/zoneminder/sock")
|
||||||
set(ZM_TMPDIR "/var/lib/zoneminder/temp")
|
set(ZM_TMPDIR "/var/lib/zoneminder/temp")
|
||||||
|
@ -193,7 +193,7 @@ elseif(ZM_TARGET_DISTRO STREQUAL "FreeBSD")
|
||||||
set(ZM_WEBDIR "/usr/local/share/zoneminder/www")
|
set(ZM_WEBDIR "/usr/local/share/zoneminder/www")
|
||||||
set(ZM_CGIDIR "/usr/local/libexec/zoneminder/cgi-bin")
|
set(ZM_CGIDIR "/usr/local/libexec/zoneminder/cgi-bin")
|
||||||
set(ZM_PERL_MM_PARMS "INSTALLDIRS=site")
|
set(ZM_PERL_MM_PARMS "INSTALLDIRS=site")
|
||||||
endif((ZM_TARGET_DISTRO STREQUAL "f22") OR (ZM_TARGET_DISTRO STREQUAL "f23"))
|
endif((ZM_TARGET_DISTRO STREQUAL "f23") OR (ZM_TARGET_DISTRO STREQUAL "f24"))
|
||||||
|
|
||||||
# Required for certain checks to work
|
# Required for certain checks to work
|
||||||
set(CMAKE_EXTRA_INCLUDE_FILES
|
set(CMAKE_EXTRA_INCLUDE_FILES
|
||||||
|
@ -761,13 +761,13 @@ if(ZM_ONVIF)
|
||||||
endif(ZM_ONVIF)
|
endif(ZM_ONVIF)
|
||||||
|
|
||||||
# Process distro subdirectories
|
# Process distro subdirectories
|
||||||
if((ZM_TARGET_DISTRO STREQUAL "f22") OR (ZM_TARGET_DISTRO STREQUAL "f23"))
|
if((ZM_TARGET_DISTRO STREQUAL "f23") OR (ZM_TARGET_DISTRO STREQUAL "f24"))
|
||||||
add_subdirectory(distros/fedora)
|
add_subdirectory(distros/fedora)
|
||||||
elseif((ZM_TARGET_DISTRO STREQUAL "el6") OR (ZM_TARGET_DISTRO STREQUAL "el7"))
|
elseif((ZM_TARGET_DISTRO STREQUAL "el6") OR (ZM_TARGET_DISTRO STREQUAL "el7"))
|
||||||
add_subdirectory(distros/redhat)
|
add_subdirectory(distros/redhat)
|
||||||
elseif(ZM_TARGET_DISTRO STREQUAL "OS13")
|
elseif(ZM_TARGET_DISTRO STREQUAL "OS13")
|
||||||
add_subdirectory(distros/opensuse)
|
add_subdirectory(distros/opensuse)
|
||||||
endif((ZM_TARGET_DISTRO STREQUAL "f22") OR (ZM_TARGET_DISTRO STREQUAL "f23"))
|
endif((ZM_TARGET_DISTRO STREQUAL "f23") OR (ZM_TARGET_DISTRO STREQUAL "f24"))
|
||||||
|
|
||||||
# Print optional libraries detection status
|
# Print optional libraries detection status
|
||||||
message(STATUS "Optional libraries found:${optlibsfound}")
|
message(STATUS "Optional libraries found:${optlibsfound}")
|
||||||
|
|
|
@ -9,15 +9,17 @@ configure_file(zoneminder.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.conf @O
|
||||||
configure_file(zoneminder.tmpfiles.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.tmpfiles @ONLY)
|
configure_file(zoneminder.tmpfiles.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.tmpfiles @ONLY)
|
||||||
configure_file(zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY)
|
configure_file(zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY)
|
||||||
|
|
||||||
# Download jscalendar & move files into position
|
# Unpack jscalendar & move files into position
|
||||||
file(DOWNLOAD http://iweb.dl.sourceforge.net/project/jscalendar/jscalendar/1.0/jscalendar-1.0.zip ${CMAKE_CURRENT_SOURCE_DIR}/jscalendar-1.0.zip STATUS download_jsc)
|
message(STATUS "Unpacking and Installing jscalendar...")
|
||||||
if(download_jsc EQUAL 0)
|
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/jscalendar.sh
|
||||||
message(STATUS "Jscalander successfully downloaded. Installing...")
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/jscalendar.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ERROR_VARIABLE unzip_jsc)
|
ERROR_VARIABLE unzip_jsc
|
||||||
message(STATUS "Status of jscalender script was: ${unzip_jsc}")
|
)
|
||||||
else(download_jsc EQUAL 0)
|
if("${unzip_jsc}" STREQUAL "")
|
||||||
message(STATUS "Unable to download optional jscalander. Skipping...")
|
message(STATUS "jscalendar successfully installed.")
|
||||||
endif(download_jsc EQUAL 0)
|
else("${unzip_jsc}" STREQUAL "")
|
||||||
|
message(FATAL_ERROR "\nAn error occured while jscalendar was being processed:\n${unzip_jsc}")
|
||||||
|
endif("${unzip_jsc}" STREQUAL "")
|
||||||
|
|
||||||
# Create several empty folders
|
# Create several empty folders
|
||||||
file(MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events images temp)
|
file(MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events images temp)
|
||||||
|
@ -45,8 +47,5 @@ install(FILES zoneminder.logrotate DESTINATION /etc/logrotate.d RENAME zoneminde
|
||||||
install(FILES ../../misc/zoneminder-tmpfiles.conf DESTINATION /etc/tmpfiles.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
install(FILES ../../misc/zoneminder-tmpfiles.conf DESTINATION /etc/tmpfiles.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
||||||
install(FILES redalert.wav DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/sounds PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
install(FILES redalert.wav DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/sounds PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
install(FILES zoneminder.service DESTINATION /usr/lib/systemd/system PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
install(FILES zoneminder.service DESTINATION /usr/lib/systemd/system PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
||||||
|
|
||||||
# Install jscalendar
|
|
||||||
if(unzip_jsc STREQUAL "")
|
|
||||||
install(DIRECTORY jscalendar-1.0/ DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/tools/jscalendar)
|
install(DIRECTORY jscalendar-1.0/ DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/tools/jscalendar)
|
||||||
endif(unzip_jsc STREQUAL "")
|
|
||||||
|
|
|
@ -0,0 +1,429 @@
|
||||||
|
%define zmuid $(id -un)
|
||||||
|
%define zmgid $(id -gn)
|
||||||
|
%define zmuid_final apache
|
||||||
|
%define zmgid_final apache
|
||||||
|
|
||||||
|
%global _hardened_build 1
|
||||||
|
|
||||||
|
### Delete the lines below to build with ffmpeg and/or x10
|
||||||
|
%define _without_ffmpeg 1
|
||||||
|
%define _without_x10 1
|
||||||
|
|
||||||
|
Name: zoneminder
|
||||||
|
Version: 1.30.0
|
||||||
|
Release: 1%{?dist}
|
||||||
|
Summary: A camera monitoring and analysis tool
|
||||||
|
Group: System Environment/Daemons
|
||||||
|
# jscalendar is LGPL (any version): http://www.dynarch.com/projects/calendar/
|
||||||
|
# Mootools is inder the MIT license: http://mootools.net/
|
||||||
|
License: GPLv2+ and LGPLv2+ and MIT
|
||||||
|
URL: http://www.zoneminder.com/
|
||||||
|
|
||||||
|
#Source: https://github.com/ZoneMinder/ZoneMinder/archive/v%{version}.tar.gz
|
||||||
|
Source: ZoneMinder-%{version}.tar.gz
|
||||||
|
|
||||||
|
BuildRequires: cmake gnutls-devel systemd-units bzip2-devel
|
||||||
|
BuildRequires: mariadb-devel pcre-devel libjpeg-turbo-devel
|
||||||
|
BuildRequires: perl(Archive::Tar) perl(Archive::Zip) perl-podlators
|
||||||
|
BuildRequires: perl(Date::Manip) perl(DBD::mysql)
|
||||||
|
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent)
|
||||||
|
BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
|
||||||
|
BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap)
|
||||||
|
BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
|
||||||
|
BuildRequires: perl(Expect) perl(Sys::Syslog)
|
||||||
|
BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
|
||||||
|
%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel}
|
||||||
|
%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)}
|
||||||
|
# cmake needs the following installed at build time due to the way it auto-detects certain parameters
|
||||||
|
BuildRequires: httpd polkit-devel
|
||||||
|
%{!?_without_ffmpeg:BuildRequires: ffmpeg}
|
||||||
|
|
||||||
|
Requires: httpd php php-gd php-mysql cambozola polkit net-tools psmisc
|
||||||
|
Requires: libjpeg-turbo vlc-core libcurl
|
||||||
|
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
||||||
|
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)
|
||||||
|
Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP)
|
||||||
|
Requires: perl(LWP::Protocol::https)
|
||||||
|
%{!?_without_ffmpeg:Requires: ffmpeg}
|
||||||
|
|
||||||
|
Requires(post): systemd-units systemd-sysv
|
||||||
|
Requires(post): /usr/bin/gpasswd
|
||||||
|
Requires(post): /usr/bin/less
|
||||||
|
Requires(preun): systemd-units
|
||||||
|
Requires(postun): systemd-units
|
||||||
|
|
||||||
|
%description
|
||||||
|
ZoneMinder is a set of applications which is intended to provide a complete
|
||||||
|
solution allowing you to capture, analyse, record and monitor any cameras you
|
||||||
|
have attached to a Linux based machine. It is designed to run on kernels which
|
||||||
|
support the Video For Linux (V4L) interface and has been tested with cameras
|
||||||
|
attached to BTTV cards, various USB cameras and IP network cameras. It is
|
||||||
|
designed to support as many cameras as you can attach to your computer without
|
||||||
|
too much degradation of performance.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n ZoneMinder-%{version}
|
||||||
|
|
||||||
|
# Change the following default values
|
||||||
|
./utils/zmeditconfigdata.sh ZM_PATH_ZMS /cgi-bin-zm/nph-zms
|
||||||
|
./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes
|
||||||
|
./utils/zmeditconfigdata.sh ZM_PATH_SWAP /dev/shm
|
||||||
|
./utils/zmeditconfigdata.sh ZM_UPLOAD_FTP_LOC_DIR /var/spool/zoneminder-upload
|
||||||
|
./utils/zmeditconfigdata.sh ZM_OPT_CONTROL yes
|
||||||
|
./utils/zmeditconfigdata.sh ZM_CHECK_FOR_UPDATES no
|
||||||
|
./utils/zmeditconfigdata.sh ZM_DYN_SHOW_DONATE_REMINDER no
|
||||||
|
./utils/zmeditconfigdata.sh ZM_OPT_FAST_DELETE no
|
||||||
|
|
||||||
|
%build
|
||||||
|
%cmake \
|
||||||
|
-DZM_TARGET_DISTRO="f23" \
|
||||||
|
%{?_without_ffmpeg:-DZM_NO_FFMPEG=ON} \
|
||||||
|
%{?_without_x10:-DZM_NO_X10=ON} \
|
||||||
|
.
|
||||||
|
|
||||||
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
%install
|
||||||
|
export DESTDIR=%{buildroot}
|
||||||
|
make install
|
||||||
|
|
||||||
|
%post
|
||||||
|
|
||||||
|
# Add any new PTZ control configurations to the database (will not overwrite)
|
||||||
|
%{_bindir}/zmcamtool.pl --import >/dev/null 2>&1 || :
|
||||||
|
|
||||||
|
if [ $1 -eq 1 ] ; then
|
||||||
|
# Initial installation
|
||||||
|
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Allow zoneminder access to local video sources, serial ports, and x10
|
||||||
|
/usr/bin/gpasswd -a %{zmuid_final} video
|
||||||
|
/usr/bin/gpasswd -a %{zmuid_final} dialout
|
||||||
|
|
||||||
|
# Upgrade from a previous version of zoneminder
|
||||||
|
if [ $1 -eq 2 ] ; then
|
||||||
|
|
||||||
|
# Add any new PTZ control configurations to the database (will not overwrite)
|
||||||
|
%{_bindir}/zmcamtool.pl --import >/dev/null 2>&1 || :
|
||||||
|
|
||||||
|
# Freshen the database
|
||||||
|
%{_bindir}/zmupdate.pl -f >/dev/null 2>&1 || :
|
||||||
|
|
||||||
|
# We can't run this automatically when new sql account permissions need to
|
||||||
|
# be manually added first
|
||||||
|
# Run zmupdate non-interactively
|
||||||
|
#/usr/bin/zmupdate.pl --nointeractive
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Warn the end user to read the README file
|
||||||
|
echo -e "\nVERY IMPORTANT: Before starting ZoneMinder, read README.Fedora to finish the\ninstallation or upgrade!\n"
|
||||||
|
echo -e "\nThe README file is located here: %{_docdir}/%{name}\n"
|
||||||
|
|
||||||
|
%preun
|
||||||
|
if [ $1 -eq 0 ] ; then
|
||||||
|
# Package removal, not upgrade
|
||||||
|
/bin/systemctl --no-reload disable zoneminder.service > /dev/null 2>&1 || :
|
||||||
|
/bin/systemctl stop zoneminder.service > /dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
%postun
|
||||||
|
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||||
|
if [ $1 -ge 1 ] ; then
|
||||||
|
# Package upgrade, not uninstall
|
||||||
|
/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
%triggerun -- zoneminder < 1.25.0-4
|
||||||
|
# Save the current service runlevel info
|
||||||
|
# User must manually run systemd-sysv-convert --apply zoneminder
|
||||||
|
# to migrate them to systemd targets
|
||||||
|
/usr/bin/systemd-sysv-convert --save zoneminder >/dev/null 2>&1 ||:
|
||||||
|
|
||||||
|
# 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 || :
|
||||||
|
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%doc AUTHORS COPYING README.md distros/fedora/README.Fedora distros/fedora/README.https distros/fedora/jscalendar-doc
|
||||||
|
%config %attr(640,root,%{zmgid_final}) /etc/zm/zm.conf
|
||||||
|
%config(noreplace) %attr(644,root,root) /etc/httpd/conf.d/zoneminder.conf
|
||||||
|
%config(noreplace) /etc/tmpfiles.d/zoneminder.conf
|
||||||
|
%config(noreplace) /etc/logrotate.d/zoneminder
|
||||||
|
|
||||||
|
%{_unitdir}/zoneminder.service
|
||||||
|
|
||||||
|
%{_bindir}/zma
|
||||||
|
%{_bindir}/zmaudit.pl
|
||||||
|
%{_bindir}/zmc
|
||||||
|
%{_bindir}/zmcontrol.pl
|
||||||
|
%{_bindir}/zmdc.pl
|
||||||
|
%{_bindir}/zmf
|
||||||
|
%{_bindir}/zmfilter.pl
|
||||||
|
%{_bindir}/zmpkg.pl
|
||||||
|
%{_bindir}/zmtrack.pl
|
||||||
|
%{_bindir}/zmtrigger.pl
|
||||||
|
%{_bindir}/zmu
|
||||||
|
%{_bindir}/zmupdate.pl
|
||||||
|
%{_bindir}/zmvideo.pl
|
||||||
|
%{_bindir}/zmwatch.pl
|
||||||
|
%{_bindir}/zmcamtool.pl
|
||||||
|
%{_bindir}/zmsystemctl.pl
|
||||||
|
%{_bindir}/zmtelemetry.pl
|
||||||
|
%{!?_without_x10:%{_bindir}/zmx10.pl}
|
||||||
|
%{_bindir}/zmonvif-probe.pl
|
||||||
|
|
||||||
|
%{perl_vendorlib}/ZoneMinder*
|
||||||
|
%{perl_vendorlib}/ONVIF*
|
||||||
|
%{perl_vendorlib}/WSDiscovery*
|
||||||
|
%{perl_vendorlib}/WSSecurity*
|
||||||
|
%{perl_vendorlib}/WSNotification*
|
||||||
|
%{_mandir}/man*/*
|
||||||
|
%dir %{_libexecdir}/zoneminder
|
||||||
|
%{_libexecdir}/zoneminder/cgi-bin
|
||||||
|
%dir %{_datadir}/zoneminder
|
||||||
|
%{_datadir}/zoneminder/db
|
||||||
|
%{_datadir}/zoneminder/www
|
||||||
|
|
||||||
|
%{_datadir}/polkit-1/actions/com.zoneminder.systemctl.policy
|
||||||
|
%{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules
|
||||||
|
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/events
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/images
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/sock
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/swap
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/temp
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/log/zoneminder
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/spool/zoneminder-upload
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /run/zoneminder
|
||||||
|
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Thu Mar 3 2016 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.30.0
|
||||||
|
- Bump version fo 1.30.0 release.
|
||||||
|
|
||||||
|
* Sat Nov 21 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.29.0
|
||||||
|
- Bump version for 1.29.0 release on Fedora 23.
|
||||||
|
|
||||||
|
* Sat Feb 14 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.1
|
||||||
|
- Bump version for 1.28.1 release on Fedora 21.
|
||||||
|
|
||||||
|
* Sun Oct 5 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.0
|
||||||
|
- Bump version for 1.28.0 release.
|
||||||
|
|
||||||
|
* Fri Mar 14 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
|
||||||
|
- Tweak build requirements for cmake
|
||||||
|
|
||||||
|
* Sat Feb 01 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
|
||||||
|
- Add zmcamtool.pl. Bump version for 1.27 release.
|
||||||
|
|
||||||
|
* Mon Dec 16 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.5
|
||||||
|
- This is a bug fixe release
|
||||||
|
- RTSP fixes, cmake enhancements, couple other misc fixes
|
||||||
|
|
||||||
|
* Mon Oct 07 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
|
||||||
|
- Initial cmake build.
|
||||||
|
|
||||||
|
* Sat Oct 05 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
|
||||||
|
- Fedora specific path changes have been moved to zoneminder-1.26.0-defaults.patch
|
||||||
|
- All files are now part of the zoneminder source tree. Update specfile accordingly.
|
||||||
|
|
||||||
|
* Sat Sep 21 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.3
|
||||||
|
- Initial rebuild for ZoneMinder 1.26.3 release.
|
||||||
|
|
||||||
|
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-13
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Jan 21 2013 Adam Tkac <atkac redhat com> - 1.25.0-12
|
||||||
|
- rebuild due to "jpeg8-ABI" feature drop
|
||||||
|
|
||||||
|
* Mon Jan 7 2013 Remi Collet <rcollet@redhat.com> - 1.25.0-11
|
||||||
|
- fix configuration file for httpd 2.4, #871502
|
||||||
|
|
||||||
|
* Fri Dec 21 2012 Adam Tkac <atkac redhat com> - 1.25.0-10
|
||||||
|
- rebuild against new libjpeg
|
||||||
|
|
||||||
|
* Thu Aug 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-9
|
||||||
|
- Add patch to work around v4l2 api breakage in 3.5 kernel.
|
||||||
|
|
||||||
|
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-8
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jun 23 2012 Petr Pisar <ppisar@redhat.com> - 1.25.0-7
|
||||||
|
- Perl 5.16 rebuild
|
||||||
|
|
||||||
|
* Wed Mar 21 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-6
|
||||||
|
- Fix stupid thinko in sql modifications.
|
||||||
|
|
||||||
|
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-5
|
||||||
|
- Clean up macro usage.
|
||||||
|
|
||||||
|
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-4
|
||||||
|
- Convert to systemd.
|
||||||
|
- Add tmpfiles.d configuration since the initscript isn't around to create
|
||||||
|
/run/zoneminder.
|
||||||
|
- Remove some pointless executable permissions.
|
||||||
|
- Add logrotate file.
|
||||||
|
|
||||||
|
* Wed Feb 22 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-3
|
||||||
|
- Update README.Fedora to reference systemctl and mention timezone info in
|
||||||
|
php.ini.
|
||||||
|
- Add proper default for EYEZM_LOG_TO_FILE.
|
||||||
|
|
||||||
|
|
||||||
|
* Thu Feb 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-2
|
||||||
|
- Rebuild for new pcre.
|
||||||
|
|
||||||
|
* Thu Jan 19 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-1
|
||||||
|
- Update to 1.25.0
|
||||||
|
- Fix gcc4.7 build problems.
|
||||||
|
- Drop gcc4.4 build fixes; for whatever reason they now break the build.
|
||||||
|
- Clean up old patches.
|
||||||
|
- Force setting of ZM_TMPDIR and ZM_RUNDIR.
|
||||||
|
|
||||||
|
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.4-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-3
|
||||||
|
- Re-add the dist-tag that somehow got lost.
|
||||||
|
|
||||||
|
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-2
|
||||||
|
- Add patch for bug 711780 - fix syntax issue in Mapped.pm.
|
||||||
|
- Undo that patch, and undo another which was the cause of the whole mess.
|
||||||
|
- Fix up other patches so ZM_PATH_BUILD is both defined and useful.
|
||||||
|
- Make sure database creation mods actually take.
|
||||||
|
- Update Fedora-specific docs with some additional info.
|
||||||
|
- Use bundled mootools (javascript, so no guideline violation).
|
||||||
|
- Update download location.
|
||||||
|
- Update the gcrypt patch to actually work.
|
||||||
|
- Upstream changed the tarball without changing the version to patch a
|
||||||
|
vulnerability, so redownload.
|
||||||
|
|
||||||
|
* Sun Aug 14 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-1
|
||||||
|
- Initial attempt to upgrade to 1.24.4.
|
||||||
|
- Add patch from BZ 460310 to build against libgcrypt instead of requiring the
|
||||||
|
gnutls openssl libs.
|
||||||
|
|
||||||
|
* Thu Jul 21 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-7.20110324svn3310
|
||||||
|
- Perl mass rebuild
|
||||||
|
|
||||||
|
* Wed Jul 20 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-6.20110324svn3310
|
||||||
|
- Perl mass rebuild
|
||||||
|
|
||||||
|
* Mon May 09 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-5.20110324svn3310
|
||||||
|
- Bump for gnutls update.
|
||||||
|
|
||||||
|
* Thu Mar 24 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-4.20110324svn3310
|
||||||
|
- Update to latest 1.24.3 subversion. Turns out that what upstream was calling
|
||||||
|
1.24.3 is really just an occasionally updated devel snapshot.
|
||||||
|
- Rebase various patches.
|
||||||
|
|
||||||
|
* Wed Mar 23 2011 Dan Horák <dan@danny.cz> - 1.24.3-3
|
||||||
|
- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)
|
||||||
|
|
||||||
|
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.3-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Jan 25 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-1
|
||||||
|
- Update to latest upstream version.
|
||||||
|
- Rebase patches.
|
||||||
|
- Initial incomplete attempt to disable v4l1 support.
|
||||||
|
|
||||||
|
* Fri Jan 21 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-6
|
||||||
|
- Unbundle cambozola; instead link to the separately pacakged copy.
|
||||||
|
- Remove BuildRoot:, %%clean and buildroot cleaning in %%install.
|
||||||
|
- Git rid of mixed space/tab usage by removing all tabs.
|
||||||
|
- Remove unnecessary Conflicts: line.
|
||||||
|
- Attempt to force short_open_tag on for the code directories.
|
||||||
|
- Move default location of sockets, swaps, logfiles and some temporary files to
|
||||||
|
make more sense and allow things to work better with a future selinux policy.
|
||||||
|
- Fix errors in README.Fedora.
|
||||||
|
|
||||||
|
* Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.24.2-5
|
||||||
|
- Mass rebuild with perl-5.12.0
|
||||||
|
|
||||||
|
* Fri Dec 4 2009 Stepan Kasal <skasal@redhat.com> - 1.24.2-4
|
||||||
|
- rebuild against perl 5.10.1
|
||||||
|
- use Perl vendorarch and archlib variables correctly
|
||||||
|
|
||||||
|
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.2-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-2
|
||||||
|
- Bump release since 1.24.2-1 was mistakenly tagged a few months ago.
|
||||||
|
|
||||||
|
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-1
|
||||||
|
- Initial update to 1.24.2.
|
||||||
|
- Rebase patches.
|
||||||
|
- Update mootools download location.
|
||||||
|
- Update to mootools 1.2.3.
|
||||||
|
- Add additional dependencies for some optional features.
|
||||||
|
|
||||||
|
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-3
|
||||||
|
- Remove unused Sys::Mmap perl dependency RPM is finding
|
||||||
|
|
||||||
|
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-2
|
||||||
|
- Update gcc44 patch to disable -frepo, seems to be broken with gcc44
|
||||||
|
- Added noffmpeg patch to make building outside mock easier
|
||||||
|
|
||||||
|
* Sat Mar 21 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-1
|
||||||
|
- Patch for gcc 4.4 compilation errors
|
||||||
|
- Upgrade to 1.24.1
|
||||||
|
|
||||||
|
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23.3-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jan 24 2009 Caolán McNamara <caolanm@redhat.com> - 1.23.3-3
|
||||||
|
- rebuild for dependencies
|
||||||
|
|
||||||
|
* Mon Dec 15 2008 Martin Ebourne <martin@zepler.org> - 1.23.3-2
|
||||||
|
- Fix permissions on zm.conf
|
||||||
|
|
||||||
|
* Fri Jul 11 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.23.3-1
|
||||||
|
- Initial attempt at packaging 1.23.
|
||||||
|
|
||||||
|
* Tue Jul 1 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-15
|
||||||
|
- Add perl module compat dependency, bz #453590
|
||||||
|
|
||||||
|
* Tue May 6 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-14
|
||||||
|
- Remove default runlevel, bz #441315
|
||||||
|
|
||||||
|
* Mon Apr 28 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.22.3-13
|
||||||
|
- Backport patch for CVE-2008-1381 from 1.23.3 to 1.22.3.
|
||||||
|
|
||||||
|
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.22.3-12
|
||||||
|
- Autorebuild for GCC 4.3
|
||||||
|
|
||||||
|
* Thu Jan 3 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-11
|
||||||
|
- Fix compilation on gcc 4.3
|
||||||
|
|
||||||
|
* Thu Dec 6 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-10
|
||||||
|
- Rebuild for new openssl
|
||||||
|
|
||||||
|
* Thu Aug 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-8
|
||||||
|
- Fix licence tag
|
||||||
|
|
||||||
|
* Thu Jul 12 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-7
|
||||||
|
- Fixes from testing by Jitz including missing dependencies and database creation
|
||||||
|
|
||||||
|
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-6
|
||||||
|
- Disable crashtrace on ppc
|
||||||
|
|
||||||
|
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-5
|
||||||
|
- Fix uid for directories in /var/lib/zoneminder
|
||||||
|
|
||||||
|
* Tue Jun 26 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-4
|
||||||
|
- Added perl Archive::Tar dependency
|
||||||
|
- Disabled web interface due to lack of access control on the event images
|
||||||
|
|
||||||
|
* Sun Jun 10 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-3
|
||||||
|
- Changes recommended in review by Jason Tibbitts
|
||||||
|
|
||||||
|
* Mon Apr 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-2
|
||||||
|
- Standardised on package name of zoneminder
|
||||||
|
|
||||||
|
* Thu Dec 28 2006 Martin Ebourne <martin@zepler.org> - 1.22.3-1
|
||||||
|
- First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin
|
|
@ -0,0 +1 @@
|
||||||
|
../redhat/jscalendar-1.0.zip
|
|
@ -1 +0,0 @@
|
||||||
zoneminder.f23.spec
|
|
|
@ -1,429 +0,0 @@
|
||||||
%define zmuid $(id -un)
|
|
||||||
%define zmgid $(id -gn)
|
|
||||||
%define zmuid_final apache
|
|
||||||
%define zmgid_final apache
|
|
||||||
|
|
||||||
%global _hardened_build 1
|
|
||||||
|
|
||||||
### Delete the lines below to build with ffmpeg and/or x10
|
|
||||||
%define _without_ffmpeg 1
|
|
||||||
%define _without_x10 1
|
|
||||||
|
|
||||||
Name: zoneminder
|
|
||||||
Version: 1.30.0
|
|
||||||
Release: 1%{?dist}
|
|
||||||
Summary: A camera monitoring and analysis tool
|
|
||||||
Group: System Environment/Daemons
|
|
||||||
# jscalendar is LGPL (any version): http://www.dynarch.com/projects/calendar/
|
|
||||||
# Mootools is inder the MIT license: http://mootools.net/
|
|
||||||
License: GPLv2+ and LGPLv2+ and MIT
|
|
||||||
URL: http://www.zoneminder.com/
|
|
||||||
|
|
||||||
#Source: https://github.com/ZoneMinder/ZoneMinder/archive/v%{version}.tar.gz
|
|
||||||
Source: ZoneMinder-%{version}.tar.gz
|
|
||||||
|
|
||||||
BuildRequires: cmake gnutls-devel systemd-units bzip2-devel
|
|
||||||
BuildRequires: mariadb-devel pcre-devel libjpeg-turbo-devel
|
|
||||||
BuildRequires: perl(Archive::Tar) perl(Archive::Zip) perl-podlators
|
|
||||||
BuildRequires: perl(Date::Manip) perl(DBD::mysql)
|
|
||||||
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent)
|
|
||||||
BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
|
|
||||||
BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap)
|
|
||||||
BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
|
|
||||||
BuildRequires: perl(Expect) perl(Sys::Syslog)
|
|
||||||
BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
|
|
||||||
%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel}
|
|
||||||
%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)}
|
|
||||||
# cmake needs the following installed at build time due to the way it auto-detects certain parameters
|
|
||||||
BuildRequires: httpd polkit-devel
|
|
||||||
%{!?_without_ffmpeg:BuildRequires: ffmpeg}
|
|
||||||
|
|
||||||
Requires: httpd php php-gd php-mysql cambozola polkit net-tools psmisc
|
|
||||||
Requires: libjpeg-turbo vlc-core libcurl
|
|
||||||
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
|
||||||
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)
|
|
||||||
Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP)
|
|
||||||
Requires: perl(LWP::Protocol::https)
|
|
||||||
%{!?_without_ffmpeg:Requires: ffmpeg}
|
|
||||||
|
|
||||||
Requires(post): systemd-units systemd-sysv
|
|
||||||
Requires(post): /usr/bin/gpasswd
|
|
||||||
Requires(post): /usr/bin/less
|
|
||||||
Requires(preun): systemd-units
|
|
||||||
Requires(postun): systemd-units
|
|
||||||
|
|
||||||
%description
|
|
||||||
ZoneMinder is a set of applications which is intended to provide a complete
|
|
||||||
solution allowing you to capture, analyse, record and monitor any cameras you
|
|
||||||
have attached to a Linux based machine. It is designed to run on kernels which
|
|
||||||
support the Video For Linux (V4L) interface and has been tested with cameras
|
|
||||||
attached to BTTV cards, various USB cameras and IP network cameras. It is
|
|
||||||
designed to support as many cameras as you can attach to your computer without
|
|
||||||
too much degradation of performance.
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup -q -n ZoneMinder-%{version}
|
|
||||||
|
|
||||||
# Change the following default values
|
|
||||||
./utils/zmeditconfigdata.sh ZM_PATH_ZMS /cgi-bin-zm/nph-zms
|
|
||||||
./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes
|
|
||||||
./utils/zmeditconfigdata.sh ZM_PATH_SWAP /dev/shm
|
|
||||||
./utils/zmeditconfigdata.sh ZM_UPLOAD_FTP_LOC_DIR /var/spool/zoneminder-upload
|
|
||||||
./utils/zmeditconfigdata.sh ZM_OPT_CONTROL yes
|
|
||||||
./utils/zmeditconfigdata.sh ZM_CHECK_FOR_UPDATES no
|
|
||||||
./utils/zmeditconfigdata.sh ZM_DYN_SHOW_DONATE_REMINDER no
|
|
||||||
./utils/zmeditconfigdata.sh ZM_OPT_FAST_DELETE no
|
|
||||||
|
|
||||||
%build
|
|
||||||
%cmake \
|
|
||||||
-DZM_TARGET_DISTRO="f23" \
|
|
||||||
%{?_without_ffmpeg:-DZM_NO_FFMPEG=ON} \
|
|
||||||
%{?_without_x10:-DZM_NO_X10=ON} \
|
|
||||||
.
|
|
||||||
|
|
||||||
make %{?_smp_mflags}
|
|
||||||
|
|
||||||
%install
|
|
||||||
export DESTDIR=%{buildroot}
|
|
||||||
make install
|
|
||||||
|
|
||||||
%post
|
|
||||||
|
|
||||||
# Add any new PTZ control configurations to the database (will not overwrite)
|
|
||||||
%{_bindir}/zmcamtool.pl --import >/dev/null 2>&1 || :
|
|
||||||
|
|
||||||
if [ $1 -eq 1 ] ; then
|
|
||||||
# Initial installation
|
|
||||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Allow zoneminder access to local video sources, serial ports, and x10
|
|
||||||
/usr/bin/gpasswd -a %{zmuid_final} video
|
|
||||||
/usr/bin/gpasswd -a %{zmuid_final} dialout
|
|
||||||
|
|
||||||
# Upgrade from a previous version of zoneminder
|
|
||||||
if [ $1 -eq 2 ] ; then
|
|
||||||
|
|
||||||
# Add any new PTZ control configurations to the database (will not overwrite)
|
|
||||||
%{_bindir}/zmcamtool.pl --import >/dev/null 2>&1 || :
|
|
||||||
|
|
||||||
# Freshen the database
|
|
||||||
%{_bindir}/zmupdate.pl -f >/dev/null 2>&1 || :
|
|
||||||
|
|
||||||
# We can't run this automatically when new sql account permissions need to
|
|
||||||
# be manually added first
|
|
||||||
# Run zmupdate non-interactively
|
|
||||||
#/usr/bin/zmupdate.pl --nointeractive
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Warn the end user to read the README file
|
|
||||||
echo -e "\nVERY IMPORTANT: Before starting ZoneMinder, read README.Fedora to finish the\ninstallation or upgrade!\n"
|
|
||||||
echo -e "\nThe README file is located here: %{_docdir}/%{name}\n"
|
|
||||||
|
|
||||||
%preun
|
|
||||||
if [ $1 -eq 0 ] ; then
|
|
||||||
# Package removal, not upgrade
|
|
||||||
/bin/systemctl --no-reload disable zoneminder.service > /dev/null 2>&1 || :
|
|
||||||
/bin/systemctl stop zoneminder.service > /dev/null 2>&1 || :
|
|
||||||
fi
|
|
||||||
|
|
||||||
%postun
|
|
||||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
|
||||||
if [ $1 -ge 1 ] ; then
|
|
||||||
# Package upgrade, not uninstall
|
|
||||||
/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || :
|
|
||||||
fi
|
|
||||||
|
|
||||||
%triggerun -- zoneminder < 1.25.0-4
|
|
||||||
# Save the current service runlevel info
|
|
||||||
# User must manually run systemd-sysv-convert --apply zoneminder
|
|
||||||
# to migrate them to systemd targets
|
|
||||||
/usr/bin/systemd-sysv-convert --save zoneminder >/dev/null 2>&1 ||:
|
|
||||||
|
|
||||||
# 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 || :
|
|
||||||
|
|
||||||
|
|
||||||
%files
|
|
||||||
%defattr(-,root,root,-)
|
|
||||||
%doc AUTHORS COPYING README.md distros/fedora/README.Fedora distros/fedora/README.https distros/fedora/jscalendar-doc
|
|
||||||
%config %attr(640,root,%{zmgid_final}) /etc/zm/zm.conf
|
|
||||||
%config(noreplace) %attr(644,root,root) /etc/httpd/conf.d/zoneminder.conf
|
|
||||||
%config(noreplace) /etc/tmpfiles.d/zoneminder.conf
|
|
||||||
%config(noreplace) /etc/logrotate.d/zoneminder
|
|
||||||
|
|
||||||
%{_unitdir}/zoneminder.service
|
|
||||||
|
|
||||||
%{_bindir}/zma
|
|
||||||
%{_bindir}/zmaudit.pl
|
|
||||||
%{_bindir}/zmc
|
|
||||||
%{_bindir}/zmcontrol.pl
|
|
||||||
%{_bindir}/zmdc.pl
|
|
||||||
%{_bindir}/zmf
|
|
||||||
%{_bindir}/zmfilter.pl
|
|
||||||
%{_bindir}/zmpkg.pl
|
|
||||||
%{_bindir}/zmtrack.pl
|
|
||||||
%{_bindir}/zmtrigger.pl
|
|
||||||
%{_bindir}/zmu
|
|
||||||
%{_bindir}/zmupdate.pl
|
|
||||||
%{_bindir}/zmvideo.pl
|
|
||||||
%{_bindir}/zmwatch.pl
|
|
||||||
%{_bindir}/zmcamtool.pl
|
|
||||||
%{_bindir}/zmsystemctl.pl
|
|
||||||
%{_bindir}/zmtelemetry.pl
|
|
||||||
%{!?_without_x10:%{_bindir}/zmx10.pl}
|
|
||||||
%{_bindir}/zmonvif-probe.pl
|
|
||||||
|
|
||||||
%{perl_vendorlib}/ZoneMinder*
|
|
||||||
%{perl_vendorlib}/ONVIF*
|
|
||||||
%{perl_vendorlib}/WSDiscovery*
|
|
||||||
%{perl_vendorlib}/WSSecurity*
|
|
||||||
%{perl_vendorlib}/WSNotification*
|
|
||||||
%{_mandir}/man*/*
|
|
||||||
%dir %{_libexecdir}/zoneminder
|
|
||||||
%{_libexecdir}/zoneminder/cgi-bin
|
|
||||||
%dir %{_datadir}/zoneminder
|
|
||||||
%{_datadir}/zoneminder/db
|
|
||||||
%{_datadir}/zoneminder/www
|
|
||||||
|
|
||||||
%{_datadir}/polkit-1/actions/com.zoneminder.systemctl.policy
|
|
||||||
%{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules
|
|
||||||
|
|
||||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder
|
|
||||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/events
|
|
||||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/images
|
|
||||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/sock
|
|
||||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/swap
|
|
||||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/temp
|
|
||||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/log/zoneminder
|
|
||||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/spool/zoneminder-upload
|
|
||||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /run/zoneminder
|
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
|
||||||
* Thu Mar 3 2016 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.30.0
|
|
||||||
- Bump version fo 1.30.0 release.
|
|
||||||
|
|
||||||
* Sat Nov 21 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.29.0
|
|
||||||
- Bump version for 1.29.0 release on Fedora 23.
|
|
||||||
|
|
||||||
* Sat Feb 14 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.1
|
|
||||||
- Bump version for 1.28.1 release on Fedora 21.
|
|
||||||
|
|
||||||
* Sun Oct 5 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.0
|
|
||||||
- Bump version for 1.28.0 release.
|
|
||||||
|
|
||||||
* Fri Mar 14 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
|
|
||||||
- Tweak build requirements for cmake
|
|
||||||
|
|
||||||
* Sat Feb 01 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
|
|
||||||
- Add zmcamtool.pl. Bump version for 1.27 release.
|
|
||||||
|
|
||||||
* Mon Dec 16 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.5
|
|
||||||
- This is a bug fixe release
|
|
||||||
- RTSP fixes, cmake enhancements, couple other misc fixes
|
|
||||||
|
|
||||||
* Mon Oct 07 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
|
|
||||||
- Initial cmake build.
|
|
||||||
|
|
||||||
* Sat Oct 05 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
|
|
||||||
- Fedora specific path changes have been moved to zoneminder-1.26.0-defaults.patch
|
|
||||||
- All files are now part of the zoneminder source tree. Update specfile accordingly.
|
|
||||||
|
|
||||||
* Sat Sep 21 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.3
|
|
||||||
- Initial rebuild for ZoneMinder 1.26.3 release.
|
|
||||||
|
|
||||||
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-13
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
|
||||||
|
|
||||||
* Mon Jan 21 2013 Adam Tkac <atkac redhat com> - 1.25.0-12
|
|
||||||
- rebuild due to "jpeg8-ABI" feature drop
|
|
||||||
|
|
||||||
* Mon Jan 7 2013 Remi Collet <rcollet@redhat.com> - 1.25.0-11
|
|
||||||
- fix configuration file for httpd 2.4, #871502
|
|
||||||
|
|
||||||
* Fri Dec 21 2012 Adam Tkac <atkac redhat com> - 1.25.0-10
|
|
||||||
- rebuild against new libjpeg
|
|
||||||
|
|
||||||
* Thu Aug 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-9
|
|
||||||
- Add patch to work around v4l2 api breakage in 3.5 kernel.
|
|
||||||
|
|
||||||
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-8
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sat Jun 23 2012 Petr Pisar <ppisar@redhat.com> - 1.25.0-7
|
|
||||||
- Perl 5.16 rebuild
|
|
||||||
|
|
||||||
* Wed Mar 21 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-6
|
|
||||||
- Fix stupid thinko in sql modifications.
|
|
||||||
|
|
||||||
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-5
|
|
||||||
- Clean up macro usage.
|
|
||||||
|
|
||||||
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-4
|
|
||||||
- Convert to systemd.
|
|
||||||
- Add tmpfiles.d configuration since the initscript isn't around to create
|
|
||||||
/run/zoneminder.
|
|
||||||
- Remove some pointless executable permissions.
|
|
||||||
- Add logrotate file.
|
|
||||||
|
|
||||||
* Wed Feb 22 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-3
|
|
||||||
- Update README.Fedora to reference systemctl and mention timezone info in
|
|
||||||
php.ini.
|
|
||||||
- Add proper default for EYEZM_LOG_TO_FILE.
|
|
||||||
|
|
||||||
|
|
||||||
* Thu Feb 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-2
|
|
||||||
- Rebuild for new pcre.
|
|
||||||
|
|
||||||
* Thu Jan 19 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-1
|
|
||||||
- Update to 1.25.0
|
|
||||||
- Fix gcc4.7 build problems.
|
|
||||||
- Drop gcc4.4 build fixes; for whatever reason they now break the build.
|
|
||||||
- Clean up old patches.
|
|
||||||
- Force setting of ZM_TMPDIR and ZM_RUNDIR.
|
|
||||||
|
|
||||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.4-4
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
|
||||||
|
|
||||||
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-3
|
|
||||||
- Re-add the dist-tag that somehow got lost.
|
|
||||||
|
|
||||||
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-2
|
|
||||||
- Add patch for bug 711780 - fix syntax issue in Mapped.pm.
|
|
||||||
- Undo that patch, and undo another which was the cause of the whole mess.
|
|
||||||
- Fix up other patches so ZM_PATH_BUILD is both defined and useful.
|
|
||||||
- Make sure database creation mods actually take.
|
|
||||||
- Update Fedora-specific docs with some additional info.
|
|
||||||
- Use bundled mootools (javascript, so no guideline violation).
|
|
||||||
- Update download location.
|
|
||||||
- Update the gcrypt patch to actually work.
|
|
||||||
- Upstream changed the tarball without changing the version to patch a
|
|
||||||
vulnerability, so redownload.
|
|
||||||
|
|
||||||
* Sun Aug 14 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-1
|
|
||||||
- Initial attempt to upgrade to 1.24.4.
|
|
||||||
- Add patch from BZ 460310 to build against libgcrypt instead of requiring the
|
|
||||||
gnutls openssl libs.
|
|
||||||
|
|
||||||
* Thu Jul 21 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-7.20110324svn3310
|
|
||||||
- Perl mass rebuild
|
|
||||||
|
|
||||||
* Wed Jul 20 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-6.20110324svn3310
|
|
||||||
- Perl mass rebuild
|
|
||||||
|
|
||||||
* Mon May 09 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-5.20110324svn3310
|
|
||||||
- Bump for gnutls update.
|
|
||||||
|
|
||||||
* Thu Mar 24 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-4.20110324svn3310
|
|
||||||
- Update to latest 1.24.3 subversion. Turns out that what upstream was calling
|
|
||||||
1.24.3 is really just an occasionally updated devel snapshot.
|
|
||||||
- Rebase various patches.
|
|
||||||
|
|
||||||
* Wed Mar 23 2011 Dan Horák <dan@danny.cz> - 1.24.3-3
|
|
||||||
- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)
|
|
||||||
|
|
||||||
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.3-2
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
|
||||||
|
|
||||||
* Tue Jan 25 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-1
|
|
||||||
- Update to latest upstream version.
|
|
||||||
- Rebase patches.
|
|
||||||
- Initial incomplete attempt to disable v4l1 support.
|
|
||||||
|
|
||||||
* Fri Jan 21 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-6
|
|
||||||
- Unbundle cambozola; instead link to the separately pacakged copy.
|
|
||||||
- Remove BuildRoot:, %%clean and buildroot cleaning in %%install.
|
|
||||||
- Git rid of mixed space/tab usage by removing all tabs.
|
|
||||||
- Remove unnecessary Conflicts: line.
|
|
||||||
- Attempt to force short_open_tag on for the code directories.
|
|
||||||
- Move default location of sockets, swaps, logfiles and some temporary files to
|
|
||||||
make more sense and allow things to work better with a future selinux policy.
|
|
||||||
- Fix errors in README.Fedora.
|
|
||||||
|
|
||||||
* Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.24.2-5
|
|
||||||
- Mass rebuild with perl-5.12.0
|
|
||||||
|
|
||||||
* Fri Dec 4 2009 Stepan Kasal <skasal@redhat.com> - 1.24.2-4
|
|
||||||
- rebuild against perl 5.10.1
|
|
||||||
- use Perl vendorarch and archlib variables correctly
|
|
||||||
|
|
||||||
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.2-3
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
|
||||||
|
|
||||||
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-2
|
|
||||||
- Bump release since 1.24.2-1 was mistakenly tagged a few months ago.
|
|
||||||
|
|
||||||
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-1
|
|
||||||
- Initial update to 1.24.2.
|
|
||||||
- Rebase patches.
|
|
||||||
- Update mootools download location.
|
|
||||||
- Update to mootools 1.2.3.
|
|
||||||
- Add additional dependencies for some optional features.
|
|
||||||
|
|
||||||
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-3
|
|
||||||
- Remove unused Sys::Mmap perl dependency RPM is finding
|
|
||||||
|
|
||||||
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-2
|
|
||||||
- Update gcc44 patch to disable -frepo, seems to be broken with gcc44
|
|
||||||
- Added noffmpeg patch to make building outside mock easier
|
|
||||||
|
|
||||||
* Sat Mar 21 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-1
|
|
||||||
- Patch for gcc 4.4 compilation errors
|
|
||||||
- Upgrade to 1.24.1
|
|
||||||
|
|
||||||
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23.3-4
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sat Jan 24 2009 Caolán McNamara <caolanm@redhat.com> - 1.23.3-3
|
|
||||||
- rebuild for dependencies
|
|
||||||
|
|
||||||
* Mon Dec 15 2008 Martin Ebourne <martin@zepler.org> - 1.23.3-2
|
|
||||||
- Fix permissions on zm.conf
|
|
||||||
|
|
||||||
* Fri Jul 11 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.23.3-1
|
|
||||||
- Initial attempt at packaging 1.23.
|
|
||||||
|
|
||||||
* Tue Jul 1 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-15
|
|
||||||
- Add perl module compat dependency, bz #453590
|
|
||||||
|
|
||||||
* Tue May 6 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-14
|
|
||||||
- Remove default runlevel, bz #441315
|
|
||||||
|
|
||||||
* Mon Apr 28 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.22.3-13
|
|
||||||
- Backport patch for CVE-2008-1381 from 1.23.3 to 1.22.3.
|
|
||||||
|
|
||||||
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.22.3-12
|
|
||||||
- Autorebuild for GCC 4.3
|
|
||||||
|
|
||||||
* Thu Jan 3 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-11
|
|
||||||
- Fix compilation on gcc 4.3
|
|
||||||
|
|
||||||
* Thu Dec 6 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-10
|
|
||||||
- Rebuild for new openssl
|
|
||||||
|
|
||||||
* Thu Aug 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-8
|
|
||||||
- Fix licence tag
|
|
||||||
|
|
||||||
* Thu Jul 12 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-7
|
|
||||||
- Fixes from testing by Jitz including missing dependencies and database creation
|
|
||||||
|
|
||||||
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-6
|
|
||||||
- Disable crashtrace on ppc
|
|
||||||
|
|
||||||
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-5
|
|
||||||
- Fix uid for directories in /var/lib/zoneminder
|
|
||||||
|
|
||||||
* Tue Jun 26 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-4
|
|
||||||
- Added perl Archive::Tar dependency
|
|
||||||
- Disabled web interface due to lack of access control on the event images
|
|
||||||
|
|
||||||
* Sun Jun 10 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-3
|
|
||||||
- Changes recommended in review by Jason Tibbitts
|
|
||||||
|
|
||||||
* Mon Apr 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-2
|
|
||||||
- Standardised on package name of zoneminder
|
|
||||||
|
|
||||||
* Thu Dec 28 2006 Martin Ebourne <martin@zepler.org> - 1.22.3-1
|
|
||||||
- First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin
|
|
|
@ -0,0 +1 @@
|
||||||
|
zoneminder.f24.spec
|
|
@ -0,0 +1,429 @@
|
||||||
|
%define zmuid $(id -un)
|
||||||
|
%define zmgid $(id -gn)
|
||||||
|
%define zmuid_final apache
|
||||||
|
%define zmgid_final apache
|
||||||
|
|
||||||
|
%global _hardened_build 1
|
||||||
|
|
||||||
|
### Delete the lines below to build with ffmpeg and/or x10
|
||||||
|
%define _without_ffmpeg 1
|
||||||
|
%define _without_x10 1
|
||||||
|
|
||||||
|
Name: zoneminder
|
||||||
|
Version: 1.30.0
|
||||||
|
Release: 1%{?dist}
|
||||||
|
Summary: A camera monitoring and analysis tool
|
||||||
|
Group: System Environment/Daemons
|
||||||
|
# jscalendar is LGPL (any version): http://www.dynarch.com/projects/calendar/
|
||||||
|
# Mootools is inder the MIT license: http://mootools.net/
|
||||||
|
License: GPLv2+ and LGPLv2+ and MIT
|
||||||
|
URL: http://www.zoneminder.com/
|
||||||
|
|
||||||
|
#Source: https://github.com/ZoneMinder/ZoneMinder/archive/v%{version}.tar.gz
|
||||||
|
Source: ZoneMinder-%{version}.tar.gz
|
||||||
|
|
||||||
|
BuildRequires: cmake gnutls-devel systemd-units bzip2-devel
|
||||||
|
BuildRequires: mariadb-devel pcre-devel libjpeg-turbo-devel
|
||||||
|
BuildRequires: perl(Archive::Tar) perl(Archive::Zip) perl-podlators
|
||||||
|
BuildRequires: perl(Date::Manip) perl(DBD::mysql)
|
||||||
|
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent)
|
||||||
|
BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
|
||||||
|
BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap)
|
||||||
|
BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
|
||||||
|
BuildRequires: perl(Expect) perl(Sys::Syslog)
|
||||||
|
BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
|
||||||
|
%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel}
|
||||||
|
%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)}
|
||||||
|
# cmake needs the following installed at build time due to the way it auto-detects certain parameters
|
||||||
|
BuildRequires: httpd polkit-devel
|
||||||
|
%{!?_without_ffmpeg:BuildRequires: ffmpeg}
|
||||||
|
|
||||||
|
Requires: httpd php php-gd php-mysql cambozola polkit net-tools psmisc
|
||||||
|
Requires: libjpeg-turbo vlc-core libcurl
|
||||||
|
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
||||||
|
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)
|
||||||
|
Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP)
|
||||||
|
Requires: perl(LWP::Protocol::https)
|
||||||
|
%{!?_without_ffmpeg:Requires: ffmpeg}
|
||||||
|
|
||||||
|
Requires(post): systemd-units systemd-sysv
|
||||||
|
Requires(post): /usr/bin/gpasswd
|
||||||
|
Requires(post): /usr/bin/less
|
||||||
|
Requires(preun): systemd-units
|
||||||
|
Requires(postun): systemd-units
|
||||||
|
|
||||||
|
%description
|
||||||
|
ZoneMinder is a set of applications which is intended to provide a complete
|
||||||
|
solution allowing you to capture, analyse, record and monitor any cameras you
|
||||||
|
have attached to a Linux based machine. It is designed to run on kernels which
|
||||||
|
support the Video For Linux (V4L) interface and has been tested with cameras
|
||||||
|
attached to BTTV cards, various USB cameras and IP network cameras. It is
|
||||||
|
designed to support as many cameras as you can attach to your computer without
|
||||||
|
too much degradation of performance.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n ZoneMinder-%{version}
|
||||||
|
|
||||||
|
# Change the following default values
|
||||||
|
./utils/zmeditconfigdata.sh ZM_PATH_ZMS /cgi-bin-zm/nph-zms
|
||||||
|
./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes
|
||||||
|
./utils/zmeditconfigdata.sh ZM_PATH_SWAP /dev/shm
|
||||||
|
./utils/zmeditconfigdata.sh ZM_UPLOAD_FTP_LOC_DIR /var/spool/zoneminder-upload
|
||||||
|
./utils/zmeditconfigdata.sh ZM_OPT_CONTROL yes
|
||||||
|
./utils/zmeditconfigdata.sh ZM_CHECK_FOR_UPDATES no
|
||||||
|
./utils/zmeditconfigdata.sh ZM_DYN_SHOW_DONATE_REMINDER no
|
||||||
|
./utils/zmeditconfigdata.sh ZM_OPT_FAST_DELETE no
|
||||||
|
|
||||||
|
%build
|
||||||
|
%cmake \
|
||||||
|
-DZM_TARGET_DISTRO="f23" \
|
||||||
|
%{?_without_ffmpeg:-DZM_NO_FFMPEG=ON} \
|
||||||
|
%{?_without_x10:-DZM_NO_X10=ON} \
|
||||||
|
.
|
||||||
|
|
||||||
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
%install
|
||||||
|
export DESTDIR=%{buildroot}
|
||||||
|
make install
|
||||||
|
|
||||||
|
%post
|
||||||
|
|
||||||
|
# Add any new PTZ control configurations to the database (will not overwrite)
|
||||||
|
%{_bindir}/zmcamtool.pl --import >/dev/null 2>&1 || :
|
||||||
|
|
||||||
|
if [ $1 -eq 1 ] ; then
|
||||||
|
# Initial installation
|
||||||
|
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Allow zoneminder access to local video sources, serial ports, and x10
|
||||||
|
/usr/bin/gpasswd -a %{zmuid_final} video
|
||||||
|
/usr/bin/gpasswd -a %{zmuid_final} dialout
|
||||||
|
|
||||||
|
# Upgrade from a previous version of zoneminder
|
||||||
|
if [ $1 -eq 2 ] ; then
|
||||||
|
|
||||||
|
# Add any new PTZ control configurations to the database (will not overwrite)
|
||||||
|
%{_bindir}/zmcamtool.pl --import >/dev/null 2>&1 || :
|
||||||
|
|
||||||
|
# Freshen the database
|
||||||
|
%{_bindir}/zmupdate.pl -f >/dev/null 2>&1 || :
|
||||||
|
|
||||||
|
# We can't run this automatically when new sql account permissions need to
|
||||||
|
# be manually added first
|
||||||
|
# Run zmupdate non-interactively
|
||||||
|
#/usr/bin/zmupdate.pl --nointeractive
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Warn the end user to read the README file
|
||||||
|
echo -e "\nVERY IMPORTANT: Before starting ZoneMinder, read README.Fedora to finish the\ninstallation or upgrade!\n"
|
||||||
|
echo -e "\nThe README file is located here: %{_docdir}/%{name}\n"
|
||||||
|
|
||||||
|
%preun
|
||||||
|
if [ $1 -eq 0 ] ; then
|
||||||
|
# Package removal, not upgrade
|
||||||
|
/bin/systemctl --no-reload disable zoneminder.service > /dev/null 2>&1 || :
|
||||||
|
/bin/systemctl stop zoneminder.service > /dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
%postun
|
||||||
|
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||||
|
if [ $1 -ge 1 ] ; then
|
||||||
|
# Package upgrade, not uninstall
|
||||||
|
/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
%triggerun -- zoneminder < 1.25.0-4
|
||||||
|
# Save the current service runlevel info
|
||||||
|
# User must manually run systemd-sysv-convert --apply zoneminder
|
||||||
|
# to migrate them to systemd targets
|
||||||
|
/usr/bin/systemd-sysv-convert --save zoneminder >/dev/null 2>&1 ||:
|
||||||
|
|
||||||
|
# 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 || :
|
||||||
|
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%doc AUTHORS COPYING README.md distros/fedora/README.Fedora distros/fedora/README.https distros/fedora/jscalendar-doc
|
||||||
|
%config %attr(640,root,%{zmgid_final}) /etc/zm/zm.conf
|
||||||
|
%config(noreplace) %attr(644,root,root) /etc/httpd/conf.d/zoneminder.conf
|
||||||
|
%config(noreplace) /etc/tmpfiles.d/zoneminder.conf
|
||||||
|
%config(noreplace) /etc/logrotate.d/zoneminder
|
||||||
|
|
||||||
|
%{_unitdir}/zoneminder.service
|
||||||
|
|
||||||
|
%{_bindir}/zma
|
||||||
|
%{_bindir}/zmaudit.pl
|
||||||
|
%{_bindir}/zmc
|
||||||
|
%{_bindir}/zmcontrol.pl
|
||||||
|
%{_bindir}/zmdc.pl
|
||||||
|
%{_bindir}/zmf
|
||||||
|
%{_bindir}/zmfilter.pl
|
||||||
|
%{_bindir}/zmpkg.pl
|
||||||
|
%{_bindir}/zmtrack.pl
|
||||||
|
%{_bindir}/zmtrigger.pl
|
||||||
|
%{_bindir}/zmu
|
||||||
|
%{_bindir}/zmupdate.pl
|
||||||
|
%{_bindir}/zmvideo.pl
|
||||||
|
%{_bindir}/zmwatch.pl
|
||||||
|
%{_bindir}/zmcamtool.pl
|
||||||
|
%{_bindir}/zmsystemctl.pl
|
||||||
|
%{_bindir}/zmtelemetry.pl
|
||||||
|
%{!?_without_x10:%{_bindir}/zmx10.pl}
|
||||||
|
%{_bindir}/zmonvif-probe.pl
|
||||||
|
|
||||||
|
%{perl_vendorlib}/ZoneMinder*
|
||||||
|
%{perl_vendorlib}/ONVIF*
|
||||||
|
%{perl_vendorlib}/WSDiscovery*
|
||||||
|
%{perl_vendorlib}/WSSecurity*
|
||||||
|
%{perl_vendorlib}/WSNotification*
|
||||||
|
%{_mandir}/man*/*
|
||||||
|
%dir %{_libexecdir}/zoneminder
|
||||||
|
%{_libexecdir}/zoneminder/cgi-bin
|
||||||
|
%dir %{_datadir}/zoneminder
|
||||||
|
%{_datadir}/zoneminder/db
|
||||||
|
%{_datadir}/zoneminder/www
|
||||||
|
|
||||||
|
%{_datadir}/polkit-1/actions/com.zoneminder.systemctl.policy
|
||||||
|
%{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules
|
||||||
|
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/events
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/images
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/sock
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/swap
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/temp
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/log/zoneminder
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/spool/zoneminder-upload
|
||||||
|
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /run/zoneminder
|
||||||
|
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Thu Mar 3 2016 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.30.0
|
||||||
|
- Bump version fo 1.30.0 release.
|
||||||
|
|
||||||
|
* Sat Nov 21 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.29.0
|
||||||
|
- Bump version for 1.29.0 release on Fedora 23.
|
||||||
|
|
||||||
|
* Sat Feb 14 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.1
|
||||||
|
- Bump version for 1.28.1 release on Fedora 21.
|
||||||
|
|
||||||
|
* Sun Oct 5 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.0
|
||||||
|
- Bump version for 1.28.0 release.
|
||||||
|
|
||||||
|
* Fri Mar 14 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
|
||||||
|
- Tweak build requirements for cmake
|
||||||
|
|
||||||
|
* Sat Feb 01 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
|
||||||
|
- Add zmcamtool.pl. Bump version for 1.27 release.
|
||||||
|
|
||||||
|
* Mon Dec 16 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.5
|
||||||
|
- This is a bug fixe release
|
||||||
|
- RTSP fixes, cmake enhancements, couple other misc fixes
|
||||||
|
|
||||||
|
* Mon Oct 07 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
|
||||||
|
- Initial cmake build.
|
||||||
|
|
||||||
|
* Sat Oct 05 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
|
||||||
|
- Fedora specific path changes have been moved to zoneminder-1.26.0-defaults.patch
|
||||||
|
- All files are now part of the zoneminder source tree. Update specfile accordingly.
|
||||||
|
|
||||||
|
* Sat Sep 21 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.3
|
||||||
|
- Initial rebuild for ZoneMinder 1.26.3 release.
|
||||||
|
|
||||||
|
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-13
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Jan 21 2013 Adam Tkac <atkac redhat com> - 1.25.0-12
|
||||||
|
- rebuild due to "jpeg8-ABI" feature drop
|
||||||
|
|
||||||
|
* Mon Jan 7 2013 Remi Collet <rcollet@redhat.com> - 1.25.0-11
|
||||||
|
- fix configuration file for httpd 2.4, #871502
|
||||||
|
|
||||||
|
* Fri Dec 21 2012 Adam Tkac <atkac redhat com> - 1.25.0-10
|
||||||
|
- rebuild against new libjpeg
|
||||||
|
|
||||||
|
* Thu Aug 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-9
|
||||||
|
- Add patch to work around v4l2 api breakage in 3.5 kernel.
|
||||||
|
|
||||||
|
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-8
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jun 23 2012 Petr Pisar <ppisar@redhat.com> - 1.25.0-7
|
||||||
|
- Perl 5.16 rebuild
|
||||||
|
|
||||||
|
* Wed Mar 21 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-6
|
||||||
|
- Fix stupid thinko in sql modifications.
|
||||||
|
|
||||||
|
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-5
|
||||||
|
- Clean up macro usage.
|
||||||
|
|
||||||
|
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-4
|
||||||
|
- Convert to systemd.
|
||||||
|
- Add tmpfiles.d configuration since the initscript isn't around to create
|
||||||
|
/run/zoneminder.
|
||||||
|
- Remove some pointless executable permissions.
|
||||||
|
- Add logrotate file.
|
||||||
|
|
||||||
|
* Wed Feb 22 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-3
|
||||||
|
- Update README.Fedora to reference systemctl and mention timezone info in
|
||||||
|
php.ini.
|
||||||
|
- Add proper default for EYEZM_LOG_TO_FILE.
|
||||||
|
|
||||||
|
|
||||||
|
* Thu Feb 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-2
|
||||||
|
- Rebuild for new pcre.
|
||||||
|
|
||||||
|
* Thu Jan 19 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-1
|
||||||
|
- Update to 1.25.0
|
||||||
|
- Fix gcc4.7 build problems.
|
||||||
|
- Drop gcc4.4 build fixes; for whatever reason they now break the build.
|
||||||
|
- Clean up old patches.
|
||||||
|
- Force setting of ZM_TMPDIR and ZM_RUNDIR.
|
||||||
|
|
||||||
|
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.4-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-3
|
||||||
|
- Re-add the dist-tag that somehow got lost.
|
||||||
|
|
||||||
|
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-2
|
||||||
|
- Add patch for bug 711780 - fix syntax issue in Mapped.pm.
|
||||||
|
- Undo that patch, and undo another which was the cause of the whole mess.
|
||||||
|
- Fix up other patches so ZM_PATH_BUILD is both defined and useful.
|
||||||
|
- Make sure database creation mods actually take.
|
||||||
|
- Update Fedora-specific docs with some additional info.
|
||||||
|
- Use bundled mootools (javascript, so no guideline violation).
|
||||||
|
- Update download location.
|
||||||
|
- Update the gcrypt patch to actually work.
|
||||||
|
- Upstream changed the tarball without changing the version to patch a
|
||||||
|
vulnerability, so redownload.
|
||||||
|
|
||||||
|
* Sun Aug 14 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-1
|
||||||
|
- Initial attempt to upgrade to 1.24.4.
|
||||||
|
- Add patch from BZ 460310 to build against libgcrypt instead of requiring the
|
||||||
|
gnutls openssl libs.
|
||||||
|
|
||||||
|
* Thu Jul 21 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-7.20110324svn3310
|
||||||
|
- Perl mass rebuild
|
||||||
|
|
||||||
|
* Wed Jul 20 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-6.20110324svn3310
|
||||||
|
- Perl mass rebuild
|
||||||
|
|
||||||
|
* Mon May 09 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-5.20110324svn3310
|
||||||
|
- Bump for gnutls update.
|
||||||
|
|
||||||
|
* Thu Mar 24 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-4.20110324svn3310
|
||||||
|
- Update to latest 1.24.3 subversion. Turns out that what upstream was calling
|
||||||
|
1.24.3 is really just an occasionally updated devel snapshot.
|
||||||
|
- Rebase various patches.
|
||||||
|
|
||||||
|
* Wed Mar 23 2011 Dan Horák <dan@danny.cz> - 1.24.3-3
|
||||||
|
- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)
|
||||||
|
|
||||||
|
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.3-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Jan 25 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-1
|
||||||
|
- Update to latest upstream version.
|
||||||
|
- Rebase patches.
|
||||||
|
- Initial incomplete attempt to disable v4l1 support.
|
||||||
|
|
||||||
|
* Fri Jan 21 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-6
|
||||||
|
- Unbundle cambozola; instead link to the separately pacakged copy.
|
||||||
|
- Remove BuildRoot:, %%clean and buildroot cleaning in %%install.
|
||||||
|
- Git rid of mixed space/tab usage by removing all tabs.
|
||||||
|
- Remove unnecessary Conflicts: line.
|
||||||
|
- Attempt to force short_open_tag on for the code directories.
|
||||||
|
- Move default location of sockets, swaps, logfiles and some temporary files to
|
||||||
|
make more sense and allow things to work better with a future selinux policy.
|
||||||
|
- Fix errors in README.Fedora.
|
||||||
|
|
||||||
|
* Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.24.2-5
|
||||||
|
- Mass rebuild with perl-5.12.0
|
||||||
|
|
||||||
|
* Fri Dec 4 2009 Stepan Kasal <skasal@redhat.com> - 1.24.2-4
|
||||||
|
- rebuild against perl 5.10.1
|
||||||
|
- use Perl vendorarch and archlib variables correctly
|
||||||
|
|
||||||
|
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.2-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-2
|
||||||
|
- Bump release since 1.24.2-1 was mistakenly tagged a few months ago.
|
||||||
|
|
||||||
|
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-1
|
||||||
|
- Initial update to 1.24.2.
|
||||||
|
- Rebase patches.
|
||||||
|
- Update mootools download location.
|
||||||
|
- Update to mootools 1.2.3.
|
||||||
|
- Add additional dependencies for some optional features.
|
||||||
|
|
||||||
|
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-3
|
||||||
|
- Remove unused Sys::Mmap perl dependency RPM is finding
|
||||||
|
|
||||||
|
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-2
|
||||||
|
- Update gcc44 patch to disable -frepo, seems to be broken with gcc44
|
||||||
|
- Added noffmpeg patch to make building outside mock easier
|
||||||
|
|
||||||
|
* Sat Mar 21 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-1
|
||||||
|
- Patch for gcc 4.4 compilation errors
|
||||||
|
- Upgrade to 1.24.1
|
||||||
|
|
||||||
|
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23.3-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jan 24 2009 Caolán McNamara <caolanm@redhat.com> - 1.23.3-3
|
||||||
|
- rebuild for dependencies
|
||||||
|
|
||||||
|
* Mon Dec 15 2008 Martin Ebourne <martin@zepler.org> - 1.23.3-2
|
||||||
|
- Fix permissions on zm.conf
|
||||||
|
|
||||||
|
* Fri Jul 11 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.23.3-1
|
||||||
|
- Initial attempt at packaging 1.23.
|
||||||
|
|
||||||
|
* Tue Jul 1 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-15
|
||||||
|
- Add perl module compat dependency, bz #453590
|
||||||
|
|
||||||
|
* Tue May 6 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-14
|
||||||
|
- Remove default runlevel, bz #441315
|
||||||
|
|
||||||
|
* Mon Apr 28 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.22.3-13
|
||||||
|
- Backport patch for CVE-2008-1381 from 1.23.3 to 1.22.3.
|
||||||
|
|
||||||
|
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.22.3-12
|
||||||
|
- Autorebuild for GCC 4.3
|
||||||
|
|
||||||
|
* Thu Jan 3 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-11
|
||||||
|
- Fix compilation on gcc 4.3
|
||||||
|
|
||||||
|
* Thu Dec 6 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-10
|
||||||
|
- Rebuild for new openssl
|
||||||
|
|
||||||
|
* Thu Aug 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-8
|
||||||
|
- Fix licence tag
|
||||||
|
|
||||||
|
* Thu Jul 12 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-7
|
||||||
|
- Fixes from testing by Jitz including missing dependencies and database creation
|
||||||
|
|
||||||
|
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-6
|
||||||
|
- Disable crashtrace on ppc
|
||||||
|
|
||||||
|
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-5
|
||||||
|
- Fix uid for directories in /var/lib/zoneminder
|
||||||
|
|
||||||
|
* Tue Jun 26 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-4
|
||||||
|
- Added perl Archive::Tar dependency
|
||||||
|
- Disabled web interface due to lack of access control on the event images
|
||||||
|
|
||||||
|
* Sun Jun 10 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-3
|
||||||
|
- Changes recommended in review by Jason Tibbitts
|
||||||
|
|
||||||
|
* Mon Apr 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-2
|
||||||
|
- Standardised on package name of zoneminder
|
||||||
|
|
||||||
|
* Thu Dec 28 2006 Martin Ebourne <martin@zepler.org> - 1.22.3-1
|
||||||
|
- First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin
|
|
@ -15,27 +15,17 @@ else(ZM_TARGET_DISTRO STREQUAL "el7")
|
||||||
configure_file(zoneminder.el6.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.el6.conf @ONLY)
|
configure_file(zoneminder.el6.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.el6.conf @ONLY)
|
||||||
endif(ZM_TARGET_DISTRO STREQUAL "el7")
|
endif(ZM_TARGET_DISTRO STREQUAL "el7")
|
||||||
|
|
||||||
# Download jscalendar & move files into position
|
# Unpack jscalendar & move files into position
|
||||||
file(DOWNLOAD http://iweb.dl.sourceforge.net/project/jscalendar/jscalendar/1.0/jscalendar-1.0.zip ${CMAKE_CURRENT_SOURCE_DIR}/jscalendar-1.0.zip LOG jsc_log STATUS download_jsc)
|
message(STATUS "Unpacking and Installing jscalendar...")
|
||||||
#message(STATUS "Log of jscalender script was: ${jsc_log}")
|
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/jscalendar.sh
|
||||||
if(download_jsc EQUAL 0)
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
message(STATUS "Jscalander successfully downloaded. Installing...")
|
ERROR_VARIABLE unzip_jsc
|
||||||
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/jscalendar.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ERROR_VARIABLE unzip_jsc)
|
)
|
||||||
message(STATUS "Status of jscalender script was: ${unzip_jsc}")
|
if("${unzip_jsc}" STREQUAL "")
|
||||||
else(download_jsc EQUAL 0)
|
message(STATUS "jscalendar successfully installed.")
|
||||||
message(STATUS "Unable to download optional jscalander. Skipping...")
|
else("${unzip_jsc}" STREQUAL "")
|
||||||
endif(download_jsc EQUAL 0)
|
message(FATAL_ERROR "\nAn error occured while jscalendar was being processed:\n${unzip_jsc}")
|
||||||
|
endif("${unzip_jsc}" STREQUAL "")
|
||||||
# Cambozola is now packaged in zmrepo
|
|
||||||
# Download cambozola & move files into position
|
|
||||||
#file(DOWNLOAD http://www.andywilcock.com/code/cambozola/cambozola-0.931.tar.gz ${CMAKE_CURRENT_SOURCE_DIR}/cambozola-0.931.tar.gz STATUS download_camb)
|
|
||||||
#if(download_camb EQUAL 0)
|
|
||||||
# message(STATUS "Cambozola successfully downloaded. Installing...")
|
|
||||||
# execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/cambozola.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ERROR_VARIABLE untar_camb)
|
|
||||||
# message(STATUS "Status of cambozola script was: ${untar_camb}")
|
|
||||||
#else(download_camb EQUAL 0)
|
|
||||||
# message(STATUS "Unable to download optional Cambozola. Skipping...")
|
|
||||||
#endif(download_camb EQUAL 0)
|
|
||||||
|
|
||||||
# Create several empty folders
|
# Create several empty folders
|
||||||
file(MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events images temp)
|
file(MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events images temp)
|
||||||
|
@ -59,6 +49,8 @@ install(CODE "execute_process(COMMAND ln -sf ../../java/cambozola.jar \"\$ENV{DE
|
||||||
|
|
||||||
# Install auxiliary files required to run zoneminder on CentOS
|
# Install auxiliary files required to run zoneminder on CentOS
|
||||||
install(FILES redalert.wav DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/sounds PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
install(FILES redalert.wav DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/sounds PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
install(DIRECTORY jscalendar-1.0/ DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/tools/jscalendar)
|
||||||
|
|
||||||
if(ZM_TARGET_DISTRO STREQUAL "el7")
|
if(ZM_TARGET_DISTRO STREQUAL "el7")
|
||||||
install(FILES zoneminder.el7.conf DESTINATION /etc/httpd/conf.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
install(FILES zoneminder.el7.conf DESTINATION /etc/httpd/conf.d RENAME zoneminder.conf PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
||||||
install(FILES zoneminder.el7.logrotate DESTINATION /etc/logrotate.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
install(FILES zoneminder.el7.logrotate DESTINATION /etc/logrotate.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
||||||
|
@ -70,12 +62,3 @@ else(ZM_TARGET_DISTRO STREQUAL "el7")
|
||||||
install(FILES zoneminder.sysvinit DESTINATION /etc/rc.d/init.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
install(FILES zoneminder.sysvinit DESTINATION /etc/rc.d/init.d RENAME zoneminder PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
||||||
endif(ZM_TARGET_DISTRO STREQUAL "el7")
|
endif(ZM_TARGET_DISTRO STREQUAL "el7")
|
||||||
|
|
||||||
# Install jscalendar
|
|
||||||
if(unzip_jsc STREQUAL "")
|
|
||||||
install(DIRECTORY jscalendar-1.0/ DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www/tools/jscalendar)
|
|
||||||
endif(unzip_jsc STREQUAL "")
|
|
||||||
|
|
||||||
# Install cambozola
|
|
||||||
if(untar_camb STREQUAL "")
|
|
||||||
install(FILES cambozola-0.931/dist/cambozola.jar DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/zoneminder/www)
|
|
||||||
endif(untar_camb STREQUAL "")
|
|
||||||
|
|
Binary file not shown.
|
@ -1,37 +1,154 @@
|
||||||
Debian
|
Debian
|
||||||
======
|
======
|
||||||
|
|
||||||
A fresh build based on master branch running Debian 7 (wheezy)\:
|
.. contents::
|
||||||
|
|
||||||
|
Easy Way: Debian Jessie
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
**Step 1:** Setup Sudo
|
||||||
|
|
||||||
|
By default Debian does not come with sudo. Log in as root or use su command.
|
||||||
|
N.B. The instructions below are for setting up sudo for your current account, you can
|
||||||
|
do this as root if you prefer.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
root@host:~# aptitude install -y apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf libjpeg8-dev libjpeg8 apache2-mpm-prefork libapache2-mod-php5 php5-cli libphp-serialization-perl libgnutls-dev libjpeg8-dev libavcodec-dev libavformat-dev libswscale-dev libavutil-dev libv4l-dev libtool ffmpeg libnetpbm10-dev libavdevice-dev libmime-lite-perl dh-autoreconf dpatch;
|
apt-get update
|
||||||
|
apt-get install sudo
|
||||||
|
usermod -a -G sudo <username>
|
||||||
|
exit
|
||||||
|
|
||||||
root@host:~# git clone https://github.com/ZoneMinder/ZoneMinder.git zoneminder;
|
Logout or try ``newgrp`` to reload user groups
|
||||||
root@host:~# cd zoneminder;
|
|
||||||
root@host:~# ln -s distros/debian;
|
|
||||||
root@host:~# dpkg-checkbuilddeps;
|
|
||||||
root@host:~# dpkg-buildpackage;
|
|
||||||
|
|
||||||
One level above you'll now find a deb package matching the architecture of the build host:
|
**Step 2:** Run sudo and update
|
||||||
|
|
||||||
|
Now run session using sudo and ensure system is updated.
|
||||||
::
|
::
|
||||||
|
|
||||||
root@host:~# ls -1 ~/zoneminder*;
|
sudo -i
|
||||||
/root/zoneminder_1.26.4-1_amd64.changes
|
apt-get upgrade
|
||||||
/root/zoneminder_1.26.4-1_amd64.deb
|
|
||||||
/root/zoneminder_1.26.4-1.dsc
|
|
||||||
/root/zoneminder_1.26.4-1.tar.gz
|
|
||||||
|
|
||||||
The dpkg command itself does not resolve dependencies. That's what high-level interfaces like aptitude and apt-get are normally for. Unfortunately, unlike RPM, there's no easy way to install a separate deb package not contained with any repository.
|
**Step 3:** Install Apache and MySQL
|
||||||
|
|
||||||
|
These are not dependencies for the package as they could
|
||||||
|
be installed elsewhere.
|
||||||
|
|
||||||
To overcome this "limitation" we'll use dpkg only to install the zoneminder package and apt-get to fetch all needed dependencies afterwards. Running dpkg-reconfigure in the end will ensure that the setup scripts e.g. for database provisioning were executed.
|
|
||||||
::
|
::
|
||||||
|
|
||||||
root@host:~# dpkg -i /root/zoneminder_1.26.4-1_amd64.deb; apt-get install -f;
|
apt-get install apache2 mysql-server
|
||||||
root@host:~# dpkg-reconfigure zoneminder;
|
|
||||||
|
**Step 4:** Edit sources.list to add jessie-backports
|
||||||
|
|
||||||
Alternatively you may also use gdebi to automatically resolve dependencies during installation:
|
|
||||||
::
|
::
|
||||||
|
|
||||||
root@host:~# aptitude install -y gdebi;
|
nano /etc/apt/sources.list
|
||||||
root@host:~# gdebi /root/zoneminder_1.26.4-1_amd64.deb;
|
|
||||||
|
|
||||||
|
Add the following to the bottom of the file
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
# Backports repository
|
||||||
|
deb http://httpredir.debian.org/debian jessie-backports main contrib non-free
|
||||||
|
|
||||||
|
CTRL+o and <Enter> to save
|
||||||
|
CTRL+x to exit
|
||||||
|
|
||||||
|
**Step 5:** Install ZoneMinder
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
apt-get update
|
||||||
|
apt-get install zoneminder
|
||||||
|
|
||||||
|
**Step 6:** Read the Readme
|
||||||
|
|
||||||
|
The rest of the install process is covered in the README.Debian, so feel free to have
|
||||||
|
a read.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
gunzip /usr/share/doc/zoneminder/README.Debian.gz
|
||||||
|
cat /usr/share/doc/zoneminder/README.Debian
|
||||||
|
|
||||||
|
**Step 7:** Setup Database
|
||||||
|
|
||||||
|
Install the zm database and setup the user account. Refer to Hints in Ubuntu install
|
||||||
|
should you choose to change default database user and password.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
cat /usr/share/zoneminder/db/zm_create.sql | sudo mysql --defaults-file=/etc/mysql/debian.cnf
|
||||||
|
echo 'grant lock tables,alter,create,select,insert,update,delete,index on zm.* to 'zmuser'@localhost identified by "zmpass";' | sudo mysql --defaults-file=/etc/mysql/debian.cnf mysql
|
||||||
|
|
||||||
|
** Step 8:** zm.conf Permissions
|
||||||
|
|
||||||
|
Adjust permissions to the zm.conf file to allow web account to access it.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
chgrp -c www-data /etc/zm/zm.conf
|
||||||
|
|
||||||
|
**Step 9:** Setup ZoneMinder service
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
systemctl enable zoneminder.service
|
||||||
|
|
||||||
|
**Step 10:** Configure Apache
|
||||||
|
|
||||||
|
The following commands will setup the default /zm virtual directory and configure
|
||||||
|
required apache modules.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
a2enconf zoneminder
|
||||||
|
a2enmod cgi
|
||||||
|
a2enmod rewrite
|
||||||
|
|
||||||
|
**Step 11:** Edit Timezone in PHP
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
nano /etc/php5/apache2/php.ini
|
||||||
|
|
||||||
|
Search for [Date] (Ctrl + w then type Date and press Enter) and change
|
||||||
|
date.timezone for your time zone. **Don't forget to remove the ; from in front
|
||||||
|
of date.timezone**
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
[Date]
|
||||||
|
; Defines the default timezone used by the date functions
|
||||||
|
; http://php.net/date.timezone
|
||||||
|
date.timezone = America/New_York
|
||||||
|
|
||||||
|
CTRL+o then [Enter] to save
|
||||||
|
|
||||||
|
CTRL+x to exit
|
||||||
|
|
||||||
|
**Step 12:** Start ZoneMinder
|
||||||
|
|
||||||
|
Reload Apache to enable your changes and then start ZoneMinder.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
systemctl reload apache2
|
||||||
|
systemctl start zoneminder
|
||||||
|
|
||||||
|
**Step 13:** Making sure ZoneMinder works
|
||||||
|
|
||||||
|
1. Open up a browser and go to ``http://hostname_or_ip/zm`` - should bring up ZoneMinder Console
|
||||||
|
|
||||||
|
2. (Optional API Check)Open up a tab in the same browser and go to ``http://hostname_or_ip/zm/api/host/getVersion.json``
|
||||||
|
|
||||||
|
If it is working correctly you should get version information similar to the example below:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
{
|
||||||
|
"version": "1.29.0",
|
||||||
|
"apiversion": "1.29.0.1"
|
||||||
|
}
|
||||||
|
|
||||||
|
**Congratulations** Your installation is complete
|
||||||
|
|
|
@ -1,289 +1,269 @@
|
||||||
Ubuntu Instruction
|
Ubuntu
|
||||||
===================
|
======
|
||||||
|
|
||||||
.. contents::
|
.. contents::
|
||||||
|
|
||||||
Easy Way: Install ZoneMinder from a package (Ubuntu 15.x+)
|
Easy Way: Ubuntu 16.04
|
||||||
-----------------------------------------------------------
|
----------------------
|
||||||
These instructions are for a brand new ubuntu 15.04 system which does not have ZM installed.
|
These instructions are for a brand new ubuntu 16.04 system which does not have ZM
|
||||||
|
installed.
|
||||||
|
|
||||||
**Step 1**: Make sure we add the correct packages
|
|
||||||
|
It is recommended that you use an Ubuntu Server install and select the LAMP option
|
||||||
|
during install to install Apache, MySQL and PHP. If you failed to do this you can
|
||||||
|
achieve the same result by running:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo add-apt-repository ppa:iconnor/zoneminder
|
tasksel install lamp-server
|
||||||
sudo apt-get update
|
|
||||||
|
|
||||||
if you don't have mysql already installed:
|
During installation it will ask you to set up a master/root password for the MySQL.
|
||||||
|
|
||||||
|
**Step 1:** Either run commands in this install using sudo or use the below to become root
|
||||||
|
::
|
||||||
|
|
||||||
|
sudo -i
|
||||||
|
|
||||||
|
**Step 2:** Update Repos
|
||||||
|
|
||||||
|
.. topic :: Latest Release
|
||||||
|
|
||||||
|
ZoneMinder 1.29.0 is now part of the current standard Ubuntu repository. But
|
||||||
|
if you wish to install the later releases of ZoneMinder you will need
|
||||||
|
to add the iconnor/zoneminder PPA.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
add-apt-repository ppa:iconnor/zoneminder
|
||||||
|
|
||||||
|
Update repo and upgrade.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo apt-get install mysql-server
|
apt-get update
|
||||||
|
apt-get upgrade
|
||||||
|
apt-get dist-upgrade
|
||||||
|
|
||||||
This will ask you to set up a master password for the DB (you are asked for the mysql root password when installing mysql server).
|
**Step 3:** Configure MySQL
|
||||||
|
|
||||||
**Step 2**: Install ZoneMinder
|
.. sidebar :: Note
|
||||||
|
|
||||||
|
The MySQL default configuration file (/etc/mysql/mysql.cnf)is read through
|
||||||
|
several symbolic links beginning with /etc/mysql/my.cnf as follows:
|
||||||
|
|
||||||
|
| /etc/mysql/my.cnf -> /etc/alternatives/my.cnf
|
||||||
|
| /etc/alternatives/my.cnf -> /etc/mysql/mysql.cnf
|
||||||
|
| /etc/mysql/mysql.cnf is a basic file
|
||||||
|
|
||||||
|
Certain new defaults in MySQL 5.7 are currently causing some issues with ZoneMinder,
|
||||||
|
the workaround is to modify the sql_mode setting of MySQL.
|
||||||
|
|
||||||
|
To better manage the MySQL server it is recommended to copy the sample config file and
|
||||||
|
replace the default my.cnf symbolic link.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo apt-get install zoneminder
|
rm /etc/mysql/my.cnf (this removes the current symbolic link)
|
||||||
|
cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf
|
||||||
|
|
||||||
**Step 3**: Configure the Database
|
To change MySQL settings:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
|
nano /etc/mysql/my.cnf
|
||||||
|
|
||||||
|
In the [mysqld] section add the following
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
sql_mode = NO_ENGINE_SUBSTITUTION
|
||||||
|
|
||||||
|
CTRL+o then [Enter] to save
|
||||||
|
|
||||||
|
CTRL+x to exit
|
||||||
|
|
||||||
|
Restart MySQL
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
systemctl restart mysql
|
||||||
|
|
||||||
|
|
||||||
|
**Step 4:** Install ZoneMinder
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
apt-get install zoneminder
|
||||||
|
|
||||||
|
**Step 5:** Configure the ZoneMinder Database
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
|
||||||
mysql -uroot -p -e "grant select,insert,update,delete,create,alter,index,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"
|
mysql -uroot -p -e "grant select,insert,update,delete,create,alter,index,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"
|
||||||
|
|
||||||
You don't really need this, but no harm (needed if you are upgrading)
|
|
||||||
|
**Step 6:** Set permissions
|
||||||
|
|
||||||
|
Set /etc/zm/zm.conf to root:www-data 740 and www-data access to content
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo /usr/bin/zmupdate.pl
|
chmod 740 /etc/zm/zm.conf
|
||||||
|
chown root:www-data /etc/zm/zm.conf
|
||||||
|
chown -R www-data:www-data /usr/share/zoneminder/
|
||||||
|
|
||||||
**Step 4**: Configure systemd to recognize ZoneMinder and configure Apache correctly:
|
**Step 7:** Configure Apache correctly:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo systemctl enable zoneminder
|
a2enconf zoneminder
|
||||||
sudo a2enconf zoneminder
|
a2enmod cgi
|
||||||
sudo a2enmod cgi
|
a2enmod rewrite
|
||||||
sudo chown -R www-data:www-data /usr/share/zoneminder/
|
|
||||||
|
|
||||||
|
**Step 8:** Enable and start Zoneminder
|
||||||
We need this for API routing to work:
|
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo a2enmod rewrite
|
systemctl enable zoneminder
|
||||||
|
systemctl start zoneminder
|
||||||
|
|
||||||
This is probably a bug with iconnor's PPA as of Oct 3, 2015 with package 1.28.107. After installing, ``zm.conf`` does not have the right read permissions, so we need to fix that. This may go away in future PPA releases:
|
**Step 9:** Edit Timezone in PHP
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo chown www-data:www-data /etc/zm/zm.conf
|
nano /etc/php/7.0/apache2/php.ini
|
||||||
|
|
||||||
We also need to install php5-gd (as of 1.28.107, this is not installed)
|
Search for [Date] (Ctrl + w then type Date and press Enter) and change
|
||||||
|
date.timezone for your time zone, see [this](http://php.net/manual/en/timezones.php).
|
||||||
|
**Don't forget to remove the ; from in front of date.timezone**
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo apt-get install php5-gd
|
[Date]
|
||||||
|
; Defines the default timezone used by the date functions
|
||||||
|
; http://php.net/date.timezone
|
||||||
|
date.timezone = America/New_York
|
||||||
|
|
||||||
**Step 5**: Edit Timezone in PHP
|
CTRL+o then [Enter] to save
|
||||||
|
|
||||||
|
CTRL+x to exit
|
||||||
|
|
||||||
|
**Step 10:** Reload Apache service
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
vi /etc/php5/apache2/php.ini
|
systemctl reload apache2
|
||||||
|
|
||||||
Look for [Date] and inside it you will see a date.timezone
|
**Step 11:** Making sure ZoneMinder works
|
||||||
that is commented. remove the comment and specific your timezone.
|
|
||||||
Please make sure the timezone is valid (see this: http://php.net/manual/en/timezones.php)
|
|
||||||
|
|
||||||
In my case:
|
1. Open up a browser and go to ``http://hostname_or_ip/zm`` - should bring up ZoneMinder Console
|
||||||
|
|
||||||
::
|
2. (Optional API Check)Open up a tab in the same browser and go to ``http://hostname_or_ip/zm/api/host/getVersion.json``
|
||||||
|
|
||||||
date.timezone = America/New_York
|
If it is working correctly you should get version information similar to the example below:
|
||||||
|
|
||||||
**Step 6**: Restart services
|
::
|
||||||
|
|
||||||
::
|
{
|
||||||
|
"version": "1.29.0",
|
||||||
|
"apiversion": "1.29.0.1"
|
||||||
|
}
|
||||||
|
|
||||||
sudo service apache2 reload
|
**Congratulations** Your installation is complete
|
||||||
sudo systemctl restart zoneminder
|
|
||||||
|
|
||||||
|
PPA install may need some tweaking of ZMS_PATH in ZoneMinder options. `Socket_sendto or no live streaming`_
|
||||||
|
|
||||||
**Step 7: make sure live streaming works**: Make sure you can view Monitor streams:
|
Easy Way: Ubuntu 14.x
|
||||||
|
---------------------
|
||||||
startup ZM console in your browser, go to ``Options->Path`` and make sure ``PATH_ZMS`` is set to ``/zm/cgi-bin/nph-zms`` and restart ZM (you should not need to do this for packages, as this should automatically work)
|
|
||||||
|
|
||||||
|
|
||||||
**Step 8**: If you have changed your DB login/password from zmuser/zmpass, the API won't know about it
|
|
||||||
|
|
||||||
If you changed the DB password **after** installing ZM, the APIs will not be able to connect to the DB.
|
|
||||||
|
|
||||||
If you have, go to ``zoneminder/www/api/app/Config`` & Edit ``database.php``
|
|
||||||
|
|
||||||
There is a class there called ``DATABASE_CONFIG`` - change the ``$default`` array to reflect your new details. Example:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
public $default = array(
|
|
||||||
'datasource' => 'Database/Mysql',
|
|
||||||
'persistent' => false,
|
|
||||||
'host' => 'localhost',
|
|
||||||
'login' => 'mynewDBusername',
|
|
||||||
'password' => 'mynewDBpassword'
|
|
||||||
'database' => 'zm',
|
|
||||||
'prefix' => '',
|
|
||||||
//'encoding' => 'utf8',
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
You are done. Lets proceed to make sure everything works:
|
|
||||||
|
|
||||||
Making sure ZM and APIs work:
|
|
||||||
|
|
||||||
1. open up a browser and go to ``http://localhost/zm`` - should bring up ZM
|
|
||||||
2. (OPTIONAL - just for peace of mind) open up a tab and go to ``http://localhost/zm/api`` - should bring up a screen showing CakePHP version with some green color boxes. Green is good. If you see red, or you don't see green, there may be a problem (should not happen). Ignore any warnings in yellow saying "DebugKit" not installed. You don't need it
|
|
||||||
3. open up a tab in the same browser and go to ``http://localhost/zm/api/host/getVersion.json``
|
|
||||||
|
|
||||||
If it responds with something like:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
{
|
|
||||||
"version": "1.28.107",
|
|
||||||
"apiversion": "1.28.107.1"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
**Then your APIs are working**
|
|
||||||
|
|
||||||
Make sure ZM and APIs work with security:
|
|
||||||
1. Enable OPT_AUTH in ZM
|
|
||||||
2. Log out of ZM in browser
|
|
||||||
3. Open a NEW tab in the SAME BROWSER (important) and go to ``http://localhost/zm/api/host/getVersion.json`` - should give you "Unauthorized" along with a lot more of text
|
|
||||||
4. Go to another tab in the SAME BROWSER (important) and log into ZM
|
|
||||||
5. Repeat step 3 and it should give you the ZM and API version
|
|
||||||
|
|
||||||
**Congrats** your installation is complete
|
|
||||||
|
|
||||||
|
|
||||||
Easy Way: Install ZoneMinder from a package (Ubuntu 14.x)
|
|
||||||
-----------------------------------------------------------
|
|
||||||
**These instructions are for a brand new ubuntu 14.x system which does not have ZM installed.**
|
**These instructions are for a brand new ubuntu 14.x system which does not have ZM installed.**
|
||||||
|
|
||||||
**Step 1:** Install ZoneMinder
|
**Step 1:** Either run commands in this install using sudo or use the below to become root
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo add-apt-repository ppa:iconnor/zoneminder
|
sudo -i
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install zoneminder
|
**Step 2:** Install ZoneMinder
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
add-apt-repository ppa:iconnor/zoneminder
|
||||||
|
apt-get update
|
||||||
|
apt-get install zoneminder
|
||||||
|
|
||||||
(just press OK for the prompts you get)
|
(just press OK for the prompts you get)
|
||||||
|
|
||||||
**Step 2:** Set up DB
|
**Step 3:** Set up DB
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
|
mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
|
||||||
mysql -uroot -p -e "grant select,insert,update,delete,create,alter,index,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"
|
mysql -uroot -p -e "grant select,insert,update,delete,create,alter,index,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"
|
||||||
|
|
||||||
**Step 3:** Set up Apache
|
**Step 4:** Set up Apache
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo a2enconf zoneminder
|
a2enconf zoneminder
|
||||||
sudo a2enmod rewrite
|
a2enmod rewrite
|
||||||
sudo a2enmod cgi
|
a2enmod cgi
|
||||||
|
|
||||||
**Step 4:**:Some tweaks that will be needed:
|
**Step 5:** Make zm.conf readable by web user.
|
||||||
|
|
||||||
Edit ``/etc/init.d/zoneminder``:
|
|
||||||
|
|
||||||
add a ``sleep 10`` right after line 25 that reads ``echo -n "Starting $prog:"``
|
|
||||||
(The reason we need this sleep is to make sure ZM starts after mysqld starts)
|
|
||||||
|
|
||||||
As of Oct 3 2015, zm.conf is not readable by ZM. This is likely a bug and will go away in the next package
|
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo chown www-data:www-data /etc/zm/zm.conf
|
sudo chown www-data:www-data /etc/zm/zm.conf
|
||||||
|
|
||||||
|
|
||||||
|
**Step 6:** Edit Timezone in PHP
|
||||||
**Step 5**: If you have changed your DB login/password
|
|
||||||
|
|
||||||
If you changed the DB password **after** installing ZM, the APIs will not be able to connect to the DB.
|
|
||||||
|
|
||||||
If you have, go to ``/usr/share/zoneminder/www/api/app/Config`` & Edit ``database.php``
|
|
||||||
|
|
||||||
There is a class there called ``DATABASE_CONFIG`` - change the ``$default`` array to reflect your new details. Example:
|
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
public $default = array(
|
nano /etc/php5/apache2/php.ini
|
||||||
'datasource' => 'Database/Mysql',
|
|
||||||
'persistent' => false,
|
|
||||||
'host' => 'localhost',
|
|
||||||
'login' => 'mynewDBusername',
|
|
||||||
'password' => 'mynewDBpassword'
|
|
||||||
'database' => 'zm',
|
|
||||||
'prefix' => '',
|
|
||||||
//'encoding' => 'utf8',`
|
|
||||||
);
|
|
||||||
|
|
||||||
We also need to install php5-gd (as of 1.28.107, this is not installed)
|
Search for [Date] (Ctrl + w then type Date and press Enter) and change
|
||||||
|
date.timezone for your time zone, see [this](http://php.net/manual/en/timezones.php).
|
||||||
|
**Don't forget to remove the ; from in front of date.timezone**
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo apt-get install php5-gd
|
[Date]
|
||||||
|
; Defines the default timezone used by the date functions
|
||||||
|
; http://php.net/date.timezone
|
||||||
|
date.timezone = America/New_York
|
||||||
|
|
||||||
|
CTRL+o then [Enter] to save
|
||||||
|
|
||||||
**Step 6**: Edit Timezone in PHP
|
CTRL+x to exit
|
||||||
|
|
||||||
``sudo vi /etc/php5/apache2/php.ini``
|
**Step 7:** Restart Apache service and start ZoneMinder
|
||||||
Look for [Date] and inside it you will see a date.timezone
|
|
||||||
that is commented. remove the comment and specific your timezone.
|
|
||||||
Please make sure the timezone is valid (see [this](http://php.net/manual/en/timezones.php))
|
|
||||||
|
|
||||||
In my case:
|
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
date.timezone = America/New_York
|
service apache2 reload
|
||||||
|
service zoneminder start
|
||||||
|
|
||||||
|
|
||||||
**Step 7: make sure live streaming works**: Make sure you can view Monitor streams:
|
**Step 8:** Making sure ZoneMinder works
|
||||||
|
|
||||||
startup ZM console in your browser, go to ``Options->Path`` and make sure ``PATH_ZMS`` is set to ``/zm/cgi-bin/nph-zms`` and restart ZM (you should not need to do this for packages, as this should automatically work)
|
1. Open up a browser and go to ``http://hostname_or_ip/zm`` - should bring up ZoneMinder Console
|
||||||
|
|
||||||
|
2. (Optional API Check)Open up a tab in the same browser and go to ``http://hostname_or_ip/zm/api/host/getVersion.json``
|
||||||
|
|
||||||
|
If it is working correctly you should get version information similar to the example below:
|
||||||
|
|
||||||
restart:
|
::
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
sudo service apache2 restart
|
|
||||||
sudo service zoneminder restart
|
|
||||||
|
|
||||||
**Step 8**: Making sure ZM and APIs work: (optional - only if you need APIs)
|
|
||||||
|
|
||||||
1. open up a browser and go to ``http://localhost/zm`` - should bring up ZM
|
|
||||||
2. (OPTIONAL - just for peace of mind) open up a tab and go to ``http://localhost/zm/api`` - should bring up a screen showing CakePHP version with some green color boxes. Green is good. If you see red, or you don't see green, there may be a problem (should not happen). Ignore any warnings in yellow saying "DebugKit" not installed. You don't need it
|
|
||||||
3. open up a tab in the same browser and go to ``http://localhost/zm/api/host/getVersion.json``
|
|
||||||
|
|
||||||
If it responds with something like:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
{
|
|
||||||
"version": "1.28.107",
|
|
||||||
"apiversion": "1.28.107.1"
|
|
||||||
}
|
|
||||||
|
|
||||||
Then your APIs are working
|
|
||||||
|
|
||||||
Make sure you can view Monitor View:
|
|
||||||
1. Open up ZM, configure your monitors and verify you can view Monitor feeds.
|
|
||||||
2. If not, open up ZM console in your browser, go to ``Options->Path`` and make sure ``PATH_ZMS`` is set to ``/zm/cgi-bin/nph-zms`` and restart ZM (you should not need to do this for packages, as this should automatically work)
|
|
||||||
|
|
||||||
Make sure ZM and APIs work with security:
|
|
||||||
1. Enable OPT_AUTH in ZM
|
|
||||||
2. Log out of ZM in browser
|
|
||||||
3. Open a NEW tab in the SAME BROWSER (important) and go to ``http://localhost/zm/api/host/getVersion.json`` - should give you "Unauthorized" along with a lot more of text
|
|
||||||
4. Go to another tab in the SAME BROWSER (important) and log into ZM
|
|
||||||
5. Repeat step 3 and it should give you the ZM and API version
|
|
||||||
|
|
||||||
**Congrats** Your installation is complete
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
"version": "1.29.0",
|
||||||
|
"apiversion": "1.29.0.1"
|
||||||
|
}
|
||||||
|
|
||||||
|
**Congratulations** Your installation is complete
|
||||||
|
|
||||||
Harder Way: Build Package From Source
|
Harder Way: Build Package From Source
|
||||||
-------------------------------------------
|
-------------------------------------
|
||||||
(These instructions assume installation from source on a ubuntu 15.x+ system)
|
(These instructions assume installation from source on a ubuntu 15.x+ system)
|
||||||
|
|
||||||
**Step 1:** Grab the package installer script
|
**Step 1:** Grab the package installer script
|
||||||
|
@ -314,12 +294,21 @@ To build the latest stable release:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
./do_debian_package.sh `lsb_release -a 2>/dev/null | grep Codename | awk '{print $2}'` `date +%Y%m%d`01 local stable
|
./do_debian_package.sh `lsb_release -a 2>/dev/null | grep Codename | awk '{print $2}'` `date +%Y%m%d`01 local stable
|
||||||
|
|
||||||
|
|
||||||
Note that the ``lsb_release -a 2>/dev/null | grep Codename | awk '{print $2}'`` part simply extracts your distribution name - like "vivid", "trusty" etc. You can always replace it by your distro name if you know it. As far as the script goes, it checks if your distro is "trusty" in which case it pulls in pre-systemd release configurations and if its not "trusty" it assumes its based on systemd and pulls in systemd related config files.
|
Note that the ``lsb_release -a 2>/dev/null | grep Codename | awk '{print $2}'``
|
||||||
|
part simply extracts your distribution name - like "vivid", "trusty" etc. You
|
||||||
|
can always replace it by your distro name if you know it. As far as the script
|
||||||
|
goes, it checks if your distro is "trusty" in which case it pulls in pre-systemd
|
||||||
|
release configurations and if its not "trusty" it assumes its based on systemd
|
||||||
|
and pulls in systemd related config files.
|
||||||
|
|
||||||
(At the end the script will ask if you want to retain the checked out version of zoneminder. If you are a developer and are making local changes, make sure you select "y" so that the next time you do the build process mentioned here, it keeps your changes. Selecting any other value than "y" or "Y" will delete the checked out code and only retain the package)
|
(At the end the script will ask if you want to retain the checked out version of
|
||||||
|
ZoneMinder. If you are a developer and are making local changes, make sure you
|
||||||
|
select "y" so that the next time you do the build process mentioned here, it
|
||||||
|
keeps your changes. Selecting any other value than "y" or "Y" will delete the
|
||||||
|
checked out code and only retain the package)
|
||||||
|
|
||||||
This should now create a bunch of .deb files
|
This should now create a bunch of .deb files
|
||||||
|
|
||||||
|
@ -335,57 +324,58 @@ This should now create a bunch of .deb files
|
||||||
|
|
||||||
**Step 5:** Post install configuration
|
**Step 5:** Post install configuration
|
||||||
|
|
||||||
::
|
Now that you have installed from your own package you can resume following the
|
||||||
|
standard install guide for your version, start at the step after Install Zoneminder.
|
||||||
|
|
||||||
sudo mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
|
Hints
|
||||||
mysql -uroot -p -e "grant select,insert,update,delete,create,alter,index,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"
|
-----
|
||||||
|
Make sure ZoneMinder and APIs work with security
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
sudo a2enmod cgi rewrite
|
1. Enable OPT_AUTH in ZoneMinder
|
||||||
sudo a2enconf zoneminder
|
2. Log out of ZoneMinder in browser
|
||||||
|
3. Open a new tab in the *same browser* (important) and go to
|
||||||
|
``http://localhost/zm/api/host/getVersion.json`` - should give you "Unauthorized"
|
||||||
|
along with a lot more of text
|
||||||
|
4. Go to another tab in the SAME BROWSER (important) and log into ZM
|
||||||
|
5. Repeat step 3 and it should give you the ZM and API version
|
||||||
|
|
||||||
|
Socket_sendto or no live streaming
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
After you have setup your camera make sure you can view Monitor streams, if not
|
||||||
|
check some of the common causes:
|
||||||
|
|
||||||
|
* Check Apache cgi module is enabled.
|
||||||
|
* Check Apache /etc/apache2/conf-enabled/zoneminder.conf ScriptAlias matches PATH_ZMS.
|
||||||
|
|
||||||
|
ScriptAlias **/zm/cgi-bin** /usr/lib/zoneminder/cgi-bin
|
||||||
|
|
||||||
|
From console go to ``Options->Path`` and make sure PATH_ZMS is set to **/zm/cgi-bin/**\ nph-zms.
|
||||||
|
|
||||||
|
|
||||||
|
Changed Default DB User
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
**Step 6:** Fix PHP TimeZone
|
If you have changed your DB login/password from zmuser/zmpass, you need to
|
||||||
|
update these values in zm.conf and the API's database.php file.
|
||||||
|
|
||||||
``sudo vi /etc/php5/apache2/php.ini``
|
1. Edit zm.conf to change ZM_DB_USER and ZM_DB_PASS to the values you used.
|
||||||
|
|
||||||
Look for [Date] and inside it you will see a date.timezone that is commented. remove the comment and specific your timezone. Please make sure the timezone is valid (see http://php.net/manual/en/timezones.php)
|
2. Edit databse.php which can be found in the web server folder zoneminder/www/api/app/Config
|
||||||
|
|
||||||
Example:
|
There is a class there called DATABASE_CONFIG -
|
||||||
|
change the $default array to reflect your new details. Example:
|
||||||
``date.timezone = America/New_York``
|
|
||||||
|
|
||||||
**Step 7:** Fix some key permission issues and make sure API works
|
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo chown www-data /etc/zm/zm.conf
|
public $default = array(
|
||||||
sudo chown -R www-data /usr/share/zoneminder/www/api/
|
'datasource' => 'Database/Mysql',
|
||||||
|
'persistent' => false,
|
||||||
|
'host' => 'localhost',
|
||||||
**Step 8:** Restart all services
|
'login' => 'mynewDBusername',
|
||||||
|
'password' => 'mynewDBpassword'
|
||||||
::
|
'database' => 'zm',
|
||||||
|
'prefix' => '',
|
||||||
sudo service apache2 restart
|
//'encoding' => 'utf8',
|
||||||
sudo service zoneminder restart
|
);
|
||||||
|
|
||||||
Check if ZM is running properly
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
sudo service zoneminder status
|
|
||||||
|
|
||||||
|
|
||||||
**Step 9:** Make sure streaming works - set PATH_ZMS
|
|
||||||
|
|
||||||
open up ZM console in your browser, go to Options->Path and make sure ``PATH_ZMS`` is set to ``/zm/cgi-bin/nph-zms`` and restart ZM
|
|
||||||
|
|
||||||
|
|
||||||
**Step 10:** Make sure everything works
|
|
||||||
|
|
||||||
* point your browser to http://yourzmip/zm - you should see ZM console running
|
|
||||||
* point your browser to http://yourzmip/zm/api/host/getVersion.json - you should see an API version
|
|
||||||
* Configure your monitors and make sure its all a-ok
|
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ If you have changed the value of an option you should then ‘save’ it. A numb
|
||||||
options/options_display
|
options/options_display
|
||||||
options/options_system
|
options/options_system
|
||||||
options/options_config
|
options/options_config
|
||||||
|
options/options_servers
|
||||||
options/options_paths
|
options/options_paths
|
||||||
options/options_web
|
options/options_web
|
||||||
options/options_images
|
options/options_images
|
||||||
|
|
|
@ -145,17 +145,18 @@ sub send_receive {
|
||||||
}
|
}
|
||||||
|
|
||||||
if($last_response) {
|
if($last_response) {
|
||||||
$self->code();
|
$self->set_code();
|
||||||
$self->message();
|
$self->set_message("");
|
||||||
$self->is_success(1);
|
$self->set_is_success(1);
|
||||||
$self->status('OK');
|
$self->set_status('OK');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$self->code();
|
$self->set_code();
|
||||||
$self->message();
|
$self->set_message("Timed out waiting for response");
|
||||||
$self->is_success(0);
|
$self->set_is_success(0);
|
||||||
$self->status('TIMEOUT');
|
$self->set_status('TIMEOUT');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $last_response;
|
return $last_response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,10 +89,11 @@ sub serialize()
|
||||||
my $ident = ${ $_[0] };
|
my $ident = ${ $_[0] };
|
||||||
my $option_ref = $_[1];
|
my $option_ref = $_[1];
|
||||||
my $attr_str = "";
|
my $attr_str = "";
|
||||||
|
my %attr_hash = %{$Attribs_of{$ident}};
|
||||||
|
|
||||||
foreach my $attr (keys %{$Attribs_of{$ident}})
|
foreach my $attr (keys %attr_hash)
|
||||||
{
|
{
|
||||||
my $value = %{$Attribs_of{$ident}}{$attr};
|
my $value = $attr_hash{$attr};
|
||||||
$attr_str .= " $attr=\"$value\"";
|
$attr_str .= " $attr=\"$value\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -333,7 +333,7 @@ bool Event::OpenFrameSocket( int monitor_id )
|
||||||
strncpy( addr.sun_path, sock_path, sizeof(addr.sun_path) );
|
strncpy( addr.sun_path, sock_path, sizeof(addr.sun_path) );
|
||||||
addr.sun_family = AF_UNIX;
|
addr.sun_family = AF_UNIX;
|
||||||
|
|
||||||
if ( connect( sd, (struct sockaddr *)&addr, strlen(addr.sun_path)+sizeof(addr.sun_family)) < 0 )
|
if ( connect( sd, (struct sockaddr *)&addr, strlen(addr.sun_path)+sizeof(addr.sun_family)+1) < 0 )
|
||||||
{
|
{
|
||||||
Warning( "Can't connect to frame server: %s", strerror(errno) );
|
Warning( "Can't connect to frame server: %s", strerror(errno) );
|
||||||
close( sd );
|
close( sd );
|
||||||
|
|
|
@ -150,11 +150,11 @@ int SWScale::Convert(const uint8_t* in_buffer, const size_t in_buffer_size, uint
|
||||||
Error("NULL Input or output buffer");
|
Error("NULL Input or output buffer");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(in_pf == 0 || out_pf == 0) {
|
// if(in_pf == 0 || out_pf == 0) {
|
||||||
Error("Invalid input or output pixel formats");
|
// Error("Invalid input or output pixel formats");
|
||||||
return -2;
|
// return -2;
|
||||||
}
|
// }
|
||||||
if(!width || !height) {
|
if (!width || !height) {
|
||||||
Error("Invalid width or height");
|
Error("Invalid width or height");
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
@ -190,18 +190,30 @@ int SWScale::Convert(const uint8_t* in_buffer, const size_t in_buffer_size, uint
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the context */
|
/* Get the context */
|
||||||
swscale_ctx = sws_getCachedContext( NULL, width, height, in_pf, width, height, out_pf, 0, NULL, NULL, NULL );
|
swscale_ctx = sws_getCachedContext(swscale_ctx, width, height, in_pf, width, height, out_pf, 0, NULL, NULL, NULL);
|
||||||
if(swscale_ctx == NULL) {
|
if(swscale_ctx == NULL) {
|
||||||
Error("Failed getting swscale context");
|
Error("Failed getting swscale context");
|
||||||
return -6;
|
return -6;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill in the buffers */
|
/* Fill in the buffers */
|
||||||
if(!avpicture_fill( (AVPicture*)input_avframe, (uint8_t*)in_buffer, in_pf, width, height ) ) {
|
#if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0)
|
||||||
|
if (av_image_fill_arrays(input_avframe->data, input_avframe->linesize,
|
||||||
|
(uint8_t*) in_buffer, in_pf, width, height, 1) <= 0) {
|
||||||
|
#else
|
||||||
|
if (avpicture_fill((AVPicture*) input_avframe, (uint8_t*) in_buffer,
|
||||||
|
in_pf, width, height) <= 0) {
|
||||||
|
#endif
|
||||||
Error("Failed filling input frame with input buffer");
|
Error("Failed filling input frame with input buffer");
|
||||||
return -7;
|
return -7;
|
||||||
}
|
}
|
||||||
if(!avpicture_fill( (AVPicture*)output_avframe, out_buffer, out_pf, width, height ) ) {
|
#if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0)
|
||||||
|
if (av_image_fill_arrays(output_avframe->data, output_avframe->linesize,
|
||||||
|
out_buffer, out_pf, width, height, 1) <= 0) {
|
||||||
|
#else
|
||||||
|
if (avpicture_fill((AVPicture*) output_avframe, out_buffer, out_pf, width,
|
||||||
|
height) <= 0) {
|
||||||
|
#endif
|
||||||
Error("Failed filling output frame with output buffer");
|
Error("Failed filling output frame with output buffer");
|
||||||
return -8;
|
return -8;
|
||||||
}
|
}
|
||||||
|
@ -330,8 +342,7 @@ int hacked_up_context2_for_older_ffmpeg(AVFormatContext **avctx, AVOutputFormat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zm_log_fps(double d, const char *postfix)
|
static void zm_log_fps(double d, const char *postfix) {
|
||||||
{
|
|
||||||
uint64_t v = lrintf(d * 100);
|
uint64_t v = lrintf(d * 100);
|
||||||
if (!v) {
|
if (!v) {
|
||||||
Debug(3, "%1.4f %s", d, postfix);
|
Debug(3, "%1.4f %s", d, postfix);
|
||||||
|
|
|
@ -597,7 +597,25 @@ int FfmpegCamera::CaptureAndRecord( Image &image, bool recording, char* event_fi
|
||||||
if ( recording && !wasRecording ) {
|
if ( recording && !wasRecording ) {
|
||||||
//Instantiate the video storage module
|
//Instantiate the video storage module
|
||||||
|
|
||||||
videoStore = new VideoStore((const char *)event_file, "mp4", mFormatContext->streams[mVideoStreamId],mAudioStreamId==-1?NULL:mFormatContext->streams[mAudioStreamId],startTime);
|
if (record_audio) {
|
||||||
|
if (mAudioStreamId == -1) {
|
||||||
|
Debug(3, "Record Audio on but no audio stream found");
|
||||||
|
videoStore = new VideoStore((const char *) event_file, "mp4",
|
||||||
|
mFormatContext->streams[mVideoStreamId],
|
||||||
|
NULL, startTime);
|
||||||
|
} else {
|
||||||
|
Debug(3, "Video module initiated with audio stream");
|
||||||
|
videoStore = new VideoStore((const char *) event_file, "mp4",
|
||||||
|
mFormatContext->streams[mVideoStreamId],
|
||||||
|
mFormatContext->streams[mAudioStreamId],
|
||||||
|
startTime);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Debug(3, "Record_audio is false so exclude audio stream");
|
||||||
|
videoStore = new VideoStore((const char *) event_file, "mp4",
|
||||||
|
mFormatContext->streams[mVideoStreamId],
|
||||||
|
NULL, startTime);
|
||||||
|
}
|
||||||
wasRecording = true;
|
wasRecording = true;
|
||||||
strcpy(oldDirectory, event_file);
|
strcpy(oldDirectory, event_file);
|
||||||
|
|
||||||
|
@ -606,24 +624,47 @@ int FfmpegCamera::CaptureAndRecord( Image &image, bool recording, char* event_fi
|
||||||
delete videoStore;
|
delete videoStore;
|
||||||
videoStore = NULL;
|
videoStore = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//The directory we are recording to is no longer tied to the current event. Need to re-init the videostore with the correct directory and start recording again
|
// The directory we are recording to is no longer tied to the current
|
||||||
if ( recording && wasRecording && (strcmp(oldDirectory, event_file) != 0 ) && (packet.flags & AV_PKT_FLAG_KEY) ) {
|
// event. Need to re-init the videostore with the correct directory and
|
||||||
// don't open new videostore until we're on a key frame..would this require an offset adjustment for the event as a result?...
|
// start recording again
|
||||||
// if we store our key frame location with the event will that be enough?
|
if (recording && wasRecording && (strcmp(oldDirectory, event_file) != 0)
|
||||||
|
&& (packet.flags & AV_PKT_FLAG_KEY)) {
|
||||||
|
// Don't open new videostore until we're on a key frame..would this
|
||||||
|
// require an offset adjustment for the event as a result?...if we store
|
||||||
|
// our key frame location with the event will that be enough?
|
||||||
Info("Re-starting video storage module");
|
Info("Re-starting video storage module");
|
||||||
if(videoStore){
|
if(videoStore){
|
||||||
delete videoStore;
|
delete videoStore;
|
||||||
videoStore = NULL;
|
videoStore = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
videoStore = new VideoStore((const char *)event_file, "mp4", mFormatContext->streams[mVideoStreamId],mAudioStreamId==-1?NULL:mFormatContext->streams[mAudioStreamId],startTime);
|
if (record_audio) {
|
||||||
|
if (mAudioStreamId == -1) {
|
||||||
|
Debug(3, "Record Audio on but no audio stream found");
|
||||||
|
videoStore = new VideoStore((const char *) event_file, "mp4",
|
||||||
|
mFormatContext->streams[mVideoStreamId],
|
||||||
|
NULL, startTime);
|
||||||
|
} else {
|
||||||
|
Debug(3, "Video module initiated with audio stream");
|
||||||
|
videoStore = new VideoStore((const char *) event_file, "mp4",
|
||||||
|
mFormatContext->streams[mVideoStreamId],
|
||||||
|
mFormatContext->streams[mAudioStreamId],
|
||||||
|
startTime);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Debug(3, "Record_audio is false so exclude audio stream");
|
||||||
|
videoStore = new VideoStore((const char *) event_file, "mp4",
|
||||||
|
mFormatContext->streams[mVideoStreamId],
|
||||||
|
NULL, startTime);
|
||||||
|
}
|
||||||
strcpy(oldDirectory, event_file);
|
strcpy(oldDirectory, event_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( videoStore && recording ) {
|
if ( videoStore && recording ) {
|
||||||
//Write the packet to our video store
|
//Write the packet to our video store
|
||||||
int ret = videoStore->writeVideoFramePacket(&packet, mFormatContext->streams[mVideoStreamId]);//, &lastKeyframePkt);
|
int ret = videoStore->writeVideoFramePacket(&packet,
|
||||||
|
mFormatContext->streams[mVideoStreamId]); //, &lastKeyframePkt);
|
||||||
if(ret<0){//Less than zero and we skipped a frame
|
if(ret<0){//Less than zero and we skipped a frame
|
||||||
av_free_packet( &packet );
|
av_free_packet( &packet );
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -632,13 +673,20 @@ int FfmpegCamera::CaptureAndRecord( Image &image, bool recording, char* event_fi
|
||||||
|
|
||||||
#if HAVE_LIBSWSCALE
|
#if HAVE_LIBSWSCALE
|
||||||
if ( mConvertContext == NULL ) {
|
if ( mConvertContext == NULL ) {
|
||||||
mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL );
|
mConvertContext = sws_getContext(mCodecContext->width,
|
||||||
|
mCodecContext->height,
|
||||||
|
mCodecContext->pix_fmt,
|
||||||
|
width, height,
|
||||||
|
imagePixFormat, SWS_BICUBIC, NULL,
|
||||||
|
NULL, NULL);
|
||||||
if ( mConvertContext == NULL )
|
if ( mConvertContext == NULL )
|
||||||
Fatal( "Unable to create conversion context for %s", mPath.c_str() );
|
Fatal( "Unable to create conversion context for %s", mPath.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( sws_scale( mConvertContext, mRawFrame->data, mRawFrame->linesize, 0, mCodecContext->height, mFrame->data, mFrame->linesize ) < 0 )
|
if (sws_scale(mConvertContext, mRawFrame->data, mRawFrame->linesize,
|
||||||
Fatal( "Unable to convert raw format %u to target format %u at frame %d", mCodecContext->pix_fmt, imagePixFormat, frameCount );
|
0, mCodecContext->height, mFrame->data, mFrame->linesize) < 0)
|
||||||
|
Fatal("Unable to convert raw format %u to target format %u at frame %d",
|
||||||
|
mCodecContext->pix_fmt, imagePixFormat, frameCount);
|
||||||
#else // HAVE_LIBSWSCALE
|
#else // HAVE_LIBSWSCALE
|
||||||
Fatal( "You must compile ffmpeg with the --enable-swscale option to use ffmpeg cameras" );
|
Fatal( "You must compile ffmpeg with the --enable-swscale option to use ffmpeg cameras" );
|
||||||
#endif // HAVE_LIBSWSCALE
|
#endif // HAVE_LIBSWSCALE
|
||||||
|
@ -650,7 +698,8 @@ int FfmpegCamera::CaptureAndRecord( Image &image, bool recording, char* event_fi
|
||||||
if ( record_audio ) {
|
if ( record_audio ) {
|
||||||
Debug(4, "Recording audio packet" );
|
Debug(4, "Recording audio packet" );
|
||||||
//Write the packet to our video store
|
//Write the packet to our video store
|
||||||
int ret = videoStore->writeAudioFramePacket(&packet, mFormatContext->streams[packet.stream_index]); //FIXME no relevance of last key frame
|
int ret = videoStore->writeAudioFramePacket(&packet,
|
||||||
|
mFormatContext->streams[packet.stream_index]); //FIXME no relevance of last key frame
|
||||||
if ( ret < 0 ) {//Less than zero and we skipped a frame
|
if ( ret < 0 ) {//Less than zero and we skipped a frame
|
||||||
av_free_packet( &packet );
|
av_free_packet( &packet );
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -35,8 +35,10 @@ static short *g_u_table;
|
||||||
static short *b_u_table;
|
static short *b_u_table;
|
||||||
__attribute__((aligned(16))) static const uint8_t movemask[16] = {0,4,8,12,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
|
__attribute__((aligned(16))) static const uint8_t movemask[16] = {0,4,8,12,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
|
||||||
|
|
||||||
jpeg_compress_struct *Image::jpg_ccinfo[101] = { 0 };
|
jpeg_compress_struct *Image::writejpg_ccinfo[101] = { 0 };
|
||||||
jpeg_decompress_struct *Image::jpg_dcinfo = 0;
|
jpeg_compress_struct *Image::encodejpg_ccinfo[101] = { 0 };
|
||||||
|
jpeg_decompress_struct *Image::readjpg_dcinfo = 0;
|
||||||
|
jpeg_decompress_struct *Image::decodejpg_dcinfo = 0;
|
||||||
struct zm_error_mgr Image::jpg_err;
|
struct zm_error_mgr Image::jpg_err;
|
||||||
|
|
||||||
/* Pointer to blend function. */
|
/* Pointer to blend function. */
|
||||||
|
@ -151,11 +153,17 @@ Image::~Image()
|
||||||
delete[] b_u_table;
|
delete[] b_u_table;
|
||||||
initialised = false;
|
initialised = false;
|
||||||
}
|
}
|
||||||
if ( jpg_dcinfo )
|
if ( readjpg_dcinfo )
|
||||||
{
|
{
|
||||||
jpeg_destroy_decompress( jpg_dcinfo );
|
jpeg_destroy_decompress( readjpg_dcinfo );
|
||||||
delete jpg_dcinfo;
|
delete readjpg_dcinfo;
|
||||||
jpg_dcinfo = 0;
|
readjpg_dcinfo = 0;
|
||||||
|
}
|
||||||
|
if ( decodejpg_dcinfo )
|
||||||
|
{
|
||||||
|
jpeg_destroy_decompress( decodejpg_dcinfo );
|
||||||
|
delete decodejpg_dcinfo;
|
||||||
|
decodejpg_dcinfo = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -653,11 +661,11 @@ bool Image::WriteRaw( const char *filename ) const
|
||||||
bool Image::ReadJpeg( const char *filename, unsigned int p_colours, unsigned int p_subpixelorder)
|
bool Image::ReadJpeg( const char *filename, unsigned int p_colours, unsigned int p_subpixelorder)
|
||||||
{
|
{
|
||||||
unsigned int new_width, new_height, new_colours, new_subpixelorder;
|
unsigned int new_width, new_height, new_colours, new_subpixelorder;
|
||||||
struct jpeg_decompress_struct *cinfo = jpg_dcinfo;
|
struct jpeg_decompress_struct *cinfo = readjpg_dcinfo;
|
||||||
|
|
||||||
if ( !cinfo )
|
if ( !cinfo )
|
||||||
{
|
{
|
||||||
cinfo = jpg_dcinfo = new jpeg_decompress_struct;
|
cinfo = readjpg_dcinfo = new jpeg_decompress_struct;
|
||||||
cinfo->err = jpeg_std_error( &jpg_err.pub );
|
cinfo->err = jpeg_std_error( &jpg_err.pub );
|
||||||
jpg_err.pub.error_exit = zm_jpeg_error_exit;
|
jpg_err.pub.error_exit = zm_jpeg_error_exit;
|
||||||
jpg_err.pub.emit_message = zm_jpeg_emit_message;
|
jpg_err.pub.emit_message = zm_jpeg_emit_message;
|
||||||
|
@ -814,11 +822,11 @@ bool Image::WriteJpeg( const char *filename, int quality_override, struct timeva
|
||||||
}
|
}
|
||||||
int quality = quality_override?quality_override:config.jpeg_file_quality;
|
int quality = quality_override?quality_override:config.jpeg_file_quality;
|
||||||
|
|
||||||
struct jpeg_compress_struct *cinfo = jpg_ccinfo[quality];
|
struct jpeg_compress_struct *cinfo = writejpg_ccinfo[quality];
|
||||||
|
|
||||||
if ( !cinfo )
|
if ( !cinfo )
|
||||||
{
|
{
|
||||||
cinfo = jpg_ccinfo[quality] = new jpeg_compress_struct;
|
cinfo = writejpg_ccinfo[quality] = new jpeg_compress_struct;
|
||||||
cinfo->err = jpeg_std_error( &jpg_err.pub );
|
cinfo->err = jpeg_std_error( &jpg_err.pub );
|
||||||
jpg_err.pub.error_exit = zm_jpeg_error_exit;
|
jpg_err.pub.error_exit = zm_jpeg_error_exit;
|
||||||
jpg_err.pub.emit_message = zm_jpeg_emit_message;
|
jpg_err.pub.emit_message = zm_jpeg_emit_message;
|
||||||
|
@ -945,11 +953,11 @@ bool Image::WriteJpeg( const char *filename, int quality_override, struct timeva
|
||||||
bool Image::DecodeJpeg( const JOCTET *inbuffer, int inbuffer_size, unsigned int p_colours, unsigned int p_subpixelorder)
|
bool Image::DecodeJpeg( const JOCTET *inbuffer, int inbuffer_size, unsigned int p_colours, unsigned int p_subpixelorder)
|
||||||
{
|
{
|
||||||
unsigned int new_width, new_height, new_colours, new_subpixelorder;
|
unsigned int new_width, new_height, new_colours, new_subpixelorder;
|
||||||
struct jpeg_decompress_struct *cinfo = jpg_dcinfo;
|
struct jpeg_decompress_struct *cinfo = decodejpg_dcinfo;
|
||||||
|
|
||||||
if ( !cinfo )
|
if ( !cinfo )
|
||||||
{
|
{
|
||||||
cinfo = jpg_dcinfo = new jpeg_decompress_struct;
|
cinfo = decodejpg_dcinfo = new jpeg_decompress_struct;
|
||||||
cinfo->err = jpeg_std_error( &jpg_err.pub );
|
cinfo->err = jpeg_std_error( &jpg_err.pub );
|
||||||
jpg_err.pub.error_exit = zm_jpeg_error_exit;
|
jpg_err.pub.error_exit = zm_jpeg_error_exit;
|
||||||
jpg_err.pub.emit_message = zm_jpeg_emit_message;
|
jpg_err.pub.emit_message = zm_jpeg_emit_message;
|
||||||
|
@ -1079,11 +1087,11 @@ bool Image::EncodeJpeg( JOCTET *outbuffer, int *outbuffer_size, int quality_over
|
||||||
|
|
||||||
int quality = quality_override?quality_override:config.jpeg_stream_quality;
|
int quality = quality_override?quality_override:config.jpeg_stream_quality;
|
||||||
|
|
||||||
struct jpeg_compress_struct *cinfo = jpg_ccinfo[quality];
|
struct jpeg_compress_struct *cinfo = encodejpg_ccinfo[quality];
|
||||||
|
|
||||||
if ( !cinfo )
|
if ( !cinfo )
|
||||||
{
|
{
|
||||||
cinfo = jpg_ccinfo[quality] = new jpeg_compress_struct;
|
cinfo = encodejpg_ccinfo[quality] = new jpeg_compress_struct;
|
||||||
cinfo->err = jpeg_std_error( &jpg_err.pub );
|
cinfo->err = jpeg_std_error( &jpg_err.pub );
|
||||||
jpg_err.pub.error_exit = zm_jpeg_error_exit;
|
jpg_err.pub.error_exit = zm_jpeg_error_exit;
|
||||||
jpg_err.pub.emit_message = zm_jpeg_emit_message;
|
jpg_err.pub.emit_message = zm_jpeg_emit_message;
|
||||||
|
|
|
@ -131,8 +131,10 @@ protected:
|
||||||
static unsigned char *y_r_table;
|
static unsigned char *y_r_table;
|
||||||
static unsigned char *y_g_table;
|
static unsigned char *y_g_table;
|
||||||
static unsigned char *y_b_table;
|
static unsigned char *y_b_table;
|
||||||
static jpeg_compress_struct *jpg_ccinfo[101];
|
static jpeg_compress_struct *writejpg_ccinfo[101];
|
||||||
static jpeg_decompress_struct *jpg_dcinfo;
|
static jpeg_compress_struct *encodejpg_ccinfo[101];
|
||||||
|
static jpeg_decompress_struct *readjpg_dcinfo;
|
||||||
|
static jpeg_decompress_struct *decodejpg_dcinfo;
|
||||||
static struct zm_error_mgr jpg_err;
|
static struct zm_error_mgr jpg_err;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
# We use session vars in here, so we need to restart the session because we stopped it in index.php to improve concurrency.
|
|
||||||
session_start();
|
|
||||||
|
|
||||||
if ( empty($_REQUEST['id']) && empty($_REQUEST['eids']) ) {
|
if ( empty($_REQUEST['id']) && empty($_REQUEST['eids']) ) {
|
||||||
ajaxError( "No event id(s) supplied" );
|
ajaxError( "No event id(s) supplied" );
|
||||||
|
@ -39,6 +37,9 @@ if ( canView( 'Events' ) ) {
|
||||||
{
|
{
|
||||||
require_once( ZM_SKIN_PATH.'/includes/export_functions.php' );
|
require_once( ZM_SKIN_PATH.'/includes/export_functions.php' );
|
||||||
|
|
||||||
|
# We use session vars in here, so we need to restart the session because we stopped it in index.php to improve concurrency.
|
||||||
|
session_start();
|
||||||
|
|
||||||
if ( !empty($_REQUEST['exportDetail']) )
|
if ( !empty($_REQUEST['exportDetail']) )
|
||||||
$exportDetail = $_SESSION['export']['detail'] = $_REQUEST['exportDetail'];
|
$exportDetail = $_SESSION['export']['detail'] = $_REQUEST['exportDetail'];
|
||||||
else
|
else
|
||||||
|
@ -64,6 +65,8 @@ if ( canView( 'Events' ) ) {
|
||||||
else
|
else
|
||||||
$exportFormat = '';
|
$exportFormat = '';
|
||||||
|
|
||||||
|
session_write_close();
|
||||||
|
|
||||||
$exportIds = !empty($_REQUEST['eids'])?$_REQUEST['eids']:$_REQUEST['id'];
|
$exportIds = !empty($_REQUEST['eids'])?$_REQUEST['eids']:$_REQUEST['id'];
|
||||||
if ( $exportFile = exportEvents( $exportIds, $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc, $exportFormat ) )
|
if ( $exportFile = exportEvents( $exportIds, $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc, $exportFormat ) )
|
||||||
ajaxResponse( array( 'exportFile'=>$exportFile ) );
|
ajaxResponse( array( 'exportFile'=>$exportFile ) );
|
||||||
|
|
|
@ -59,62 +59,64 @@ class AppController extends Controller {
|
||||||
public function beforeFilter() {
|
public function beforeFilter() {
|
||||||
$this->loadModel('Config');
|
$this->loadModel('Config');
|
||||||
|
|
||||||
$options = array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_OPT_USE_API'));
|
$options = array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_OPT_USE_API'));
|
||||||
$config = $this->Config->find('first', $options);
|
$config = $this->Config->find('first', $options);
|
||||||
$zmOptApi = $config['Config']['Value'];
|
$zmOptApi = $config['Config']['Value'];
|
||||||
|
|
||||||
if ($zmOptApi !='1')
|
if ($zmOptApi !='1') {
|
||||||
{
|
throw new UnauthorizedException(__('API Disabled'));
|
||||||
throw new UnauthorizedException(__('API Disabled'));
|
return;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_OPT_USE_AUTH'));
|
$options = array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_OPT_USE_AUTH'));
|
||||||
$config = $this->Config->find('first', $options);
|
$config = $this->Config->find('first', $options);
|
||||||
$zmOptAuth = $config['Config']['Value'];
|
$zmOptAuth = $config['Config']['Value'];
|
||||||
if (!$this->Session->Read('user.Username') && ($zmOptAuth=='1'))
|
|
||||||
{
|
|
||||||
throw new UnauthorizedException(__('Not Authenticated'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->loadModel('User');
|
|
||||||
$loggedinUser = $this->Session->Read('user.Username');
|
|
||||||
$isEnabled = $this->Session->Read('user.Enabled');
|
|
||||||
// this will likely never happen as if its
|
|
||||||
// not enabled, login will fail and Not Auth will be returned
|
|
||||||
// however, keeping this here for now
|
|
||||||
if ($isEnabled != "1" && $zmOptAuth=="1")
|
|
||||||
{
|
|
||||||
throw new UnauthorizedException(__('User is not enabled'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($zmOptAuth=='1')
|
if ( $zmOptAuth=='1' ) {
|
||||||
{
|
$this->loadModel('User');
|
||||||
$options = array ('conditions' => array ('User.Username' => $loggedinUser));
|
if ( isset($_REQUEST['user']) and isset($_REQUEST['pass']) ) {
|
||||||
$userMonitors = $this->User->find('first', $options);
|
$user = $this->User->find('first', array ('conditions' => array (
|
||||||
$this->Session->Write('allowedMonitors',$userMonitors['User']['MonitorIds']);
|
'User.Username' => $_REQUEST['user'],
|
||||||
$this->Session->Write('streamPermission',$userMonitors['User']['Stream']);
|
'User.Password' => $_REQUEST['pass'],
|
||||||
$this->Session->Write('eventPermission',$userMonitors['User']['Events']);
|
)) );
|
||||||
$this->Session->Write('controlPermission',$userMonitors['User']['Control']);
|
if ( ! $user ) {
|
||||||
$this->Session->Write('systemPermission',$userMonitors['User']['System']);
|
throw new UnauthorizedException(__('User not found'));
|
||||||
$this->Session->Write('monitorPermission',$userMonitors['User']['Monitors']);
|
return;
|
||||||
}
|
} else {
|
||||||
else // if auth is not on, you can do everything
|
$this->Session->Write( 'user.Username', $user['User']['Username'] );
|
||||||
{
|
$this->Session->Write( 'user.Enabled', $user['User']['Enabled'] );
|
||||||
//$userMonitors = $this->User->find('first', $options);
|
}
|
||||||
$this->Session->Write('allowedMonitors','');
|
}
|
||||||
$this->Session->Write('streamPermission','View');
|
|
||||||
$this->Session->Write('eventPermission','Edit');
|
if( ! $this->Session->Read('user.Username') ) {
|
||||||
$this->Session->Write('controlPermission','Edit');
|
throw new UnauthorizedException(__('Not Authenticated'));
|
||||||
$this->Session->Write('systemPermission','Edit');
|
return;
|
||||||
$this->Session->Write('monitorPermission','Edit');
|
} else if ( ! $this->Session->Read('user.Username') ) {
|
||||||
}
|
throw new UnauthorizedException(__('User is not enabled'));
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$options = array ('conditions' => array ('User.Username' => $this->Session->Read('user.Username')));
|
||||||
|
$userMonitors = $this->User->find('first', $options);
|
||||||
|
$this->Session->Write('allowedMonitors',$userMonitors['User']['MonitorIds']);
|
||||||
|
$this->Session->Write('streamPermission',$userMonitors['User']['Stream']);
|
||||||
|
$this->Session->Write('eventPermission',$userMonitors['User']['Events']);
|
||||||
|
$this->Session->Write('controlPermission',$userMonitors['User']['Control']);
|
||||||
|
$this->Session->Write('systemPermission',$userMonitors['User']['System']);
|
||||||
|
$this->Session->Write('monitorPermission',$userMonitors['User']['Monitors']);
|
||||||
}
|
}
|
||||||
|
else // if auth is not on, you can do everything
|
||||||
|
{
|
||||||
|
//$userMonitors = $this->User->find('first', $options);
|
||||||
|
$this->Session->Write('allowedMonitors','');
|
||||||
|
$this->Session->Write('streamPermission','View');
|
||||||
|
$this->Session->Write('eventPermission','Edit');
|
||||||
|
$this->Session->Write('controlPermission','Edit');
|
||||||
|
$this->Session->Write('systemPermission','Edit');
|
||||||
|
$this->Session->Write('monitorPermission','Edit');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} # end function beforeFilter()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,7 +247,7 @@ function applyZoneUnits()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
form.elements['newZone[TempArea]'].value = 100;
|
form.elements['newZone[TempArea]'].value = Math.round( area/monitorArea * 100 );
|
||||||
toPercent( form.elements['newZone[MinAlarmPixels]'], area );
|
toPercent( form.elements['newZone[MinAlarmPixels]'], area );
|
||||||
toPercent( form.elements['newZone[MaxAlarmPixels]'], area );
|
toPercent( form.elements['newZone[MaxAlarmPixels]'], area );
|
||||||
toPercent( form.elements['newZone[MinFilterPixels]'], area );
|
toPercent( form.elements['newZone[MinFilterPixels]'], area );
|
||||||
|
@ -321,7 +321,7 @@ function updateZoneImage()
|
||||||
var Point = SVG.createSVGPoint();
|
var Point = SVG.createSVGPoint();
|
||||||
Point.x = zone['Points'][i].x;
|
Point.x = zone['Points'][i].x;
|
||||||
Point.y = zone['Points'][i].y;
|
Point.y = zone['Points'][i].y;
|
||||||
Poly.points.appendItem( Point );
|
Poly.points.appendItem( Point );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ function updateActivePoint( index )
|
||||||
var Point = $('zonePoly').points.getItem(index);
|
var Point = $('zonePoly').points.getItem(index);
|
||||||
Point.x =x;
|
Point.x =x;
|
||||||
Point.y =y;
|
Point.y =y;
|
||||||
|
updateArea();
|
||||||
}
|
}
|
||||||
|
|
||||||
function addPoint( index )
|
function addPoint( index )
|
||||||
|
@ -371,7 +371,8 @@ function addPoint( index )
|
||||||
else
|
else
|
||||||
zone['Points'].splice( nextIndex, 0, { 'x': newX, 'y': newY } );
|
zone['Points'].splice( nextIndex, 0, { 'x': newX, 'y': newY } );
|
||||||
drawZonePoints();
|
drawZonePoints();
|
||||||
updateZoneImage();
|
// drawZonePoints calls updateZoneImage
|
||||||
|
//updateZoneImage();
|
||||||
//setActivePoint( nextIndex );
|
//setActivePoint( nextIndex );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,6 +387,21 @@ function limitPointValue( point, loVal, hiVal )
|
||||||
point.value = constrainValue(point.value, loVal, hiVal)
|
point.value = constrainValue(point.value, loVal, hiVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateArea( ) {
|
||||||
|
area = Polygon_calcArea( zone['Points'] );
|
||||||
|
zone.Area = area;
|
||||||
|
var form = $('zoneForm');
|
||||||
|
form.elements['newZone[Area]'].value = area;
|
||||||
|
if ( form.elements['newZone[Units]'].value == 'Percent' ) {
|
||||||
|
|
||||||
|
form.elements['newZone[TempArea]'].value = Math.round( area/monitorArea*100 );
|
||||||
|
} else if ( form.elements['newZone[Units]'].value == 'Pixels' ) {
|
||||||
|
form.elements['newZone[TempArea]'].value = area;
|
||||||
|
} else {
|
||||||
|
alert("Unknown units: " + form.elements['newZone[Units]'].value );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function updateX( index )
|
function updateX( index )
|
||||||
{
|
{
|
||||||
limitPointValue( $('newZone[Points]['+index+'][x]'), 0, maxX );
|
limitPointValue( $('newZone[Points]['+index+'][x]'), 0, maxX );
|
||||||
|
@ -396,8 +412,7 @@ function updateX( index )
|
||||||
point.setStyle( 'left', x+'px' );
|
point.setStyle( 'left', x+'px' );
|
||||||
zone['Points'][index].x = x;
|
zone['Points'][index].x = x;
|
||||||
var Point = $('zonePoly').points.getItem(index);
|
var Point = $('zonePoly').points.getItem(index);
|
||||||
Point.x =x;
|
Point.x = x;
|
||||||
Point.y =y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateY( index )
|
function updateY( index )
|
||||||
|
@ -410,8 +425,7 @@ function updateY( index )
|
||||||
point.setStyle( 'top', y+'px' );
|
point.setStyle( 'top', y+'px' );
|
||||||
zone['Points'][index].y = y;
|
zone['Points'][index].y = y;
|
||||||
var Point = $('zonePoly').points.getItem(index);
|
var Point = $('zonePoly').points.getItem(index);
|
||||||
Point.x =x;
|
Point.y = y;
|
||||||
Point.y =y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveChanges( element )
|
function saveChanges( element )
|
||||||
|
@ -453,13 +467,13 @@ function drawZonePoints()
|
||||||
|
|
||||||
cell = new Element( 'td' );
|
cell = new Element( 'td' );
|
||||||
var input = new Element( 'input', { 'id': 'newZone[Points]['+i+'][x]', 'name': 'newZone[Points]['+i+'][x]', 'value': zone['Points'][i].x, 'size': 5 } );
|
var input = new Element( 'input', { 'id': 'newZone[Points]['+i+'][x]', 'name': 'newZone[Points]['+i+'][x]', 'value': zone['Points'][i].x, 'size': 5 } );
|
||||||
input.addEvent( 'change', updateX.pass( i ) );
|
input.addEvent( 'input', updateX.pass( i ) );
|
||||||
input.inject( cell );
|
input.inject( cell );
|
||||||
cell.inject( row );
|
cell.inject( row );
|
||||||
|
|
||||||
cell = new Element( 'td' );
|
cell = new Element( 'td' );
|
||||||
input = new Element( 'input', { 'id': 'newZone[Points]['+i+'][y]', 'name': 'newZone[Points]['+i+'][y]', 'value': zone['Points'][i].y, 'size': 5 } );
|
input = new Element( 'input', { 'id': 'newZone[Points]['+i+'][y]', 'name': 'newZone[Points]['+i+'][y]', 'value': zone['Points'][i].y, 'size': 5 } );
|
||||||
input.addEvent( 'change', updateY.pass( i ) );
|
input.addEvent( 'input', updateY.pass( i ) );
|
||||||
input.inject( cell );
|
input.inject( cell );
|
||||||
cell.inject( row );
|
cell.inject( row );
|
||||||
|
|
||||||
|
@ -739,4 +753,16 @@ function initPage() {
|
||||||
appletRefresh.delay( appletRefreshTime*1000 );
|
appletRefresh.delay( appletRefreshTime*1000 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Polygon_calcArea( coords ) {
|
||||||
|
var n_coords = coords.length;
|
||||||
|
var float_area = 0.0;
|
||||||
|
|
||||||
|
for ( i = 0, j = n_coords-1; i < n_coords; j = i++ ) {
|
||||||
|
var trap_area = ( ( coords[i].x - coords[j].x ) * ( coords[i].y + coords[j].y ) ) / 2;
|
||||||
|
float_area += trap_area;
|
||||||
|
//printf( "%.2f (%.2f)\n", float_area, trap_area );
|
||||||
|
}
|
||||||
|
return Math.round( Math.abs( float_area ) );
|
||||||
|
}
|
||||||
|
|
||||||
window.addEvent( 'domready', initPage );
|
window.addEvent( 'domready', initPage );
|
||||||
|
|
|
@ -48,6 +48,7 @@ zone['Points'][<?php echo $i ?>] = { 'x': <?php echo $newZone['Points'][$i]['x']
|
||||||
|
|
||||||
var maxX = <?php echo $monitor->Width()-1 ?>;
|
var maxX = <?php echo $monitor->Width()-1 ?>;
|
||||||
var maxY = <?php echo $monitor->Height()-1 ?>;
|
var maxY = <?php echo $monitor->Height()-1 ?>;
|
||||||
|
var monitorArea = <?php echo $monitor->Width() * $monitor->Height() ?>;
|
||||||
var selfIntersecting = <?php echo $selfIntersecting?'true':'false' ?>;
|
var selfIntersecting = <?php echo $selfIntersecting?'true':'false' ?>;
|
||||||
|
|
||||||
var selfIntersectingString = '<?php echo addslashes(translate('SelfIntersecting')) ?>';
|
var selfIntersectingString = '<?php echo addslashes(translate('SelfIntersecting')) ?>';
|
||||||
|
|
|
@ -131,7 +131,7 @@ xhtmlHeaders(__FILE__, translate('Zone') );
|
||||||
<h2><?php echo translate('Monitor') ?> <?php echo $monitor->Name() ?> - <?php echo translate('Zone') ?> <?php echo $newZone['Name'] ?></h2>
|
<h2><?php echo translate('Monitor') ?> <?php echo $monitor->Name() ?> - <?php echo translate('Zone') ?> <?php echo $newZone['Name'] ?></h2>
|
||||||
</div>
|
</div>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<form name="zoneForm" id="zoneForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
<form name="zoneForm" id="zoneForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onkeypress="return event.keyCode != 13;">
|
||||||
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
||||||
<input type="hidden" name="action" value="zone"/>
|
<input type="hidden" name="action" value="zone"/>
|
||||||
<input type="hidden" name="mid" value="<?php echo $mid ?>"/>
|
<input type="hidden" name="mid" value="<?php echo $mid ?>"/>
|
||||||
|
@ -249,8 +249,8 @@ for ( $i = 0; $i < $pointCols; $i++ )
|
||||||
?>
|
?>
|
||||||
<tr id="row<?php echo $j ?>" onmouseover="highlightOn( <?php echo $j ?> )" onmouseout="highlightOff( <?php echo $j ?> )" onclick="setActivePoint( <?php echo $j ?> )">
|
<tr id="row<?php echo $j ?>" onmouseover="highlightOn( <?php echo $j ?> )" onmouseout="highlightOff( <?php echo $j ?> )" onclick="setActivePoint( <?php echo $j ?> )">
|
||||||
<td><?php echo $j+1 ?></td>
|
<td><?php echo $j+1 ?></td>
|
||||||
<td><input name="newZone[Points][<?php echo $j ?>][x]" id="newZone[Points][<?php echo $j ?>][x]" size="5" value="<?php echo $newZone['Points'][$j]['x'] ?>" onchange="updateX( this, <?php echo $j ?> )"<?php if ( canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/></td>
|
<td><input name="newZone[Points][<?php echo $j ?>][x]" id="newZone[Points][<?php echo $j ?>][x]" size="5" value="<?php echo $newZone['Points'][$j]['x'] ?>" oninput="updateX( this, <?php echo $j ?> );"<?php if ( canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/></td>
|
||||||
<td><input name="newZone[Points][<?php echo $j ?>][y]" id="newZone[Points][<?php echo $j ?>][y]" size="5" value="<?php echo $newZone['Points'][$j]['y'] ?>" onchange="updateY( this, <?php echo $j ?> )"<?php if ( canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/></td>
|
<td><input name="newZone[Points][<?php echo $j ?>][y]" id="newZone[Points][<?php echo $j ?>][y]" size="5" value="<?php echo $newZone['Points'][$j]['y'] ?>" oninput="updateY( this, <?php echo $j ?> );"<?php if ( canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/></td>
|
||||||
<td><a href="#" onclick="addPoint( this, <?php echo $j ?> ); return( false );">+</a><?php if ( count($newZone['Points']) > 3 ) { ?> <a id="delete<?php echo $j ?>" href="#" onclick="delPoint( this, <?php echo $j ?> ); return(false);">–</a><?php } ?> <a id="cancel<?php echo $j ?>" href="#" onclick="unsetActivePoint( <?php echo $j ?> ); return( false );">X</a></td>
|
<td><a href="#" onclick="addPoint( this, <?php echo $j ?> ); return( false );">+</a><?php if ( count($newZone['Points']) > 3 ) { ?> <a id="delete<?php echo $j ?>" href="#" onclick="delPoint( this, <?php echo $j ?> ); return(false);">–</a><?php } ?> <a id="cancel<?php echo $j ?>" href="#" onclick="unsetActivePoint( <?php echo $j ?> ); return( false );">X</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in New Issue