├── .github └── pull_request_template.md ├── .gitignore ├── Makefile ├── README.md ├── archives └── .gitkeep └── debian ├── README.Debian ├── README.md ├── changelog ├── compat ├── conf ├── apache.conf ├── lighttpd.conf ├── matomo-archive └── matomo-log ├── control ├── copyright ├── gpg-keys └── matomo-keyring-automatic.gpg ├── matomo.config ├── matomo.dirs ├── matomo.docs ├── matomo.install ├── matomo.links ├── matomo.lintian-overrides ├── matomo.postinst ├── matomo.postrm ├── matomo.preinst ├── matomo.prerm ├── po └── .gitkeep ├── rules ├── scripts ├── githelp.sh ├── history.sh └── vercomp.sh ├── source └── format └── templates /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.sw? 3 | archives/* 4 | debian/matomo 5 | debian/matomo.debhelper.log 6 | debian/matomo.substvars 7 | debian/matomo.*.debhelper 8 | debian/piwik 9 | debian/piwik.debhelper.log 10 | debian/piwik.substvars 11 | debian/piwik.*.debhelper 12 | debian/files 13 | tmp/* 14 | tmp.* 15 | matomo 16 | matomo-*.tar.gz 17 | matomo-*.zip 18 | matomo-*.asc 19 | piwik 20 | piwik-*.tar.gz 21 | piwik-*.zip 22 | piwik-*.asc 23 | pubkey.asc 24 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Matomo (Piwik) package construction 2 | # 3 | # This is what you mostly need to know about this Makefile 4 | # * make release: When a new release has been published 5 | # * make upload: To upload your debian package 6 | # * make commitrelease: To commit your debian/changelog 7 | # * make builddeb: To rebuild your debian package. debian/changelog is not updated 8 | # * make checkdeb: To check the package compliance using lintian 9 | # 10 | # Options are: 11 | # * RELEASE_VERSION=x.y.z Specify which package version you want to build 12 | # * RELEASE_CHANGELOG=x.y.z Specify which package version you want to get changelog from 13 | 14 | URL = https://builds.matomo.org 15 | FINGERPRINT = 814E346FA01A20DBB04B6807B5DBD5925590A237 16 | 17 | CURRENT_VERSION := $(shell head -1 debian/changelog | sed 's/.*(//;s/).*//;s/-.*//') 18 | DEB_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH) 19 | 20 | ifndef DEB_VERSION 21 | DEB_VERSION := $(shell head -n 1 debian/changelog | sed 's/.*(//;s/).*//;') 22 | endif 23 | 24 | ifndef DEB_STATUS 25 | DEB_STATUS := $(shell head -n 1 debian/changelog | awk '{print $$3}' | sed 's/;//g') 26 | endif 27 | 28 | ifndef RELEASE_VERSION 29 | RELEASE_VERSION := $(shell wget --no-cache -qO - $(URL)/LATEST) 30 | endif 31 | 32 | ifndef RELEASE_CHANGELOG 33 | RELEASE_CHANGELOG := $(RELEASE_VERSION) 34 | endif 35 | 36 | RELEASE_VERSION_GREATER = $(shell ./debian/scripts/vercomp.sh $(RELEASE_VERSION) $(CURRENT_VERSION)) 37 | RELEASE_VERSION_LOWER = $(shell ./debian/scripts/vercomp.sh $(RELEASE_VERSION) $(CURRENT_VERSION)) 38 | 39 | ifndef PW_ARCHIVE_EXT 40 | PW_ARCHIVE_EXT := $(shell wget --no-cache -q --spider $(URL)/matomo-$(RELEASE_VERSION).tar.gz && echo 'tar.gz' || echo 'zip' ) 41 | endif 42 | 43 | ARCHIVE = matomo-$(RELEASE_VERSION).$(PW_ARCHIVE_EXT) 44 | SIG = matomo-$(RELEASE_VERSION).$(PW_ARCHIVE_EXT).asc 45 | 46 | DESTDIR = / 47 | DIST = stable 48 | URGENCY = high 49 | 50 | MAKE_OPTS = -s 51 | 52 | INSTALL = /usr/bin/install 53 | 54 | .PHONY : checkfetch fixperms checkversions release checkenv builddeb checkdeb checkdebdetail newrelease newversion changelog history clean upload fixsettings 55 | 56 | RED = \033[0;31m 57 | GREEN = \033[0;32m 58 | NC = \033[0m 59 | 60 | # check and optionally fetch the corresponding matomo archive 61 | # from the official server. Uncompress the archive and 62 | # perform additional minor cleanups 63 | checkfetch: 64 | @echo -n " [WGET] ... " 65 | @if [ ! -f "$(SIG)" ]; then echo -n "$(URL)/$(SIG) "; wget --no-cache -q $(URL)/$(SIG); fi; 66 | @if [ ! -f "$(ARCHIVE)" ]; then echo -n "$(URL)/$(ARCHIVE) "; wget --no-cache -q $(URL)/$(ARCHIVE); fi; 67 | @echo "done." 68 | @gpgconf --kill dirmngr 69 | @test ! -z "$(shell gpg2 --list-keys | grep $(FINGERPRINT))" || gpg2 --keyserver keys.gnupg.net --recv-keys $(FINGERPRINT) 70 | @echo " [GPG] verify $(FINGERPRINT)" && gpg --verify $(SIG) 71 | @echo " [RM] matomo/" && if [ -d "matomo" ]; then rm -rf "matomo"; fi 72 | @echo " [UNPACK] $(ARCHIVE)" 73 | @test "$(PW_ARCHIVE_EXT)" != "zip" || unzip -qq $(ARCHIVE) 74 | @test "$(PW_ARCHIVE_EXT)" != "tar.gz" || tar -zxf $(ARCHIVE) 75 | 76 | # perform some cleanup tasks to remove extraneous files 77 | # from the built package. Some (js)libs are dragged with 78 | # examples and extra material that aren't required in the 79 | # final package 80 | cleanup: 81 | @echo " [RM] Cleanup: vcs, ci" 82 | @rm -f 'How to install Matomo.html' 83 | @find matomo/ -type f -name .gitignore -exec rm -f {} \; 84 | @find matomo/ -type f -name .gitattributes -exec rm -f {} \; 85 | @find matomo/ -type f -name .gitmodules -exec rm -f {} \; 86 | @find matomo/ -type f -name .git -exec rm -f {} \; 87 | @find matomo/ -type f -name .gitkeep -exec rm -f {} \; 88 | @find matomo/ -type f -name .editorconfig -exec rm -f {} \; 89 | @find matomo/ -type f -name .travis.yml -exec rm -f {} \; 90 | @find matomo/ -type f -name .travis.sh -exec rm -f {} \; 91 | @find matomo/ -type f -name .coveralls.yml -exec rm -f {} \; 92 | @find matomo/ -type f -name .jshintrc -exec rm -f {} \; 93 | @find matomo/ -type f -name .scrutinizer.yml -exec rm -f {} \; 94 | @find matomo/ -type f -name "*bower.json" -exec rm -f {} \; 95 | @find matomo/ -type f -name ".npmignore" -exec rm -f {} \; 96 | @find matomo/ -type f -name ".eslintrc" -exec rm -f {} \; 97 | @find matomo/vendor -mindepth 2 -type f -name "autoload.php" -exec rm -f {} \; 98 | @rm -rf matomo/vendor/doctrine/cache/.git 99 | @rm -f matomo/misc/translationTool.sh 100 | @echo " [RM] Cleanup: jScrollPane" 101 | @rm -rf matomo/libs/bower_components/jScrollPane/issues 102 | @rm -f matomo/libs/bower_components/jScrollPane/ajax_content.html 103 | @rm -f matomo/libs/bower_components/jScrollPane/script/demo.js 104 | @rm -f matomo/libs/bower_components/jScrollPane/themes/lozenge/index.html 105 | @rm -rf matomo/libs/bower_components/sprintf/demo 106 | @rm -f matomo/vendor/leafo/lessphp/lessify matomo/vendor/leafo/lessphp/plessc 107 | @rm -rf matomo/vendor/tecnickcom/tcpdf/tools 108 | 109 | 110 | checkconfig: 111 | @echo -n " [CONF] Checking configuration files... " 112 | @if [ "$(shell cat debian/matomo.install | grep "^matomo/config/" | wc -l)" -ne "$(shell find ./matomo/config/ -type f | wc -l)" ]; then \ 113 | echo "\n $(RED)[CONF]$(NC) Configuration files may have been added or removed, please update debian/matomo.install"; \ 114 | echo " $(shell cat debian/matomo.install | grep "^matomo/config/" | wc -l)" -ne "$(shell find ./matomo/config/ -type f | wc -l)" "$(shell pwd)"; \ 115 | exit 1; \ 116 | fi 117 | @echo "done" 118 | 119 | checkmatomoinstall: 120 | @echo -n " [CONF] Checking other files/dir... " 121 | @for F in $(shell cat debian/matomo.install|grep ^matomo|cut -f1) ; do \ 122 | echo -n " * checking in matomo.install: $$F"; \ 123 | if [ ! -e "$$F" ]; then \ 124 | echo " $(RED)missing$(NC)."; \ 125 | echo "1" >&2; \ 126 | else \ 127 | echo " $(GREEN)ok$(NC)."; \ 128 | fi; \ 129 | done 3>&2 2>&1 1>&3 | grep --silent "1" && exit 1 || echo >/dev/null 130 | 131 | checkmatomorootdir: 132 | @echo -n " [CONF] Checking other files/dir... " 133 | @for F in $(shell ls matomo) ; do \ 134 | echo -n " * checking in root dir: $$F"; \ 135 | if [ ! $(shell grep "^matomo/$$F" debian/matomo.install) ]; then \ 136 | echo " $(RED)missing$(NC)."; \ 137 | echo "1" >&2; \ 138 | else \ 139 | echo " $(GREEN)ok$(NC)."; \ 140 | fi; \ 141 | done 3>&2 2>&1 1>&3 | grep --silent "1" && exit 1 || echo >/dev/null 142 | 143 | manifest: 144 | @if [ -z "$(DESTDIR)" ]; then echo "$(RED)missing DESTDIR=$(NC)"; exit 1; fi 145 | @echo -n " [MANIFEST] Generating manifest.inc.php... " 146 | @rm -f $(DESTDIR)/etc/matomo/manifest.inc.php 147 | @find $(DESTDIR)/ -type f -printf '%s ' -exec md5sum {} \; \ 148 | | grep -v "user/.htaccess" \ 149 | | grep -v "$(DESTDIR)/DEBIAN/" \ 150 | | grep -v "$(DESTDIR)/usr/share/doc/matomo/" \ 151 | | grep -v "$(DESTDIR)/usr/share/matomo/README" \ 152 | | grep -v "$(DESTDIR)/usr/share/lintian/" \ 153 | | grep -v "$(DESTDIR)/etc/cron.d" \ 154 | | grep -v "$(DESTDIR)/etc/logrotate.d" \ 155 | | grep -v "$(DESTDIR)/etc/matomo/lighttpd.conf" \ 156 | | grep -v "$(DESTDIR)/etc/matomo/apache.conf" \ 157 | | grep -v "$(DESTDIR)/etc/apt/" \ 158 | | egrep -v 'manifest.inc.php|autoload.php|autoload_real.php' \ 159 | | sed 's#$(DESTDIR)##g;' \ 160 | | sed 's#/usr/share/matomo/##g; s#/etc/matomo/#config/#g;' \ 161 | | sed '1,$$ s/\([0-9]*\) \([a-z0-9]*\) \(.*\)/\t\t"\3" => array("\1", "\2"),/;' \ 162 | | sort \ 163 | | sed '1 s/^/ $(DESTDIR)/etc/matomo/manifest.inc.php 165 | @echo "$(GREEN)done$(NC)." 166 | @echo -n " [MANIFEST] Checking manifest.inc.php syntax... " 167 | @php -l $(DESTDIR)/etc/matomo/manifest.inc.php >/dev/null 168 | @echo "$(GREEN)done$(NC)." 169 | @echo -n " [MANIFEST] Checking for unexpected entries in manifest.inc.php... " 170 | @if [ ! -z "$(shell grep '"/' $(DESTDIR)/etc/matomo/manifest.inc.php)" ]; then echo "$(RED)check $(DESTDIR)/etc/matomo/manifest.inc.php for extra entries$(NC)"; exit 1; fi; 171 | @echo "$(GREEN)done$(NC)." 172 | 173 | 174 | fixsettings: 175 | @echo " [SED] Configuration adjustments" 176 | @sed -i '/\.gitignore/d' $(DESTDIR)/etc/matomo/manifest.inc.php 177 | @sed -i 's/^\(enable_auto_update\).*/\1 = 0/g;' $(DESTDIR)/etc/matomo/global.ini.php 178 | @sed -i '1 s/python/python3/' $(DESTDIR)/usr/share/matomo/misc/log-analytics/import_logs.py 179 | 180 | # fix various file permissions 181 | fixperms: 182 | @echo -n " [CHMOD] Fixing permissions... " 183 | @find $(DESTDIR) -type d -not -path "$(DESTDIR)/DEBIAN" -exec chmod 0755 {} \; 184 | @find $(DESTDIR) -type f -not -path "$(DESTDIR)/DEBIAN/*" -exec chmod 0644 {} \; 185 | @chmod 0755 $(DESTDIR)/usr/share/matomo/misc/cron/archive.sh 186 | @chmod 0755 $(DESTDIR)/usr/share/matomo/console 187 | # @chmod 0755 $(DESTDIR)/usr/share/matomo/vendor/lox/xhprof/scripts/xhprofile.php 188 | @chmod 0755 $(DESTDIR)/usr/share/matomo/vendor/pear/archive_tar/sync-php4 189 | @chmod 0755 $(DESTDIR)/usr/share/matomo/vendor/matomo/matomo-php-tracker/run_tests.sh 190 | # @chmod 0755 $(DESTDIR)/usr/share/matomo/vendor/szymach/c-pchart/coverage.sh 191 | # @chmod 0755 $(DESTDIR)/usr/share/matomo/vendor/twig/twig/drupal_test.sh 192 | # @chmod 0755 $(DESTDIR)/usr/share/matomo/vendor/wikimedia/less.php/bin/lessc 193 | 194 | @echo "done." 195 | 196 | # check lintian licenses so we can remove obsolete ones 197 | checklintianlic: 198 | @echo " [DEB] Checking extra license files presence" 199 | @for F in $(shell cat debian/matomo.lintian-overrides | grep extra-license-file | awk '{print $$3}') ; do \ 200 | echo -n " * checking: $$F"; \ 201 | if [ ! -f "$(DESTDIR)/$$F" ]; then \ 202 | echo " $(RED)missing$(NC)."; \ 203 | echo "1" >&2; \ 204 | else \ 205 | echo " $(GREEN)ok$(NC)."; \ 206 | fi; \ 207 | done 3>&2 2>&1 1>&3 | grep --silent "1" && exit 1 || echo >/dev/null 208 | 209 | # check lintian licenses so we can remove obsolete ones 210 | checklintianextralibs: 211 | @echo " [DEB] Checking for extra libs presence" 212 | @for F in $(shell cat debian/matomo.lintian-overrides | grep -e embedded-javascript-library -e embedded-php-library | awk '{print $$3}') ; do \ 213 | echo -n " * checking: $$F"; \ 214 | if [ ! -f "$(DESTDIR)/$$F" ]; then \ 215 | echo " $(RED)missing$(NC)."; \ 216 | echo "1" >&2; \ 217 | else \ 218 | echo " $(GREEN)ok$(NC)."; \ 219 | fi; \ 220 | done 3>&2 2>&1 1>&3 | grep --silent "1" && exit 1 || echo >/dev/null 221 | 222 | # raise an error if the building version is lower that the head of debian/changelog 223 | checkversions: 224 | ifeq "$(RELEASE_VERSION_LOWER)" "1" 225 | @echo "$(RED)The version you're trying to build is older that the head of your changelog.$(NC)" 226 | @exit 1 227 | endif 228 | 229 | # create a new release either major or minor. 230 | release: checkenv checkversions 231 | ifeq "$(RELEASE_VERSION_GREATER)" "2" 232 | @$(MAKE) newrelease 233 | @$(MAKE) history 234 | else 235 | @$(MAKE) newversion 236 | endif 237 | @debchange --changelog debian/changelog --release '' 238 | @$(MAKE) builddeb 239 | @$(MAKE) checkdebdetail 240 | 241 | # check if the local environment is suitable to generate a package 242 | # we check environment variables and a gpg private key matching 243 | # these variables. this is necessary as we sign our packages. 244 | checkenv: 245 | ifndef DEBEMAIL 246 | @echo " [ENV] Missing environment variable DEBEMAIL" 247 | @exit 1 248 | endif 249 | ifndef DEBFULLNAME 250 | @echo " [ENV] Missing environment variable DEBFULLNAME" 251 | @exit 1 252 | endif 253 | @echo " [GPG] Checking environment" 254 | @gpg2 --list-secret-keys "$(DEBFULLNAME) <$(DEBEMAIL)>" >/dev/null 255 | 256 | # creates the .deb package and other related files 257 | # all files are placed in ../ 258 | builddeb: checkenv checkversions 259 | @echo -n " [PREP] Checking package status..." 260 | ifeq "$(DEB_STATUS)" "UNRELEASED" 261 | @echo " $(RED)The package changelog marks the package as 'UNRELEASED'.$(NC)" 262 | @echo " $(RED)run this command: debchange --changelog debian/changelog --release ''$(NC)" 263 | @exit 1 264 | else 265 | @echo "$(GREEN)ok$(NC)." 266 | endif 267 | 268 | @echo " [DPKG] Building packages..." 269 | dpkg-buildpackage -i '-Itmp' -I.git -I$(ARCHIVE) -rfakeroot 270 | 271 | 272 | # check the generated .deb for consistency 273 | # the filename is determines by the 1st line of debian/changelog 274 | checkdeb: 275 | @echo " [LINTIAN] Checking package(s)..." 276 | @for P in $(shell cat debian/control | grep ^Package | awk '{print $$2}'); do \ 277 | lintian --no-tag-display-limit --color auto -L ">=warning" -v -i ../$${P}_$(shell dpkg-parsechangelog | grep ^Version | awk '{print $$2}')_*.deb; \ 278 | done 279 | 280 | # check the generated .deb for consistency 281 | # the filename is determines by the 1st line of debian/changelog 282 | checkdebdetail: 283 | @echo " [LINTIAN] Checking package(s)..." 284 | @for P in $(shell cat debian/control | grep ^Package | awk '{print $$2}'); do \ 285 | lintian --no-tag-display-limit --color auto -L ">=info" -v -i ../$${P}_$(shell dpkg-parsechangelog | grep ^Version | awk '{print $$2}')_*.deb; \ 286 | done 287 | 288 | # create a new release based on RELEASE_VERSION variable 289 | newrelease: 290 | @debchange --changelog debian/changelog --urgency $(URGENCY) --package $(shell cat debian/control | grep ^Source | awk '{print $$2}') --newversion $(RELEASE_VERSION)-1 "Releasing Matomo $(RELEASE_VERSION)" 291 | 292 | # creates a new version in debian/changelog 293 | newversion: 294 | @debchange --changelog debian/changelog -i --urgency $(URGENCY) 295 | @debchange --changelog debian/changelog --force-distribution $(DIST) --urgency $(URGENCY) -r 296 | 297 | # allow user to enter one or more changelog comment manually 298 | changelog: 299 | @debchange --changelog debian/changelog --force-distribution $(DIST) --urgency $(URGENCY) -r 300 | @debchange --changelog debian/changelog -a 301 | 302 | # fetch the history and add it to the debian/changelog 303 | history: 304 | @bash debian/scripts/history.sh $(RELEASE_VERSION) $(RELEASE_CHANGELOG) 305 | 306 | # clean for any previous / unwanted files from previous build 307 | clean: 308 | @echo " [RM] matomo/ debian/tmp/ debian/matomo/" 309 | @rm -rf matomo debian/tmp debian/matomo 310 | 311 | distclean: clean 312 | @echo " [RM] matomo-*.tar.gz matomo-*.tar.gz.asc matomo-*.zip matomo-*.zip.asc" 313 | @rm -f matomo-*.tar.gz matomo-*.tar.gz.asc matomo-*.zip matomo-*.zip.asc 314 | 315 | prepupload: 316 | @echo " [MKDIR] tmp/" 317 | @test -d tmp || mkdir tmp 318 | @test ! -f $(ARCHIVE) || echo " [MV] $(ARCHIVE) => tmp/" 319 | @test ! -f $(ARCHIVE) || mv $(ARCHIVE) tmp/ 320 | @test ! -f $(SIG) || echo " [MV] $(SIG) => tmp/" 321 | @test ! -f $(SIG) || mv $(SIG) tmp/ 322 | @test ! -f ../matomo_$(DEB_VERSION)_all.deb || echo " [MV] ../matomo_$(DEB_VERSION)_all.deb => tmp/" 323 | @test ! -f ../matomo_$(DEB_VERSION)_all.deb || mv ../matomo_$(DEB_VERSION)_all.deb $(CURDIR)/tmp/ 324 | @test ! -f ../matomo_$(DEB_VERSION).dsc || echo " [MV] ../matomo_$(DEB_VERSION).dsc => tmp/" 325 | @test ! -f ../matomo_$(DEB_VERSION).dsc || mv ../matomo_$(DEB_VERSION).dsc $(CURDIR)/tmp/ 326 | @test ! -f ../matomo_$(DEB_VERSION)_$(DEB_ARCH).changes || echo " [MV] ../matomo_$(DEB_VERSION)_$(DEB_ARCH).changes => tmp/" 327 | @test ! -f ../matomo_$(DEB_VERSION)_$(DEB_ARCH).changes || mv ../matomo_$(DEB_VERSION)_$(DEB_ARCH).changes $(CURDIR)/tmp/ 328 | @test ! -f ../matomo_$(DEB_VERSION).tar.gz || echo " [MV] ../matomo_$(DEB_VERSION).tar.gz => tmp/" 329 | @test ! -f ../matomo_$(DEB_VERSION).tar.gz || mv ../matomo_$(DEB_VERSION).tar.gz $(CURDIR)/tmp/ 330 | @test ! -f ../matomo_$(DEB_VERSION)_$(DEB_ARCH).buildinfo || echo " [MV] ../matomo_$(DEB_VERSION)_$(DEB_ARCH).buildinfo => tmp/" 331 | @test ! -f ../matomo_$(DEB_VERSION)_$(DEB_ARCH).buildinfo || mv ../matomo_$(DEB_VERSION)_$(DEB_ARCH).buildinfo $(CURDIR)/tmp/ 332 | 333 | upload: prepupload 334 | @echo " [UPLOAD] => to matomo" 335 | @dupload --quiet --to matomo $(CURDIR)/tmp/matomo_$(DEB_VERSION)_$(DEB_ARCH).changes 336 | 337 | commitrelease: 338 | @echo " [GIT] Commit release" 339 | @./debian/scripts/githelp.sh commitrelease 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Matomo Package 2 | 3 | This repository contains the Matomo release script (official package). 4 | 5 | To generate a new Matomo release for example 3.0.0-b1, follow these steps: 6 | 7 | * Edit `core/Version.php` and set the correct version number 8 | * Check that the CI builds is green 9 | * Create a release on Github which will automatically create a git tag. 10 | * Then package the release. Run: `./scripts/build.sh 3.0.0-b1`. This script will: 11 | * the first time it runs it clones the Matomo git repository. 12 | * then it builds the package, removing any un-necessary files, 13 | * then it uploads the `.zip` and `.tar.gz` packages to https://builds.matomo.org 14 | * The new Matomo version is now shipped to users worldwide, 15 | * Users will now notified in their Administration area, and some users will receive email alerts about the new version. 16 | 17 | ## Multiple gpg keys 18 | To choose a default key without having to specify --default-key on the command-line every time, create a configuration file (if it doesn't already exist), `~/.gnupg/gpg.conf` and add a line containing 19 | 20 | `default-key 5590A237` 21 | 22 | -------------------------------------------------------------------------------- /archives/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matomo-org/matomo-package/b85ea252badc817b5abf952f8c5a67dd17f41e8a/archives/.gitkeep -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | Install 2 | ======= 3 | 4 | 1 - Create a MariaDB / MySQL database named "matomo" 5 | CREATE DATABASE `matomo` /*!40100 DEFAULT CHARACTER SET utf8 */; 6 | 7 | 2 - Create a user/password with access to the database previously created 8 | CREATE USER matomo@localhost IDENTIFIED BY '4/V3ryStron6!*passW0rd'; 9 | GRANT ALL PRIVILEGES ON matomo.* to matomo@localhost; 10 | -- the FILE privileges is optional, but matomo can leverage that feature 11 | -- to improve performance 12 | GRANT FILE ON *.* TO matomo@localhost; 13 | 14 | 3a- If you don't have any virtualhost, uncomment the Alias line in /etc/apache2/conf.d/matomo.conf 15 | 16 | 3b- If you operate with virtualhosts, do as follow 17 | a) if you use a dedicated virtual host for your matomo 18 | 19 | [...] 20 | DocumentRoot /usr/share/matomo 21 | [...] 22 | 23 | 24 | b) if you want the matomo Alias in all your virtualhosts, uncomment the Alias line in /etc/apache2/conf.d/matomo.conf 25 | 26 | c) if you prefer to restrict matomo Alias to a specific virtualhost 27 | 28 | [...] 29 | DocumentRoot /var/www/foo 30 | 31 | Alias /matomo /usr/share/matomo 32 | [...] 33 | 34 | 35 | 3c- Ensure conf-available/matomo.conf is enable 36 | 37 | 4 - Point your browser to your matomo URL 38 | 39 | 5 - Follow the steps and provide the MariaDB / MySQL credential details when requested. 40 | 41 | 6 - Add the given javascript code to your pages, ideally at the bottom of the html just before 42 | 43 | See http://matomo.org/docs/installation/ 44 | 45 | Cron job 46 | ======== 47 | 48 | The Debian matomo package also provides a crontab file /etc/cron.d/matomo 49 | It's released commented out, but we highly recommend to uncomment it to make sure Piwik loads very fast. 50 | 51 | See http://matomo.org/docs/setup-auto-archiving/ 52 | -------------------------------------------------------------------------------- /debian/README.md: -------------------------------------------------------------------------------- 1 | # Debian package for Piwik 2 | 3 | ## Audience 4 | 5 | This documentation is primarily for Piwik staff in charge of generating the Debian package. System administrators may also be interested in this documentation. 6 | 7 | ## Description 8 | 9 | This repository contains the required skeleton to create your own Debian package for Piwik. 10 | 11 | ## Pre-requisites 12 | 13 | You need to install the following packages 14 | 15 | * lintian 16 | * devscripts 17 | * debhelper 18 | * dupload 19 | 20 | You also need 21 | 22 | * A valid GPG key to sign your package, set with your email address (to sign the generated package) 23 | * Your valid and current GPG must have been inserted into the server keyring 24 | * The env variable ``DEBEMAIL`` set with your email address (to update the changelog) 25 | * The env variable ``DEBFULLNAME`` set with your full name (to update the changelog) 26 | * Please note that ``DEBFULLNAME``, ``DEBEMAIL`` and the details of your GPG key must match 27 | * A valid "dupload" rule named "piwik" to upload your file on the official server 28 | * Your public ssh key installed and enabled on the production server 29 | 30 | ## Package 31 | 32 | The process has been designed to be as simple as possible. Though, manual intervention may be required from time to time. Seek help of an experienced sysadmin if you have any doubts. 33 | 34 | ### New release 35 | 36 | The ``release`` rule will generate, sign and verify your package. 37 | 38 | * ``make release`` 39 | 40 | If no errors were reported, you should be fine to send your package for immediate publication 41 | 42 | * ``make upload`` 43 | 44 | ### Resuming a release 45 | 46 | If ``make newrelease`` has been interrupted, check and fix the error(s). Then, you can resume the process with the command below. 47 | 48 | * ``make buildddeb`` 49 | 50 | ### Manual package verification 51 | 52 | You may want to check the package for consistency and other warning. This step is part of ``make release`` 53 | 54 | * ``make checkdeb`` 55 | * lintian will display errors and warnings if any 56 | 57 | Please note that a package shouldn't be uploaded if errors or warnings remain. 58 | 59 | ### New release upload 60 | 61 | Once "dupload" has been configured and a rule named "piwik" is present, just type: 62 | 63 | * ``make upload`` 64 | 65 | ### Intermediate versions 66 | 67 | Once in a while it might be necessary to fixes minor details associated to the package. 68 | 69 | * ``make newversion`` 70 | 71 | It will create a new intermediate version in ``debian/changelog``. 72 | 73 | * ``make changelog`` 74 | 75 | If you need to edit ``debian/changelog``. This also update the date and time of the latest entry. 76 | 77 | * ``make builddeb`` 78 | 79 | This will build and sign your Debian package. 80 | 81 | * ``make checkdeb`` 82 | 83 | Check your package and displays errors and warnings if any. 84 | 85 | * ``make upload`` 86 | 87 | Sends your package to the Piwik.org server. 88 | 89 | ## Resources 90 | 91 | ### dupload configuration 92 | 93 | Your basic dupload configuration should look like this: 94 | 95 | package config; 96 | $preupload{'changes'} = '/usr/share/dupload/gpg-check %1'; 97 | $preupload{'deb'} = 'lintian --color auto -v -i %1'; 98 | 99 | $cfg{'piwik'} = { 100 | fqdn => "piwik.org", 101 | method => "scpb", 102 | mailto => 'aurelien@requiem.fr', 103 | cc => 'matt@piwik.org', 104 | login => 'piwik-package', 105 | incoming => '/home/piwik-package/incoming/stable/', 106 | dinstall_runs => 0, 107 | }; 108 | 109 | 1; 110 | 111 | ### Release process 112 | 113 | The ``make release`` command does multiple things for you in the background 114 | 115 | * Check your environment 116 | * Check the latest Piwik version 117 | * Download the changelog and Update ``debian/changelog`` if needed 118 | * Download, unpack and clean the Piwik directory 119 | * Generate the Debian package 120 | * Digitally sign the Debian package 121 | * Call ``lintian`` to ensure your package complies with the Debian standards 122 | 123 | ### Versions 124 | 125 | Understanding the different Piwik versions 126 | 127 | * Official Web releases 128 | * ``2.0`` is a major Piwik release as found on [Piwik.org](http://piwik.org) 129 | * ``2.0.1`` is a minor Piwik release as found on [Piwik.org](http://piwik.org) 130 | * Official Debian releases 131 | * ``2.0-1`` or ``2.0.1-1`` are the first Debian package releases of a major or minor version of Piwik 132 | * ``2.0-2`` or ``2.0.1-2`` are intermediate Debian package releases containing only packaging changes 133 | 134 | 135 | ### Details about ``debian/changelog`` 136 | 137 | The file ``debian/changelog`` contains 2 sorts of entries 138 | 139 | 1. For all major and minor releases (``*-1``) 140 | 141 | The changelog details as found on the Piwik.org website. This includes the bug numbers. 142 | 143 | 2. For all intermediate versions (``*-2``, ``*-3``, ...) 144 | 145 | These changelog entries describe the internal package changes, but no core code changes. (ie. permission fixes, cleanup, ...) 146 | 147 | # Background history 148 | 149 | I needed to install Piwik on a Debian server for a client. I found Fabrizio's work but sadly this didn't work with the latest Piwik (1.12) version. So, as I maintain my own internal package repository, I decided to adapt his work and create a true vanilla version of Piwik for Debian. I also tried my best to ensure a good security level (files owned by ``root``, configs in ``/etc/piwik`` and generated files in ``/var/lib/piwik/``). 150 | 151 | Some Debian purist may scream at me for all the lintian rules, licenses files and other problems. The idea is not to submit my work to the Debian project, but at least offer an interim for people willing to maintain their Piwik installation via a proper package. 152 | 153 | # Credits 154 | 155 | * Aurélien Requiem (aurelien AT requiem DOT fr) for packaging Piwik, automatic some of the tasks and the related documentation 156 | * Matthieu Aubry (matt AT piwik DOT org) for his advices, additional checks and fixes 157 | * Main credit goes to the Piwik team for their fantastic work 158 | * All people contributing to the Piwik project and the funders 159 | * Fabrizio Regalli and the Debian team for some of the files reused and adapted (see ``debian/copyright``) 160 | 161 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 13 2 | -------------------------------------------------------------------------------- /debian/conf/apache.conf: -------------------------------------------------------------------------------- 1 | # if you are running apache, the file should already be linked 2 | # in /etc/apache2/conf.d or /etc/apache2/conf-available 3 | 4 | # Uncomment the "Alias" to add matomo as a global alias 5 | # or if you are running virtual hosts, then add the alias 6 | # to the desired site(s). 7 | # Alias /piwik /usr/share/matomo 8 | # Alias /matomo /usr/share/matomo 9 | 10 | 11 | DirectoryIndex index.php 12 | Options FollowSymLinks 13 | AllowOverride All 14 | 15 | Order allow,deny 16 | Allow from all 17 | 18 | = 2.4> 19 | Require all granted 20 | 21 | 22 | 23 | 24 | Options None 25 | 26 | Order allow,deny 27 | Deny from all 28 | 29 | = 2.4> 30 | Require all denied 31 | 32 | 33 | 34 | 35 | Options None 36 | 37 | Order allow,deny 38 | Deny from all 39 | 40 | = 2.4> 41 | Require all denied 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /debian/conf/lighttpd.conf: -------------------------------------------------------------------------------- 1 | # Alias for piwik directory 2 | alias.url += ( 3 | "/piwik" => "/usr/share/matomo", 4 | "/matomo" => "/usr/share/matomo", 5 | ) 6 | -------------------------------------------------------------------------------- /debian/conf/matomo-archive: -------------------------------------------------------------------------------- 1 | # set and uncomment the cron as you like 2 | # .---------------- minute (0 - 59) 3 | # | .-------------- hour (0 - 23) 4 | # | | .---------- day of month (1 - 31) 5 | # | | | .-------- month (1 - 12) OR jan,feb,mar,apr ... 6 | # | | | | .------ day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat 7 | # | | | | | 8 | # * * * * * user-name command to be executed 9 | # 5 * * * * www-data [ -e /usr/share/matomo/console ] && [ -x /usr/bin/php ] && nice /usr/bin/php /usr/share/matomo/console core:archive --url="http://example.org/matomo/" >>/var/log/matomo/matomo-archive.log 2>&1 10 | -------------------------------------------------------------------------------- /debian/conf/matomo-log: -------------------------------------------------------------------------------- 1 | /var/log/matomo/matomo-archive.log 2 | { 3 | rotate 30 4 | daily 5 | missingok 6 | notifempty 7 | delaycompress 8 | compress 9 | } 10 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: matomo 2 | Section: web 3 | Priority: optional 4 | Maintainer: Edouard Gaulué 5 | Build-Depends: debhelper (>=13), unzip 6 | Standards-Version: 3.8.0 7 | 8 | Package: matomo 9 | Architecture: all 10 | Homepage: http://matomo.org 11 | Pre-Depends: debconf (>= 1.5.71) | debconf-2.0 12 | Depends: php-cli, php-mysql|php-mysqlnd, php-curl, php-gd, php-xml, python3 13 | Recommends: logrotate, libapache2-mod-php|php-cgi|php-fpm, php-geoip 14 | Suggests: mariadb-server | mysql-server, geoip-database-extra, php-mbstring, libmaxminddb0 15 | Description: Leading Free/Libre open source Web Analytics software 16 | Matomo (formerly Piwik) is a full featured PHP MySQL software program that 17 | you download and install on your own webserver. At the end of the five minute 18 | installation process you will be given a JavaScript code. Simply copy and 19 | paste this tag on websites you wish to track and access your analytics reports 20 | in real time. 21 | . 22 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0 2 | Upstream-Name: piwik 3 | Upstream-Contact: Matthieu Aubry 4 | Source: http://piwik.org/ 5 | 6 | Files: debian/* 7 | Copyright: © 2013, Aurelien Requiem 8 | License: GPL-3+ 9 | 10 | Files: debian/piwik.cron.d debian/conf/lighttpd.conf debian/docs 11 | Copyright: © 2013, Fabrizio Regalli 12 | License: GPL-3+ 13 | 14 | Files: debian/postrm debian/prerm 15 | Copyright: © 2013, Fabrizio Regalli , Aurelien Requiem 16 | License: GPL-3+ 17 | 18 | Files: debian/README.Debian debian/control debian/lintian-overrides debian/templates debian/substvars 19 | Copyright: © 2013, Aurelien Requiem , Edouard Gaulué 20 | License: GPL-3+ 21 | 22 | Files: debian/conf/apache.conf debian/install debian/postinst 23 | Copyright: © 2013, Fabrizio Regalli , Aurelien Requiem , Edouard Gaulué 24 | License: GPL-3+ 25 | 26 | Files: * 27 | Copyright: © 2013, The Piwik Team 28 | License: GPL-3+ 29 | 30 | On Debian systems, you can find the full text of the GNU General Public 31 | License v3 in `/usr/share/common-licenses/GPL-3'. 32 | 33 | -------------------------------------------------------------------------------- /debian/gpg-keys/matomo-keyring-automatic.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matomo-org/matomo-package/b85ea252badc817b5abf952f8c5a67dd17f41e8a/debian/gpg-keys/matomo-keyring-automatic.gpg -------------------------------------------------------------------------------- /debian/matomo.config: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # see http://www.fifi.org/doc/debconf-doc/tutorial.html 4 | # see http://manpages.ubuntu.com/manpages/lucid/man7/debconf-devel.7.html 5 | 6 | set -e 7 | umask 022 8 | 9 | # Source debconf library. 10 | . /usr/share/debconf/confmodule 11 | db_version 2.0 || { echo "$0: needs DebConf 2.0 or later"; exit 1; } 12 | 13 | # db_beginblock 14 | 15 | # import piwik preferences 16 | 17 | db_get piwik/automatic-upgrade || true 18 | if [ "$RET" = "true" ]; then 19 | # migrate the value 20 | db_set matomo/automatic-upgrade "$RET" 21 | 22 | # set the question as already seen 23 | db_fset matomo/automatic-upgrade seen true 24 | 25 | # reset to default value for piwik package because it's unused anyway 26 | db_reset piwik/automatic-upgrade 27 | 28 | echo "* Automatic database upgrade preference migrated from Piwik to Matomo" 29 | fi 30 | 31 | db_input high matomo/automatic-upgrade || true 32 | db_go || true 33 | 34 | # db_endblock 35 | 36 | exit 37 | -------------------------------------------------------------------------------- /debian/matomo.dirs: -------------------------------------------------------------------------------- 1 | etc/matomo/environment 2 | usr/share/matomo 3 | var/log/matomo 4 | var/lib/matomo/data/tmp/assets 5 | var/lib/matomo/data/tmp/cache/tracker 6 | var/lib/matomo/data/tmp/latest 7 | var/lib/matomo/data/tmp/logs 8 | var/lib/matomo/data/tmp/sessions 9 | var/lib/matomo/data/tmp/tcpdf 10 | var/lib/matomo/data/tmp/templates_c 11 | -------------------------------------------------------------------------------- /debian/matomo.docs: -------------------------------------------------------------------------------- 1 | matomo/LEGALNOTICE 2 | -------------------------------------------------------------------------------- /debian/matomo.install: -------------------------------------------------------------------------------- 1 | matomo/config/global.php etc/matomo/ 2 | matomo/config/global.ini.php etc/matomo/ 3 | matomo/config/manifest.inc.php etc/matomo/ 4 | matomo/config/environment/dev.php etc/matomo/environment/ 5 | #matomo/config/environment/test.php etc/matomo/environment/ 6 | #matomo/config/environment/ui-test.php etc/matomo/environment/ 7 | matomo/CHANGELOG.md usr/share/doc/matomo/ 8 | matomo/console usr/share/matomo/ 9 | matomo/CONTRIBUTING.md usr/share/doc/matomo/ 10 | matomo/core usr/share/matomo/ 11 | matomo/DIObject.php usr/share/matomo/ 12 | matomo/index.php usr/share/matomo/ 13 | matomo/js usr/share/matomo/ 14 | matomo/lang usr/share/matomo/ 15 | matomo/libs usr/share/matomo/ 16 | matomo/LegacyAutoloader.php usr/share/matomo/ 17 | matomo/LEGALNOTICE usr/share/doc/matomo/ 18 | matomo/LICENSE usr/share/doc/matomo/ 19 | matomo/matomo.js usr/share/matomo/ 20 | matomo/matomo.php usr/share/matomo/ 21 | matomo/misc usr/share/matomo/ 22 | matomo/node_modules usr/share/matomo/ 23 | matomo/offline-service-worker.js usr/share/matomo/ 24 | matomo/piwik.js usr/share/matomo/ 25 | matomo/piwik.php usr/share/matomo/ 26 | matomo/plugins usr/share/matomo/ 27 | matomo/PRIVACY.md usr/share/doc/matomo/ 28 | matomo/README.md usr/share/doc/matomo/ 29 | matomo/robots.txt usr/share/matomo/ 30 | matomo/SECURITY.md usr/share/doc/matomo/ 31 | matomo/tests usr/share/matomo/ 32 | matomo/vendor usr/share/matomo/ 33 | debian/conf/apache.conf etc/matomo 34 | debian/conf/lighttpd.conf etc/matomo 35 | debian/conf/matomo-archive etc/cron.d/ 36 | debian/conf/matomo-log etc/logrotate.d/ 37 | debian/gpg-keys/matomo-keyring-automatic.gpg etc/apt/trusted.gpg.d/ 38 | -------------------------------------------------------------------------------- /debian/matomo.links: -------------------------------------------------------------------------------- 1 | # 2 | # config file 3 | etc/matomo usr/share/matomo/config 4 | # 5 | # Symlink tmp 6 | var/lib/matomo/data/tmp usr/share/matomo/tmp 7 | # 8 | # Other files 9 | #usr/share/doc/matomo/README.md usr/share/matomo/README.md 10 | -------------------------------------------------------------------------------- /debian/matomo.lintian-overrides: -------------------------------------------------------------------------------- 1 | # That is the aim of this package to be able to install matomo through the Matomo "debian" repository 2 | # We could request users to do it by hand, some will have already do. 3 | matomo: package-installs-apt-keyring etc/apt/trusted.gpg.d/matomo-keyring-automatic.gpg 4 | 5 | # Matomo is a Web application that provide its needed javascript library, not as good as using debian ones but complying with their requested version 6 | matomo: embedded-javascript-library usr/share/matomo/libs/jqplot/excanvas.min.js please use libjs-excanvas 7 | matomo: embedded-javascript-library usr/share/matomo/node_modules/jquery-mousewheel/jquery.mousewheel.js please use libjs-jquery-mousewheel 8 | matomo: embedded-javascript-library usr/share/matomo/node_modules/jquery-ui-dist/jquery-ui.min.css please use libjs-jquery-ui 9 | matomo: embedded-javascript-library usr/share/matomo/node_modules/jquery-ui-dist/jquery-ui.min.js please use libjs-jquery-ui 10 | matomo: embedded-javascript-library usr/share/matomo/node_modules/jquery/dist/jquery.min.js please use libjs-jquery 11 | matomo: embedded-javascript-library usr/share/matomo/plugins/UserCountryMap/javascripts/vendor/raphael.min.js please use libjs-raphael 12 | 13 | # Matomo is a Web application that provide its needed php library, not as good as using debian ones but complying with their requested version 14 | matomo: embedded-php-library usr/share/matomo/core/Visualization/Sparkline.php please use libsparkline-php 15 | matomo: embedded-php-library usr/share/matomo/plugins/CoreVisualizations/Visualizations/Sparkline.php please use libsparkline-php 16 | matomo: embedded-php-library usr/share/matomo/vendor/davaxi/sparkline/src/Sparkline.php please use libsparkline-php 17 | matomo: embedded-php-library usr/share/matomo/vendor/matomo/decompress/libs/PclZip/pclzip.lib.php please use libphp-pclzip 18 | 19 | # Matomo is a Web application that provide its needed font, not as good as using debian ones but complying with their requested version 20 | matomo: duplicate-font-file usr/share/matomo/plugins/ImageGraph/fonts/tahoma.ttf also in fonts-wine 21 | 22 | # Matomo core is GPL 3. Matomo rely on vendor libraries and try to verify their licence comply with the opensource Matomo nature. 23 | # For this package to get one day in the main debian repository, all licences should be mentionned in debian/copyright. 24 | matomo: extra-license-file usr/share/matomo/libs/Authenticator/LICENSE.md 25 | matomo: extra-license-file usr/share/matomo/misc/log-analytics/LICENSE.txt 26 | matomo: extra-license-file usr/share/matomo/node_modules/angular-animate/LICENSE.md 27 | matomo: extra-license-file usr/share/matomo/node_modules/angular-cookies/LICENSE.md 28 | matomo: extra-license-file usr/share/matomo/node_modules/angular-mocks/LICENSE.md 29 | matomo: extra-license-file usr/share/matomo/node_modules/angular-sanitize/LICENSE.md 30 | matomo: extra-license-file usr/share/matomo/node_modules/angular/LICENSE.md 31 | matomo: extra-license-file usr/share/matomo/node_modules/chroma-js/LICENSE 32 | matomo: extra-license-file usr/share/matomo/node_modules/iframe-resizer/LICENSE 33 | matomo: extra-license-file usr/share/matomo/node_modules/jquery-mousewheel/LICENSE.txt 34 | matomo: extra-license-file usr/share/matomo/node_modules/jquery-ui-dist/LICENSE.txt 35 | matomo: extra-license-file usr/share/matomo/node_modules/jquery.dotdotdot/LICENSE.txt 36 | matomo: extra-license-file usr/share/matomo/node_modules/jquery.scrollto/LICENSE 37 | matomo: extra-license-file usr/share/matomo/node_modules/jquery/LICENSE.txt 38 | matomo: extra-license-file usr/share/matomo/node_modules/materialize-css/LICENSE 39 | matomo: extra-license-file usr/share/matomo/node_modules/mousetrap/LICENSE 40 | matomo: extra-license-file usr/share/matomo/node_modules/qrcodejs2/LICENSE 41 | matomo: extra-license-file usr/share/matomo/node_modules/sprintf-js/LICENSE 42 | matomo: extra-license-file usr/share/matomo/node_modules/visibilityjs/LICENSE 43 | matomo: extra-license-file usr/share/matomo/plugins/CorePluginsAdmin/templates/license.twig 44 | matomo: extra-license-file usr/share/matomo/plugins/TagManager/LICENSE 45 | matomo: extra-license-file usr/share/matomo/vendor/composer/LICENSE 46 | matomo: extra-license-file usr/share/matomo/vendor/composer/ca-bundle/LICENSE 47 | matomo: extra-license-file usr/share/matomo/vendor/composer/semver/LICENSE 48 | matomo: extra-license-file usr/share/matomo/vendor/davaxi/sparkline/LICENSE 49 | matomo: extra-license-file usr/share/matomo/vendor/geoip2/geoip2/LICENSE 50 | matomo: extra-license-file usr/share/matomo/vendor/matomo/cache/LICENSE 51 | matomo: extra-license-file usr/share/matomo/vendor/matomo/decompress/LICENSE 52 | matomo: extra-license-file usr/share/matomo/vendor/matomo/device-detector/LICENSE 53 | matomo: extra-license-file usr/share/matomo/vendor/matomo/ini/LICENSE 54 | matomo: extra-license-file usr/share/matomo/vendor/matomo/matomo-php-tracker/LICENSE 55 | matomo: extra-license-file usr/share/matomo/vendor/matomo/network/LICENSE 56 | matomo: extra-license-file usr/share/matomo/vendor/matomo/searchengine-and-social-list/LICENSE 57 | matomo: extra-license-file usr/share/matomo/vendor/maxmind-db/reader/LICENSE 58 | matomo: extra-license-file usr/share/matomo/vendor/maxmind/web-service-common/LICENSE 59 | matomo: extra-license-file usr/share/matomo/vendor/opis/closure/LICENSE 60 | matomo: extra-license-file usr/share/matomo/vendor/php-di/phpdoc-reader/LICENSE 61 | matomo: extra-license-file usr/share/matomo/vendor/phpmailer/phpmailer/LICENSE 62 | matomo: extra-license-file usr/share/matomo/vendor/psr/container/LICENSE 63 | matomo: extra-license-file usr/share/matomo/vendor/symfony/polyfill-ctype/LICENSE 64 | matomo: extra-license-file usr/share/matomo/vendor/symfony/polyfill-mbstring/LICENSE 65 | matomo: extra-license-file usr/share/matomo/vendor/szymach/c-pchart/LICENSE 66 | matomo: extra-license-file usr/share/matomo/vendor/tedivm/jshrink/LICENSE 67 | matomo: extra-license-file usr/share/doc/matomo/LICENSE.gz 68 | matomo: extra-license-file usr/share/matomo/js/LICENSE.txt 69 | matomo: extra-license-file usr/share/matomo/libs/Zend/LICENSE.txt 70 | matomo: extra-license-file usr/share/matomo/libs/jqplot/gpl-2.0.txt 71 | matomo: extra-license-file usr/share/matomo/vendor/monolog/monolog/LICENSE 72 | matomo: extra-license-file usr/share/matomo/vendor/mustangostang/spyc/COPYING 73 | matomo: extra-license-file usr/share/matomo/vendor/pear/console_getopt/LICENSE 74 | matomo: extra-license-file usr/share/matomo/vendor/pear/pear_exception/LICENSE 75 | matomo: extra-license-file usr/share/matomo/vendor/php-di/invoker/LICENSE 76 | matomo: extra-license-file usr/share/matomo/vendor/php-di/php-di/LICENSE 77 | matomo: extra-license-file usr/share/matomo/vendor/psr/log/LICENSE 78 | matomo: extra-license-file usr/share/matomo/vendor/symfony/console/Symfony/Component/Console/LICENSE 79 | matomo: extra-license-file usr/share/matomo/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE 80 | matomo: extra-license-file usr/share/matomo/vendor/symfony/monolog-bridge/Symfony/Bridge/Monolog/LICENSE 81 | matomo: extra-license-file usr/share/matomo/vendor/tecnickcom/tcpdf/LICENSE.TXT 82 | matomo: extra-license-file usr/share/matomo/vendor/twig/twig/LICENSE 83 | matomo: extra-license-file usr/share/matomo/vendor/wikimedia/less.php/LICENSE 84 | matomo: extra-license-file usr/share/matomo/vendor/matomo/doctrine-cache-fork/LICENSE 85 | matomo: extra-license-file usr/share/matomo/vendor/symfony/polyfill-iconv/LICENSE 86 | matomo: extra-license-file usr/share/matomo/vendor/lox/xhprof/LICENSE 87 | 88 | # That is the aim of Matomo to provide an opensource tracker alternative to Google or others 89 | matomo: privacy-breach-piwik usr/share/matomo/js/piwik.js (choke on: 'settrackerurl') 90 | matomo: privacy-breach-piwik usr/share/matomo/js/piwik.min.js (choke on: "settrackerurl") 91 | matomo: privacy-breach-piwik usr/share/matomo/matomo.js (choke on: "settrackerurl") 92 | matomo: privacy-breach-piwik usr/share/matomo/piwik.js (choke on: "settrackerurl") 93 | 94 | # Matomo use it's own bug numbers 95 | matomo: improbable-bug-number-in-closes 96 | 97 | # Change/reset permission on /var/lib/matomo/data/tmp to www-data 0755/0644 98 | matomo: recursive-privilege-change postinst:14 99 | matomo: recursive-privilege-change postinst:15 100 | matomo: recursive-privilege-change postinst:16 101 | 102 | # Rules added specifically for 4.1.0 103 | matomo: script-not-executable usr/share/matomo/vendor/wikimedia/less.php/bin/lessc 104 | -------------------------------------------------------------------------------- /debian/matomo.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Source debconf library. 6 | . /usr/share/debconf/confmodule 7 | db_version 2.0 || { echo "$0: needs DebConf 2.0 or later"; exit 1; } 8 | 9 | # fix dir permission if needed 10 | if ! dpkg-statoverride --list /var/lib/matomo/data/tmp >/dev/null; then 11 | if [ -d /var/lib/matomo/data/tmp ]; then 12 | # if a site is busy, the cache files may appear/disappear when the commands below are running 13 | # which would create a false positive failure. So trying to avoid that situation. 14 | chown -R www-data:www-data /var/lib/matomo/data/tmp 2>/dev/null || true 15 | find /var/lib/matomo/data/tmp -type d -exec chmod 755 {} \; 2> /dev/null || true 16 | find /var/lib/matomo/data/tmp -type f -exec chmod 644 {} \; 2> /dev/null || true 17 | fi 18 | else 19 | echo " * Skipped permission changes in /var/lib/matomo/data/tmp according to 'dpkg'" 20 | fi 21 | 22 | if ! dpkg-statoverride --list /etc/matomo >/dev/null; then 23 | chgrp www-data /etc/matomo 24 | chgrp www-data /etc/matomo/*.php 25 | 26 | chmod 0775 /etc/matomo 27 | chmod 0644 /etc/matomo/*.conf 28 | chmod 0664 /etc/matomo/*.php 29 | else 30 | echo " * Skipped permission changes in /etc/matomo according to 'dpkg'" 31 | fi 32 | 33 | if ! dpkg-statoverride --list /var/log/matomo >/dev/null; then 34 | chown www-data /var/log/matomo 35 | else 36 | echo " * Skipped permission changes in /var/log/matomo according to 'dpkg'" 37 | fi 38 | 39 | if ! dpkg-statoverride --list /usr/share/matomo/misc/user >/dev/null; then 40 | chown root:www-data /usr/share/matomo/misc/user 41 | chmod 0775 /usr/share/matomo/misc/user 42 | else 43 | echo " * Skipped permission changes in /usr/share/matomo/misc/user according to 'dpkg'" 44 | fi 45 | 46 | 47 | if which lighty-enable-mod >/dev/null 2>&1 ; 48 | then 49 | if [ ! -f /etc/lighttpd/conf-available/50-matomo.conf ]; 50 | then 51 | ln -s /etc/matomo/lighttpd.conf /etc/lighttpd/conf-available/50-matomo.conf 52 | invoke-rc.d lighttpd reload 2>/dev/null || true 53 | fi 54 | echo " * Check Matomo web configuration in /etc/lighttpd/conf-available/50-matomo.conf" 55 | fi 56 | 57 | # debian 8 and above 58 | if [ -e /usr/share/apache2/apache2-maintscript-helper ]; 59 | then 60 | . /usr/share/apache2/apache2-maintscript-helper 61 | if [ -e "/etc/apache2/conf.d/matomo.conf" ] && [ ! -e "/etc/apache2/conf-available/matomo.conf" ]; 62 | then 63 | echo " * Migrating previous '/etc/apache2/conf.d/matomo.conf' to '/etc/apache2/conf-available/matomo.conf'" 64 | mv /etc/apache2/conf.d/matomo.conf /etc/apache2/conf-available/matomo.conf 65 | # the conf is enabled since it was debian 7 default behavior 66 | apache2_invoke enconf matomo.conf || exit $? 67 | else 68 | if [ ! -e /etc/apache2/conf-available/matomo.conf ]; 69 | then 70 | ln -s /etc/matomo/apache.conf /etc/apache2/conf-available/matomo.conf 71 | apache2_invoke enconf matomo.conf || exit $? 72 | fi 73 | echo " * Check Matomo web configuration in /etc/apache2/conf-available/matomo.conf" 74 | fi 75 | fi 76 | 77 | # Piwik to Matomo configuration migration 78 | if [ -d "/etc/piwik.orig" ] 79 | then 80 | if [ -e "/etc/piwik.orig/config.ini.php" ] && [ ! -e "/etc/matomo/config.ini.php" ] 81 | then 82 | echo " * Copying Piwik configuration (/etc/piwik.orig/config.ini.php) to Matomo configuration folder (/etc/matomo/)" 83 | cp -pd "/etc/piwik.orig/config.ini.php" "/etc/matomo/config.ini.php" 84 | fi 85 | fi 86 | 87 | echo " * Matomo main configuration files are stored in /etc/matomo/" 88 | echo " * Matomo crontab file is stored in /etc/cron.d/matomo-archive" 89 | echo " * When installing/using matomo, make sure you disable any ads blocker" 90 | 91 | if [ -e "/usr/share/matomo/config/config.ini.php" ]; then 92 | # Regenerating .htaccess files reflecting last Matomo version will (shouldn't hurt nginx as stated in the documentation) 93 | echo " * Please wait while Matomo is upgrading web server configuration files..." 94 | echo " (cf. https://matomo.org/faq/troubleshooting/how-do-i-fix-the-error-private-directories-are-accessible/)" 95 | php /usr/share/matomo/console core:create-security-files 96 | fi 97 | 98 | db_get matomo/automatic-upgrade || true 99 | if [ "$RET" = "true" ]; then 100 | if [ -e "/usr/share/matomo/config/config.ini.php" ]; then 101 | # it's safe to assume an admin has configured matomo 102 | # so an upgrade should be doable 103 | echo " * Please wait while Matomo is upgrading database..." 104 | php /usr/share/matomo/console core:update --yes 105 | else 106 | echo " * Automatic upgrade not perform as Matomo doesn't seem to be installed." 107 | echo " * Have you configured it yet?" 108 | fi 109 | else 110 | echo " * To finish Matomo's upgrade, please run: /usr/bin/php /usr/share/matomo/console core:update" 111 | fi 112 | 113 | if [ -e "/usr/share/matomo/config/config.ini.php" ]; then 114 | echo " * If upgrading, visit index.php?module=Installation&action=systemCheckPage to check and manage your plugins." 115 | fi 116 | 117 | if [ ! -e "/usr/share/matomo/config/config.ini.php" ]; then 118 | echo " * Go to /etc/matomo and finish Apache or NGINX configuration." 119 | echo " Then visit this matomo site you have just set to finish the installation." 120 | fi 121 | 122 | #DEBHELPER# 123 | 124 | exit 0 125 | -------------------------------------------------------------------------------- /debian/matomo.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | ## Remove symlink previous created. 5 | 6 | if [ "$1" = "remove" ] || [ "$1" = "purge" ]; 7 | then 8 | 9 | if [ -L /etc/lighttpd/conf-available/50-matomo.conf ]; 10 | then 11 | rm -f /etc/lighttpd/conf-available/50-matomo.conf 12 | invoke-rc.d lighttpd reload 3>/dev/null || true 13 | fi 14 | 15 | if [ -e /usr/share/apache2/apache2-maintscript-helper ]; 16 | then 17 | . /usr/share/apache2/apache2-maintscript-helper 18 | apache2_invoke disconf matomo.conf || exit $? 19 | rm -f /etc/apache2/conf-available/matomo.conf 20 | fi 21 | fi 22 | 23 | #DEBHELPER# 24 | -------------------------------------------------------------------------------- /debian/matomo.preinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | # Before installing Matomo (ie: not an 'upgrade', we check if Piwik is already present 5 | # and if it is, we move its configuration folder in a safe location (/etc/piwik.orid "/etc/piwik.orig 6 | # this will allow Matomo to deploy correctly 7 | 8 | if [ "$1" = "install" ] 9 | then 10 | if [ -d "/etc/piwik" ] && [ ! -e "/etc/piwik.orig" ]; then 11 | echo " * Piwik is now Matomo. Matomo configuration files are stored in /etc/matomo/" 12 | 13 | echo " * Piwik has been previously installed on this system and its configuration folder" 14 | echo " * remains. We're moving Piwik configuration folder from '/etc/piwik' to '/etc/piwik.orig'" 15 | echo " * so this package can install correctly." 16 | 17 | echo " * Review the configuration changes accordingly." 18 | 19 | mv "/etc/piwik" "/etc/piwik.orig" 20 | 21 | OBSOLETE_CONFS="/etc/lighttpd/conf-available/50-piwik.conf /etc/apache2/conf.d/piwik.conf /etc/apache2/conf-available/piwik.conf" 22 | for C in $OBSOLETE_CONFS; do 23 | if [ -e "$C" ]; then 24 | echo " * Found obsolete configuration file related to Piwik in $C" 25 | fi 26 | done 27 | fi 28 | fi 29 | 30 | #DEBHELPER# 31 | -------------------------------------------------------------------------------- /debian/matomo.prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | ## Delete manually these directories because they are not empty and dpkg fails 5 | 6 | if [ "$1" = "remove" ]; 7 | then 8 | rm -rf /var/lib/matomo 9 | rm -rf /usr/share/matomo/config 10 | fi 11 | 12 | if [ "$1" = "upgrade" ]; 13 | then 14 | rm -rf /var/lib/matomo/data/tmp/templates_c/* 15 | fi 16 | 17 | 18 | #DEBHELPER# 19 | -------------------------------------------------------------------------------- /debian/po/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matomo-org/matomo-package/b85ea252badc817b5abf952f8c5a67dd17f41e8a/debian/po/.gitkeep -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | #export DH_VERBOSE=1 4 | 5 | d = debian/matomo 6 | 7 | %: 8 | dh $@ 9 | 10 | build: build-stamp 11 | build-stamp: 12 | @rm -f debian/files 13 | @dh_testdir 14 | 15 | clean: 16 | @dh_testdir 17 | @dh_testroot 18 | @dh_prep 19 | @$(MAKE) clean 20 | 21 | install: build 22 | @dh_testdir 23 | @dh_testroot 24 | @dh_prep 25 | @dh_installdirs 26 | @$(MAKE) checkfetch DESTDIR=$(CURDIR)/$d 27 | @$(MAKE) cleanup DESTDIR=$(CURDIR)/$d 28 | @$(MAKE) checkconfig DESTDIR=$(CURDIR)/$d 29 | @$(MAKE) checkmatomoinstall DESTDIR=$(CURDIR)/$d 30 | @$(MAKE) checkmatomorootdir DESTDIR=$(CURDIR)/$d 31 | @dh_install 32 | @dh_lintian 33 | @dh_link 34 | 35 | 36 | # build architecture-independent files 37 | binary-indep: build install 38 | @dh_testdir 39 | @dh_testroot 40 | @dh_installdirs -i 41 | @dh_install -i 42 | @dh_installcron 43 | @dh_installchangelogs 44 | @dh_installdocs 45 | @dh_installdebconf 46 | @dh_compress 47 | @dh_link 48 | @dh_fixperms 49 | @$(MAKE) fixperms DESTDIR=$(CURDIR)/$d 50 | @$(MAKE) fixsettings DESTDIR=$(CURDIR)/$d 51 | @$(MAKE) checklintianlic DESTDIR=$(CURDIR)/$d 52 | @$(MAKE) checklintianextralibs DESTDIR=$(CURDIR)/$d 53 | @$(MAKE) manifest DESTDIR=$(CURDIR)/$d 54 | @dh_installdeb 55 | @dh_gencontrol 56 | @dh_md5sums 57 | @dh_builddeb 58 | 59 | # build architecture-dependent files 60 | binary-arch: build install 61 | 62 | binary: binary-indep binary-arch 63 | .PHONY: build clean binary-indep binary-arch binary install 64 | -------------------------------------------------------------------------------- /debian/scripts/githelp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$1" = "commitrelease" ] 4 | then 5 | if [ ! -r "debian/changelog" ] 6 | then 7 | echo "Cannot read debian/changelog" 8 | exit 1 9 | fi 10 | 11 | if git status --short . | grep -v 'debian/changelog' 12 | then 13 | echo "One or more files needs to be committed" 14 | exit 1 15 | else 16 | RELEASE=$(head -n 1 debian/changelog | sed 's/[()]//g' | awk '{print $2}') 17 | git commit -S -m "$(head -n 1 debian/changelog)" debian/changelog 18 | git tag --sign -m "release ${RELEASE}" "${RELEASE}" 19 | 20 | fi 21 | fi 22 | -------------------------------------------------------------------------------- /debian/scripts/history.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # warning: this script tries to deal with UTF-8 aliens (not gremlins) 4 | # this means some UTF-8 entities are replaced on the fly so recode doesn't 5 | # complain during the intermediate conversion steps. 6 | # note: I'm quite unsure as to why some characters aren't converted nicely 7 | # compared to others as FF seems to display them correctly. Feedback and help 8 | # welcome. 9 | 10 | # this is a regexp for sed. 11 | # http://www.ascii.cl/htmlcodes.htm 12 | UTF8_ALIENS='s/#8243/#8221/g; s/#8211/#45/g; s/#8216/#39/g; s/#8242/#39/g;' 13 | 14 | if [ -z "$1" ] || [ ! -f "debian/changelog" ] 15 | then 16 | exit 1 17 | fi 18 | 19 | if [ ! -z "$3" ] && [ "$3" = "--test" ] 20 | then 21 | echo "Test mode enabled, not adding entries to debian/changelog" 22 | TEST_MODE=1 23 | else 24 | TEST_MODE=0 25 | fi 26 | 27 | if [ ! -x /usr/bin/recode ] 28 | then 29 | echo "You need to install 'recode' (apt-get install recode -V -y)" 30 | exit 1 31 | fi 32 | 33 | #EG Remove last control on version to be more permisive 34 | #CHANGELOG_URL=$(wget -O - -q 'https://matomo.org/changelog/' | grep "Matomo $1" | sed 's/.*href=\([^>]*\).*/\1/' | sed -e 's/"//g' -e "s/'//g" | grep ^http | grep "$1/") 35 | CHANGELOG_URL=$(wget -O - -q 'https://matomo.org/changelog/' | grep "Matomo.* $1" | sed 's/.*href=\([^>]*\).*/\1/' | sed -e 's/"//g' -e "s/'//g" | grep ^http) 36 | 37 | if ! echo "$CHANGELOG_URL" | grep --quiet --ignore-case http 38 | then 39 | echo "Cannot find changelog url" 40 | exit 2 41 | fi 42 | 43 | echo "Changelog url found at $CHANGELOG_URL" 44 | 45 | wget -O - -q "$CHANGELOG_URL" | \ 46 | sed -n "/List of.*in Matomo $2.*>$/,/<\/ul>/p;" | \ 47 | grep -e 'dev.matomo.org/trac/ticket' -e 'github.com/matomo-org' | \ 48 | sed -e :a -e 's/<[^>]*>//g;/