From d13335358f6afe6ebb3a1a732855a23f50cd2565 Mon Sep 17 00:00:00 2001 From: Matthew Trescott Date: Mon, 5 Mar 2018 18:39:29 -0500 Subject: [PATCH 01/10] Copy ubuntu1604 to ubuntu1804 --- distros/ubuntu1804/NEWS | 10 + distros/ubuntu1804/README.Debian | 160 ++++++++++++++++ distros/ubuntu1804/TODO.Debian | 12 ++ distros/ubuntu1804/changelog | 0 distros/ubuntu1804/clean | 3 + distros/ubuntu1804/compat | 1 + .../ubuntu1804/conf/apache2/zoneminder.conf | 19 ++ distros/ubuntu1804/control | 154 ++++++++++++++++ distros/ubuntu1804/copyright | 174 ++++++++++++++++++ distros/ubuntu1804/examples/nginx.conf | 32 ++++ distros/ubuntu1804/gbp.conf | 7 + distros/ubuntu1804/libzoneminder-perl.install | 2 + distros/ubuntu1804/patches/series | 0 .../patches/use_libjs-mootools.patch | 18 ++ distros/ubuntu1804/rules | 98 ++++++++++ distros/ubuntu1804/source/format | 1 + distros/ubuntu1804/source/lintian-overrides | 9 + distros/ubuntu1804/zoneminder-doc.doc-base | 8 + distros/ubuntu1804/zoneminder-doc.install | 1 + distros/ubuntu1804/zoneminder-doc.links | 2 + distros/ubuntu1804/zoneminder.apache2 | 1 + distros/ubuntu1804/zoneminder.bug-presubj | 5 + distros/ubuntu1804/zoneminder.dirs | 8 + distros/ubuntu1804/zoneminder.docs | 1 + distros/ubuntu1804/zoneminder.examples | 2 + distros/ubuntu1804/zoneminder.init | 91 +++++++++ distros/ubuntu1804/zoneminder.install | 11 ++ distros/ubuntu1804/zoneminder.links | 1 + distros/ubuntu1804/zoneminder.linktrees | 14 ++ .../ubuntu1804/zoneminder.lintian-overrides | 14 ++ distros/ubuntu1804/zoneminder.logrotate | 12 ++ distros/ubuntu1804/zoneminder.maintscript | 1 + distros/ubuntu1804/zoneminder.manpages | 1 + distros/ubuntu1804/zoneminder.postinst | 69 +++++++ distros/ubuntu1804/zoneminder.postrm | 14 ++ distros/ubuntu1804/zoneminder.preinst | 36 ++++ distros/ubuntu1804/zoneminder.service | 21 +++ distros/ubuntu1804/zoneminder.tmpfile | 3 + 38 files changed, 1016 insertions(+) create mode 100644 distros/ubuntu1804/NEWS create mode 100644 distros/ubuntu1804/README.Debian create mode 100644 distros/ubuntu1804/TODO.Debian create mode 100644 distros/ubuntu1804/changelog create mode 100644 distros/ubuntu1804/clean create mode 100644 distros/ubuntu1804/compat create mode 100644 distros/ubuntu1804/conf/apache2/zoneminder.conf create mode 100644 distros/ubuntu1804/control create mode 100644 distros/ubuntu1804/copyright create mode 100644 distros/ubuntu1804/examples/nginx.conf create mode 100644 distros/ubuntu1804/gbp.conf create mode 100644 distros/ubuntu1804/libzoneminder-perl.install create mode 100644 distros/ubuntu1804/patches/series create mode 100644 distros/ubuntu1804/patches/use_libjs-mootools.patch create mode 100755 distros/ubuntu1804/rules create mode 100644 distros/ubuntu1804/source/format create mode 100644 distros/ubuntu1804/source/lintian-overrides create mode 100644 distros/ubuntu1804/zoneminder-doc.doc-base create mode 100644 distros/ubuntu1804/zoneminder-doc.install create mode 100644 distros/ubuntu1804/zoneminder-doc.links create mode 100644 distros/ubuntu1804/zoneminder.apache2 create mode 100644 distros/ubuntu1804/zoneminder.bug-presubj create mode 100644 distros/ubuntu1804/zoneminder.dirs create mode 100644 distros/ubuntu1804/zoneminder.docs create mode 100644 distros/ubuntu1804/zoneminder.examples create mode 100644 distros/ubuntu1804/zoneminder.init create mode 100644 distros/ubuntu1804/zoneminder.install create mode 100644 distros/ubuntu1804/zoneminder.links create mode 100644 distros/ubuntu1804/zoneminder.linktrees create mode 100644 distros/ubuntu1804/zoneminder.lintian-overrides create mode 100644 distros/ubuntu1804/zoneminder.logrotate create mode 100644 distros/ubuntu1804/zoneminder.maintscript create mode 100644 distros/ubuntu1804/zoneminder.manpages create mode 100644 distros/ubuntu1804/zoneminder.postinst create mode 100644 distros/ubuntu1804/zoneminder.postrm create mode 100644 distros/ubuntu1804/zoneminder.preinst create mode 100644 distros/ubuntu1804/zoneminder.service create mode 100644 distros/ubuntu1804/zoneminder.tmpfile diff --git a/distros/ubuntu1804/NEWS b/distros/ubuntu1804/NEWS new file mode 100644 index 000000000..6200726cf --- /dev/null +++ b/distros/ubuntu1804/NEWS @@ -0,0 +1,10 @@ +zoneminder (1.28.1-1) unstable; urgency=low + + This version is no longer automatically initialize or upgrade database. + See README.Debian for details. + + Changed installation paths (please correct your web server configuration): + /usr/share/zoneminder --> /usr/share/zoneminder/www + /usr/lib/cgi-bin --> /usr/lib/zoneminder/cgi-bin + + -- Dmitry Smirnov Tue, 31 Mar 2015 15:12:17 +1100 diff --git a/distros/ubuntu1804/README.Debian b/distros/ubuntu1804/README.Debian new file mode 100644 index 000000000..8182e0678 --- /dev/null +++ b/distros/ubuntu1804/README.Debian @@ -0,0 +1,160 @@ +Zoneminder for Debian +--------------------- + +Initializing database +--------------------- + + pv /usr/share/zoneminder/db/zm_create.sql | sudo mysql --defaults-file=/etc/mysql/debian.cnf +OR + cat /usr/share/zoneminder/db/zm_create.sql | sudo mysql --defaults-file=/etc/mysql/debian.cnf + + echo 'grant lock tables,alter,create,index,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";'\ + | sudo mysql --defaults-file=/etc/mysql/debian.cnf mysql + +Hint: generate secure password with `pwgen` and update "/etc/zm/zm.conf" +accordingly. + +The following command can help to ensure that zoneminder can read its +configuration file: + + chgrp -c www-data /etc/zm/zm.conf + + +Upgrading database +------------------ + +Prior to 1.28.1 database upgrade was performed automatically. +"zoneminder" service will refuse to start with outdated database. + +Assuming that database is on "localhost" then the following command can be +used to upgrade "zm" database: + + zmupdate.pl + +Additional permissions may be required to perform upgrade: + + echo 'grant lock tables, create, alter on zm.* to 'zmuser'@localhost identified by "zmpass";'\ + | sudo mysql --defaults-file=/etc/mysql/debian.cnf mysql + +The following command prints the current version of zoneminder database: + + echo 'select Value from Config where Name = "ZM_DYN_CURR_VERSION";' \ + | sudo mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names zm + + +Enabling service +---------------- + +By default Zoneminder service is not starting automatically and need to be +manually activated once database is configured: + +On systemd: + + sudo systemctl enable zoneminder.service + +On SysV: + + sudo update-rc.d zoneminder enable + + +Web server set-up +----------------- + +There are few manual steps to get the web interface working: + +## Apache2 + +Apache can be configured as folder "/zm" using sample .conf: + + sudo a2enconf zoneminder + +Alternatively Apache web site configuration template can be used to setup +zoneminder as "http://zoneminder": + + sudo cp -v /usr/share/doc/zoneminder/examples/apache.conf /etc/apache2/sites-available/ + sudo a2ensite zoneminder.conf + +Common configuration steps for Apache2: + + sudo a2enmod cgi + sudo service apache2 reload + + +## nginx / fcgiwrap + +Nginx needs "php5-fpm" package to support PHP and "fcgiwrap" package +for binary "cgi-bin" applications: + + sudo apt-get install php5-fpm fcgiwrap + +To enable a URL alias that makes Zoneminder available from + + http://yourserver/zm + +the following line is to be added to "server" section of a web site +configuration: + + include /usr/share/doc/zoneminder/examples/nginx.conf; + +For "default" web site it would be sufficient to include the above +statement to the file + + /etc/nginx/sites-enabled/default + +To avoid problems with feeds from multiple cameras "fcgiwrap" should be +configured to start at least as many processes as there are cameras. +It can be done by adjusting DAEMON_OPTS in "/etc/default/fcgiwrap". +Systemd users may be affected by the following bug: + + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=792705 + + +## Note: + +When Zoneminder web site is running it may be necessary to set +Options/Paths/PATH_ZMS to "/zm/cgi-bin/nph-zms" or according to chosen web +site configuration. + + +Changing the location for images and events +------------------------------------------- + +Zoneminder, in its upstream form, stores data in /usr/share/zoneminder/. This +package modifies that by changing /usr/share/zoneminder/images and +/usr/share/zoneminder/events to symlinks to directories under +/var/cache/zoneminder. + +There are numerous places these could be put and ways to do it. But, at the +moment, if you change this, an upgrade will fail with a warning about these +locations having changed (the reason for this was that previously, an upgrade +would silently revert the changes and cause event loss - refer +bug #608793). + +If you do want to change the location, here are a couple of suggestions. +(thanks to vagrant@freegeek.org): + +These lines in fstab could allow you to bind-mount an alternate location + + /dev/sdX1 /otherdrive ext3 defaults 0 2 + /otherdrive/zoneminder/images /var/cache/zoneminder/images bind defaults 0 2 + /otherdrive/zoneminder/events /var/cache/zoneminder/events bind defaults 0 2 + + or if you have a separate partition for each: + + /dev/sdX1 /var/cache/zoneminder/images ext3 defaults 0 2 + /dev/sdX2 /var/cache/zoneminder/events ext3 defaults 0 2 + + -- Peter Howard , Sun, 16 Jan 2010 01:35:51 +1100 + +Access to /dev/video* +--------------------- + +For cameras which require access to /dev/video*, zoneminder may need the +www-data user added to the video group in order to see those cameras: + + adduser www-data video + +Note that all web applications running on the zoneminder server will then have +access to all video devices on the system. + + -- Vagrant Cascadian Sun, 27 Mar 2011 13:06:56 -0700 diff --git a/distros/ubuntu1804/TODO.Debian b/distros/ubuntu1804/TODO.Debian new file mode 100644 index 000000000..9dc59613b --- /dev/null +++ b/distros/ubuntu1804/TODO.Debian @@ -0,0 +1,12 @@ + +## Separate substantial /usr/share into its own arch-all package. + +## Decide how to handle database updates. + + * Consider possibility that database may be on another machine (#469239). + * Consider dbconfig-common? Probably not (what if database is not on localhost?). + +### Run `zmupdate.pl` from service control scripts (init.d, service) on start? + + Automatic upgrade will break "one DB, many zoneminders" setup (unimportant?). + diff --git a/distros/ubuntu1804/changelog b/distros/ubuntu1804/changelog new file mode 100644 index 000000000..e69de29bb diff --git a/distros/ubuntu1804/clean b/distros/ubuntu1804/clean new file mode 100644 index 000000000..941ef2a3a --- /dev/null +++ b/distros/ubuntu1804/clean @@ -0,0 +1,3 @@ +.gitattributes +web/api/.gitattributes +web/api/.gitignore diff --git a/distros/ubuntu1804/compat b/distros/ubuntu1804/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/distros/ubuntu1804/compat @@ -0,0 +1 @@ +9 diff --git a/distros/ubuntu1804/conf/apache2/zoneminder.conf b/distros/ubuntu1804/conf/apache2/zoneminder.conf new file mode 100644 index 000000000..59efc6248 --- /dev/null +++ b/distros/ubuntu1804/conf/apache2/zoneminder.conf @@ -0,0 +1,19 @@ +# Remember to enable cgi mod (i.e. "a2enmod cgi"). +ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin" + + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + AllowOverride All + Require all granted + + +Alias /zm /usr/share/zoneminder/www + + Options -Indexes +FollowSymLinks + + DirectoryIndex index.php + + + + + AllowOverride All + diff --git a/distros/ubuntu1804/control b/distros/ubuntu1804/control new file mode 100644 index 000000000..09c4ce9bc --- /dev/null +++ b/distros/ubuntu1804/control @@ -0,0 +1,154 @@ +Source: zoneminder +Section: net +Priority: optional +Maintainer: Dmitry Smirnov +Uploaders: Vagrant Cascadian +Build-Depends: debhelper (>= 9), dh-systemd, python-sphinx | python3-sphinx, apache2-dev, dh-linktree + ,cmake + ,libx264-dev, libmp4v2-dev + ,libavdevice-dev (>= 6:10~) + ,libavcodec-dev (>= 6:10~) + ,libavformat-dev (>= 6:10~) + ,libavutil-dev (>= 6:10~) + ,libswscale-dev (>= 6:10~) + ,libbz2-dev + ,libgcrypt-dev + ,libcurl4-gnutls-dev + ,libgnutls-openssl-dev + ,libjpeg8-dev | libjpeg9-dev | libjpeg62-turbo-dev + ,default-libmysqlclient-dev | libmysqlclient-dev + ,libpcre3-dev + ,libpolkit-gobject-1-dev + ,libv4l-dev (>= 0.8.3) [!hurd-any] + ,libvlc-dev + ,libdate-manip-perl + ,libdbd-mysql-perl + ,libphp-serialization-perl + ,libsys-mmap-perl [!hurd-any] + ,libwww-perl + ,libdata-uuid-perl +# Unbundled (dh_linktree): + ,libjs-jquery + ,libjs-mootools +Standards-Version: 3.9.8 +Homepage: http://www.zoneminder.com/ +Vcs-Browser: http://anonscm.debian.org/cgit/collab-maint/zoneminder.git +Vcs-Git: git://anonscm.debian.org/collab-maint/zoneminder.git + +Package: zoneminder +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} + ,javascript-common + ,libmp4v2-2, libx264-142|libx264-148, libswscale-ffmpeg3|libswscale4|libswscale3 + ,ffmpeg | libav-tools + ,libdate-manip-perl, libmime-lite-perl, libmime-tools-perl + ,libdbd-mysql-perl + ,libphp-serialization-perl + ,libmodule-load-conditional-perl + ,libnet-sftp-foreign-perl + ,libarchive-zip-perl + ,libdbd-mysql-perl + ,libdevice-serialport-perl + ,libimage-info-perl + ,libjson-any-perl + ,libsys-mmap-perl [!hurd-any] + ,liburi-encode-perl + ,libwww-perl + ,libdata-dump-perl + ,libclass-std-fast-perl + ,libsoap-wsdl-perl + ,libio-socket-multicast-perl + ,libdigest-sha-perl + ,libsys-cpu-perl, libsys-meminfo-perl + ,libdata-uuid-perl + ,mysql-client | virtual-mysql-client + ,perl-modules + ,php5-mysql | php-mysql, php5-gd | php-gd , php5-apcu | php-apcu , php-apc | php-apcu-bc + ,policykit-1 + ,rsyslog | system-log-daemon + ,zip + ,libpcre3 +Recommends: ${misc:Recommends} + ,libapache2-mod-php5 | libapache2-mod-php | php5-fpm | php-fpm + ,mysql-server | virtual-mysql-server + ,zoneminder-doc (>= ${source:Version}) + ,ffmpeg +Suggests: fcgiwrap, logrotate +Description: video camera security and surveillance solution + ZoneMinder is intended for use in single or multi-camera video security + applications, including commercial or home CCTV, theft prevention and child + or family member or home monitoring and other care scenarios. It + supports capture, analysis, recording, and monitoring of video data coming + from one or more video or network cameras attached to a Linux system. + ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom + cameras using a variety of protocols. It is suitable for use as a home + video security system and for commercial or professional video security + and surveillance. It can also be integrated into a home automation system + via X.10 or other protocols. + +#Package: libzoneminder-perl +#Section: perl +#Architecture: all +#Multi-Arch: foreign +#Depends: ${misc:Depends}, ${perl:Depends} +# ,libarchive-zip-perl +# ,libdbd-mysql-perl +# ,libdevice-serialport-perl +# ,libimage-info-perl +# ,libjson-any-perl +# ,libsys-mmap-perl [!hurd-any] +# ,liburi-encode-perl +# ,libwww-perl +#Description: ZoneMinder Perl libraries +# ZoneMinder is intended for use in single or multi-camera video security +# applications, including commercial or home CCTV, theft prevention and child +# or family member or home monitoring and other care scenarios. It +# supports capture, analysis, recording, and monitoring of video data coming +# from one or more video or network cameras attached to a Linux system. +# ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom +# cameras using a variety of protocols. It is suitable for use as a home +# video security system and for commercial or professional video security +# and surveillance. It can also be integrated into a home automation system +# via X.10 or other protocols. +# . +# This package provides ZoneMinder Perl libraries; it can be used to +# write custom interfaces as well. + +Package: zoneminder-doc +Section: doc +Architecture: all +Multi-Arch: foreign +Depends: ${misc:Depends}, ${sphinxdoc:Depends}, python-sphinx-rtd-theme | python3-sphinx-rtd-theme +Suggests: www-browser +Description: ZoneMinder documentation + ZoneMinder is intended for use in single or multi-camera video security + applications, including commercial or home CCTV, theft prevention and child + or family member or home monitoring and other care scenarios. It + supports capture, analysis, recording, and monitoring of video data coming + from one or more video or network cameras attached to a Linux system. + ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom + cameras using a variety of protocols. It is suitable for use as a home + video security system and for commercial or professional video security + and surveillance. It can also be integrated into a home automation system + via X.10 or other protocols. + . + This package provides ZoneMinder documentation in HTML format. + +Package: zoneminder-dbg +Section: debug +Priority: extra +Architecture: any +Depends: zoneminder (= ${binary:Version}), ${misc:Depends} +Description: Zoneminder -- debugging symbols + ZoneMinder is intended for use in single or multi-camera video security + applications, including commercial or home CCTV, theft prevention and child + or family member or home monitoring and other care scenarios. It + supports capture, analysis, recording, and monitoring of video data coming + from one or more video or network cameras attached to a Linux system. + ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom + cameras using a variety of protocols. It is suitable for use as a home + video security system and for commercial or professional video security + and surveillance. It can also be integrated into a home automation system + via X.10 or other protocols. + . + This package provides debugging symbols diff --git a/distros/ubuntu1804/copyright b/distros/ubuntu1804/copyright new file mode 100644 index 000000000..c48025a25 --- /dev/null +++ b/distros/ubuntu1804/copyright @@ -0,0 +1,174 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ZoneMinder +Upstream-Contact: Philip Coombes +Source: https://github.com/ZoneMinder/ZoneMinder +Comment: + This package was originally debianized by matrix + on Mon, 7 Mar 2005 02:07:57 -0500. + It was re-done for submission to the Debian project by Peter Howard + on Fri, 8 Dec 2006 10:19:43 +1100 +Files-Excluded: + web/skins/*/js/jquery-* + web/tools/mootools/*-yc.js + +Files: * +Copyright: 2001-2014 Philip Coombes + 2008 Brian Rudy + 2014 Vincent Giovannone + 2013 Tim Craig + 2003-2008 Corey DeLasaux + 2001-2010 Chris Kistner +License: GPL-2+ + +Files: distros/* +Copyright: 2001-2008 Philip Coombes + 2014 Isaac Connor + 2005 Serg Oskin +License: GPL-2+ + +Files: web/skins/*/js/jquery-* +Copyright: 2010 John Resig + 2010 The Dojo Foundation +License: GPL-2 or Expat +Comment: + Dual licensed under the MIT or GPL Version 2 licenses. + http://jquery.org/license + . + Includes Sizzle.js http://sizzlejs.com/ + Released under the MIT, BSD, and GPL Licenses. + +Files: web/tools/mootools/*.js +Copyright: 2009 Marcelo Jorge Vieira (metal) + 2006-2010 Valerio Proietti (http://mad4milk.net/) +License: Expat + +Files: web/api/* +Copyright: 2005-2013 Cake Software Foundation, Inc. (http://cakefoundation.org) +License: Expat + +Files: + cmake/Modules/CheckPrototypeDefinition*.cmake + cmake/Modules/FindGLIB2.cmake + cmake/Modules/FindPolkit.cmake + cmake/Modules/GNUInstallDirs.cmake +Copyright: + 2005-2011 Kitware, Inc. + 2010-2011 Andreas Schneider + 2009 Dario Freddi + 2008 Laurent Montel, + 2011 Nikita Krupen'ko +License: BSD-3-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + . + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + . + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + . + * The names of Kitware, Inc., the Insight Consortium, or the names of + any consortium members, or of any contributors, may not be used to + endorse or promote products derived from this software without + specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: cmake/Modules/FindPerlModules.cmake +Copyright: 2012 Iowa State University +License: Boost-1.0 + Boost Software License - Version 1.0 - August 17th, 2003 + . + Permission is hereby granted, free of charge, to any person or organization + obtaining a copy of the software and accompanying documentation covered by + this license (the "Software") to use, reproduce, display, distribute, + execute, and transmit the Software, and to prepare derivative works of the + Software, and to permit third-parties to whom the Software is furnished to + do so, all subject to the following: + . + The copyright notices in the Software and this entire statement, including + the above license grant, this restriction and the following disclaimer, + must be included in all copies of the Software, in whole or in part, and + all derivative works of the Software, unless such copies or derivative + works are solely in the form of machine-executable object code generated by + a source language processor. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT + SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE + FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +Files: debian/* +Copyright: 2015 Dmitry Smirnov + 2007-2014 Peter Howard + 2010-2012 Vagrant Cascadian + 2001-2008 Philip Coombes +License: GPL-2+ + +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +License: GPL-2+ + This package is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + . + You should have received a copy of the GNU General Public + License along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + . + The complete text of the GNU General Public License version 2 + can be found in "/usr/share/common-licenses/GPL-2". + +License: GPL-2 + This package is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; version 2 of the License. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + . + You should have received a copy of the GNU General Public + License along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + . + The complete text of the GNU General Public License version 2 + can be found in "/usr/share/common-licenses/GPL-2". diff --git a/distros/ubuntu1804/examples/nginx.conf b/distros/ubuntu1804/examples/nginx.conf new file mode 100644 index 000000000..5636ca3e1 --- /dev/null +++ b/distros/ubuntu1804/examples/nginx.conf @@ -0,0 +1,32 @@ +location /zm/cgi-bin { + gzip off; + alias /usr/lib/zoneminder/cgi-bin; + + include /etc/nginx/fastcgi_params; + fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_pass unix:/var/run/fcgiwrap.socket; +} + +location /zm { +# if ($scheme ~ ^http:){ +# rewrite ^(.*)$ https://$host$1 permanent; +# } + + gzip off; + alias /usr/share/zoneminder/www; + index index.php; + + location ~ \.php$ { + if (!-f $request_filename) { return 404; } + expires epoch; + include /etc/nginx/fastcgi_params; + fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_index index.php; + fastcgi_pass unix:/var/run/php5-fpm.sock; + } + + location ~ \.(jpg|jpeg|gif|png|ico)$ { + access_log off; + expires 33d; + } +} diff --git a/distros/ubuntu1804/gbp.conf b/distros/ubuntu1804/gbp.conf new file mode 100644 index 000000000..4608913d9 --- /dev/null +++ b/distros/ubuntu1804/gbp.conf @@ -0,0 +1,7 @@ + +[dch] +id-length = 0 + +[import-orig] +pristine-tar = False +merge = False diff --git a/distros/ubuntu1804/libzoneminder-perl.install b/distros/ubuntu1804/libzoneminder-perl.install new file mode 100644 index 000000000..67191d9cf --- /dev/null +++ b/distros/ubuntu1804/libzoneminder-perl.install @@ -0,0 +1,2 @@ +usr/share/man/man3 +usr/share/perl5 diff --git a/distros/ubuntu1804/patches/series b/distros/ubuntu1804/patches/series new file mode 100644 index 000000000..e69de29bb diff --git a/distros/ubuntu1804/patches/use_libjs-mootools.patch b/distros/ubuntu1804/patches/use_libjs-mootools.patch new file mode 100644 index 000000000..b3925f6d0 --- /dev/null +++ b/distros/ubuntu1804/patches/use_libjs-mootools.patch @@ -0,0 +1,18 @@ +Last-Update: 2015-03-29 +Forwarded: no +Bug-Debian: http://bugs.debian.org/585590 +Reviewed-By: Dmitry Smirnov +Description: use mootools shipped by debian, rather than the zoneminder included mootools. + +--- a/web/skins/classic/includes/functions.php ++++ b/web/skins/classic/includes/functions.php +@@ -63,9 +63,8 @@ + } + ?> + + +- + + + >/dev/null 2>&1 || : + endscript + daily + rotate 7 +} diff --git a/distros/ubuntu1804/zoneminder.maintscript b/distros/ubuntu1804/zoneminder.maintscript new file mode 100644 index 000000000..3aa20b3a0 --- /dev/null +++ b/distros/ubuntu1804/zoneminder.maintscript @@ -0,0 +1 @@ +rm_conffile /etc/zm/apache.conf 1.28.1-5~ diff --git a/distros/ubuntu1804/zoneminder.manpages b/distros/ubuntu1804/zoneminder.manpages new file mode 100644 index 000000000..d2053d688 --- /dev/null +++ b/distros/ubuntu1804/zoneminder.manpages @@ -0,0 +1 @@ +docs/_build/man/*.1 diff --git a/distros/ubuntu1804/zoneminder.postinst b/distros/ubuntu1804/zoneminder.postinst new file mode 100644 index 000000000..d2cef7804 --- /dev/null +++ b/distros/ubuntu1804/zoneminder.postinst @@ -0,0 +1,69 @@ +#! /bin/sh + +set -e + +if [ "$1" = "configure" ]; then + + . /etc/zm/zm.conf + + # The logs can contain passwords, etc... so by setting group root, only www-data can read them, not people in the www-data group + chown www-data:root /var/log/zm + chown www-data:www-data /var/lib/zm + if [ -z "$2" ]; then + chown www-data:www-data /var/cache/zoneminder /var/cache/zoneminder/* + fi + if [ ! -e "/etc/apache2/mods-enabled/cgi.load" ]; then + echo "The cgi module is not enabled in apache2. I am enabling it using a2enmod cgi." + a2enmod cgi + fi + + # Do this every time the package is installed or upgraded + # Ensure zoneminder is stopped + deb-systemd-invoke stop zoneminder.service || exit $? + + # Ensure zoneminder is stopped + deb-systemd-invoke stop zoneminder.service || exit $? + if [ "$ZM_DB_HOST" = "localhost" ]; then + + if [ -e "/etc/init.d/mysql" ]; then + + # + # Get mysql started if it isn't + # + if ! $(/etc/init.d/mysql status >/dev/null 2>&1); then + deb-systemd-invoke start mysql.service || exit $? + fi + + if $(/etc/init.d/mysql status >/dev/null 2>&1); then + mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload + # test if database if already present... + if ! $(echo quit | mysql --defaults-file=/etc/mysql/debian.cnf zm > /dev/null 2> /dev/null) ; then + cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf + # This creates the user. + echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost identified by \"${ZM_DB_PASS}\";" | mysql --defaults-file=/etc/mysql/debian.cnf mysql + else + echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost;" | mysql --defaults-file=/etc/mysql/debian.cnf mysql + fi + + zmupdate.pl --nointeractive + zmupdate.pl --nointeractive -f + + # Add any new PTZ control configurations to the database (will not overwrite) + zmcamtool.pl --import >/dev/null 2>&1 + + else + echo 'NOTE: mysql not running, please start mysql and run dpkg-reconfigure zoneminder when it is running.' + fi + else + echo 'mysql not found, assuming remote server.' + fi + + else + echo "Not doing database upgrade due to remote db server ($ZM_DB_HOST)" + fi + echo "Done Updating, starting ZoneMinder" + deb-systemd-invoke restart zoneminder.service || exit $? + +fi + +#DEBHELPER# diff --git a/distros/ubuntu1804/zoneminder.postrm b/distros/ubuntu1804/zoneminder.postrm new file mode 100644 index 000000000..ba2066c8d --- /dev/null +++ b/distros/ubuntu1804/zoneminder.postrm @@ -0,0 +1,14 @@ +#! /bin/sh + +set -e + +if [ "$1" = "purge" ]; then + echo " +Reminder: to completely remove \"zoneminder\" it may be necessary + * to delete database using the following sample command: + sudo mysqladmin --defaults-file=/etc/mysql/debian.cnf -f drop zm + * to delete remaining data files in "/var/cache/zoneminder". +" +fi + +#DEBHELPER# diff --git a/distros/ubuntu1804/zoneminder.preinst b/distros/ubuntu1804/zoneminder.preinst new file mode 100644 index 000000000..9459b48d0 --- /dev/null +++ b/distros/ubuntu1804/zoneminder.preinst @@ -0,0 +1,36 @@ +#!/bin/sh + +set -e + +## Remove obsolete symlink which is in the way of dh_apache2: +ol="/etc/apache2/conf-available/zoneminder.conf" +if [ -h "${ol}" ]; then + [ "$(readlink ${ol})" = "/etc/zm/apache.conf" ] && rm -f "${ol}" +fi + +abort=false +if [ -h /usr/share/zoneminder/www/events ]; then + l=$(readlink /usr/share/zoneminder/www/events) + if [ "$l" != "/var/cache/zoneminder/events" -a "$l" != "/var/cache/zoneminder/events/" ]; then + abort=true + fi +fi +if [ -h /usr/share/zoneminder/www/images ]; then + l=$(readlink /usr/share/zoneminder/www/images ) + if [ "$l" != "/var/cache/zoneminder/images" -a "$l" != "/var/cache/zoneminder/images/" ]; then + abort=true + fi +fi + +if [ "$abort" = "true" ]; then + cat >&2 << EOF +Aborting installation of zoneminder due to non-default symlinks in +/usr/share/zoneminder for the images and/or events directory, which could +result in loss of data. Please move your data in each of these directories to +/var/cache/zoneminder before installing zoneminder from the package. +EOF + exit 1 + +fi + +#DEBHELPER# diff --git a/distros/ubuntu1804/zoneminder.service b/distros/ubuntu1804/zoneminder.service new file mode 100644 index 000000000..a4479c49c --- /dev/null +++ b/distros/ubuntu1804/zoneminder.service @@ -0,0 +1,21 @@ +# ZoneMinder systemd unit file +# This file is intended to work with Debian distributions + +[Unit] +Description=ZoneMinder CCTV recording and surveillance system +After=network.target mysql.service +# Remarked out so that it will start ZM on machines that don't have mysql installed +#Requires=mysql.service + +[Service] +#User=www-data +Type=forking +ExecStart=/usr/bin/zmpkg.pl start +ExecReload=/usr/bin/zmpkg.pl restart +ExecStop=/usr/bin/zmpkg.pl stop +PIDFile=/var/run/zm/zm.pid +Restart=on-abnormal +Environment=TZ=:/etc/localtime + +[Install] +WantedBy=multi-user.target diff --git a/distros/ubuntu1804/zoneminder.tmpfile b/distros/ubuntu1804/zoneminder.tmpfile new file mode 100644 index 000000000..ef68288ba --- /dev/null +++ b/distros/ubuntu1804/zoneminder.tmpfile @@ -0,0 +1,3 @@ +d /var/run/zm 0755 www-data www-data +d /tmp/zm 0755 www-data www-data +d /var/tmp/zm 0755 www-data www-data From 3475bfb6728dc132d64956e8d2f6cd7572eb870a Mon Sep 17 00:00:00 2001 From: Matthew Trescott Date: Mon, 5 Mar 2018 18:46:52 -0500 Subject: [PATCH 02/10] Fix compilation on Ubuntu 18.04 I'm not entirely sure why this wasn't a problem with icconor's source package on launchpad. But, even unfamiliar as I am with CMake, it doesn't make sense to me to throw a fatal error by checking for a header that is already known to be unavailable. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6fea0e6d..0ff870584 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -482,24 +482,24 @@ if(MP4V2_LIBRARIES) if(MP4V2_INCLUDE_DIR) include_directories("${MP4V2_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${MP4V2_INCLUDE_DIR}") + check_include_file("mp4v2/mp4v2.h" HAVE_MP4V2_MP4V2_H) endif(MP4V2_INCLUDE_DIR) - check_include_file("mp4v2/mp4v2.h" HAVE_MP4V2_MP4V2_H) # mp4v2.h find_path(MP4V2_INCLUDE_DIR mp4v2.h) if(MP4V2_INCLUDE_DIR) include_directories("${MP4V2_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${MP4V2_INCLUDE_DIR}") + check_include_file("mp4v2.h" HAVE_MP4V2_H) endif(MP4V2_INCLUDE_DIR) - check_include_file("mp4v2.h" HAVE_MP4V2_H) # mp4.h find_path(MP4V2_INCLUDE_DIR mp4.h) if(MP4V2_INCLUDE_DIR) include_directories("${MP4V2_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${MP4V2_INCLUDE_DIR}") + check_include_file("mp4.h" HAVE_MP4_H) endif(MP4V2_INCLUDE_DIR) - check_include_file("mp4.h" HAVE_MP4_H) mark_as_advanced(FORCE MP4V2_LIBRARIES MP4V2_INCLUDE_DIR) set(optlibsfound "${optlibsfound} mp4v2") From 49a2065f34abeac6b627746c258f8fbbadc268da Mon Sep 17 00:00:00 2001 From: Matthew Trescott Date: Mon, 5 Mar 2018 19:06:38 -0500 Subject: [PATCH 03/10] Allow packaging with libx264-152, allow packaging with MariaDB instead of MySQL --- distros/ubuntu1804/control | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/distros/ubuntu1804/control b/distros/ubuntu1804/control index 09c4ce9bc..68c985945 100644 --- a/distros/ubuntu1804/control +++ b/distros/ubuntu1804/control @@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 9), dh-systemd, python-sphinx | python3-sphinx, apa ,libcurl4-gnutls-dev ,libgnutls-openssl-dev ,libjpeg8-dev | libjpeg9-dev | libjpeg62-turbo-dev - ,default-libmysqlclient-dev | libmysqlclient-dev + ,default-libmysqlclient-dev | libmysqlclient-dev | libmariadbclient-dev-compat ,libpcre3-dev ,libpolkit-gobject-1-dev ,libv4l-dev (>= 0.8.3) [!hurd-any] @@ -39,7 +39,7 @@ Package: zoneminder Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,javascript-common - ,libmp4v2-2, libx264-142|libx264-148, libswscale-ffmpeg3|libswscale4|libswscale3 + ,libmp4v2-2, libx264-142|libx264-148|libx264-152, libswscale-ffmpeg3|libswscale4|libswscale3 ,ffmpeg | libav-tools ,libdate-manip-perl, libmime-lite-perl, libmime-tools-perl ,libdbd-mysql-perl @@ -61,7 +61,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,libdigest-sha-perl ,libsys-cpu-perl, libsys-meminfo-perl ,libdata-uuid-perl - ,mysql-client | virtual-mysql-client + ,mysql-client | mariadb-client | virtual-mysql-client ,perl-modules ,php5-mysql | php-mysql, php5-gd | php-gd , php5-apcu | php-apcu , php-apc | php-apcu-bc ,policykit-1 @@ -70,7 +70,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,libpcre3 Recommends: ${misc:Recommends} ,libapache2-mod-php5 | libapache2-mod-php | php5-fpm | php-fpm - ,mysql-server | virtual-mysql-server + ,mysql-server | mariadb-server | virtual-mysql-server ,zoneminder-doc (>= ${source:Version}) ,ffmpeg Suggests: fcgiwrap, logrotate From c750db91b5aaef42823ef7142bd9707e1729bb5b Mon Sep 17 00:00:00 2001 From: Matthew Trescott Date: Mon, 5 Mar 2018 19:11:53 -0500 Subject: [PATCH 04/10] Make sure a2enmod is available before calling it in postinst The user may be using zm with e.g. nginx since apache is not a dependency. --- distros/ubuntu1804/zoneminder.postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/ubuntu1804/zoneminder.postinst b/distros/ubuntu1804/zoneminder.postinst index d2cef7804..2b80b08f4 100644 --- a/distros/ubuntu1804/zoneminder.postinst +++ b/distros/ubuntu1804/zoneminder.postinst @@ -12,7 +12,7 @@ if [ "$1" = "configure" ]; then if [ -z "$2" ]; then chown www-data:www-data /var/cache/zoneminder /var/cache/zoneminder/* fi - if [ ! -e "/etc/apache2/mods-enabled/cgi.load" ]; then + if [ ! -e "/etc/apache2/mods-enabled/cgi.load" ] && [ "$(command -v a2enmod)" != "" ]; then echo "The cgi module is not enabled in apache2. I am enabling it using a2enmod cgi." a2enmod cgi fi From 17c5028312ac74659fd5a1b4b8ae0755bdb7c1f2 Mon Sep 17 00:00:00 2001 From: Matthew Trescott Date: Mon, 5 Mar 2018 19:17:11 -0500 Subject: [PATCH 05/10] Don't install init.d script Despite not being specified in the --with parameter to dh, dh_installinit still seems to be run. Since most distros use systemd now, it seems like a bad idea to install services to /etc/init.d. --- distros/ubuntu1804/rules | 3 - distros/ubuntu1804/zoneminder.init | 91 ------------------------------ 2 files changed, 94 deletions(-) delete mode 100644 distros/ubuntu1804/zoneminder.init diff --git a/distros/ubuntu1804/rules b/distros/ubuntu1804/rules index 6bc3dffb5..13e30daf1 100755 --- a/distros/ubuntu1804/rules +++ b/distros/ubuntu1804/rules @@ -66,9 +66,6 @@ override_dh_fixperms: chown root:www-data $(CURDIR)/debian/zoneminder/etc/zm/zm.conf chmod 640 $(CURDIR)/debian/zoneminder/etc/zm/zm.conf -override_dh_installinit: - dh_installinit --no-start - override_dh_systemd_start: dh_systemd_start --no-start diff --git a/distros/ubuntu1804/zoneminder.init b/distros/ubuntu1804/zoneminder.init deleted file mode 100644 index 5cdf62165..000000000 --- a/distros/ubuntu1804/zoneminder.init +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: zoneminder -# Required-Start: $network $remote_fs $syslog -# Required-Stop: $network $remote_fs $syslog -# Should-Start: mysql -# Should-Stop: mysql -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Control ZoneMinder as a Service -# Description: ZoneMinder CCTV recording and surveillance system -### END INIT INFO -# chkconfig: 2345 20 20 - -# Source function library. -. /lib/lsb/init-functions - -prog=ZoneMinder -ZM_PATH_BIN="/usr/bin" -RUNDIR="/var/run/zm" -TMPDIR="/tmp/zm" -command="$ZM_PATH_BIN/zmpkg.pl" - -start() { - echo -n "Starting $prog: " - export TZ=:/etc/localtime - mkdir -p "$RUNDIR" && chown www-data:www-data "$RUNDIR" - mkdir -p "$TMPDIR" && chown www-data:www-data "$TMPDIR" - $command start - RETVAL=$? - [ $RETVAL = 0 ] && echo success - [ $RETVAL != 0 ] && echo failure - echo - [ $RETVAL = 0 ] && touch /var/lock/zm - return $RETVAL -} -stop() { - echo -n "Stopping $prog: " - # - # Why is this status check being done? - # as $command stop returns 1 if zoneminder - # is stopped, which will result in - # this returning 1, which will stuff - # dpkg when it tries to stop zoneminder before - # uninstalling . . . - # - result=`$command status` - if [ ! "$result" = "running" ]; then - echo "Zoneminder already stopped" - echo - RETVAL=0 - else - $command stop - RETVAL=$? - [ $RETVAL = 0 ] && echo success - [ $RETVAL != 0 ] && echo failure - echo - [ $RETVAL = 0 ] && rm -f /var/lock/zm - fi -} -status() { - result=`$command status` - if [ "$result" = "running" ]; then - echo "ZoneMinder is running" - RETVAL=0 - else - echo "ZoneMinder is stopped" - RETVAL=1 - fi -} - -case "$1" in -'start') - start - ;; -'stop') - stop - ;; -'restart' | 'force-reload') - stop - start - ;; -'status') - status - ;; -*) - echo "Usage: $0 { start | stop | restart | status }" - RETVAL=1 - ;; -esac -exit $RETVAL From 61949776974a0008237c81198a03c176f893c326 Mon Sep 17 00:00:00 2001 From: Matthew Trescott Date: Mon, 5 Mar 2018 19:38:42 -0500 Subject: [PATCH 06/10] Revamp postinst to also support MariaDB and use systemd to check service status, not /etc/init.d. --- distros/ubuntu1804/zoneminder.postinst | 119 +++++++++++++------------ 1 file changed, 64 insertions(+), 55 deletions(-) diff --git a/distros/ubuntu1804/zoneminder.postinst b/distros/ubuntu1804/zoneminder.postinst index 2b80b08f4..65c023dd1 100644 --- a/distros/ubuntu1804/zoneminder.postinst +++ b/distros/ubuntu1804/zoneminder.postinst @@ -3,66 +3,75 @@ set -e if [ "$1" = "configure" ]; then - - . /etc/zm/zm.conf - - # The logs can contain passwords, etc... so by setting group root, only www-data can read them, not people in the www-data group - chown www-data:root /var/log/zm - chown www-data:www-data /var/lib/zm - if [ -z "$2" ]; then - chown www-data:www-data /var/cache/zoneminder /var/cache/zoneminder/* - fi - if [ ! -e "/etc/apache2/mods-enabled/cgi.load" ] && [ "$(command -v a2enmod)" != "" ]; then - echo "The cgi module is not enabled in apache2. I am enabling it using a2enmod cgi." - a2enmod cgi - fi - - # Do this every time the package is installed or upgraded - # Ensure zoneminder is stopped - deb-systemd-invoke stop zoneminder.service || exit $? - - # Ensure zoneminder is stopped - deb-systemd-invoke stop zoneminder.service || exit $? - if [ "$ZM_DB_HOST" = "localhost" ]; then - - if [ -e "/etc/init.d/mysql" ]; then - - # - # Get mysql started if it isn't - # - if ! $(/etc/init.d/mysql status >/dev/null 2>&1); then - deb-systemd-invoke start mysql.service || exit $? - fi - - if $(/etc/init.d/mysql status >/dev/null 2>&1); then - mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload - # test if database if already present... - if ! $(echo quit | mysql --defaults-file=/etc/mysql/debian.cnf zm > /dev/null 2> /dev/null) ; then - cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf - # This creates the user. - echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost identified by \"${ZM_DB_PASS}\";" | mysql --defaults-file=/etc/mysql/debian.cnf mysql + + . /etc/zm/zm.conf + + # The logs can contain passwords, etc... so by setting group root, only www-data can read them, not people in the www-data group + chown www-data:root /var/log/zm + chown www-data:www-data /var/lib/zm + if [ -z "$2" ]; then + chown www-data:www-data /var/cache/zoneminder /var/cache/zoneminder/* + fi + if [ ! -e "/etc/apache2/mods-enabled/cgi.load" ] && [ "$(command -v a2enmod)" != "" ]; then + echo "The cgi module is not enabled in apache2. I am enabling it using a2enmod cgi." + a2enmod cgi + fi + + # Do this every time the package is installed or upgraded + + # Ensure zoneminder is stopped + deb-systemd-invoke stop zoneminder.service + if [ "$ZM_DB_HOST" = "localhost" ]; then + if [ -e "/lib/systemd/system/mysql.service" ] || [ -e "/lib/systemd/system/mariadb.service" ]; then + + # + # Get mysql started if it isn't running + # + $(systemctl status mysql.service >/dev/null 2>&1); MYSQL_STATUS=$? + $(systemctl status mariadb.service >/dev/null 2>&1); MARIADB_STATUS=$? + if [ "$MYSQL_STATUS" != "0" ] && [ "$MARIADB_STATUS" != "0" ]; then + # 3 = inactive, 4 = nonexistant + # Due to /etc/init.d service autogeneration, mysql.service always returns the status of mariadb.service + # However, mariadb.service + if [ "$MARIADB_STATUS" = "3" ]; then + DBSERVICE="mariadb.service" + deb-systemd-invoke start mariadb.service + elif [ "$MYSQL_STATUS" = "3" ]; then + DBSERVICE="mysql.service" + deb-systemd-invoke start mysql.service + fi + fi + + # Make sure systemctl status exit code is 0; i.e. the DB is running + if systemctl status "$DBSERVICE" >/dev/null 2>&1; then + mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload + # test if database if already present... + if ! $(echo quit | mysql zm > /dev/null 2> /dev/null) ; then + cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf + # This creates the user. + echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost identified by \"${ZM_DB_PASS}\";" | mysql --defaults-file=/etc/mysql/debian.cnf mysql + else + echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost;" | mysql mysql + fi + + zmupdate.pl --nointeractive + zmupdate.pl --nointeractive -f + + # Add any new PTZ control configurations to the database (will not overwrite) + zmcamtool.pl --import >/dev/null 2>&1 + + else + echo 'NOTE: MySQL/MariaDB not running; please start mysql and run dpkg-reconfigure zoneminder when it is running.' + fi else - echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost;" | mysql --defaults-file=/etc/mysql/debian.cnf mysql + echo 'MySQL/MariaDB not found; assuming remote server.' fi - zmupdate.pl --nointeractive - zmupdate.pl --nointeractive -f - - # Add any new PTZ control configurations to the database (will not overwrite) - zmcamtool.pl --import >/dev/null 2>&1 - - else - echo 'NOTE: mysql not running, please start mysql and run dpkg-reconfigure zoneminder when it is running.' - fi else - echo 'mysql not found, assuming remote server.' + echo "Not doing database upgrade due to remote db server ($ZM_DB_HOST)." fi - - else - echo "Not doing database upgrade due to remote db server ($ZM_DB_HOST)" - fi - echo "Done Updating, starting ZoneMinder" - deb-systemd-invoke restart zoneminder.service || exit $? + echo "Done Updating; starting ZoneMinder." + deb-systemd-invoke restart zoneminder.service fi From 7a9350c44ff0727dc69fc13f64822c26f032605c Mon Sep 17 00:00:00 2001 From: Matthew Trescott Date: Mon, 5 Mar 2018 20:24:40 -0500 Subject: [PATCH 07/10] Quick fix for mistake --- distros/ubuntu1804/zoneminder.postinst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/distros/ubuntu1804/zoneminder.postinst b/distros/ubuntu1804/zoneminder.postinst index 65c023dd1..4c72a3ba3 100644 --- a/distros/ubuntu1804/zoneminder.postinst +++ b/distros/ubuntu1804/zoneminder.postinst @@ -29,17 +29,19 @@ if [ "$1" = "configure" ]; then # $(systemctl status mysql.service >/dev/null 2>&1); MYSQL_STATUS=$? $(systemctl status mariadb.service >/dev/null 2>&1); MARIADB_STATUS=$? + + # 3 = inactive, 4 = nonexistant + if [ "$MARIADB_STATUS" != "4" ]; then + DBSERVICE="mariadb.service" + else + DBSERVICE="mysql.service" + fi + if [ "$MYSQL_STATUS" != "0" ] && [ "$MARIADB_STATUS" != "0" ]; then # 3 = inactive, 4 = nonexistant # Due to /etc/init.d service autogeneration, mysql.service always returns the status of mariadb.service - # However, mariadb.service - if [ "$MARIADB_STATUS" = "3" ]; then - DBSERVICE="mariadb.service" - deb-systemd-invoke start mariadb.service - elif [ "$MYSQL_STATUS" = "3" ]; then - DBSERVICE="mysql.service" - deb-systemd-invoke start mysql.service - fi + # However, mariadb.service will not return the status of mysql.service. + deb-systemd-invoke start $DBSERVICE fi # Make sure systemctl status exit code is 0; i.e. the DB is running From 4c44c32a62020c5d0ae03295760d5cabec591d60 Mon Sep 17 00:00:00 2001 From: Matthew Trescott Date: Tue, 6 Mar 2018 19:23:01 -0500 Subject: [PATCH 08/10] Allow db username/password setting in conf.d --- distros/ubuntu1804/zoneminder.postinst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/distros/ubuntu1804/zoneminder.postinst b/distros/ubuntu1804/zoneminder.postinst index 4c72a3ba3..e3cd72343 100644 --- a/distros/ubuntu1804/zoneminder.postinst +++ b/distros/ubuntu1804/zoneminder.postinst @@ -5,6 +5,9 @@ set -e if [ "$1" = "configure" ]; then . /etc/zm/zm.conf + for CONFFILE in /etc/zm/conf.d/*.conf; do + . "$CONFFILE" + done # The logs can contain passwords, etc... so by setting group root, only www-data can read them, not people in the www-data group chown www-data:root /var/log/zm From ee146acf0779388eed19b270b9b89cbf5b66ab6f Mon Sep 17 00:00:00 2001 From: Matthew Trescott Date: Tue, 6 Mar 2018 20:35:41 -0500 Subject: [PATCH 09/10] Remove obsolete symlink handling, update README.Debian --- distros/ubuntu1804/README.Debian | 46 +++++---------------------- distros/ubuntu1804/zoneminder.preinst | 25 --------------- 2 files changed, 8 insertions(+), 63 deletions(-) diff --git a/distros/ubuntu1804/README.Debian b/distros/ubuntu1804/README.Debian index 8182e0678..4fe3464d2 100644 --- a/distros/ubuntu1804/README.Debian +++ b/distros/ubuntu1804/README.Debian @@ -23,8 +23,7 @@ configuration file: Upgrading database ------------------ -Prior to 1.28.1 database upgrade was performed automatically. -"zoneminder" service will refuse to start with outdated database. +The database is updated automatically on installation. You should not need to take this step. Assuming that database is on "localhost" then the following command can be used to upgrade "zm" database: @@ -45,17 +44,11 @@ The following command prints the current version of zoneminder database: Enabling service ---------------- -By default Zoneminder service is not starting automatically and need to be -manually activated once database is configured: - -On systemd: +By default Zoneminder service is not automatically started and needs to be +manually enabled once database is configured: sudo systemctl enable zoneminder.service -On SysV: - - sudo update-rc.d zoneminder enable - Web server set-up ----------------- @@ -82,10 +75,10 @@ Common configuration steps for Apache2: ## nginx / fcgiwrap -Nginx needs "php5-fpm" package to support PHP and "fcgiwrap" package +Nginx needs "php-fpm" package to support PHP and "fcgiwrap" package for binary "cgi-bin" applications: - sudo apt-get install php5-fpm fcgiwrap + sudo apt-get install php-fpm fcgiwrap To enable a URL alias that makes Zoneminder available from @@ -119,32 +112,9 @@ site configuration. Changing the location for images and events ------------------------------------------- -Zoneminder, in its upstream form, stores data in /usr/share/zoneminder/. This -package modifies that by changing /usr/share/zoneminder/images and -/usr/share/zoneminder/events to symlinks to directories under -/var/cache/zoneminder. - -There are numerous places these could be put and ways to do it. But, at the -moment, if you change this, an upgrade will fail with a warning about these -locations having changed (the reason for this was that previously, an upgrade -would silently revert the changes and cause event loss - refer -bug #608793). - -If you do want to change the location, here are a couple of suggestions. -(thanks to vagrant@freegeek.org): - -These lines in fstab could allow you to bind-mount an alternate location - - /dev/sdX1 /otherdrive ext3 defaults 0 2 - /otherdrive/zoneminder/images /var/cache/zoneminder/images bind defaults 0 2 - /otherdrive/zoneminder/events /var/cache/zoneminder/events bind defaults 0 2 - - or if you have a separate partition for each: - - /dev/sdX1 /var/cache/zoneminder/images ext3 defaults 0 2 - /dev/sdX2 /var/cache/zoneminder/events ext3 defaults 0 2 - - -- Peter Howard , Sun, 16 Jan 2010 01:35:51 +1100 +ZoneMinder is now able to be configured to use an alternative location for storing +events and images at compile time. This package makes use of that, so symlinks in +/usr/share/zoneminder/www are no longer necessary. Access to /dev/video* --------------------- diff --git a/distros/ubuntu1804/zoneminder.preinst b/distros/ubuntu1804/zoneminder.preinst index 9459b48d0..6088c3ea9 100644 --- a/distros/ubuntu1804/zoneminder.preinst +++ b/distros/ubuntu1804/zoneminder.preinst @@ -8,29 +8,4 @@ if [ -h "${ol}" ]; then [ "$(readlink ${ol})" = "/etc/zm/apache.conf" ] && rm -f "${ol}" fi -abort=false -if [ -h /usr/share/zoneminder/www/events ]; then - l=$(readlink /usr/share/zoneminder/www/events) - if [ "$l" != "/var/cache/zoneminder/events" -a "$l" != "/var/cache/zoneminder/events/" ]; then - abort=true - fi -fi -if [ -h /usr/share/zoneminder/www/images ]; then - l=$(readlink /usr/share/zoneminder/www/images ) - if [ "$l" != "/var/cache/zoneminder/images" -a "$l" != "/var/cache/zoneminder/images/" ]; then - abort=true - fi -fi - -if [ "$abort" = "true" ]; then - cat >&2 << EOF -Aborting installation of zoneminder due to non-default symlinks in -/usr/share/zoneminder for the images and/or events directory, which could -result in loss of data. Please move your data in each of these directories to -/var/cache/zoneminder before installing zoneminder from the package. -EOF - exit 1 - -fi - #DEBHELPER# From 00ab9b4c033095e1080d16b7223f8006f8fbedf5 Mon Sep 17 00:00:00 2001 From: Andy Bauer Date: Tue, 13 Mar 2018 09:28:11 -0500 Subject: [PATCH 10/10] merge proposed changes in ubuntu1804 folder -> ubuntu1604 folder instead --- distros/ubuntu1604/README.Debian | 46 +---- distros/ubuntu1604/control | 8 +- distros/ubuntu1604/rules | 3 - distros/ubuntu1604/zoneminder.init | 91 --------- distros/ubuntu1604/zoneminder.postinst | 124 +++++++------ distros/ubuntu1604/zoneminder.preinst | 25 --- distros/ubuntu1804/NEWS | 10 - distros/ubuntu1804/README.Debian | 130 ------------- distros/ubuntu1804/TODO.Debian | 12 -- distros/ubuntu1804/changelog | 0 distros/ubuntu1804/clean | 3 - distros/ubuntu1804/compat | 1 - .../ubuntu1804/conf/apache2/zoneminder.conf | 19 -- distros/ubuntu1804/control | 154 ---------------- distros/ubuntu1804/copyright | 174 ------------------ distros/ubuntu1804/examples/nginx.conf | 32 ---- distros/ubuntu1804/gbp.conf | 7 - distros/ubuntu1804/libzoneminder-perl.install | 2 - distros/ubuntu1804/patches/series | 0 .../patches/use_libjs-mootools.patch | 18 -- distros/ubuntu1804/rules | 95 ---------- distros/ubuntu1804/source/format | 1 - distros/ubuntu1804/source/lintian-overrides | 9 - distros/ubuntu1804/zoneminder-doc.doc-base | 8 - distros/ubuntu1804/zoneminder-doc.install | 1 - distros/ubuntu1804/zoneminder-doc.links | 2 - distros/ubuntu1804/zoneminder.apache2 | 1 - distros/ubuntu1804/zoneminder.bug-presubj | 5 - distros/ubuntu1804/zoneminder.dirs | 8 - distros/ubuntu1804/zoneminder.docs | 1 - distros/ubuntu1804/zoneminder.examples | 2 - distros/ubuntu1804/zoneminder.install | 11 -- distros/ubuntu1804/zoneminder.links | 1 - distros/ubuntu1804/zoneminder.linktrees | 14 -- .../ubuntu1804/zoneminder.lintian-overrides | 14 -- distros/ubuntu1804/zoneminder.logrotate | 12 -- distros/ubuntu1804/zoneminder.maintscript | 1 - distros/ubuntu1804/zoneminder.manpages | 1 - distros/ubuntu1804/zoneminder.postinst | 83 --------- distros/ubuntu1804/zoneminder.postrm | 14 -- distros/ubuntu1804/zoneminder.preinst | 11 -- distros/ubuntu1804/zoneminder.service | 21 --- distros/ubuntu1804/zoneminder.tmpfile | 3 - 43 files changed, 81 insertions(+), 1097 deletions(-) delete mode 100644 distros/ubuntu1604/zoneminder.init delete mode 100644 distros/ubuntu1804/NEWS delete mode 100644 distros/ubuntu1804/README.Debian delete mode 100644 distros/ubuntu1804/TODO.Debian delete mode 100644 distros/ubuntu1804/changelog delete mode 100644 distros/ubuntu1804/clean delete mode 100644 distros/ubuntu1804/compat delete mode 100644 distros/ubuntu1804/conf/apache2/zoneminder.conf delete mode 100644 distros/ubuntu1804/control delete mode 100644 distros/ubuntu1804/copyright delete mode 100644 distros/ubuntu1804/examples/nginx.conf delete mode 100644 distros/ubuntu1804/gbp.conf delete mode 100644 distros/ubuntu1804/libzoneminder-perl.install delete mode 100644 distros/ubuntu1804/patches/series delete mode 100644 distros/ubuntu1804/patches/use_libjs-mootools.patch delete mode 100755 distros/ubuntu1804/rules delete mode 100644 distros/ubuntu1804/source/format delete mode 100644 distros/ubuntu1804/source/lintian-overrides delete mode 100644 distros/ubuntu1804/zoneminder-doc.doc-base delete mode 100644 distros/ubuntu1804/zoneminder-doc.install delete mode 100644 distros/ubuntu1804/zoneminder-doc.links delete mode 100644 distros/ubuntu1804/zoneminder.apache2 delete mode 100644 distros/ubuntu1804/zoneminder.bug-presubj delete mode 100644 distros/ubuntu1804/zoneminder.dirs delete mode 100644 distros/ubuntu1804/zoneminder.docs delete mode 100644 distros/ubuntu1804/zoneminder.examples delete mode 100644 distros/ubuntu1804/zoneminder.install delete mode 100644 distros/ubuntu1804/zoneminder.links delete mode 100644 distros/ubuntu1804/zoneminder.linktrees delete mode 100644 distros/ubuntu1804/zoneminder.lintian-overrides delete mode 100644 distros/ubuntu1804/zoneminder.logrotate delete mode 100644 distros/ubuntu1804/zoneminder.maintscript delete mode 100644 distros/ubuntu1804/zoneminder.manpages delete mode 100644 distros/ubuntu1804/zoneminder.postinst delete mode 100644 distros/ubuntu1804/zoneminder.postrm delete mode 100644 distros/ubuntu1804/zoneminder.preinst delete mode 100644 distros/ubuntu1804/zoneminder.service delete mode 100644 distros/ubuntu1804/zoneminder.tmpfile diff --git a/distros/ubuntu1604/README.Debian b/distros/ubuntu1604/README.Debian index 8182e0678..4fe3464d2 100644 --- a/distros/ubuntu1604/README.Debian +++ b/distros/ubuntu1604/README.Debian @@ -23,8 +23,7 @@ configuration file: Upgrading database ------------------ -Prior to 1.28.1 database upgrade was performed automatically. -"zoneminder" service will refuse to start with outdated database. +The database is updated automatically on installation. You should not need to take this step. Assuming that database is on "localhost" then the following command can be used to upgrade "zm" database: @@ -45,17 +44,11 @@ The following command prints the current version of zoneminder database: Enabling service ---------------- -By default Zoneminder service is not starting automatically and need to be -manually activated once database is configured: - -On systemd: +By default Zoneminder service is not automatically started and needs to be +manually enabled once database is configured: sudo systemctl enable zoneminder.service -On SysV: - - sudo update-rc.d zoneminder enable - Web server set-up ----------------- @@ -82,10 +75,10 @@ Common configuration steps for Apache2: ## nginx / fcgiwrap -Nginx needs "php5-fpm" package to support PHP and "fcgiwrap" package +Nginx needs "php-fpm" package to support PHP and "fcgiwrap" package for binary "cgi-bin" applications: - sudo apt-get install php5-fpm fcgiwrap + sudo apt-get install php-fpm fcgiwrap To enable a URL alias that makes Zoneminder available from @@ -119,32 +112,9 @@ site configuration. Changing the location for images and events ------------------------------------------- -Zoneminder, in its upstream form, stores data in /usr/share/zoneminder/. This -package modifies that by changing /usr/share/zoneminder/images and -/usr/share/zoneminder/events to symlinks to directories under -/var/cache/zoneminder. - -There are numerous places these could be put and ways to do it. But, at the -moment, if you change this, an upgrade will fail with a warning about these -locations having changed (the reason for this was that previously, an upgrade -would silently revert the changes and cause event loss - refer -bug #608793). - -If you do want to change the location, here are a couple of suggestions. -(thanks to vagrant@freegeek.org): - -These lines in fstab could allow you to bind-mount an alternate location - - /dev/sdX1 /otherdrive ext3 defaults 0 2 - /otherdrive/zoneminder/images /var/cache/zoneminder/images bind defaults 0 2 - /otherdrive/zoneminder/events /var/cache/zoneminder/events bind defaults 0 2 - - or if you have a separate partition for each: - - /dev/sdX1 /var/cache/zoneminder/images ext3 defaults 0 2 - /dev/sdX2 /var/cache/zoneminder/events ext3 defaults 0 2 - - -- Peter Howard , Sun, 16 Jan 2010 01:35:51 +1100 +ZoneMinder is now able to be configured to use an alternative location for storing +events and images at compile time. This package makes use of that, so symlinks in +/usr/share/zoneminder/www are no longer necessary. Access to /dev/video* --------------------- diff --git a/distros/ubuntu1604/control b/distros/ubuntu1604/control index 09c4ce9bc..68c985945 100644 --- a/distros/ubuntu1604/control +++ b/distros/ubuntu1604/control @@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 9), dh-systemd, python-sphinx | python3-sphinx, apa ,libcurl4-gnutls-dev ,libgnutls-openssl-dev ,libjpeg8-dev | libjpeg9-dev | libjpeg62-turbo-dev - ,default-libmysqlclient-dev | libmysqlclient-dev + ,default-libmysqlclient-dev | libmysqlclient-dev | libmariadbclient-dev-compat ,libpcre3-dev ,libpolkit-gobject-1-dev ,libv4l-dev (>= 0.8.3) [!hurd-any] @@ -39,7 +39,7 @@ Package: zoneminder Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,javascript-common - ,libmp4v2-2, libx264-142|libx264-148, libswscale-ffmpeg3|libswscale4|libswscale3 + ,libmp4v2-2, libx264-142|libx264-148|libx264-152, libswscale-ffmpeg3|libswscale4|libswscale3 ,ffmpeg | libav-tools ,libdate-manip-perl, libmime-lite-perl, libmime-tools-perl ,libdbd-mysql-perl @@ -61,7 +61,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,libdigest-sha-perl ,libsys-cpu-perl, libsys-meminfo-perl ,libdata-uuid-perl - ,mysql-client | virtual-mysql-client + ,mysql-client | mariadb-client | virtual-mysql-client ,perl-modules ,php5-mysql | php-mysql, php5-gd | php-gd , php5-apcu | php-apcu , php-apc | php-apcu-bc ,policykit-1 @@ -70,7 +70,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,libpcre3 Recommends: ${misc:Recommends} ,libapache2-mod-php5 | libapache2-mod-php | php5-fpm | php-fpm - ,mysql-server | virtual-mysql-server + ,mysql-server | mariadb-server | virtual-mysql-server ,zoneminder-doc (>= ${source:Version}) ,ffmpeg Suggests: fcgiwrap, logrotate diff --git a/distros/ubuntu1604/rules b/distros/ubuntu1604/rules index 6bc3dffb5..13e30daf1 100755 --- a/distros/ubuntu1604/rules +++ b/distros/ubuntu1604/rules @@ -66,9 +66,6 @@ override_dh_fixperms: chown root:www-data $(CURDIR)/debian/zoneminder/etc/zm/zm.conf chmod 640 $(CURDIR)/debian/zoneminder/etc/zm/zm.conf -override_dh_installinit: - dh_installinit --no-start - override_dh_systemd_start: dh_systemd_start --no-start diff --git a/distros/ubuntu1604/zoneminder.init b/distros/ubuntu1604/zoneminder.init deleted file mode 100644 index 5cdf62165..000000000 --- a/distros/ubuntu1604/zoneminder.init +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: zoneminder -# Required-Start: $network $remote_fs $syslog -# Required-Stop: $network $remote_fs $syslog -# Should-Start: mysql -# Should-Stop: mysql -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Control ZoneMinder as a Service -# Description: ZoneMinder CCTV recording and surveillance system -### END INIT INFO -# chkconfig: 2345 20 20 - -# Source function library. -. /lib/lsb/init-functions - -prog=ZoneMinder -ZM_PATH_BIN="/usr/bin" -RUNDIR="/var/run/zm" -TMPDIR="/tmp/zm" -command="$ZM_PATH_BIN/zmpkg.pl" - -start() { - echo -n "Starting $prog: " - export TZ=:/etc/localtime - mkdir -p "$RUNDIR" && chown www-data:www-data "$RUNDIR" - mkdir -p "$TMPDIR" && chown www-data:www-data "$TMPDIR" - $command start - RETVAL=$? - [ $RETVAL = 0 ] && echo success - [ $RETVAL != 0 ] && echo failure - echo - [ $RETVAL = 0 ] && touch /var/lock/zm - return $RETVAL -} -stop() { - echo -n "Stopping $prog: " - # - # Why is this status check being done? - # as $command stop returns 1 if zoneminder - # is stopped, which will result in - # this returning 1, which will stuff - # dpkg when it tries to stop zoneminder before - # uninstalling . . . - # - result=`$command status` - if [ ! "$result" = "running" ]; then - echo "Zoneminder already stopped" - echo - RETVAL=0 - else - $command stop - RETVAL=$? - [ $RETVAL = 0 ] && echo success - [ $RETVAL != 0 ] && echo failure - echo - [ $RETVAL = 0 ] && rm -f /var/lock/zm - fi -} -status() { - result=`$command status` - if [ "$result" = "running" ]; then - echo "ZoneMinder is running" - RETVAL=0 - else - echo "ZoneMinder is stopped" - RETVAL=1 - fi -} - -case "$1" in -'start') - start - ;; -'stop') - stop - ;; -'restart' | 'force-reload') - stop - start - ;; -'status') - status - ;; -*) - echo "Usage: $0 { start | stop | restart | status }" - RETVAL=1 - ;; -esac -exit $RETVAL diff --git a/distros/ubuntu1604/zoneminder.postinst b/distros/ubuntu1604/zoneminder.postinst index d2cef7804..e3cd72343 100644 --- a/distros/ubuntu1604/zoneminder.postinst +++ b/distros/ubuntu1604/zoneminder.postinst @@ -3,66 +3,80 @@ set -e if [ "$1" = "configure" ]; then - - . /etc/zm/zm.conf - - # The logs can contain passwords, etc... so by setting group root, only www-data can read them, not people in the www-data group - chown www-data:root /var/log/zm - chown www-data:www-data /var/lib/zm - if [ -z "$2" ]; then - chown www-data:www-data /var/cache/zoneminder /var/cache/zoneminder/* - fi - if [ ! -e "/etc/apache2/mods-enabled/cgi.load" ]; then - echo "The cgi module is not enabled in apache2. I am enabling it using a2enmod cgi." - a2enmod cgi - fi - - # Do this every time the package is installed or upgraded - # Ensure zoneminder is stopped - deb-systemd-invoke stop zoneminder.service || exit $? - - # Ensure zoneminder is stopped - deb-systemd-invoke stop zoneminder.service || exit $? - if [ "$ZM_DB_HOST" = "localhost" ]; then - - if [ -e "/etc/init.d/mysql" ]; then - - # - # Get mysql started if it isn't - # - if ! $(/etc/init.d/mysql status >/dev/null 2>&1); then - deb-systemd-invoke start mysql.service || exit $? - fi - - if $(/etc/init.d/mysql status >/dev/null 2>&1); then - mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload - # test if database if already present... - if ! $(echo quit | mysql --defaults-file=/etc/mysql/debian.cnf zm > /dev/null 2> /dev/null) ; then - cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf - # This creates the user. - echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost identified by \"${ZM_DB_PASS}\";" | mysql --defaults-file=/etc/mysql/debian.cnf mysql + + . /etc/zm/zm.conf + for CONFFILE in /etc/zm/conf.d/*.conf; do + . "$CONFFILE" + done + + # The logs can contain passwords, etc... so by setting group root, only www-data can read them, not people in the www-data group + chown www-data:root /var/log/zm + chown www-data:www-data /var/lib/zm + if [ -z "$2" ]; then + chown www-data:www-data /var/cache/zoneminder /var/cache/zoneminder/* + fi + if [ ! -e "/etc/apache2/mods-enabled/cgi.load" ] && [ "$(command -v a2enmod)" != "" ]; then + echo "The cgi module is not enabled in apache2. I am enabling it using a2enmod cgi." + a2enmod cgi + fi + + # Do this every time the package is installed or upgraded + + # Ensure zoneminder is stopped + deb-systemd-invoke stop zoneminder.service + if [ "$ZM_DB_HOST" = "localhost" ]; then + if [ -e "/lib/systemd/system/mysql.service" ] || [ -e "/lib/systemd/system/mariadb.service" ]; then + + # + # Get mysql started if it isn't running + # + $(systemctl status mysql.service >/dev/null 2>&1); MYSQL_STATUS=$? + $(systemctl status mariadb.service >/dev/null 2>&1); MARIADB_STATUS=$? + + # 3 = inactive, 4 = nonexistant + if [ "$MARIADB_STATUS" != "4" ]; then + DBSERVICE="mariadb.service" + else + DBSERVICE="mysql.service" + fi + + if [ "$MYSQL_STATUS" != "0" ] && [ "$MARIADB_STATUS" != "0" ]; then + # 3 = inactive, 4 = nonexistant + # Due to /etc/init.d service autogeneration, mysql.service always returns the status of mariadb.service + # However, mariadb.service will not return the status of mysql.service. + deb-systemd-invoke start $DBSERVICE + fi + + # Make sure systemctl status exit code is 0; i.e. the DB is running + if systemctl status "$DBSERVICE" >/dev/null 2>&1; then + mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload + # test if database if already present... + if ! $(echo quit | mysql zm > /dev/null 2> /dev/null) ; then + cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf + # This creates the user. + echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost identified by \"${ZM_DB_PASS}\";" | mysql --defaults-file=/etc/mysql/debian.cnf mysql + else + echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost;" | mysql mysql + fi + + zmupdate.pl --nointeractive + zmupdate.pl --nointeractive -f + + # Add any new PTZ control configurations to the database (will not overwrite) + zmcamtool.pl --import >/dev/null 2>&1 + + else + echo 'NOTE: MySQL/MariaDB not running; please start mysql and run dpkg-reconfigure zoneminder when it is running.' + fi else - echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost;" | mysql --defaults-file=/etc/mysql/debian.cnf mysql + echo 'MySQL/MariaDB not found; assuming remote server.' fi - zmupdate.pl --nointeractive - zmupdate.pl --nointeractive -f - - # Add any new PTZ control configurations to the database (will not overwrite) - zmcamtool.pl --import >/dev/null 2>&1 - - else - echo 'NOTE: mysql not running, please start mysql and run dpkg-reconfigure zoneminder when it is running.' - fi else - echo 'mysql not found, assuming remote server.' + echo "Not doing database upgrade due to remote db server ($ZM_DB_HOST)." fi - - else - echo "Not doing database upgrade due to remote db server ($ZM_DB_HOST)" - fi - echo "Done Updating, starting ZoneMinder" - deb-systemd-invoke restart zoneminder.service || exit $? + echo "Done Updating; starting ZoneMinder." + deb-systemd-invoke restart zoneminder.service fi diff --git a/distros/ubuntu1604/zoneminder.preinst b/distros/ubuntu1604/zoneminder.preinst index 9459b48d0..6088c3ea9 100644 --- a/distros/ubuntu1604/zoneminder.preinst +++ b/distros/ubuntu1604/zoneminder.preinst @@ -8,29 +8,4 @@ if [ -h "${ol}" ]; then [ "$(readlink ${ol})" = "/etc/zm/apache.conf" ] && rm -f "${ol}" fi -abort=false -if [ -h /usr/share/zoneminder/www/events ]; then - l=$(readlink /usr/share/zoneminder/www/events) - if [ "$l" != "/var/cache/zoneminder/events" -a "$l" != "/var/cache/zoneminder/events/" ]; then - abort=true - fi -fi -if [ -h /usr/share/zoneminder/www/images ]; then - l=$(readlink /usr/share/zoneminder/www/images ) - if [ "$l" != "/var/cache/zoneminder/images" -a "$l" != "/var/cache/zoneminder/images/" ]; then - abort=true - fi -fi - -if [ "$abort" = "true" ]; then - cat >&2 << EOF -Aborting installation of zoneminder due to non-default symlinks in -/usr/share/zoneminder for the images and/or events directory, which could -result in loss of data. Please move your data in each of these directories to -/var/cache/zoneminder before installing zoneminder from the package. -EOF - exit 1 - -fi - #DEBHELPER# diff --git a/distros/ubuntu1804/NEWS b/distros/ubuntu1804/NEWS deleted file mode 100644 index 6200726cf..000000000 --- a/distros/ubuntu1804/NEWS +++ /dev/null @@ -1,10 +0,0 @@ -zoneminder (1.28.1-1) unstable; urgency=low - - This version is no longer automatically initialize or upgrade database. - See README.Debian for details. - - Changed installation paths (please correct your web server configuration): - /usr/share/zoneminder --> /usr/share/zoneminder/www - /usr/lib/cgi-bin --> /usr/lib/zoneminder/cgi-bin - - -- Dmitry Smirnov Tue, 31 Mar 2015 15:12:17 +1100 diff --git a/distros/ubuntu1804/README.Debian b/distros/ubuntu1804/README.Debian deleted file mode 100644 index 4fe3464d2..000000000 --- a/distros/ubuntu1804/README.Debian +++ /dev/null @@ -1,130 +0,0 @@ -Zoneminder for Debian ---------------------- - -Initializing database ---------------------- - - pv /usr/share/zoneminder/db/zm_create.sql | sudo mysql --defaults-file=/etc/mysql/debian.cnf -OR - cat /usr/share/zoneminder/db/zm_create.sql | sudo mysql --defaults-file=/etc/mysql/debian.cnf - - echo 'grant lock tables,alter,create,index,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";'\ - | sudo mysql --defaults-file=/etc/mysql/debian.cnf mysql - -Hint: generate secure password with `pwgen` and update "/etc/zm/zm.conf" -accordingly. - -The following command can help to ensure that zoneminder can read its -configuration file: - - chgrp -c www-data /etc/zm/zm.conf - - -Upgrading database ------------------- - -The database is updated automatically on installation. You should not need to take this step. - -Assuming that database is on "localhost" then the following command can be -used to upgrade "zm" database: - - zmupdate.pl - -Additional permissions may be required to perform upgrade: - - echo 'grant lock tables, create, alter on zm.* to 'zmuser'@localhost identified by "zmpass";'\ - | sudo mysql --defaults-file=/etc/mysql/debian.cnf mysql - -The following command prints the current version of zoneminder database: - - echo 'select Value from Config where Name = "ZM_DYN_CURR_VERSION";' \ - | sudo mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names zm - - -Enabling service ----------------- - -By default Zoneminder service is not automatically started and needs to be -manually enabled once database is configured: - - sudo systemctl enable zoneminder.service - - -Web server set-up ------------------ - -There are few manual steps to get the web interface working: - -## Apache2 - -Apache can be configured as folder "/zm" using sample .conf: - - sudo a2enconf zoneminder - -Alternatively Apache web site configuration template can be used to setup -zoneminder as "http://zoneminder": - - sudo cp -v /usr/share/doc/zoneminder/examples/apache.conf /etc/apache2/sites-available/ - sudo a2ensite zoneminder.conf - -Common configuration steps for Apache2: - - sudo a2enmod cgi - sudo service apache2 reload - - -## nginx / fcgiwrap - -Nginx needs "php-fpm" package to support PHP and "fcgiwrap" package -for binary "cgi-bin" applications: - - sudo apt-get install php-fpm fcgiwrap - -To enable a URL alias that makes Zoneminder available from - - http://yourserver/zm - -the following line is to be added to "server" section of a web site -configuration: - - include /usr/share/doc/zoneminder/examples/nginx.conf; - -For "default" web site it would be sufficient to include the above -statement to the file - - /etc/nginx/sites-enabled/default - -To avoid problems with feeds from multiple cameras "fcgiwrap" should be -configured to start at least as many processes as there are cameras. -It can be done by adjusting DAEMON_OPTS in "/etc/default/fcgiwrap". -Systemd users may be affected by the following bug: - - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=792705 - - -## Note: - -When Zoneminder web site is running it may be necessary to set -Options/Paths/PATH_ZMS to "/zm/cgi-bin/nph-zms" or according to chosen web -site configuration. - - -Changing the location for images and events -------------------------------------------- - -ZoneMinder is now able to be configured to use an alternative location for storing -events and images at compile time. This package makes use of that, so symlinks in -/usr/share/zoneminder/www are no longer necessary. - -Access to /dev/video* ---------------------- - -For cameras which require access to /dev/video*, zoneminder may need the -www-data user added to the video group in order to see those cameras: - - adduser www-data video - -Note that all web applications running on the zoneminder server will then have -access to all video devices on the system. - - -- Vagrant Cascadian Sun, 27 Mar 2011 13:06:56 -0700 diff --git a/distros/ubuntu1804/TODO.Debian b/distros/ubuntu1804/TODO.Debian deleted file mode 100644 index 9dc59613b..000000000 --- a/distros/ubuntu1804/TODO.Debian +++ /dev/null @@ -1,12 +0,0 @@ - -## Separate substantial /usr/share into its own arch-all package. - -## Decide how to handle database updates. - - * Consider possibility that database may be on another machine (#469239). - * Consider dbconfig-common? Probably not (what if database is not on localhost?). - -### Run `zmupdate.pl` from service control scripts (init.d, service) on start? - - Automatic upgrade will break "one DB, many zoneminders" setup (unimportant?). - diff --git a/distros/ubuntu1804/changelog b/distros/ubuntu1804/changelog deleted file mode 100644 index e69de29bb..000000000 diff --git a/distros/ubuntu1804/clean b/distros/ubuntu1804/clean deleted file mode 100644 index 941ef2a3a..000000000 --- a/distros/ubuntu1804/clean +++ /dev/null @@ -1,3 +0,0 @@ -.gitattributes -web/api/.gitattributes -web/api/.gitignore diff --git a/distros/ubuntu1804/compat b/distros/ubuntu1804/compat deleted file mode 100644 index ec635144f..000000000 --- a/distros/ubuntu1804/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/distros/ubuntu1804/conf/apache2/zoneminder.conf b/distros/ubuntu1804/conf/apache2/zoneminder.conf deleted file mode 100644 index 59efc6248..000000000 --- a/distros/ubuntu1804/conf/apache2/zoneminder.conf +++ /dev/null @@ -1,19 +0,0 @@ -# Remember to enable cgi mod (i.e. "a2enmod cgi"). -ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin" - - Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch - AllowOverride All - Require all granted - - -Alias /zm /usr/share/zoneminder/www - - Options -Indexes +FollowSymLinks - - DirectoryIndex index.php - - - - - AllowOverride All - diff --git a/distros/ubuntu1804/control b/distros/ubuntu1804/control deleted file mode 100644 index 68c985945..000000000 --- a/distros/ubuntu1804/control +++ /dev/null @@ -1,154 +0,0 @@ -Source: zoneminder -Section: net -Priority: optional -Maintainer: Dmitry Smirnov -Uploaders: Vagrant Cascadian -Build-Depends: debhelper (>= 9), dh-systemd, python-sphinx | python3-sphinx, apache2-dev, dh-linktree - ,cmake - ,libx264-dev, libmp4v2-dev - ,libavdevice-dev (>= 6:10~) - ,libavcodec-dev (>= 6:10~) - ,libavformat-dev (>= 6:10~) - ,libavutil-dev (>= 6:10~) - ,libswscale-dev (>= 6:10~) - ,libbz2-dev - ,libgcrypt-dev - ,libcurl4-gnutls-dev - ,libgnutls-openssl-dev - ,libjpeg8-dev | libjpeg9-dev | libjpeg62-turbo-dev - ,default-libmysqlclient-dev | libmysqlclient-dev | libmariadbclient-dev-compat - ,libpcre3-dev - ,libpolkit-gobject-1-dev - ,libv4l-dev (>= 0.8.3) [!hurd-any] - ,libvlc-dev - ,libdate-manip-perl - ,libdbd-mysql-perl - ,libphp-serialization-perl - ,libsys-mmap-perl [!hurd-any] - ,libwww-perl - ,libdata-uuid-perl -# Unbundled (dh_linktree): - ,libjs-jquery - ,libjs-mootools -Standards-Version: 3.9.8 -Homepage: http://www.zoneminder.com/ -Vcs-Browser: http://anonscm.debian.org/cgit/collab-maint/zoneminder.git -Vcs-Git: git://anonscm.debian.org/collab-maint/zoneminder.git - -Package: zoneminder -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} - ,javascript-common - ,libmp4v2-2, libx264-142|libx264-148|libx264-152, libswscale-ffmpeg3|libswscale4|libswscale3 - ,ffmpeg | libav-tools - ,libdate-manip-perl, libmime-lite-perl, libmime-tools-perl - ,libdbd-mysql-perl - ,libphp-serialization-perl - ,libmodule-load-conditional-perl - ,libnet-sftp-foreign-perl - ,libarchive-zip-perl - ,libdbd-mysql-perl - ,libdevice-serialport-perl - ,libimage-info-perl - ,libjson-any-perl - ,libsys-mmap-perl [!hurd-any] - ,liburi-encode-perl - ,libwww-perl - ,libdata-dump-perl - ,libclass-std-fast-perl - ,libsoap-wsdl-perl - ,libio-socket-multicast-perl - ,libdigest-sha-perl - ,libsys-cpu-perl, libsys-meminfo-perl - ,libdata-uuid-perl - ,mysql-client | mariadb-client | virtual-mysql-client - ,perl-modules - ,php5-mysql | php-mysql, php5-gd | php-gd , php5-apcu | php-apcu , php-apc | php-apcu-bc - ,policykit-1 - ,rsyslog | system-log-daemon - ,zip - ,libpcre3 -Recommends: ${misc:Recommends} - ,libapache2-mod-php5 | libapache2-mod-php | php5-fpm | php-fpm - ,mysql-server | mariadb-server | virtual-mysql-server - ,zoneminder-doc (>= ${source:Version}) - ,ffmpeg -Suggests: fcgiwrap, logrotate -Description: video camera security and surveillance solution - ZoneMinder is intended for use in single or multi-camera video security - applications, including commercial or home CCTV, theft prevention and child - or family member or home monitoring and other care scenarios. It - supports capture, analysis, recording, and monitoring of video data coming - from one or more video or network cameras attached to a Linux system. - ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom - cameras using a variety of protocols. It is suitable for use as a home - video security system and for commercial or professional video security - and surveillance. It can also be integrated into a home automation system - via X.10 or other protocols. - -#Package: libzoneminder-perl -#Section: perl -#Architecture: all -#Multi-Arch: foreign -#Depends: ${misc:Depends}, ${perl:Depends} -# ,libarchive-zip-perl -# ,libdbd-mysql-perl -# ,libdevice-serialport-perl -# ,libimage-info-perl -# ,libjson-any-perl -# ,libsys-mmap-perl [!hurd-any] -# ,liburi-encode-perl -# ,libwww-perl -#Description: ZoneMinder Perl libraries -# ZoneMinder is intended for use in single or multi-camera video security -# applications, including commercial or home CCTV, theft prevention and child -# or family member or home monitoring and other care scenarios. It -# supports capture, analysis, recording, and monitoring of video data coming -# from one or more video or network cameras attached to a Linux system. -# ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom -# cameras using a variety of protocols. It is suitable for use as a home -# video security system and for commercial or professional video security -# and surveillance. It can also be integrated into a home automation system -# via X.10 or other protocols. -# . -# This package provides ZoneMinder Perl libraries; it can be used to -# write custom interfaces as well. - -Package: zoneminder-doc -Section: doc -Architecture: all -Multi-Arch: foreign -Depends: ${misc:Depends}, ${sphinxdoc:Depends}, python-sphinx-rtd-theme | python3-sphinx-rtd-theme -Suggests: www-browser -Description: ZoneMinder documentation - ZoneMinder is intended for use in single or multi-camera video security - applications, including commercial or home CCTV, theft prevention and child - or family member or home monitoring and other care scenarios. It - supports capture, analysis, recording, and monitoring of video data coming - from one or more video or network cameras attached to a Linux system. - ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom - cameras using a variety of protocols. It is suitable for use as a home - video security system and for commercial or professional video security - and surveillance. It can also be integrated into a home automation system - via X.10 or other protocols. - . - This package provides ZoneMinder documentation in HTML format. - -Package: zoneminder-dbg -Section: debug -Priority: extra -Architecture: any -Depends: zoneminder (= ${binary:Version}), ${misc:Depends} -Description: Zoneminder -- debugging symbols - ZoneMinder is intended for use in single or multi-camera video security - applications, including commercial or home CCTV, theft prevention and child - or family member or home monitoring and other care scenarios. It - supports capture, analysis, recording, and monitoring of video data coming - from one or more video or network cameras attached to a Linux system. - ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom - cameras using a variety of protocols. It is suitable for use as a home - video security system and for commercial or professional video security - and surveillance. It can also be integrated into a home automation system - via X.10 or other protocols. - . - This package provides debugging symbols diff --git a/distros/ubuntu1804/copyright b/distros/ubuntu1804/copyright deleted file mode 100644 index c48025a25..000000000 --- a/distros/ubuntu1804/copyright +++ /dev/null @@ -1,174 +0,0 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: ZoneMinder -Upstream-Contact: Philip Coombes -Source: https://github.com/ZoneMinder/ZoneMinder -Comment: - This package was originally debianized by matrix - on Mon, 7 Mar 2005 02:07:57 -0500. - It was re-done for submission to the Debian project by Peter Howard - on Fri, 8 Dec 2006 10:19:43 +1100 -Files-Excluded: - web/skins/*/js/jquery-* - web/tools/mootools/*-yc.js - -Files: * -Copyright: 2001-2014 Philip Coombes - 2008 Brian Rudy - 2014 Vincent Giovannone - 2013 Tim Craig - 2003-2008 Corey DeLasaux - 2001-2010 Chris Kistner -License: GPL-2+ - -Files: distros/* -Copyright: 2001-2008 Philip Coombes - 2014 Isaac Connor - 2005 Serg Oskin -License: GPL-2+ - -Files: web/skins/*/js/jquery-* -Copyright: 2010 John Resig - 2010 The Dojo Foundation -License: GPL-2 or Expat -Comment: - Dual licensed under the MIT or GPL Version 2 licenses. - http://jquery.org/license - . - Includes Sizzle.js http://sizzlejs.com/ - Released under the MIT, BSD, and GPL Licenses. - -Files: web/tools/mootools/*.js -Copyright: 2009 Marcelo Jorge Vieira (metal) - 2006-2010 Valerio Proietti (http://mad4milk.net/) -License: Expat - -Files: web/api/* -Copyright: 2005-2013 Cake Software Foundation, Inc. (http://cakefoundation.org) -License: Expat - -Files: - cmake/Modules/CheckPrototypeDefinition*.cmake - cmake/Modules/FindGLIB2.cmake - cmake/Modules/FindPolkit.cmake - cmake/Modules/GNUInstallDirs.cmake -Copyright: - 2005-2011 Kitware, Inc. - 2010-2011 Andreas Schneider - 2009 Dario Freddi - 2008 Laurent Montel, - 2011 Nikita Krupen'ko -License: BSD-3-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - . - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - . - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - . - * The names of Kitware, Inc., the Insight Consortium, or the names of - any consortium members, or of any contributors, may not be used to - endorse or promote products derived from this software without - specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Files: cmake/Modules/FindPerlModules.cmake -Copyright: 2012 Iowa State University -License: Boost-1.0 - Boost Software License - Version 1.0 - August 17th, 2003 - . - Permission is hereby granted, free of charge, to any person or organization - obtaining a copy of the software and accompanying documentation covered by - this license (the "Software") to use, reproduce, display, distribute, - execute, and transmit the Software, and to prepare derivative works of the - Software, and to permit third-parties to whom the Software is furnished to - do so, all subject to the following: - . - The copyright notices in the Software and this entire statement, including - the above license grant, this restriction and the following disclaimer, - must be included in all copies of the Software, in whole or in part, and - all derivative works of the Software, unless such copies or derivative - works are solely in the form of machine-executable object code generated by - a source language processor. - . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - -Files: debian/* -Copyright: 2015 Dmitry Smirnov - 2007-2014 Peter Howard - 2010-2012 Vagrant Cascadian - 2001-2008 Philip Coombes -License: GPL-2+ - -License: Expat - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - . - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -License: GPL-2+ - This package is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - . - You should have received a copy of the GNU General Public - License along with this package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - . - The complete text of the GNU General Public License version 2 - can be found in "/usr/share/common-licenses/GPL-2". - -License: GPL-2 - This package is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; version 2 of the License. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - . - You should have received a copy of the GNU General Public - License along with this package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - . - The complete text of the GNU General Public License version 2 - can be found in "/usr/share/common-licenses/GPL-2". diff --git a/distros/ubuntu1804/examples/nginx.conf b/distros/ubuntu1804/examples/nginx.conf deleted file mode 100644 index 5636ca3e1..000000000 --- a/distros/ubuntu1804/examples/nginx.conf +++ /dev/null @@ -1,32 +0,0 @@ -location /zm/cgi-bin { - gzip off; - alias /usr/lib/zoneminder/cgi-bin; - - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME $request_filename; - fastcgi_pass unix:/var/run/fcgiwrap.socket; -} - -location /zm { -# if ($scheme ~ ^http:){ -# rewrite ^(.*)$ https://$host$1 permanent; -# } - - gzip off; - alias /usr/share/zoneminder/www; - index index.php; - - location ~ \.php$ { - if (!-f $request_filename) { return 404; } - expires epoch; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME $request_filename; - fastcgi_index index.php; - fastcgi_pass unix:/var/run/php5-fpm.sock; - } - - location ~ \.(jpg|jpeg|gif|png|ico)$ { - access_log off; - expires 33d; - } -} diff --git a/distros/ubuntu1804/gbp.conf b/distros/ubuntu1804/gbp.conf deleted file mode 100644 index 4608913d9..000000000 --- a/distros/ubuntu1804/gbp.conf +++ /dev/null @@ -1,7 +0,0 @@ - -[dch] -id-length = 0 - -[import-orig] -pristine-tar = False -merge = False diff --git a/distros/ubuntu1804/libzoneminder-perl.install b/distros/ubuntu1804/libzoneminder-perl.install deleted file mode 100644 index 67191d9cf..000000000 --- a/distros/ubuntu1804/libzoneminder-perl.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/share/man/man3 -usr/share/perl5 diff --git a/distros/ubuntu1804/patches/series b/distros/ubuntu1804/patches/series deleted file mode 100644 index e69de29bb..000000000 diff --git a/distros/ubuntu1804/patches/use_libjs-mootools.patch b/distros/ubuntu1804/patches/use_libjs-mootools.patch deleted file mode 100644 index b3925f6d0..000000000 --- a/distros/ubuntu1804/patches/use_libjs-mootools.patch +++ /dev/null @@ -1,18 +0,0 @@ -Last-Update: 2015-03-29 -Forwarded: no -Bug-Debian: http://bugs.debian.org/585590 -Reviewed-By: Dmitry Smirnov -Description: use mootools shipped by debian, rather than the zoneminder included mootools. - ---- a/web/skins/classic/includes/functions.php -+++ b/web/skins/classic/includes/functions.php -@@ -63,9 +63,8 @@ - } - ?> - - -- - - - >/dev/null 2>&1 || : - endscript - daily - rotate 7 -} diff --git a/distros/ubuntu1804/zoneminder.maintscript b/distros/ubuntu1804/zoneminder.maintscript deleted file mode 100644 index 3aa20b3a0..000000000 --- a/distros/ubuntu1804/zoneminder.maintscript +++ /dev/null @@ -1 +0,0 @@ -rm_conffile /etc/zm/apache.conf 1.28.1-5~ diff --git a/distros/ubuntu1804/zoneminder.manpages b/distros/ubuntu1804/zoneminder.manpages deleted file mode 100644 index d2053d688..000000000 --- a/distros/ubuntu1804/zoneminder.manpages +++ /dev/null @@ -1 +0,0 @@ -docs/_build/man/*.1 diff --git a/distros/ubuntu1804/zoneminder.postinst b/distros/ubuntu1804/zoneminder.postinst deleted file mode 100644 index e3cd72343..000000000 --- a/distros/ubuntu1804/zoneminder.postinst +++ /dev/null @@ -1,83 +0,0 @@ -#! /bin/sh - -set -e - -if [ "$1" = "configure" ]; then - - . /etc/zm/zm.conf - for CONFFILE in /etc/zm/conf.d/*.conf; do - . "$CONFFILE" - done - - # The logs can contain passwords, etc... so by setting group root, only www-data can read them, not people in the www-data group - chown www-data:root /var/log/zm - chown www-data:www-data /var/lib/zm - if [ -z "$2" ]; then - chown www-data:www-data /var/cache/zoneminder /var/cache/zoneminder/* - fi - if [ ! -e "/etc/apache2/mods-enabled/cgi.load" ] && [ "$(command -v a2enmod)" != "" ]; then - echo "The cgi module is not enabled in apache2. I am enabling it using a2enmod cgi." - a2enmod cgi - fi - - # Do this every time the package is installed or upgraded - - # Ensure zoneminder is stopped - deb-systemd-invoke stop zoneminder.service - if [ "$ZM_DB_HOST" = "localhost" ]; then - if [ -e "/lib/systemd/system/mysql.service" ] || [ -e "/lib/systemd/system/mariadb.service" ]; then - - # - # Get mysql started if it isn't running - # - $(systemctl status mysql.service >/dev/null 2>&1); MYSQL_STATUS=$? - $(systemctl status mariadb.service >/dev/null 2>&1); MARIADB_STATUS=$? - - # 3 = inactive, 4 = nonexistant - if [ "$MARIADB_STATUS" != "4" ]; then - DBSERVICE="mariadb.service" - else - DBSERVICE="mysql.service" - fi - - if [ "$MYSQL_STATUS" != "0" ] && [ "$MARIADB_STATUS" != "0" ]; then - # 3 = inactive, 4 = nonexistant - # Due to /etc/init.d service autogeneration, mysql.service always returns the status of mariadb.service - # However, mariadb.service will not return the status of mysql.service. - deb-systemd-invoke start $DBSERVICE - fi - - # Make sure systemctl status exit code is 0; i.e. the DB is running - if systemctl status "$DBSERVICE" >/dev/null 2>&1; then - mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload - # test if database if already present... - if ! $(echo quit | mysql zm > /dev/null 2> /dev/null) ; then - cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf - # This creates the user. - echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost identified by \"${ZM_DB_PASS}\";" | mysql --defaults-file=/etc/mysql/debian.cnf mysql - else - echo "grant lock tables,alter,select,insert,update,delete,create,index on ${ZM_DB_NAME}.* to '${ZM_DB_USER}'@localhost;" | mysql mysql - fi - - zmupdate.pl --nointeractive - zmupdate.pl --nointeractive -f - - # Add any new PTZ control configurations to the database (will not overwrite) - zmcamtool.pl --import >/dev/null 2>&1 - - else - echo 'NOTE: MySQL/MariaDB not running; please start mysql and run dpkg-reconfigure zoneminder when it is running.' - fi - else - echo 'MySQL/MariaDB not found; assuming remote server.' - fi - - else - echo "Not doing database upgrade due to remote db server ($ZM_DB_HOST)." - fi - echo "Done Updating; starting ZoneMinder." - deb-systemd-invoke restart zoneminder.service - -fi - -#DEBHELPER# diff --git a/distros/ubuntu1804/zoneminder.postrm b/distros/ubuntu1804/zoneminder.postrm deleted file mode 100644 index ba2066c8d..000000000 --- a/distros/ubuntu1804/zoneminder.postrm +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/sh - -set -e - -if [ "$1" = "purge" ]; then - echo " -Reminder: to completely remove \"zoneminder\" it may be necessary - * to delete database using the following sample command: - sudo mysqladmin --defaults-file=/etc/mysql/debian.cnf -f drop zm - * to delete remaining data files in "/var/cache/zoneminder". -" -fi - -#DEBHELPER# diff --git a/distros/ubuntu1804/zoneminder.preinst b/distros/ubuntu1804/zoneminder.preinst deleted file mode 100644 index 6088c3ea9..000000000 --- a/distros/ubuntu1804/zoneminder.preinst +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -set -e - -## Remove obsolete symlink which is in the way of dh_apache2: -ol="/etc/apache2/conf-available/zoneminder.conf" -if [ -h "${ol}" ]; then - [ "$(readlink ${ol})" = "/etc/zm/apache.conf" ] && rm -f "${ol}" -fi - -#DEBHELPER# diff --git a/distros/ubuntu1804/zoneminder.service b/distros/ubuntu1804/zoneminder.service deleted file mode 100644 index a4479c49c..000000000 --- a/distros/ubuntu1804/zoneminder.service +++ /dev/null @@ -1,21 +0,0 @@ -# ZoneMinder systemd unit file -# This file is intended to work with Debian distributions - -[Unit] -Description=ZoneMinder CCTV recording and surveillance system -After=network.target mysql.service -# Remarked out so that it will start ZM on machines that don't have mysql installed -#Requires=mysql.service - -[Service] -#User=www-data -Type=forking -ExecStart=/usr/bin/zmpkg.pl start -ExecReload=/usr/bin/zmpkg.pl restart -ExecStop=/usr/bin/zmpkg.pl stop -PIDFile=/var/run/zm/zm.pid -Restart=on-abnormal -Environment=TZ=:/etc/localtime - -[Install] -WantedBy=multi-user.target diff --git a/distros/ubuntu1804/zoneminder.tmpfile b/distros/ubuntu1804/zoneminder.tmpfile deleted file mode 100644 index ef68288ba..000000000 --- a/distros/ubuntu1804/zoneminder.tmpfile +++ /dev/null @@ -1,3 +0,0 @@ -d /var/run/zm 0755 www-data www-data -d /tmp/zm 0755 www-data www-data -d /var/tmp/zm 0755 www-data www-data