# That is the aim of this package to be able to install matomo through the Matomo "debian" repository
# We could request users to do it by hand, some will have already do.
matomo: package-installs-apt-keyring [etc/apt/trusted.gpg.d/matomo-keyring-automatic.gpg]

# Matomo is a Web application that provide its needed javascript library, not as good as using debian ones but complying with their requested version
matomo: embedded-javascript-library please use libjs-excanvas [usr/share/matomo/libs/jqplot/excanvas.min.js]
matomo: embedded-javascript-library please use libjs-jquery [usr/share/matomo/node_modules/jquery/dist/jquery.min.js]
matomo: embedded-javascript-library please use libjs-jquery-mousewheel [usr/share/matomo/node_modules/jquery-mousewheel/jquery.mousewheel.js]
matomo: embedded-javascript-library please use libjs-jquery-ui [usr/share/matomo/node_modules/jquery-ui-dist/jquery-ui.min.css]
matomo: embedded-javascript-library please use libjs-jquery-ui [usr/share/matomo/node_modules/jquery-ui-dist/jquery-ui.min.js]
matomo: embedded-javascript-library please use libjs-raphael [usr/share/matomo/plugins/UserCountryMap/javascripts/vendor/raphael.min.js]

# Matomo is a Web application that provide its needed php library, not as good as using debian ones but complying with their requested version
matomo: embedded-php-library please use libphp-pclzip [usr/share/matomo/vendor/matomo/decompress/libs/PclZip/pclzip.lib.php]
matomo: embedded-php-library please use libsparkline-php [usr/share/matomo/core/Visualization/Sparkline.php]
matomo: embedded-php-library please use libsparkline-php [usr/share/matomo/plugins/CoreVisualizations/Visualizations/Sparkline.php]
matomo: embedded-php-library please use libsparkline-php [usr/share/matomo/vendor/davaxi/sparkline/src/Sparkline.php]

# Matomo is a Web application that provide its needed font, not as good as using debian ones but complying with their requested version
matomo: duplicate-font-file also in (fonts-wine) [usr/share/matomo/plugins/ImageGraph/fonts/tahoma.ttf]

# Matomo core is GPL 3. Matomo rely on vendor libraries and try to verify their licence comply with the opensource Matomo nature.
# For this package to get one day in the main debian repository, all licences should be mentionned in debian/copyright.
matomo: extra-license-file [usr/share/doc/matomo/LICENSE.gz]
matomo: extra-license-file [usr/share/matomo/js/LICENSE.txt]
matomo: extra-license-file [usr/share/matomo/libs/Authenticator/LICENSE.md]
matomo: extra-license-file [usr/share/matomo/libs/jqplot/gpl-2.0.txt]
matomo: extra-license-file [usr/share/matomo/libs/Zend/LICENSE.txt]
matomo: extra-license-file [usr/share/matomo/misc/log-analytics/LICENSE.txt]
matomo: extra-license-file [usr/share/matomo/node_modules/chroma-js/LICENSE]
matomo: extra-license-file [usr/share/matomo/node_modules/iframe-resizer/LICENSE]
matomo: extra-license-file [usr/share/matomo/node_modules/jquery/LICENSE.txt]
matomo: extra-license-file [usr/share/matomo/node_modules/jquery-mousewheel/LICENSE.txt]
matomo: extra-license-file [usr/share/matomo/node_modules/jquery.scrollto/LICENSE]
matomo: extra-license-file [usr/share/matomo/node_modules/jquery-ui-dist/LICENSE.txt]
matomo: extra-license-file [usr/share/matomo/node_modules/@materializecss/materialize/LICENSE]
matomo: extra-license-file [usr/share/matomo/node_modules/mousetrap/LICENSE]
matomo: extra-license-file [usr/share/matomo/node_modules/qrcodejs2/LICENSE]
matomo: extra-license-file [usr/share/matomo/node_modules/sprintf-js/LICENSE]
matomo: extra-license-file [usr/share/matomo/node_modules/visibilityjs/LICENSE]
matomo: extra-license-file [usr/share/matomo/plugins/TagManager/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/composer/ca-bundle/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/composer/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/composer/semver/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/davaxi/sparkline/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/geoip2/geoip2/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/lox/xhprof/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/matomo/cache/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/matomo/decompress/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/matomo/device-detector/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/matomo/doctrine-cache-fork/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/matomo/ini/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/matomo/matomo-php-tracker/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/matomo/network/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/matomo/searchengine-and-social-list/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/maxmind-db/reader/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/maxmind/web-service-common/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/monolog/monolog/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/opis/closure/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/pear/console_getopt/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/pear/pear_exception/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/php-di/invoker/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/php-di/php-di/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/php-di/phpdoc-reader/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/phpmailer/phpmailer/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/psr/container/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/psr/event-dispatcher/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/psr/log/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/console/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/deprecation-contracts/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/error-handler/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/event-dispatcher-contracts/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/event-dispatcher/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/http-foundation/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/http-kernel/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/monolog-bridge/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/polyfill-ctype/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/polyfill-iconv/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/polyfill-intl-grapheme/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/polyfill-intl-normalizer/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/polyfill-mbstring/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/polyfill-php73/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/polyfill-php80/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/service-contracts/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/string/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/symfony/var-dumper/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/szymach/c-pchart/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/tecnickcom/tcpdf/LICENSE.TXT]
matomo: extra-license-file [usr/share/matomo/vendor/tedivm/jshrink/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/twig/twig/LICENSE]
matomo: extra-license-file [usr/share/matomo/vendor/wikimedia/less.php/LICENSE]

