- Update to 5.1.1
OBS-URL: https://build.opensuse.org/package/show/network:utilities/matomo?expand=0&rev=130
This commit is contained in:
commit
aae7a13091
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
3
matomo-5.0.3.tar.gz
Normal file
3
matomo-5.0.3.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cd656ee7df4b29ac453456c6b9708d8264093ac2c99d6669d2830f31624cd626
|
||||
size 21130963
|
3
matomo-5.1.1.tar.gz
Normal file
3
matomo-5.1.1.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c62e91f4efe93b106081aebec30ab38b00ca2bb43522ca6576fc60fb49a975e4
|
||||
size 21356213
|
65
matomo-README.SUSE
Normal file
65
matomo-README.SUSE
Normal file
@ -0,0 +1,65 @@
|
||||
a) mariadb/mysql
|
||||
$ mysql -u adminusername -p
|
||||
mysql> CREATE DATABASE _matomo_db_name_here_;
|
||||
mysql> CREATE USER 'matomo'@'localhost' IDENTIFIED BY '_password_';
|
||||
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON _matomo_db_name_here_.* TO 'matomo'@'localhost';
|
||||
|
||||
Replace _matomo_db_name_here_ with the name of your MySQL database (if possible, this database should only have the Matomo tables installed).
|
||||
Replace _password_ with your password.
|
||||
|
||||
b) apache
|
||||
In /etc/apache2/conf.d/matomo.conf you must insert your domain.
|
||||
|
||||
Apache22: Allow from .mydomain.de
|
||||
Apache24: Require host mydomain.de
|
||||
|
||||
Enable needed modules:
|
||||
~# for module in php7 headers setenvif ; do
|
||||
~# /usr/sbin/a2enmod $module
|
||||
~# done
|
||||
|
||||
If you also want to enable compression, just enable the following modules as well:
|
||||
~# /usr/sbin/a2enmod deflate
|
||||
~# /usr/sbin/a2enmod filter
|
||||
|
||||
And then restart or reload apache
|
||||
|
||||
~# /usr/bin/systemctl restart apache2
|
||||
|
||||
c) installer
|
||||
Go to http://www.mydomain.de/matomo/
|
||||
|
||||
At mysql-setup use mysqli not pod.
|
||||
|
||||
|
||||
d) Attention:
|
||||
You must disable caching for matomo.
|
||||
|
||||
Example for APC
|
||||
you can insert php_flag apc.cache_by_default Off in /etc/apache2/conf.d/matomo.conf like:
|
||||
|
||||
<Directory "/srv/www/matomo">
|
||||
AllowOverride All
|
||||
Options FollowSymLinks
|
||||
|
||||
php_flag apc.cache_by_default Off
|
||||
|
||||
<IfModule mod_authz_core.c>
|
||||
...
|
||||
|
||||
e) php
|
||||
To prevent some critical issue, you must set the following in your php.ini file:
|
||||
always_populate_raw_post_data=-1
|
||||
After making this change, restart your web server
|
||||
|
||||
f) auto archiving
|
||||
For autoarchiving you have two options.
|
||||
With cron or with systemd.timer.
|
||||
For cron you must uncomment the line in /etc/cron.d/matomo-archive
|
||||
For systemd.timer you must start and enable matomo-archive.timer:
|
||||
~# /usr/bin/systemctl enable --now matomo-archive.timer
|
||||
|
||||
g) Enable infile
|
||||
- GRANT FILE ON *.* TO '<your_matomo_user>'@'localhost'
|
||||
- usermod -a -G www mysql
|
||||
- systemctl restart mysql apache2
|
9
matomo-archive.cron
Normal file
9
matomo-archive.cron
Normal file
@ -0,0 +1,9 @@
|
||||
#
|
||||
# cron for matomo Auto-Archiving of Your Reports
|
||||
#
|
||||
|
||||
# without CLI
|
||||
#-5 * * * * @APACHE_USER@ /usr/bin/php @APACHE_SERVERROOT@/matomo/misc/cron/archive.php --url=http://localhost/matomo/ > /var/log/matomo/matomo-archive.log
|
||||
|
||||
# with CLI
|
||||
-5 * * * * @APACHE_USER@ /usr/bin/php @APACHE_SERVERROOT@/matomo/console core:archive --url=http://localhost/matomo/ > /var/log/matomo/matomo-archive.log
|
10
matomo-archive.service
Normal file
10
matomo-archive.service
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Auto-Archiving of matomo Reports
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=@APACHE_USER@
|
||||
Group=@APACHE_GROUP@
|
||||
ExecStart=/bin/bash -ce "/usr/bin/php @APACHE_SERVERROOT@/matomo/console core:archive --url=http://localhost/matomo/ >> /var/log/matomo/matomo-archive.log 2>&1"
|
||||
#StandardOutput=file:/var/log/matomo/matomo-archive.log
|
||||
#StandardError=file:/var/log/matomo/matomo-archive.log
|
10
matomo-archive.timer
Normal file
10
matomo-archive.timer
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Auto-Archiving of matomo Reports
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* *:05:00
|
||||
AccuracySec=12h
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
17
matomo-package_update.patch
Normal file
17
matomo-package_update.patch
Normal file
@ -0,0 +1,17 @@
|
||||
Index: matomo/plugins/CoreUpdater/Commands/Update.php
|
||||
===================================================================
|
||||
--- matomo.orig/plugins/CoreUpdater/Commands/Update.php
|
||||
+++ matomo/plugins/CoreUpdater/Commands/Update.php
|
||||
@@ -79,7 +79,12 @@ class Update extends ConsoleCommand
|
||||
$this->writeSuccessMessage(array(Piwik::translate('CoreUpdater_DbUpgradeNotExecuted')));
|
||||
}
|
||||
|
||||
+ // Only show if autoupdate is enabled. Don't show if update through distribution package update.
|
||||
+ $enableAutoUpdate = (bool) Config::getInstance()->General['enable_auto_update'];
|
||||
+ if ($enableAutoUpdate === true){
|
||||
$this->writeAlertMessageWhenCommandExecutedWithUnexpectedUser();
|
||||
+ }
|
||||
+
|
||||
} catch (NoUpdatesFoundException $e) {
|
||||
// Do not fail if no updates were found
|
||||
$this->writeSuccessMessage(array($e->getMessage()));
|
2
matomo-tmpfile.conf
Normal file
2
matomo-tmpfile.conf
Normal file
@ -0,0 +1,2 @@
|
||||
# setting PHP's session.save_path to this directory
|
||||
d /run/matomo_sessions 0750 wwwrun www -
|
2741
matomo.changes
Normal file
2741
matomo.changes
Normal file
File diff suppressed because it is too large
Load Diff
117
matomo.conf
Normal file
117
matomo.conf
Normal file
@ -0,0 +1,117 @@
|
||||
Alias /matomo "__matomo_web__"
|
||||
|
||||
<Directory "__matomo_web__">
|
||||
AllowOverride All
|
||||
Options FollowSymLinks
|
||||
<IfModule mod_authz_core.c>
|
||||
# Apache 2.4
|
||||
Require all granted
|
||||
</IfModule>
|
||||
<IfModule !mod_authz_core.c>
|
||||
# Apache 2.2
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</IfModule>
|
||||
|
||||
|
||||
<IfModule mod_authz_core.c>
|
||||
# Apache 2.4
|
||||
|
||||
<Files "*">
|
||||
Require host 127.0.0.1
|
||||
# Require ip 128.252.135.
|
||||
# Require host mydomain.com
|
||||
# Require host host.mydomain.com
|
||||
</Files>
|
||||
|
||||
<Files ~ "^matomo\.(js|php)|^piwik\.(js|php)|robots\.txt$|index\.php$">
|
||||
Require all granted
|
||||
</Files>
|
||||
|
||||
<Files "archive.php">
|
||||
Require all granted
|
||||
</Files>
|
||||
|
||||
</IfModule>
|
||||
|
||||
|
||||
<IfModule !mod_authz_core.c>
|
||||
# Apache 2.2
|
||||
|
||||
<Files "*">
|
||||
Order deny, allow
|
||||
Deny from all
|
||||
Allow from 127.0.0.1
|
||||
# Allow from 128.252.135.
|
||||
# Allow from .mydomain.com
|
||||
# Allow from host.mydomain.com
|
||||
</Files>
|
||||
|
||||
<Files ~ "^matomo\.(js|php)|^piwik\.(js|php)|robots\.txt$|index\.php$">
|
||||
Allow from all
|
||||
Satisfy any
|
||||
</Files>
|
||||
|
||||
<Files "archive.php">
|
||||
Order Allow,Deny
|
||||
Allow from all
|
||||
</Files>
|
||||
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_mime.c>
|
||||
AddType application/x-javascript .js
|
||||
AddType text/css .css
|
||||
</IfModule>
|
||||
<IfModule mod_deflate.c>
|
||||
AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/plain text/xml application/javascript
|
||||
<IfModule mod_setenvif.c>
|
||||
BrowserMatch ^Mozilla/4 gzip-only-text/html
|
||||
BrowserMatch ^Mozilla/4.0[678] no-gzip
|
||||
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
|
||||
</IfModule>
|
||||
</IfModule>
|
||||
Header append Vary User-Agent env=!dont-vary
|
||||
|
||||
<IfModule mod_php7.c>
|
||||
# improved security
|
||||
php_admin_value open_basedir "__matomo_web__:__matomo_conf__:__matomo_log__:/tmp:/usr/bin:/var/cache/apache2:/run/matomo_sessions"
|
||||
php_admin_flag display_startup_errors Off
|
||||
php_admin_flag display_errors Off
|
||||
php_admin_flag file_uploads Off
|
||||
php_admin_flag allow_url_fopen Off
|
||||
php_admin_value upload_tmp_dir "/var/cache/apache2"
|
||||
php_admin_value session.save_path "/run/matomo_sessions/"
|
||||
php_admin_value disable_functions "posix_setpgid,exec,ftp_login,mysql_pconnect,apache_setenv,popen,posix_getpwuid,posix_setsid,passthru,escapeshellcmd,ini_alter,ftp_raw,ftp_nb_fput,ini_restore,shell_exec,ftp_get,proc_get_status,highlight_file,proc_close,proc_terminate,syslog,ftp_connect,posix_uname,ini_get_all,proc_open,posix_kill,escapeshellarg,ftp_rawlist,posix_setuid,openlog,php_uname,system,ftp_exec,posix_mkfifo,proc_nice,ftp_put"
|
||||
php_admin_value memory_limit "1024M"
|
||||
php_admin_value max_execution_time 120
|
||||
</IfModule>
|
||||
<IfModule mod_php8.c>
|
||||
# improved security
|
||||
php_admin_value open_basedir "__matomo_web__:__matomo_conf__:__matomo_log__:/tmp:/usr/bin:/var/cache/apache2:/run/matomo_sessions"
|
||||
php_admin_flag display_startup_errors Off
|
||||
php_admin_flag display_errors Off
|
||||
php_admin_flag file_uploads Off
|
||||
php_admin_flag allow_url_fopen Off
|
||||
php_admin_value upload_tmp_dir "/var/cache/apache2"
|
||||
php_admin_value session.save_path "/run/matomo_sessions/"
|
||||
php_admin_value disable_functions "posix_setpgid,exec,ftp_login,mysql_pconnect,apache_setenv,popen,posix_getpwuid,posix_setsid,passthru,escapeshellcmd,ini_alter,ftp_raw,ftp_nb_fput,ini_restore,shell_exec,ftp_get,proc_get_status,highlight_file,proc_close,proc_terminate,syslog,ftp_connect,posix_uname,ini_get_all,proc_open,posix_kill,escapeshellarg,ftp_rawlist,posix_setuid,openlog,php_uname,system,ftp_exec,posix_mkfifo,proc_nice,ftp_put"
|
||||
php_admin_value memory_limit "1024M"
|
||||
php_admin_value max_execution_time 120
|
||||
</IfModule>
|
||||
|
||||
|
||||
</Directory>
|
||||
|
||||
|
||||
<Directory "__matomo_web__/vendor/tecnickcom/tcpdf/tools">
|
||||
<IfModule mod_authz_core.c>
|
||||
# Apache 2.4
|
||||
Require all denied
|
||||
</IfModule>
|
||||
<IfModule !mod_authz_core.c>
|
||||
# Apache 2.2
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
||||
</Directory>
|
10
matomo.logrotate
Normal file
10
matomo.logrotate
Normal file
@ -0,0 +1,10 @@
|
||||
/var/log/matomo/matomo-archive.log
|
||||
{
|
||||
su @APACHE_USER@ @APACHE_GROUP@
|
||||
rotate 30
|
||||
daily
|
||||
missingok
|
||||
notifempty
|
||||
delaycompress
|
||||
compress
|
||||
}
|
3
matomo.my.cnf
Normal file
3
matomo.my.cnf
Normal file
@ -0,0 +1,3 @@
|
||||
# for Matomo
|
||||
[mysqld]
|
||||
max_allowed_packet = 64MB
|
10
matomo.rpmlintrc
Normal file
10
matomo.rpmlintrc
Normal file
@ -0,0 +1,10 @@
|
||||
# Output filters
|
||||
addFilter("hidden-file-or-dir")
|
||||
addFilter("macro-in-comment")
|
||||
addFilter("suse-missing-rclink matomo-archive")
|
||||
addFilter("zero-length /srv/www/matomo/plugins/Morpheus/stylesheets/base/font.css")
|
||||
addFilter("pem-certificate")
|
||||
addFilter("non-conffile-in-etc /etc/matomo/environment/dev.php")
|
||||
addFilter("non-conffile-in-etc /etc/matomo/environment/test.php")
|
||||
addFilter("non-conffile-in-etc /etc/matomo/environment/ui-test.php")
|
||||
addFilter("explicit-lib-dependency php-zlib")
|
245
matomo.spec
Normal file
245
matomo.spec
Normal file
@ -0,0 +1,245 @@
|
||||
#
|
||||
# spec file for package matomo
|
||||
#
|
||||
# Copyright (c) 2020 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
# See also http://en.opensuse.org/openSUSE:Specfile_guidelines
|
||||
|
||||
%{!?_tmpfilesdir:%global _tmpfilesdir %{_prefix}/lib/tmpfiles.d}
|
||||
|
||||
Name: matomo
|
||||
Version: 5.1.1
|
||||
Release: 0
|
||||
Summary: Web analytics platform
|
||||
License: GPL-3.0-or-later
|
||||
Group: Productivity/Networking/Web/Utilities
|
||||
URL: http://matomo.org/
|
||||
Source0: http://builds.matomo.org/%{name}-%{version}.tar.gz
|
||||
Source2: %{name}.conf
|
||||
Source3: %{name}.logrotate
|
||||
Source4: %{name}-README.SUSE
|
||||
Source10: %{name}-archive.cron
|
||||
Source11: %{name}-archive.service
|
||||
Source12: %{name}-archive.timer
|
||||
Source13: %{name}.my.cnf
|
||||
Source14: %{name}-tmpfile.conf
|
||||
Source99: %{name}.rpmlintrc
|
||||
# PATCH-FIX-OPENSUSE: Don't show wrong message with wrong owner of %%{apache_serverroot}/%%{name} when disable enable_auto_update through package installation.
|
||||
Patch1: %{name}-package_update.patch
|
||||
BuildArch: noarch
|
||||
%if 0%{?suse_version} >= 1500
|
||||
Requires(pre): user(wwwrun)
|
||||
Requires(pre): group(www)
|
||||
%else
|
||||
Requires(pre): aaa_base
|
||||
%endif
|
||||
BuildRequires: apache-rpm-macros
|
||||
BuildRequires: cron
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: logrotate
|
||||
BuildRequires: mariadb
|
||||
BuildRequires: unzip
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
Requires: nodejs
|
||||
Requires: python3
|
||||
Requires: logrotate
|
||||
Requires: php-ctype
|
||||
Requires: php-curl
|
||||
Requires: php-dom
|
||||
Requires: php-gd
|
||||
Requires: php-iconv
|
||||
# for the upgrade process:
|
||||
Requires(pre): php-json
|
||||
Requires: php-json
|
||||
Requires: php-mbstring
|
||||
Requires: php-mysql
|
||||
Requires: php-pdo
|
||||
#Requires: php-sqlite
|
||||
Requires: php-tokenizer
|
||||
Requires: php-xmlreader
|
||||
Requires: php-xmlwriter
|
||||
Requires: php-zlib
|
||||
Requires(pre): php
|
||||
%{?systemd_requires}
|
||||
Recommends: php-geoip
|
||||
Recommends: php-openssl
|
||||
Recommends: mariadb
|
||||
Recommends: cron
|
||||
Conflicts: piwik
|
||||
|
||||
%description
|
||||
Matomo, formerly Piwik, is a web analytics platform that gives
|
||||
insights into a website's visitors and marketing campaigns, so the
|
||||
strategy and online experience of visitors may be optimized.
|
||||
|
||||
%package apache
|
||||
Summary: Apache configuration for %{name}
|
||||
Group: Productivity/Networking/Web/Utilities
|
||||
BuildRequires: apache2
|
||||
Requires: apache2
|
||||
Requires: mod_php_any >= 7.2.5
|
||||
Recommends: apache2-mod_geoip
|
||||
Supplements: packageand(apache2:%name)
|
||||
|
||||
%description apache
|
||||
This subpackage contains the Apache configuration files
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}
|
||||
%patch -P 1 -p1
|
||||
install -m644 %{SOURCE4} README.SUSE
|
||||
# remove unwanted files
|
||||
find . -type f "(" -name .htaccess -o -name .travis.sh -o -name .gitkeep ")" -delete
|
||||
#find . -name ".git*" -exec rm -Rf "{}" "+"
|
||||
find . -type f "(" -name "*.c" -o -name "*.h" -o -name "*.js.orig" ")" -delete
|
||||
# env-script-interpreter
|
||||
find . -type f -exec sed -i -e 's|\/usr\/bin\/env php|\/usr\/bin\/php|g' {} +
|
||||
find . -type f -name "*.sh" -exec sed -i -e 's|\/usr\/bin\/env bash|\/bin\/bash|g' {} +
|
||||
sed -i 's|python$|python3|' misc/log-analytics/import_logs.py
|
||||
|
||||
#
|
||||
# disable the auto updater, it can't work properly with the new, more secure permissions and is a bad idea on a RPM based setup anyways.
|
||||
#
|
||||
sed -i '/enable_auto_update/s/1$/0/' config/global.ini.php
|
||||
|
||||
#
|
||||
# Fix integrity check triggered from fix of rpmlint errors.
|
||||
# Drop moved files
|
||||
for i in CHANGELOG.md CONTRIBUTING.md PRIVACY.md README.md SECURITY.md LEGALNOTICE LICENSE 'misc\/cron\/.htaccess' 'misc\/How to install Matomo.html' 'vendor\/tecnickcom\/tcpdf\/tools\/.htaccess' 'vendor\/twig\/twig\/ext\/twig\/php_twig.h' 'vendor\/twig\/twig\/ext\/twig\/twig.c' 'js\/piwik.js.orig' '.eslintignore' '.eslintrc.js' '.browserslistrc' 'vendor\/lox\/xhprof\/extension\/php_xhprof.h' 'vendor\/lox\/xhprof\/extension\/xhprof.c'
|
||||
do
|
||||
sed -i "/\W\"${i}\"\W/d" config/manifest.inc.php
|
||||
done
|
||||
# Insert new hashes for chanded files
|
||||
for file in console 'vendor/tecnickcom/tcpdf/tools/tcpdf_addfont.php' 'config/global.ini.php' 'core/CliMulti/Output.php' 'plugins/CoreUpdater/Commands/Update.php' 'vendor/matomo/matomo-php-tracker/run_tests.sh' 'vendor/wikimedia/less.php/bin/lessc' 'misc/log-analytics/import_logs.py' 'core/CliMulti.php' 'vendor/symfony/error-handler/Resources/bin/extract-tentative-return-types.php' 'vendor/symfony/error-handler/Resources/bin/patch-type-declarations' 'vendor/symfony/var-dumper/Resources/bin/var-dump-server'
|
||||
do
|
||||
size=$(ls -l $file | awk '{ print $5 }')
|
||||
checksum=$(md5sum $file | awk '{ print $1 }')
|
||||
file2=$(echo "$file" | sed 's/\//\\\//g')
|
||||
sed -i "/\W\"$file2\"\W/c \"$file\" => array(\"$size\", \"$checksum\")," config/manifest.inc.php
|
||||
done
|
||||
|
||||
%build
|
||||
# nothing to build
|
||||
|
||||
%install
|
||||
# make directories
|
||||
install -d -m0755 %{buildroot}/%{apache_serverroot}/%{name}
|
||||
install -d -m0755 %{buildroot}/%{apache_serverroot}/%{name}/tmp
|
||||
install -d -m0755 %{buildroot}/%{_sysconfdir}/%{name}
|
||||
install -d -m0755 %{buildroot}/%{_defaultdocdir}/%{name}
|
||||
# copy src from build to buildroot
|
||||
mv *SUSE %{buildroot}/%{_defaultdocdir}/%{name}
|
||||
mv LEGALNOTICE %{buildroot}/%{_defaultdocdir}/%{name}
|
||||
mv LICENSE %{buildroot}/%{_defaultdocdir}/%{name}
|
||||
mv "misc/How to install Matomo.html" %{buildroot}/%{_defaultdocdir}/%{name}
|
||||
mv *md %{buildroot}/%{_defaultdocdir}/%{name}
|
||||
cp -dR * %{buildroot}/%{apache_serverroot}/%{name}
|
||||
# install matomo.conf to apache conf.d
|
||||
mkdir -p %{buildroot}/%{apache_sysconfdir}/conf.d
|
||||
sed -e 's|__matomo_web__|%{apache_serverroot}/%{name}|g' \
|
||||
-e 's|__matomo_conf__|%{_sysconfdir}/%{name}|g' \
|
||||
-e 's|__matomo_log__|/var/log/%{name}|g' \
|
||||
%{SOURCE2} > %{buildroot}/%{apache_sysconfdir}/conf.d/%{name}.conf
|
||||
# install logrotate
|
||||
install -D -m0644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
|
||||
sed -i -e 's|@APACHE_USER@|%{apache_user}|g' %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
|
||||
sed -i -e 's|@APACHE_GROUP@|%{apache_group}|g' %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
|
||||
# move config to etc/matomo and make symlink
|
||||
mv %{buildroot}/%{apache_serverroot}/%{name}/config/* \
|
||||
%{buildroot}/%{_sysconfdir}/%{name}
|
||||
rm -d %{buildroot}/%{apache_serverroot}/%{name}/config
|
||||
ln -s %{_sysconfdir}/%{name} %{buildroot}/%{apache_serverroot}/%{name}/config
|
||||
# install cronscript and systemd-timer
|
||||
install -d -m 0755 %{buildroot}/%{_sysconfdir}/cron.d
|
||||
install -d -m 0755 %{buildroot}/var/log/%{name}
|
||||
install -D -m 0644 %{SOURCE10} %{buildroot}/%{_sysconfdir}/cron.d/%{name}-archive
|
||||
install -D -m 0644 %{SOURCE11} %{buildroot}%{_unitdir}/%{name}-archive.service
|
||||
install -D -m 0644 %{SOURCE12} %{buildroot}%{_unitdir}/%{name}-archive.timer
|
||||
install -D -m 0644 %{SOURCE14} %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
||||
sed -i -e 's|@APACHE_USER@|%{apache_user}|g' %{buildroot}%{_sysconfdir}/cron.d/%{name}-archive
|
||||
sed -i -e 's|@APACHE_SERVERROOT@|%{apache_serverroot}|g' %{buildroot}%{_sysconfdir}/cron.d/%{name}-archive
|
||||
sed -i -e 's|@APACHE_USER@|%{apache_user}|g' %{buildroot}%{_unitdir}/%{name}-archive.service
|
||||
sed -i -e 's|@APACHE_GROUP@|%{apache_group}|g' %{buildroot}%{_unitdir}/%{name}-archive.service
|
||||
sed -i -e 's|@APACHE_SERVERROOT@|%{apache_serverroot}|g' %{buildroot}%{_unitdir}/%{name}-archive.service
|
||||
# install changes for mariadb
|
||||
install -D -m0644 %{SOURCE13} %{buildroot}/%{_sysconfdir}/my.cnf.d/%{name}.my.cnf
|
||||
|
||||
%fdupes %{buildroot}/%{_prefix}
|
||||
%fdupes %{buildroot}/srv
|
||||
|
||||
%pre
|
||||
%service_add_pre matomo-archive.timer matomo-archive.service
|
||||
|
||||
%post
|
||||
# BSC#1154324
|
||||
# # # chown -R %{apache_user}:%{apache_group} %{apache_serverroot}/%{name}
|
||||
%service_add_post matomo-archive.timer matomo-archive.service apache2.service
|
||||
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
|
||||
if [ $1 -gt 1 ]; then
|
||||
# Update matomo if this is an upgrade $1 == 2
|
||||
echo "matomo: Update matomo:core..."
|
||||
su %{apache_user} -s /bin/sh -c "%{_bindir}/php %{apache_serverroot}/%{name}/console config:set 'Tracker.record_statistics="0"'" || :
|
||||
su %{apache_user} -s /bin/sh -c "%{_bindir}/php %{apache_serverroot}/%{name}/console config:set 'General.maintenance_mode="1"'" || :
|
||||
su %{apache_user} -s /bin/sh -c "%{_bindir}/php %{apache_serverroot}/%{name}/console core:update --yes" || :
|
||||
su %{apache_user} -s /bin/sh -c "%{_bindir}/php %{apache_serverroot}/%{name}/console config:set 'General.maintenance_mode="0"'" || :
|
||||
su %{apache_user} -s /bin/sh -c "%{_bindir}/php %{apache_serverroot}/%{name}/console config:set 'Tracker.record_statistics="1"'" || :
|
||||
:
|
||||
fi
|
||||
|
||||
%preun
|
||||
%service_del_preun matomo-archive.timer matomo-archive.service
|
||||
|
||||
%postun
|
||||
%service_del_postun matomo-archive.timer matomo-archive.service apache2.service
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%dir %{_defaultdocdir}/%{name}
|
||||
%{_defaultdocdir}/%{name}/*
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
||||
%config(noreplace) %{_sysconfdir}/cron.d/%{name}-archive
|
||||
%config(noreplace) %{_sysconfdir}/my.cnf.d/%{name}.my.cnf
|
||||
%{_unitdir}/%{name}-archive.service
|
||||
%{_unitdir}/%{name}-archive.timer
|
||||
%{_tmpfilesdir}/%{name}.conf
|
||||
%dir %attr(0750,%{apache_user},%{apache_group}) %{_sysconfdir}/%{name}
|
||||
%dir %attr(0750,%{apache_user},%{apache_group}) %{_sysconfdir}/%{name}/environment
|
||||
%attr(0640,%{apache_user},%{apache_group}) %{_sysconfdir}/%{name}/*.php
|
||||
%attr(0640,%{apache_user},%{apache_group}) %{_sysconfdir}/%{name}/environment/*.php
|
||||
%ghost %attr(0750,%{apache_user},%{apache_group}) /run/%{name}_sessions
|
||||
%defattr(644,root,root,755)
|
||||
%dir %{apache_serverroot}/%{name}
|
||||
%dir %attr(0750,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/js
|
||||
%dir %attr(0750,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/misc
|
||||
%dir %attr(0750,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/plugins
|
||||
%dir %attr(0750,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/tmp
|
||||
%dir %attr(0750,%{apache_user},%{apache_group}) /var/log/%{name}
|
||||
%config(noreplace) %attr(600,%{apache_user},%{apache_group}) %{_sysconfdir}/%{name}/*php
|
||||
%{_sysconfdir}/%{name}/environment/*php
|
||||
%attr(0644,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/matomo.js
|
||||
%attr(0644,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/piwik.js
|
||||
%attr(0644,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/js/piwik.min.js
|
||||
%attr(0770,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/console
|
||||
%attr(0770,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/misc/cron/archive.sh
|
||||
%attr(0770,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/misc/log-analytics/import_logs.py
|
||||
%attr(0770,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/vendor/pear/archive_tar/sync-php4
|
||||
%attr(0770,%{apache_user},%{apache_group}) %{apache_serverroot}/%{name}/vendor/wikimedia/less.php/bin/lessc
|
||||
%{apache_serverroot}/%{name}/*
|
||||
|
||||
%files apache
|
||||
%config(noreplace) %{apache_sysconfdir}/conf.d/%{name}.conf
|
||||
|
||||
%changelog
|
Loading…
x
Reference in New Issue
Block a user