diff --git a/distros/debian8/README.source b/distros/debian8/README.source deleted file mode 100644 index b546508b2..000000000 --- a/distros/debian8/README.source +++ /dev/null @@ -1,12 +0,0 @@ -This package uses quilt to manage all modifications to the upstream source. -Changes are stored in the source package as diffs in debian/patches and applied -during the build. - -See /usr/share/doc/quilt/README.source for a detailed explanation. - - -This package uses the version 3.0 of the debian source package; An upstream -tarball is required to build it. This tarball can be generated automagically by -downloading the sources from the github repository with the following command: - -fakeroot debian/rules get-orig-source diff --git a/distros/debian8/changelog b/distros/debian8/changelog index 410e17821..0035f1e36 100644 --- a/distros/debian8/changelog +++ b/distros/debian8/changelog @@ -1,3 +1,11 @@ +zoneminder (1.28.0+nmu1) testing; urgency=medium + + * Non-maintainer upload + * Split the debian package into several packages + * Switch to native source format + + -- Emmanuel Papin Thu, 15 Jan 2015 20:00:08 +0100 + zoneminder (1.28.0-0.2) testing; urgency=medium * Non-maintainer upload. diff --git a/distros/debian8/control b/distros/debian8/control index 613abe30b..efa9ecef2 100644 --- a/distros/debian8/control +++ b/distros/debian8/control @@ -2,14 +2,21 @@ Source: zoneminder Section: net Priority: optional Maintainer: Isaac Connor -Build-Depends: debhelper (>= 9), po-debconf (>= 1.0), dh-systemd (>= 1.5), autoconf, automake, quilt, libphp-serialization-perl, libgnutls28-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev|libjpeg9-dev|libjpeg62-turbo-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, ffmpeg | libav-tools, libnetpbm10-dev, libavdevice-dev, libdevice-serialport-perl, libarchive-zip-perl, libmime-lite-perl, dh-autoreconf, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev|libgcrypt20-dev, libpolkit-gobject-1-dev +Build-Depends: debhelper (>= 9), po-debconf (>= 1.0), dh-systemd (>= 1.5), autoconf, automake, libphp-serialization-perl, libgnutls28-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev | libjpeg9-dev | libjpeg62-turbo-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, libnetpbm10-dev, libavdevice-dev, libdevice-serialport-perl, libarchive-zip-perl, libmime-lite-perl, dh-autoreconf, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev | libgcrypt20-dev, libpolkit-gobject-1-dev, libdbi-perl, libnet-sftp-foreign-perl, libexpect-perl, libmime-tools-perl Standards-Version: 3.9.6 Package: zoneminder -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, debconf, dbconfig-common, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, liburi-encode-perl, libgcrypt11|libgcrypt20, libpolkit-gobject-1-0, policykit-1 -Recommends: mysql-server|mariadb-server -Description: Video camera security and surveillance solution +Section: metapackages +Architecture: all +Depends: ${misc:Depends}, + libzoneminder-perl (>= ${source:Version}), + zoneminder-database (>= ${source:Version}), + zoneminder-core (>= ${binary:Version}), + zoneminder-ui-base (>= ${source:Version}), + zoneminder-ui-classic (>= ${source:Version}), + zoneminder-ui-mobile (>= ${source:Version}), + zoneminder-ui-xml (>= ${source:Version}) +Description: Video camera security and surveillance solution (metapackage) 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 @@ -21,20 +28,95 @@ Description: Video camera security and surveillance solution and surveillance. It can also be integrated into a home automation system via X.10 or other protocols. -Package: zoneminder-dbg +Package: libzoneminder-perl +Section: perl +Architecture: all +Depends: ${misc:Depends}, ${perl:Depends}, libdbi-perl, + libdevice-serialport-perl, libimage-info-perl, libjson-any-perl, + libsys-mmap-perl, liburi-encode-perl, libwww-perl +Description: Perl libraries for ZoneMinder + ZoneMinder is a video camera security and surveillance solution. + . + This package provides the libraries for the perl scripts, it can be used to + write custom interfaces as well. + +Package: zoneminder-database +Section: database +Architecture: all +Depends: ${misc:Depends}, debconf, dbconfig-common, + mysql-client | mariadb-client +Recommends: mysql-server | mariadb-server +Description: Database management package for ZoneMinder + ZoneMinder is a video camera security and surveillance solution. + . + This package provides the sql files and maintenance scripts to perform all the + database operations (installation, upgrade or removal) on a local or a remote + server. + +Package: zoneminder-core +Section: video +Architecture: any +Depends: libzoneminder-perl (= ${source:Version}), + zoneminder-database (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends}, + ${perl:Depends}, libarchive-tar-perl, libarchive-zip-perl, libdate-manip-perl, + libdbi-perl, libmodule-load-conditional-perl, libmime-lite-perl, + libmime-tools-perl, libnet-sftp-foreign-perl, libphp-serialization-perl, + debconf, ffmpeg | libav-tools, rsyslog | system-log-daemon, netpbm, zip, + policykit-1, apache2 +Description: Core binaries and perl scripts for ZoneMinder + ZoneMinder is a video camera security and surveillance solution. + . + This package provides the executable compiled binaries which do the main video + processing work and the perl scripts which perform helper and/or external + interface tasks. + +Package: zoneminder-core-dbg Priority: extra Section: debug Architecture: any -Depends: zoneminder (= ${binary:Version}), ${misc:Depends} -Description: Debugging symbols for zoneminder. +Depends: zoneminder-core (= ${binary:Version}), ${misc:Depends} +Description: Debugging symbols for ZoneMinder ZoneMinder is a 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. + . + This package provides the debugging symbols for the executable compiled + binaries. + +Package: zoneminder-ui-base +Section: web +Architecture: any +Depends: zoneminder-core (= ${binary:Version}), ${shlibs:Depends}, + ${misc:Depends}, debconf, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, + php5, php5-mysql | php5-mysqlnd +Description: Essential files for ZoneMinder's web user interface + ZoneMinder is a video camera security and surveillance solution. + . + This package provides the essential web files and maintenance scripts to set up + a basic web environment. + +Package: zoneminder-ui-classic +Section: web +Architecture: all +Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends} +Description: Classic web user interface for ZoneMinder + ZoneMinder is a video camera security and surveillance solution. + . + This package provides the classic web user interface. + +Package: zoneminder-ui-mobile +Section: web +Architecture: all +Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends} +Description: Mobile web user interface for ZoneMinder + ZoneMinder is a video camera security and surveillance solution. + . + This package provides the web user interface for mobile devices. + +Package: zoneminder-ui-xml +Section: web +Architecture: all +Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends} +Description: XML interface for ZoneMinder + ZoneMinder is a video camera security and surveillance solution. + . + This package provides a XML interface mainly intended for use with the eyeZm + iPhone Application, but can be used with any other custom programs as well. diff --git a/distros/debian8/libzoneminder-perl.install b/distros/debian8/libzoneminder-perl.install new file mode 100644 index 000000000..792ffc15e --- /dev/null +++ b/distros/debian8/libzoneminder-perl.install @@ -0,0 +1,4 @@ +usr/share/perl5/ZoneMinder +usr/share/perl5/ZoneMinder.pm +debian/tmp/usr/share/man/man3/ZoneMinder.3pm +debian/tmp/usr/share/man/man3/ZoneMinder::* diff --git a/distros/debian8/patches/series b/distros/debian8/patches/series deleted file mode 100644 index e69de29bb..000000000 diff --git a/distros/debian8/po/POTFILES.in b/distros/debian8/po/POTFILES.in index a3d64930e..5b155907e 100644 --- a/distros/debian8/po/POTFILES.in +++ b/distros/debian8/po/POTFILES.in @@ -1 +1,3 @@ -[type: gettext/rfc822deb] zoneminder.templates +[type: gettext/rfc822deb] zoneminder-core.templates +[type: gettext/rfc822deb] zoneminder-database.templates +[type: gettext/rfc822deb] zoneminder-ui-base.templates diff --git a/distros/debian8/po/fr.po b/distros/debian8/po/fr.po index 8b512df1b..85ced7fd2 100644 --- a/distros/debian8/po/fr.po +++ b/distros/debian8/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: zoneminder\n" "Report-Msgid-Bugs-To: zoneminder@packages.debian.org\n" -"POT-Creation-Date: 2014-12-12 12:28+0100\n" +"POT-Creation-Date: 2014-12-16 12:34+0100\n" "PO-Revision-Date: 2014-12-07 00:40+0100\n" "Last-Translator: Emmanuel Papin \n" "Language-Team: French \n" @@ -16,27 +16,80 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:1001 +msgid "Delete this non empty directory?" +msgstr "Supprimer ce répertoire non vide ?" + +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:1001 +msgid "" +"A purge of the ZoneMinder package is performed but the directory '/var/cache/" +"zoneminder' is not empty so it will not be deleted." +msgstr "" +"Une purge du paquet ZoneMinder est en cours mais le répertoire '/var/cache/" +"zoneminder' n'est pas vide et sera donc conservé." + +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:1001 +msgid "" +"Please consider that this directory is designed to contain data resulting " +"from event detection. Therefore, \"proof of evidence\" could be lost!\"" +msgstr "" +"Veuillez considérer que ce répertoire est conçu pour contenir des données " +"résultants de la détection d'événements. Par conséquent, des preuves " +"pourraient être perdues !" + +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:1001 +msgid "" +"If you are not sure of your decision, please do not delete this directory " +"but perform a manual checkup." +msgstr "" +"Si vous n'êtes pas sûr de votre décision, veuillez conserver ce répertoire " +"et effectuer une vérification manuelle." + +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:2001 +msgid "Deletion confirmed?" +msgstr "Supression confirmée ?" + +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:2001 +msgid "" +"You have allowed the deletion of directory '/var/cache/zoneminder' although " +"it may contain critical data." +msgstr "" +"Vous avez autorisé la suppression du répertoire '/var/cache/zoneminder' bien " +"qu'il puisse contenir des données critiques." + #. Type: select #. Choices -#: ../zoneminder.templates:1001 +#: ../zoneminder-database.templates:1001 msgid "local" msgstr "local" #. Type: select #. Choices -#: ../zoneminder.templates:1001 +#: ../zoneminder-database.templates:1001 msgid "remote" msgstr "distant" #. Type: select #. Description -#: ../zoneminder.templates:1002 +#: ../zoneminder-database.templates:1002 msgid "Database location:" msgstr "Emplacement de la base de donnée :" #. Type: select #. Description -#: ../zoneminder.templates:1002 +#: ../zoneminder-database.templates:1002 msgid "" "A database server is required to run ZoneMinder. The database can be " "installed either locally or remotely on a machine of your network." @@ -46,7 +99,7 @@ msgstr "" #. Type: select #. Description -#: ../zoneminder.templates:1002 +#: ../zoneminder-database.templates:1002 msgid "" "If you choose a remote location, you will have to select the 'tcp/ip' " "connection method and enter the hostname or ip address of the remote machine " @@ -58,13 +111,13 @@ msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:2001 +#: ../zoneminder-database.templates:2001 msgid "No local database server is available:" msgstr "Aucun serveur local de base de données n'est disponible :" #. Type: error #. Description -#: ../zoneminder.templates:2001 +#: ../zoneminder-database.templates:2001 msgid "" "Currently ZoneMinder supports mysql or mariadb database server but none of " "them appears to be installed on this machine." @@ -74,7 +127,7 @@ msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:2001 +#: ../zoneminder-database.templates:2001 msgid "" "In order to complete ZoneMinder's installation, after ending of this " "assistant, please install a compatible database server and then restart the " @@ -88,19 +141,19 @@ msgstr "" #. Description #. Type: error #. Description -#: ../zoneminder.templates:2001 ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:2001 ../zoneminder-database.templates:3001 msgid "$ sudo dpkg-reconfigure zoneminder" msgstr "$ sudo dpkg-reconfigure zoneminder" #. Type: error #. Description -#: ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:3001 msgid "Remote database servers are not allowed:" msgstr "Les serveurs de base de données distants ne sont pas autorisés :" #. Type: error #. Description -#: ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:3001 msgid "" "The current configuration of dbconfig-common does not allow installation of " "a database on remote servers." @@ -110,7 +163,7 @@ msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:3001 msgid "" "In order to reconfigure dbconfig-common, please invoke the following command " "after ending of this assistant:" @@ -120,13 +173,13 @@ msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:3001 msgid "$ sudo dpkg-reconfigure dbconfig-common" msgstr "$ sudo dpkg-reconfigure dbconfig-common" #. Type: error #. Description -#: ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:3001 msgid "" "Then, to complete ZoneMinder's installation, please restart this assistant " "by invoking:" @@ -134,37 +187,21 @@ msgstr "" "Ensuite, pour compléter l'installation de ZoneMinder, veuillez redémarrer " "cet assistant en invoquant :" -#. Type: multiselect -#. Description -#: ../zoneminder.templates:4001 -msgid "Web server to reconfigure automatically:" -msgstr "Serveur web à reconfigurer automatiquement :" - -#. Type: multiselect -#. Description -#: ../zoneminder.templates:4001 -msgid "" -"Please choose the web server that should be automatically configured for " -"ZoneMinder's web portal access." -msgstr "" -"Veuillez choisir le serveur web à reconfigurer automatiquement pour l'accès " -"au portail web de ZoneMinder." - #. Type: password #. Description -#: ../zoneminder.templates:5001 +#: ../zoneminder-database.templates:4001 msgid "New password for the ZoneMinder 'admin' user:" msgstr "Nouveau mot de passe pour le compte 'admin' de ZoneMinder :" #. Type: password #. Description -#: ../zoneminder.templates:5001 +#: ../zoneminder-database.templates:4001 msgid "Please enter the password of the default administrative user." msgstr "Veuillez entrer le mot de passe du compte administrateur par défaut." #. Type: password #. Description -#: ../zoneminder.templates:5001 +#: ../zoneminder-database.templates:4001 msgid "" "While not mandatory, it is highly recommended that you set a custom password " "for the administrative 'admin' user." @@ -174,79 +211,42 @@ msgstr "" #. Type: password #. Description -#: ../zoneminder.templates:5001 +#: ../zoneminder-database.templates:4001 msgid "If this field is left blank, the password will not be changed." msgstr "Si le champ est laissé vide, le mot de passe ne sera pas changé." #. Type: password #. Description -#: ../zoneminder.templates:6001 +#: ../zoneminder-database.templates:5001 msgid "Repeat password for the ZoneMinder 'admin' user:" msgstr "Répéter le mot de passe pour le compte 'admin' de ZoneMinder :" #. Type: error #. Description -#: ../zoneminder.templates:7001 +#: ../zoneminder-database.templates:6001 msgid "Password input error" msgstr "Erreur de mot de passe" #. Type: error #. Description -#: ../zoneminder.templates:7001 +#: ../zoneminder-database.templates:6001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" "Les deux mots de passe saisis ne sont pas les mêmes. Veuillez essayer à " "nouveau." -#. Type: boolean +#. Type: multiselect #. Description -#: ../zoneminder.templates:8001 -msgid "Delete this non empty directory?" -msgstr "Supprimer ce répertoire non vide ?" +#: ../zoneminder-ui-base.templates:1001 +msgid "Web server to reconfigure automatically:" +msgstr "Serveur web à reconfigurer automatiquement :" -#. Type: boolean +#. Type: multiselect #. Description -#: ../zoneminder.templates:8001 +#: ../zoneminder-ui-base.templates:1001 msgid "" -"A purge of the ZoneMinder package is performed but the directory '/var/cache/" -"zoneminder' is not empty so it will not be deleted." +"Please choose the web server that should be automatically configured for " +"ZoneMinder's web portal access." msgstr "" -"Une purge du paquet ZoneMinder est en cours mais le répertoire '/var/cache/" -"zoneminder' n'est pas vide et sera donc conservé." - -#. Type: boolean -#. Description -#: ../zoneminder.templates:8001 -msgid "" -"Please consider that this directory is designed to contain data resulting " -"from event detection. Therefore, \"proof of evidence\" could be lost!\"" -msgstr "" -"Veuillez considérer que ce répertoire est conçu pour contenir des données " -"résultants de la détection d'événements. Par conséquent, des preuves " -"pourraient être perdues !" - -#. Type: boolean -#. Description -#: ../zoneminder.templates:8001 -msgid "" -"If you are not sure of your decision, please do not delete this directory " -"but perform a manual checkup." -msgstr "" -"Si vous n'êtes pas sûr de votre décision, veuillez conserver ce répertoire " -"et effectuer une vérification manuelle." - -#. Type: boolean -#. Description -#: ../zoneminder.templates:9001 -msgid "Deletion confirmed?" -msgstr "Supression confirmée ?" - -#. Type: boolean -#. Description -#: ../zoneminder.templates:9001 -msgid "" -"You have allowed the deletion of directory '/var/cache/zoneminder' although " -"it may contain critical data." -msgstr "" -"Vous avez autorisé la suppression du répertoire '/var/cache/zoneminder' bien " -"qu'il puisse contenir des données critiques." +"Veuillez choisir le serveur web à reconfigurer automatiquement pour l'accès " +"au portail web de ZoneMinder." diff --git a/distros/debian8/po/templates.pot b/distros/debian8/po/templates.pot index 7d10caa4b..941a4094e 100644 --- a/distros/debian8/po/templates.pot +++ b/distros/debian8/po/templates.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: zoneminder\n" "Report-Msgid-Bugs-To: zoneminder@packages.debian.org\n" -"POT-Creation-Date: 2014-12-12 12:28+0100\n" +"POT-Creation-Date: 2014-12-16 12:34+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,27 +17,71 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:1001 +msgid "Delete this non empty directory?" +msgstr "" + +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:1001 +msgid "" +"A purge of the ZoneMinder package is performed but the directory '/var/cache/" +"zoneminder' is not empty so it will not be deleted." +msgstr "" + +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:1001 +msgid "" +"Please consider that this directory is designed to contain data resulting " +"from event detection. Therefore, \"proof of evidence\" could be lost!\"" +msgstr "" + +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:1001 +msgid "" +"If you are not sure of your decision, please do not delete this directory " +"but perform a manual checkup." +msgstr "" + +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:2001 +msgid "Deletion confirmed?" +msgstr "" + +#. Type: boolean +#. Description +#: ../zoneminder-core.templates:2001 +msgid "" +"You have allowed the deletion of directory '/var/cache/zoneminder' although " +"it may contain critical data." +msgstr "" + #. Type: select #. Choices -#: ../zoneminder.templates:1001 +#: ../zoneminder-database.templates:1001 msgid "local" msgstr "" #. Type: select #. Choices -#: ../zoneminder.templates:1001 +#: ../zoneminder-database.templates:1001 msgid "remote" msgstr "" #. Type: select #. Description -#: ../zoneminder.templates:1002 +#: ../zoneminder-database.templates:1002 msgid "Database location:" msgstr "" #. Type: select #. Description -#: ../zoneminder.templates:1002 +#: ../zoneminder-database.templates:1002 msgid "" "A database server is required to run ZoneMinder. The database can be " "installed either locally or remotely on a machine of your network." @@ -45,7 +89,7 @@ msgstr "" #. Type: select #. Description -#: ../zoneminder.templates:1002 +#: ../zoneminder-database.templates:1002 msgid "" "If you choose a remote location, you will have to select the 'tcp/ip' " "connection method and enter the hostname or ip address of the remote machine " @@ -54,13 +98,13 @@ msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:2001 +#: ../zoneminder-database.templates:2001 msgid "No local database server is available:" msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:2001 +#: ../zoneminder-database.templates:2001 msgid "" "Currently ZoneMinder supports mysql or mariadb database server but none of " "them appears to be installed on this machine." @@ -68,7 +112,7 @@ msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:2001 +#: ../zoneminder-database.templates:2001 msgid "" "In order to complete ZoneMinder's installation, after ending of this " "assistant, please install a compatible database server and then restart the " @@ -79,19 +123,19 @@ msgstr "" #. Description #. Type: error #. Description -#: ../zoneminder.templates:2001 ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:2001 ../zoneminder-database.templates:3001 msgid "$ sudo dpkg-reconfigure zoneminder" msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:3001 msgid "Remote database servers are not allowed:" msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:3001 msgid "" "The current configuration of dbconfig-common does not allow installation of " "a database on remote servers." @@ -99,7 +143,7 @@ msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:3001 msgid "" "In order to reconfigure dbconfig-common, please invoke the following command " "after ending of this assistant:" @@ -107,47 +151,33 @@ msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:3001 msgid "$ sudo dpkg-reconfigure dbconfig-common" msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:3001 +#: ../zoneminder-database.templates:3001 msgid "" "Then, to complete ZoneMinder's installation, please restart this assistant " "by invoking:" msgstr "" -#. Type: multiselect -#. Description -#: ../zoneminder.templates:4001 -msgid "Web server to reconfigure automatically:" -msgstr "" - -#. Type: multiselect -#. Description -#: ../zoneminder.templates:4001 -msgid "" -"Please choose the web server that should be automatically configured for " -"ZoneMinder's web portal access." -msgstr "" - #. Type: password #. Description -#: ../zoneminder.templates:5001 +#: ../zoneminder-database.templates:4001 msgid "New password for the ZoneMinder 'admin' user:" msgstr "" #. Type: password #. Description -#: ../zoneminder.templates:5001 +#: ../zoneminder-database.templates:4001 msgid "Please enter the password of the default administrative user." msgstr "" #. Type: password #. Description -#: ../zoneminder.templates:5001 +#: ../zoneminder-database.templates:4001 msgid "" "While not mandatory, it is highly recommended that you set a custom password " "for the administrative 'admin' user." @@ -155,68 +185,38 @@ msgstr "" #. Type: password #. Description -#: ../zoneminder.templates:5001 +#: ../zoneminder-database.templates:4001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../zoneminder.templates:6001 +#: ../zoneminder-database.templates:5001 msgid "Repeat password for the ZoneMinder 'admin' user:" msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:7001 +#: ../zoneminder-database.templates:6001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../zoneminder.templates:7001 +#: ../zoneminder-database.templates:6001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" -#. Type: boolean +#. Type: multiselect #. Description -#: ../zoneminder.templates:8001 -msgid "Delete this non empty directory?" +#: ../zoneminder-ui-base.templates:1001 +msgid "Web server to reconfigure automatically:" msgstr "" -#. Type: boolean +#. Type: multiselect #. Description -#: ../zoneminder.templates:8001 +#: ../zoneminder-ui-base.templates:1001 msgid "" -"A purge of the ZoneMinder package is performed but the directory '/var/cache/" -"zoneminder' is not empty so it will not be deleted." -msgstr "" - -#. Type: boolean -#. Description -#: ../zoneminder.templates:8001 -msgid "" -"Please consider that this directory is designed to contain data resulting " -"from event detection. Therefore, \"proof of evidence\" could be lost!\"" -msgstr "" - -#. Type: boolean -#. Description -#: ../zoneminder.templates:8001 -msgid "" -"If you are not sure of your decision, please do not delete this directory " -"but perform a manual checkup." -msgstr "" - -#. Type: boolean -#. Description -#: ../zoneminder.templates:9001 -msgid "Deletion confirmed?" -msgstr "" - -#. Type: boolean -#. Description -#: ../zoneminder.templates:9001 -msgid "" -"You have allowed the deletion of directory '/var/cache/zoneminder' although " -"it may contain critical data." +"Please choose the web server that should be automatically configured for " +"ZoneMinder's web portal access." msgstr "" diff --git a/distros/debian8/rules b/distros/debian8/rules index 4e97df736..3364d8750 100755 --- a/distros/debian8/rules +++ b/distros/debian8/rules @@ -38,12 +38,12 @@ BRANCH = $(shell git rev-parse --abbrev-ref HEAD) HEAD = $(shell git rev-parse HEAD) PKD = $(abspath $(dir $(MAKEFILE_LIST))) PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source)) -VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};') +VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-|\+nmu\d+.*)};') DTYPE = TARBALL = ../$(PKG)_$(VER)$(DTYPE).orig.tar.xz %: - dh $@ --with quilt,autoreconf,systemd + dh $@ --with autoreconf,systemd override_dh_auto_configure: CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" dh_auto_configure -- \ @@ -79,33 +79,39 @@ override_dh_install: rm -rf debian/zoneminder/usr/share/zoneminder/events rm -rf debian/zoneminder/usr/share/zoneminder/images rm -rf debian/zoneminder/usr/share/zoneminder/temp - dh_link var/cache/zoneminder/events usr/share/zoneminder/events - dh_link var/cache/zoneminder/images usr/share/zoneminder/images - dh_link var/cache/zoneminder/temp usr/share/zoneminder/temp + # The link stuff for these folders has been moved to + # zoneminder-core.links file # # This is a slightly lesser kludge; moving the cgi stuff to # /usr/share/zoneminder/cgi-bin breaks one set of behavior, # having it just in /usr/lib/cgi-bin breaks another bit of # behavior. - # - dh_link usr/lib/cgi-bin usr/share/zoneminder/cgi-bin + # The link stuff for /usr/share/zoneminder/cgi-bin has been moved to + # zoneminder-ui-base.links file + +override_dh_installinit: + dh_installinit --package=zoneminder-core --name=zoneminder + +override_dh_systemd_start: + dh_systemd_start --package=zoneminder-core --name=zoneminder \ + --restart-after-upgrade + +override_dh_systemd_enable: + dh_systemd_enable --package=zoneminder-core --name=zoneminder override_dh_fixperms: dh_fixperms # # As requested by the Debian Webapps Policy Manual §3.2.1 - chown root:www-data debian/zoneminder/etc/zm/zm.conf - chmod 640 debian/zoneminder/etc/zm/zm.conf + chown root:www-data debian/zoneminder-core/etc/zm/zm.conf + chmod 640 debian/zoneminder-core/etc/zm/zm.conf override_dh_auto_test: # do not run tests... -override_dh_systemd_start: - dh_systemd_start --restart-after-upgrade - .PHONY: override_dh_strip override_dh_strip: - dh_strip --dbg-package=zoneminder-dbg + dh_strip --dbg-package=zoneminder-core-dbg # Inspired by https://wiki.debian.org/onlyjob/get-orig-source .PHONY: get-orig-source diff --git a/distros/debian8/source/format b/distros/debian8/source/format index 163aaf8d8..89ae9db8f 100644 --- a/distros/debian8/source/format +++ b/distros/debian8/source/format @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff --git a/distros/debian8/source/local-options b/distros/debian8/source/local-options index 9cdfca9f9..e69de29bb 100644 --- a/distros/debian8/source/local-options +++ b/distros/debian8/source/local-options @@ -1,2 +0,0 @@ -unapply-patches -abort-on-upstream-changes diff --git a/distros/debian8/watch b/distros/debian8/watch deleted file mode 100644 index 5a8a9c4d7..000000000 --- a/distros/debian8/watch +++ /dev/null @@ -1,3 +0,0 @@ -version=3 -http://www.zoneminder.com/downloads.html \ - .*/ZoneMinder-(.*).tar.gz diff --git a/distros/debian8/zoneminder-core.config b/distros/debian8/zoneminder-core.config new file mode 100644 index 000000000..2a15a599e --- /dev/null +++ b/distros/debian8/zoneminder-core.config @@ -0,0 +1,11 @@ +#!/bin/sh +# config maintainer script for zoneminder-core package + +set -e + +# Source the debconf stuff +. /usr/share/debconf/confmodule + +#DEBHELPER# + +exit 0 diff --git a/distros/debian8/zoneminder-core.dirs b/distros/debian8/zoneminder-core.dirs new file mode 100644 index 000000000..350c32aff --- /dev/null +++ b/distros/debian8/zoneminder-core.dirs @@ -0,0 +1,4 @@ +var/log/zm +var/cache/zoneminder/events +var/cache/zoneminder/images +var/cache/zoneminder/temp diff --git a/distros/debian8/zoneminder-core.install b/distros/debian8/zoneminder-core.install new file mode 100644 index 000000000..afd9ada95 --- /dev/null +++ b/distros/debian8/zoneminder-core.install @@ -0,0 +1,4 @@ +etc/zm +usr/bin +usr/share/polkit-1/actions +usr/share/polkit-1/rules.d diff --git a/distros/debian8/zoneminder.links b/distros/debian8/zoneminder-core.links similarity index 74% rename from distros/debian8/zoneminder.links rename to distros/debian8/zoneminder-core.links index 9715ee428..5560a100a 100644 --- a/distros/debian8/zoneminder.links +++ b/distros/debian8/zoneminder-core.links @@ -1,4 +1,3 @@ var/cache/zoneminder/events usr/share/zoneminder/events var/cache/zoneminder/images usr/share/zoneminder/images var/cache/zoneminder/temp usr/share/zoneminder/temp -usr/lib/cgi-bin usr/share/zoneminder/cgi-bin diff --git a/distros/debian8/zoneminder-core.postinst b/distros/debian8/zoneminder-core.postinst new file mode 100644 index 000000000..b1552e73b --- /dev/null +++ b/distros/debian8/zoneminder-core.postinst @@ -0,0 +1,80 @@ +#! /bin/sh +# postinst maintainer script for zoneminder-core package + +set -e + +# Source the debconf stuff +. /usr/share/debconf/confmodule + +# Source the config file +CONFIGFILE=/etc/zm/zm.conf +. $CONFIGFILE + +# Do this when the package is installed, upgraded or reconfigured +if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then + + # Retrieve data from dbconfig (inputs from user) + . /etc/dbconfig-common/zoneminder.conf + + # ZoneMinder config file handling + # Inspired by: http://manpages.debian.org/cgi-bin/man.cgi?query=debconf-devel&sektion=7 + + # Backup the config file + cp -a -f $CONFIGFILE ${CONFIGFILE}.postinst.bak + + # Redeclare variables if missing in config file + test -z $dbc_dbserver || grep -Eq "^ *ZM_DB_HOST=" $CONFIGFILE \ + || echo "ZM_DB_HOST=" >> ${CONFIGFILE}.postinst.bak + test -z $dbc_dbname || grep -Eq "^ *ZM_DB_NAME=" $CONFIGFILE \ + || echo "ZM_DB_NAME=" >> ${CONFIGFILE}.postinst.bak + test -z $dbc_dbuser || grep -Eq "^ *ZM_DB_USER=" $CONFIGFILE \ + || echo "ZM_DB_USER=" >> ${CONFIGFILE}.postinst.bak + test -z $dbc_dbpass || grep -Eq "^ *ZM_DB_PASS=" $CONFIGFILE \ + || echo "ZM_DB_PASS=" >> ${CONFIGFILE}.postinst.bak + + # Prevent ZM_DB_HOST to be empty if user selected the 'unix socket' method + if test -z $dbc_dbserver; then + dbc_dbserver_override="localhost" + else + dbc_dbserver_override=$dbc_dbserver + fi + + # Update variables in config file + sed -i "s/^ *ZM_DB_HOST=.*/ZM_DB_HOST=$dbc_dbserver_override/" \ + ${CONFIGFILE}.postinst.bak + test -z $dbc_dbname || sed -i "s/^ *ZM_DB_NAME=.*/ZM_DB_NAME=$dbc_dbname/" \ + ${CONFIGFILE}.postinst.bak + test -z $dbc_dbuser || sed -i "s/^ *ZM_DB_USER=.*/ZM_DB_USER=$dbc_dbuser/" \ + ${CONFIGFILE}.postinst.bak + test -z $dbc_dbpass || sed -i "s/^ *ZM_DB_PASS=.*/ZM_DB_PASS=$dbc_dbpass/" \ + ${CONFIGFILE}.postinst.bak + + # Clean-up backup file + mv -f ${CONFIGFILE}.postinst.bak $CONFIGFILE + + + # Set some file permissions + chown $ZM_WEB_USER:$ZM_WEB_GROUP /var/log/zm + if [ -z "$2" ]; then + chown $ZM_WEB_USER:$ZM_WEB_GROUP -R /var/cache/zoneminder + fi + # As requested by the Debian Webapps Policy Manual §3.2.1 + chown root:${ZM_WEB_GROUP} $CONFIGFILE + chmod 640 $CONFIGFILE +fi + +# Do this every time the package is installed or upgraded +# Test for database presence to avoid failure of zmupdate.pl +if [ "$dbc_install" = "true" ] && [ "$1" = "configure" ]; then + + # Ensure zoneminder is stopped + deb-systemd-invoke stop zoneminder.service || exit $? + + # Run the ZoneMinder update tool + zmupdate.pl --nointeractive + +fi + +#DEBHELPER# + +exit 0 diff --git a/distros/debian8/zoneminder-core.postrm b/distros/debian8/zoneminder-core.postrm new file mode 100644 index 000000000..d75e75e8b --- /dev/null +++ b/distros/debian8/zoneminder-core.postrm @@ -0,0 +1,37 @@ +#! /bin/sh +# postrm maintainer script for zoneminder-core package + +set -e + +# Source the debconf stuff +if [ -f /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule +fi + +if [ "$1" = "purge" ]; then + + # Ask the user if we have to remove the cache directory even if not empty + if [ -d /var/cache/zoneminder ] \ + && [ ! $(find /var/cache/zoneminder -maxdepth 0 -type d -empty 2>/dev/null) ]; then + RET="" + db_input high zoneminder/ask_delete || true + db_go || true + db_get zoneminder/ask_delete + if [ "$RET" = "true" ]; then + RET="" + db_input high zoneminder/ask_delete_again || true + db_go || true + db_get zoneminder/ask_delete_again + if [ "$RET" = "true" ]; then + rm -rf /var/cache/zoneminder + fi + fi + fi +fi + +#DEBHELPER# + +# postrm rm may freeze without that +db_stop + +exit 0 diff --git a/distros/debian8/zoneminder.preinst b/distros/debian8/zoneminder-core.preinst similarity index 93% rename from distros/debian8/zoneminder.preinst rename to distros/debian8/zoneminder-core.preinst index f9c518431..3ed1ef661 100644 --- a/distros/debian8/zoneminder.preinst +++ b/distros/debian8/zoneminder-core.preinst @@ -1,5 +1,5 @@ #!/bin/sh -# preinst maintainer script for zoneminder +# preinst maintainer script for zoneminder-core package set -e diff --git a/distros/debian8/zoneminder-core.templates b/distros/debian8/zoneminder-core.templates new file mode 100644 index 000000000..35fdefd7a --- /dev/null +++ b/distros/debian8/zoneminder-core.templates @@ -0,0 +1,19 @@ +Template: zoneminder/ask_delete +Type: boolean +Default: false +_Description: Delete this non empty directory? + A purge of the ZoneMinder package is performed but the directory + '/var/cache/zoneminder' is not empty so it will not be deleted. + . + Please consider that this directory is designed to contain data resulting from + event detection. Therefore, "proof of evidence" could be lost!" + . + If you are not sure of your decision, please do not delete this directory but + perform a manual checkup. + +Template: zoneminder/ask_delete_again +Type: boolean +Default: false +_Description: Deletion confirmed? + You have allowed the deletion of directory '/var/cache/zoneminder' although + it may contain critical data. diff --git a/distros/debian8/zoneminder.init b/distros/debian8/zoneminder-core.zoneminder.init similarity index 100% rename from distros/debian8/zoneminder.init rename to distros/debian8/zoneminder-core.zoneminder.init diff --git a/distros/debian8/zoneminder.service b/distros/debian8/zoneminder-core.zoneminder.service similarity index 100% rename from distros/debian8/zoneminder.service rename to distros/debian8/zoneminder-core.zoneminder.service diff --git a/distros/debian8/zoneminder.tmpfile b/distros/debian8/zoneminder-core.zoneminder.tmpfile similarity index 100% rename from distros/debian8/zoneminder.tmpfile rename to distros/debian8/zoneminder-core.zoneminder.tmpfile diff --git a/distros/debian8/zoneminder.config b/distros/debian8/zoneminder-database.config similarity index 87% rename from distros/debian8/zoneminder.config rename to distros/debian8/zoneminder-database.config index 88cd62695..f6a84d36d 100644 --- a/distros/debian8/zoneminder.config +++ b/distros/debian8/zoneminder-database.config @@ -9,12 +9,26 @@ set -e # Set the first version in which dbconfig-common was introduced in the package dbc_first_version="1.28.0" -# Source the config file if exists CONFIGFILE=/etc/zm/zm.conf if [ -e $CONFIGFILE ]; then + # Source the config file if exists . $CONFIGFILE +elif [ -e ${CONFIGFILE}.dpkg-new ]; then + # If no config file, source the config file which is going to be installed + # by the core package + . ${CONFIGFILE}.dpkg-new +else + # If no config file is going to be installed, set some default values + ZM_DB_HOST= + ZM_DB_NAME="zm" + ZM_DB_USER="zmuser" fi +# Set some variables for the dbconfig-common stuff +dbc_dbserver="$ZM_DB_HOST" +dbc_dbname="$ZM_DB_NAME" +dbc_dbuser="$ZM_DB_USER" + if [ -f /usr/share/dbconfig-common/dpkg/config ]; then # Default use dbconfig-common @@ -26,11 +40,6 @@ if [ -f /usr/share/dbconfig-common/dpkg/config ]; then # Set authentication method to password dbc_authmethod_user="password" - # Re-use data from ZM config file - dbc_dbserver="$ZM_DB_HOST" - dbc_dbname="$ZM_DB_NAME" - dbc_dbuser="$ZM_DB_USER" - # Source the dbconfig-common stuff . /usr/share/dbconfig-common/dpkg/config fi @@ -78,10 +87,6 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then # Ask the user for all database settings dbc_go zoneminder $@ - # Ask the user for the web server(s) to configure - db_input high zoneminder/webserver || true - db_go || true - # Ask the user for the password of the database administrator if the user # has not yet answered to this question. # This situation may occur if the user skipped the database creation step @@ -126,6 +131,9 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then # password update in ZoneMinder database db_set zoneminder/admin_password "" fi + # Set the seen flag to not ask this question again if no password is + # provided + db_fset zoneminder/admin_password seen true fi diff --git a/distros/debian8/zoneminder.dirs b/distros/debian8/zoneminder-database.dirs similarity index 55% rename from distros/debian8/zoneminder.dirs rename to distros/debian8/zoneminder-database.dirs index eeb6a6c46..b37463a9e 100644 --- a/distros/debian8/zoneminder.dirs +++ b/distros/debian8/zoneminder-database.dirs @@ -1,8 +1,3 @@ -var/log/zm -var/lib/zm -var/cache/zoneminder/events -var/cache/zoneminder/images -var/cache/zoneminder/temp usr/share/zoneminder/db usr/share/dbconfig-common/data/zoneminder/install usr/share/dbconfig-common/data/zoneminder/upgrade/mysql diff --git a/distros/debian8/zoneminder-database.install b/distros/debian8/zoneminder-database.install new file mode 100644 index 000000000..756c5bbfa --- /dev/null +++ b/distros/debian8/zoneminder-database.install @@ -0,0 +1 @@ +usr/share/zoneminder/db diff --git a/distros/debian8/zoneminder-database.postinst b/distros/debian8/zoneminder-database.postinst new file mode 100644 index 000000000..41d4e5b5b --- /dev/null +++ b/distros/debian8/zoneminder-database.postinst @@ -0,0 +1,79 @@ +#! /bin/sh +# postinst maintainer script for zoneminder-db package + +set -e + +# Source the debconf stuff +. /usr/share/debconf/confmodule + +mysql_update() { + + # Source the dbconfig stuff + . /usr/share/dbconfig-common/internal/mysql + + # Update the password of the hard-coded default 'admin' account + test -z $ADMIN_PASSWORD || dbc_mysql_exec_command "UPDATE Users SET Password = password('$ADMIN_PASSWORD') WHERE Username = 'admin';" || true + + # Update the database version + dbc_mysql_exec_command "UPDATE Config SET Value = '$DB_VERSION' WHERE Name = 'ZM_DYN_DB_VERSION';" || true +} + +if [ -f /usr/share/dbconfig-common/dpkg/postinst ]; then + + # Set the first version in which dbconfig-common was introduced in the package + dbc_first_version="1.28.0" + + # Set the database type + dbc_dbtypes="mysql" + + # Source the dbconfig-common stuff + . /usr/share/dbconfig-common/dpkg/postinst +fi + +# Do this when the package is installed, upgraded or reconfigured +if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then + + # Install sql database create file for dbconfig + # (needed at first package installation) + if [ ! -f /usr/share/dbconfig-common/data/zoneminder/install/mysql ]; then + install -m 644 /usr/share/zoneminder/db/zm_create.sql \ + /usr/share/dbconfig-common/data/zoneminder/install/mysql + # Remove unneeded sql requests + # dbconfig will create the underlying database + sed -i "/^ *CREATE DATABASE /d" \ + /usr/share/dbconfig-common/data/zoneminder/install/mysql + sed -i "/^ *USE /d" \ + /usr/share/dbconfig-common/data/zoneminder/install/mysql + fi + + # Symlink sql update files for dbconfig (needed when upgrading the package) + for sqlfile in /usr/share/zoneminder/db/zm_update-*.sql; do + lnk=`echo $sqlfile | sed "s/^\/usr\/share\/zoneminder\/db\/zm_update-\(.*\)\.sql/\1/"` + if [ ! -L /usr/share/dbconfig-common/data/zoneminder/upgrade/mysql/$lnk ]; then + ln -sf $sqlfile \ + /usr/share/dbconfig-common/data/zoneminder/upgrade/mysql/$lnk + fi + done || true + + # Create the underlying database and populate it + # dbconfig will take care of applying any updates which are newer than the + # previously installed version + dbc_go zoneminder $@ + + # Get the password of ZoneMinder user 'admin' from debconf + db_get zoneminder/admin_password + ADMIN_PASSWORD=$RET + + # Remove the password from debconf database + test -z $ADMIN_PASSWORD || db_reset zoneminder/admin_password || true + + # Get the lastest database version from dbconfig upgrade folder + DB_VERSION=$(ls -rv /usr/share/dbconfig-common/data/zoneminder/upgrade/$dbc_dbtypes | head -1) + + # Update the default admin account and database version + mysql_update +fi + +#DEBHELPER# + +exit 0 diff --git a/distros/debian8/zoneminder-database.postrm b/distros/debian8/zoneminder-database.postrm new file mode 100644 index 000000000..231f01ad7 --- /dev/null +++ b/distros/debian8/zoneminder-database.postrm @@ -0,0 +1,34 @@ +#! /bin/sh +# postrm maintainer script for zoneminder-db package + +set -e + +# Source the debconf stuff +if [ -f /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule +fi + +# Source the dbconfig stuff +if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then + . /usr/share/dbconfig-common/dpkg/postrm + # Ask the user what do to with dbconfig when removing the package + dbc_go zoneminder $@ +fi + +if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then + # Remove dbconfig stuff added in postinst script + rm -rf /usr/share/dbconfig-common/data/zoneminder + # No need to manually remove the zm database, dbconfig take care of this +fi + +if [ "$1" = "purge" ]; then + # Delete a potential remaining file used in postinst script + rm -f /etc/zm/zm.conf.postinst.bak +fi + +#DEBHELPER# + +# postrm rm may freeze without that +db_stop + +exit 0 diff --git a/distros/debian8/zoneminder.prerm b/distros/debian8/zoneminder-database.prerm similarity index 92% rename from distros/debian8/zoneminder.prerm rename to distros/debian8/zoneminder-database.prerm index 0adf963e5..31786116a 100644 --- a/distros/debian8/zoneminder.prerm +++ b/distros/debian8/zoneminder-database.prerm @@ -1,5 +1,5 @@ #!/bin/sh -# prerm script for zoneminder +# prerm script for zoneminder-db package set -e diff --git a/distros/debian8/zoneminder.templates b/distros/debian8/zoneminder-database.templates similarity index 68% rename from distros/debian8/zoneminder.templates rename to distros/debian8/zoneminder-database.templates index 9b1c21b98..4de4342f6 100644 --- a/distros/debian8/zoneminder.templates +++ b/distros/debian8/zoneminder-database.templates @@ -38,14 +38,6 @@ _Description: Remote database servers are not allowed: . $ sudo dpkg-reconfigure zoneminder -Template: zoneminder/webserver -Type: multiselect -Choices: apache2 -Default: apache2 -_Description: Web server to reconfigure automatically: - Please choose the web server that should be automatically configured for - ZoneMinder's web portal access. - Template: zoneminder/admin_password Type: password _Description: New password for the ZoneMinder 'admin' user: @@ -64,23 +56,3 @@ Template: zoneminder/password_mismatch Type: error _Description: Password input error The two passwords you entered were not the same. Please try again. - -Template: zoneminder/ask_delete -Type: boolean -Default: false -_Description: Delete this non empty directory? - A purge of the ZoneMinder package is performed but the directory - '/var/cache/zoneminder' is not empty so it will not be deleted. - . - Please consider that this directory is designed to contain data resulting from - event detection. Therefore, "proof of evidence" could be lost!" - . - If you are not sure of your decision, please do not delete this directory but - perform a manual checkup. - -Template: zoneminder/ask_delete_again -Type: boolean -Default: false -_Description: Deletion confirmed? - You have allowed the deletion of directory '/var/cache/zoneminder' although - it may contain critical data. diff --git a/distros/debian8/zoneminder-ui-base.config b/distros/debian8/zoneminder-ui-base.config new file mode 100644 index 000000000..2660208a8 --- /dev/null +++ b/distros/debian8/zoneminder-ui-base.config @@ -0,0 +1,20 @@ +#!/bin/sh +# config maintainer script for zoneminder-ui-base package + +set -e + +# Source the debconf stuff +. /usr/share/debconf/confmodule + +# Do this when the package is installed, upgraded or reconfigured +# Most of answers are cached so the questions will not be asked again +if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then + + # Ask the user for the web server(s) to configure + db_input high zoneminder/webserver || true + db_go || true +fi + +#DEBHELPER# + +exit 0 diff --git a/distros/debian8/zoneminder.install b/distros/debian8/zoneminder-ui-base.install similarity index 51% rename from distros/debian8/zoneminder.install rename to distros/debian8/zoneminder-ui-base.install index 86fe0a0a6..f72b569be 100644 --- a/distros/debian8/zoneminder.install +++ b/distros/debian8/zoneminder-ui-base.install @@ -1,22 +1,11 @@ -usr/bin +debian/apache.conf etc/zm usr/lib/cgi-bin -usr/share/man -usr/share/perl5/ZoneMinder -usr/share/perl5/ZoneMinder.pm -usr/share/polkit-1/actions -usr/share/polkit-1/rules.d usr/share/zoneminder/ajax usr/share/zoneminder/css -usr/share/zoneminder/db usr/share/zoneminder/graphics usr/share/zoneminder/includes usr/share/zoneminder/index.php usr/share/zoneminder/js usr/share/zoneminder/lang -usr/share/zoneminder/skins usr/share/zoneminder/tools usr/share/zoneminder/views -etc/zm -db/zm_create.sql usr/share/zoneminder/db -db/zm_update-*.sql usr/share/zoneminder/db -debian/apache.conf etc/zm diff --git a/distros/debian8/zoneminder-ui-base.links b/distros/debian8/zoneminder-ui-base.links new file mode 100644 index 000000000..b00a147d6 --- /dev/null +++ b/distros/debian8/zoneminder-ui-base.links @@ -0,0 +1 @@ +usr/lib/cgi-bin usr/share/zoneminder/cgi-bin diff --git a/distros/debian8/zoneminder-ui-base.postinst b/distros/debian8/zoneminder-ui-base.postinst new file mode 100644 index 000000000..a5bce3c98 --- /dev/null +++ b/distros/debian8/zoneminder-ui-base.postinst @@ -0,0 +1,48 @@ +#! /bin/sh +# postinst maintainer script for zoneminder-ui-base package + +set -e + +# Source the debconf stuff +. /usr/share/debconf/confmodule + +apache_install() { + + mkdir -p /etc/apache2/conf-available + ln -sf ../../zm/apache.conf /etc/apache2/conf-available/zoneminder.conf + + COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) + + if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke enconf zoneminder + elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then + [ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/zoneminder.conf ] && ln -s ../conf-available/zoneminder.conf /etc/apache2/conf.d/zoneminder.conf + fi + + # Enable CGI script module in apache (not enabled by default on jessie) + a2enmod cgi >/dev/null 2>&1 + + # Reload the web server + deb-systemd-invoke reload apache2.service || true +} + +# Do this when the package is installed, upgraded or reconfigured +if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then + + # Configure the web server + db_get zoneminder/webserver + webservers="$RET" + + for webserver in $webservers; do + webserver=${webserver%,} + # Currently we only support apache2 + if [ "$webserver" = "apache2" ] ; then + apache_install $1 + fi + done +fi + +#DEBHELPER# + +exit 0 diff --git a/distros/debian8/zoneminder-ui-base.postrm b/distros/debian8/zoneminder-ui-base.postrm new file mode 100644 index 000000000..441bb5218 --- /dev/null +++ b/distros/debian8/zoneminder-ui-base.postrm @@ -0,0 +1,41 @@ +#! /bin/sh +# postrm maintainer script for zoneminder-ui-base package + +set -e + +# Source the debconf stuff +if [ -f /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule +fi + +apache_remove() { + COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) + if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke disconf zoneminder + elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then + rm -f /etc/apache2/conf.d/zoneminder.conf + fi + rm -f /etc/apache2/conf-available/zoneminder.conf + # Reload the web server + deb-systemd-invoke reload apache2.service || true +} + +if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then + # Deconfigure the web server + db_get zoneminder/webserver + for webserver in $RET; do + webserver=${webserver%,} + # Currently we only support apache2 + if [ "$webserver" = "apache2" ] ; then + apache_remove $1 + fi + done +fi + +#DEBHELPER# + +# postrm rm may freeze without that +db_stop + +exit 0 diff --git a/distros/debian8/zoneminder-ui-base.templates b/distros/debian8/zoneminder-ui-base.templates new file mode 100644 index 000000000..31e70277f --- /dev/null +++ b/distros/debian8/zoneminder-ui-base.templates @@ -0,0 +1,7 @@ +Template: zoneminder/webserver +Type: multiselect +Choices: apache2 +Default: apache2 +_Description: Web server to reconfigure automatically: + Please choose the web server that should be automatically configured for + ZoneMinder's web portal access. diff --git a/distros/debian8/zoneminder-ui-classic.install b/distros/debian8/zoneminder-ui-classic.install new file mode 100644 index 000000000..9532d9dc9 --- /dev/null +++ b/distros/debian8/zoneminder-ui-classic.install @@ -0,0 +1 @@ +usr/share/zoneminder/skins/classic diff --git a/distros/debian8/zoneminder-ui-mobile.install b/distros/debian8/zoneminder-ui-mobile.install new file mode 100644 index 000000000..464bb74eb --- /dev/null +++ b/distros/debian8/zoneminder-ui-mobile.install @@ -0,0 +1 @@ +usr/share/zoneminder/skins/mobile diff --git a/distros/debian8/zoneminder-ui-xml.install b/distros/debian8/zoneminder-ui-xml.install new file mode 100644 index 000000000..6617707f8 --- /dev/null +++ b/distros/debian8/zoneminder-ui-xml.install @@ -0,0 +1 @@ +usr/share/zoneminder/skins/xml diff --git a/distros/debian8/zoneminder.postinst b/distros/debian8/zoneminder.postinst deleted file mode 100644 index 5969e9693..000000000 --- a/distros/debian8/zoneminder.postinst +++ /dev/null @@ -1,180 +0,0 @@ -#! /bin/sh -# postinst maintainer script for zoneminder - -set -e - -# Source the debconf stuff -. /usr/share/debconf/confmodule - -# Source the config file if exists -CONFIGFILE=/etc/zm/zm.conf -if [ -e $CONFIGFILE ]; then - . $CONFIGFILE -fi - -apache_install() { - - mkdir -p /etc/apache2/conf-available - ln -sf ../../zm/apache.conf /etc/apache2/conf-available/zoneminder.conf - - COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) - - if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then - . /usr/share/apache2/apache2-maintscript-helper - apache2_invoke enconf zoneminder - elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then - [ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/zoneminder.conf ] && ln -s ../conf-available/zoneminder.conf /etc/apache2/conf.d/zoneminder.conf - fi - - # Enable CGI script module in apache (not enabled by default on jessie) - a2enmod cgi >/dev/null 2>&1 - - # Reload the web server - deb-systemd-invoke reload apache2.service || true -} - -mysql_update() { - - # Source the dbconfig stuff - . /usr/share/dbconfig-common/internal/mysql - - # Update the password of the hard-coded default 'admin' account - test -z $ADMIN_PASSWORD || dbc_mysql_exec_command "UPDATE Users SET Password = password('$ADMIN_PASSWORD') WHERE Username = 'admin';" || true - - # Update the database version - dbc_mysql_exec_command "UPDATE Config SET Value = '$DB_VERSION' WHERE Name = 'ZM_DYN_DB_VERSION';" || true -} - -if [ -f /usr/share/dbconfig-common/dpkg/postinst ]; then - - # Set the first version in which dbconfig-common was introduced in the package - dbc_first_version="1.28.0" - - # Set the database type - dbc_dbtypes="mysql" - - # Source the dbconfig-common stuff - . /usr/share/dbconfig-common/dpkg/postinst -fi - -# Do this when the package is installed, upgraded or reconfigured -if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then - - # Install sql database create file for dbconfig - # (needed at first package installation) - if [ ! -f /usr/share/dbconfig-common/data/zoneminder/install/mysql ]; then - install -m 644 /usr/share/zoneminder/db/zm_create.sql \ - /usr/share/dbconfig-common/data/zoneminder/install/mysql - # Remove unneeded sql requests - # dbconfig will create the underlying database - sed -i "/^ *CREATE DATABASE /d" \ - /usr/share/dbconfig-common/data/zoneminder/install/mysql - sed -i "/^ *USE /d" \ - /usr/share/dbconfig-common/data/zoneminder/install/mysql - fi - - # Symlink sql update files for dbconfig (needed when upgrading the package) - for sqlfile in /usr/share/zoneminder/db/zm_update-*.sql; do - lnk=`echo $sqlfile | sed "s/^\/usr\/share\/zoneminder\/db\/zm_update-\(.*\)\.sql/\1/"` - if [ ! -L /usr/share/dbconfig-common/data/zoneminder/upgrade/mysql/$lnk ]; then - ln -sf $sqlfile \ - /usr/share/dbconfig-common/data/zoneminder/upgrade/mysql/$lnk - fi - done || true - - # Create the underlying database and populate it - # dbconfig will take care of applying any updates which are newer than the - # previously installed version - dbc_go zoneminder $@ - - # Get the password of ZoneMinder user 'admin' from debconf - db_get zoneminder/admin_password - ADMIN_PASSWORD=$RET - - # Remove the password from debconf database - test -z $ADMIN_PASSWORD || db_reset zoneminder/admin_password || true - - # Get the lastest database version from dbconfig upgrade folder - DB_VERSION=$(ls -rv /usr/share/dbconfig-common/data/zoneminder/upgrade/$dbc_dbtypes | head -1) - - # Update the default admin account and database version - mysql_update - - # Retrieve data from dbconfig (inputs from user) - . /etc/dbconfig-common/zoneminder.conf - - # ZoneMinder config file handling - # Inspired by: http://manpages.debian.org/cgi-bin/man.cgi?query=debconf-devel&sektion=7 - - # Backup the config file - cp -a -f $CONFIGFILE ${CONFIGFILE}.postinst.bak - - # Redeclare variables if missing in config file - test -z $dbc_dbserver || grep -Eq "^ *ZM_DB_HOST=" $CONFIGFILE \ - || echo "ZM_DB_HOST=" >> ${CONFIGFILE}.postinst.bak - test -z $dbc_dbname || grep -Eq "^ *ZM_DB_NAME=" $CONFIGFILE \ - || echo "ZM_DB_NAME=" >> ${CONFIGFILE}.postinst.bak - test -z $dbc_dbuser || grep -Eq "^ *ZM_DB_USER=" $CONFIGFILE \ - || echo "ZM_DB_USER=" >> ${CONFIGFILE}.postinst.bak - test -z $dbc_dbpass || grep -Eq "^ *ZM_DB_PASS=" $CONFIGFILE \ - || echo "ZM_DB_PASS=" >> ${CONFIGFILE}.postinst.bak - - # Prevent ZM_DB_HOST to be empty if user selected the 'unix socket' method - if test -z $dbc_dbserver; then - dbc_dbserver_override="localhost" - else - dbc_dbserver_override=$dbc_dbserver - fi - - # Update variables in config file - sed -i "s/^ *ZM_DB_HOST=.*/ZM_DB_HOST=$dbc_dbserver_override/" \ - ${CONFIGFILE}.postinst.bak - test -z $dbc_dbname || sed -i "s/^ *ZM_DB_NAME=.*/ZM_DB_NAME=$dbc_dbname/" \ - ${CONFIGFILE}.postinst.bak - test -z $dbc_dbuser || sed -i "s/^ *ZM_DB_USER=.*/ZM_DB_USER=$dbc_dbuser/" \ - ${CONFIGFILE}.postinst.bak - test -z $dbc_dbpass || sed -i "s/^ *ZM_DB_PASS=.*/ZM_DB_PASS=$dbc_dbpass/" \ - ${CONFIGFILE}.postinst.bak - - # Clean-up backup file - mv -f ${CONFIGFILE}.postinst.bak $CONFIGFILE - - - # Set some file permissions - chown $ZM_WEB_USER:$ZM_WEB_GROUP /var/log/zm - chown $ZM_WEB_USER:$ZM_WEB_GROUP /var/lib/zm - if [ -z "$2" ]; then - chown $ZM_WEB_USER:$ZM_WEB_GROUP -R /var/cache/zoneminder - fi - # As requested by the Debian Webapps Policy Manual §3.2.1 - chown root:$ZM_WEB_GROUP /etc/zm/zm.conf - chmod 640 /etc/zm/zm.conf - - # Configure the web server - db_get zoneminder/webserver - webservers="$RET" - - for webserver in $webservers; do - webserver=${webserver%,} - # Currently we only support apache2 - if [ "$webserver" = "apache2" ] ; then - apache_install $1 - fi - done -fi - -# Do this every time the package is installed or upgraded -# Test for database presence to avoid failure of zmupdate.pl -if [ "$dbc_install" = "true" ] && [ "$1" = "configure" ]; then - - # Ensure zoneminder is stopped - deb-systemd-invoke stop zoneminder.service || exit $? - - # Run the ZoneMinder update tool - zmupdate.pl - -fi - -#DEBHELPER# - -exit 0 diff --git a/distros/debian8/zoneminder.postrm b/distros/debian8/zoneminder.postrm deleted file mode 100644 index d5cd11ebd..000000000 --- a/distros/debian8/zoneminder.postrm +++ /dev/null @@ -1,78 +0,0 @@ -#! /bin/sh -# postrm maintainer script for zoneminder - -set -e - -# Source the debconf stuff -if [ -f /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule -fi - -apache_remove() { - COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) - if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then - . /usr/share/apache2/apache2-maintscript-helper - apache2_invoke disconf zoneminder - elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then - rm -f /etc/apache2/conf.d/zoneminder.conf - fi - rm -f /etc/apache2/conf-available/zoneminder.conf - # Reload the web server - deb-systemd-invoke reload apache2.service || true -} - -# Source the dbconfig stuff -if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then - . /usr/share/dbconfig-common/dpkg/postrm - # Ask the user what do to with dbconfig when removing the package - dbc_go zoneminder $@ -fi - -if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then - - # Deconfigure the web server - db_get zoneminder/webserver - for webserver in $RET; do - webserver=${webserver%,} - # Currently we only support apache2 - if [ "$webserver" = "apache2" ] ; then - apache_remove $1 - fi - done - - # Remove dbconfig stuff added in postinst script - rm -rf /usr/share/dbconfig-common/data/zoneminder - - # No need to manually remove the zm database, dbconfig take care of this -fi - -if [ "$1" = "purge" ]; then - - # Delete a potential remaining file used in postinst script - rm -f /etc/zm/zm.conf.postinst.bak - - # Ask the user if we have to remove the cache directory even if not empty - if [ -d /var/cache/zoneminder ] \ - && [ ! $(find /var/cache/zoneminder -maxdepth 0 -type d -empty 2>/dev/null) ]; then - RET="" - db_input high zoneminder/ask_delete || true - db_go || true - db_get zoneminder/ask_delete - if [ "$RET" = "true" ]; then - RET="" - db_input high zoneminder/ask_delete_again || true - db_go || true - db_get zoneminder/ask_delete_again - if [ "$RET" = "true" ]; then - rm -rf /var/cache/zoneminder - fi - fi - fi -fi - -#DEBHELPER# - -# postrm rm may freeze without that -db_stop - -exit 0