# That is the aim of Matomo to provide an opensource tracker alternative to Google or others
matomo: privacy-breach-piwik (choke on: 'settrackerurl') [usr/share/matomo/js/piwik.js]
matomo: privacy-breach-piwik (choke on: "settrackerurl") [usr/share/matomo/js/piwik.min.js]
matomo: privacy-breach-piwik (choke on: "settrackerurl") [usr/share/matomo/matomo.js]
matomo: privacy-breach-piwik (choke on: "settrackerurl") [usr/share/matomo/piwik.js]

# Matomo use it's own bug numbers
#matomo: improbable-bug-number-in-closes

# Change/reset permission on /var/lib/matomo/data/tmp to www-data 0755/0644
matomo: recursive-privilege-change "chown -R" [postinst:*]
matomo: recursive-privilege-change "find /var/lib/matomo/data/tmp -type d -exec chmod" [postinst:*]
matomo: recursive-privilege-change "find /var/lib/matomo/data/tmp -type f -exec chmod" [postinst:*]

# Rules added specifically for 4.1.0
matomo: script-not-executable [usr/share/matomo/vendor/wikimedia/less.php/bin/lessc]
# Rules added for version 5.x 
matomo: script-not-executable [usr/share/matomo/vendor/symfony/error-handler/Resources/bin/extract-tentative-return-types.php]
matomo: script-not-executable [usr/share/matomo/vendor/symfony/error-handler/Resources/bin/patch-type-declarations]
matomo: script-not-executable [usr/share/matomo/vendor/symfony/var-dumper/Resources/bin/var-dump-server]


# Temporary rule until moving to v5
#matomo: missing-systemd-timer-for-cron-script [etc/cron.d/matomo-archive]

# To learn v4 postinst how to deal with abort-upgrade
matomo: uses-dpkg-database-directly [preinst]

# The NEWS entry is labelled 1:5.3.1-2, which is this binary's version but not the
# source version this package is built from. That is deliberate and the entry has to
# match the binary: apt-listchanges compares the label against what is installed, and
# with the source version there it reads the file and displays nothing -- on the very
# upgrade the notice exists for.
#
# The epoch is on the binary alone because it is apt that has to prefer this package
# over the matomo Debian distributes, whose 5.3.1+dfsg-1 dpkg reads as newer than
# anything published here.
matomo: debian-news-entry-has-unknown-version 1:5.3.1-2 [usr/share/doc/matomo/NEWS.Debian.gz:*]

# Inherited, and deliberately so. This package ships the same files as the 5.3.1-1
# already published -- bar the notice above -- so that upgrading to it changes nothing
# on the system. Correcting a permission here would mean touching that tree, which is
# the one thing this package must not do.
matomo: non-standard-file-perm 0664 != 0644 [etc/matomo/manifest.inc.php]

# The preinst prints the commands an administrator has to run by hand when it refuses
# to install; one of them is a chown -R on the directory extensions are copied into.
# It is text inside an echo, never executed by the script.
matomo: recursive-privilege-change "chown -R" [preinst:*]
