matomo/matomo.spec
Eric Schirra b04a875d36 Accepting request 1008109 from home:ecsos:server
- Update to 4.12.0
  This is a major security release.
  * matomo-org/matomo
    - #16125 Support Sec-CH-UA Client Hints in addition to UserAgent
    - #17452 Offer opt out without iframe / 3rd party cookies
    - #19233 Handle 429 response code within UI
    - #19028 Have a message in the UI after install saying this plugin does not track to Cloud
    - #19525 Improve password confirmation in UI & API
    - #15262 Fix average order value graph flattening out to value 0
    - #19540 Fix sizing of subtables with different column count
    - #15924 Ensure download urls are encoded correctly in visits log
    - #18766 Show the selected conversion rate on Goals->Overview evolution graph
    - #18781 Show correct “Rows to display” on Evolution graph
    - #19335 Improve password confirmation in UI & API
    - #19485 Fixes Goal row evolution with double quotes in the goal name resulting in an error
    - #19550 Ensure API requests with session auth check 2fa status
    - #19586 Require password confirmation when removing users through UI
    - #19591 Require password confirmation when removing a site in UI
    - #19598 Use brute force detection for reset password action
    - #19611 Require password confirmation when inviting a user in UI
    - #19302 Provide possibility to configure referrer exclusion list
    - #19387 Fixes glossary navigation
    - #19530 Allow custom cookie expiry date for `optUserOut()` & `forgetUserOptOut()` functions
    - #19572 Add config option for database errors to ignore during updates
    - #18750 Improve role/capability handling in usermanager
    - #19254 Fix adjacent elements to dashboard-dropdown-menu-modal overlapping on narrower screens
    - #19632 Fix CSP header when viewing plugin details
    - #19446 Fixes different height of selectors
    - #19456 Fixes icon-menu-hamburger size
    - #12024 Improve URL detection in mod_pagespeed check
    - #19319 Fix problem with too long browser version
    - #19323 Attempt to handle incorrectly prefixed region codes
    - #19346 Fix FAQ links using # in the link no longer working
    - #19354 Improve reset password email formatting to fix broken link
    - #19360 Fix number formatting in additional Y axis in (evolution) charts
    - #19393 Fix date range handling to prevent evolution graph display being confused when changing the period
    - #19508 Fixed incorrect Cuban province names on visitor map
    - #19569 Fix for current year not processed for new custom reports
    - #19588 Fix placing series / series picker in charts
    - #19615 Fix for page goals visualization showing hits instead of visits
    - #19269 Include conversion attribution in visitor details
    - #19308 Improve debugging via Vardumper overriding
    - #19333 Login plugin language reworked
    - #19363 Setting prepare callback before validation
    - #19374 Fix typo in Revenue Entry Documentation translation string
    - #19385 Added translation keys for scope titles in custom dimensions
    - #19420 Implement url parameter to ignore referrer
    - #19454 Full width field in settings
    - #19458 Add TikTok to socical networks
    - #19491 Allow reading consent removed cookie even if cookies are disabled
    - #19510 Update outdated FAQ and Guide links
    - #19517 Exclude paypal as referrer in javascript tracker
    - #19527 Update HTTPs security check, when client is using HTTP just throw a warning on diagnostic
    - #19532 Implement cookie expire time – forgetConsentGiven
    - #19594 Do not accept invalid SSL certificates for requests to ASPSMS and Clockwork
    - #19673 Adds Microsoft and Yandex click ids to default query parameters exclusion list
  * matomo-org/tag-manager
    - #503 Add support for `data-matomo-mask` attribute on events
    - #519 Prevent possible XSS via changeDebugUrl
    - #249 Add description/comment field to Tags/Triggers/Variables for better documentation of functionality
    - #543 Handle Click Events correctly in shadowDOM (web components)
    - #334 Added goal revenue field to tag edit view
    - #314 Fixed issue when renaming Matomo Configuration variable, its name is not propagated to the tags using it
    - #511 Improve Start and end date for Tags handling of timezone
    - #326 Fix for Tagmanager working along with CSP when triggering a HTML tag
    - #495 Show info icon documentation links when defining triggers
    - #504 Fixes UI issue by setting container selector max width
    - #541 Add a link to the documentation about the datalayer when the container tracking code is shown
  * matomo-org/tracker-proxy
    - #77 Update # FAQ Links to match new knowledge base structure
  * matomo-org/matomo-php-tracker
    - #104 Adds support for client hints
  * matomo-org/device-detector
    - #7082 Add detection for postmarket os
    - #7129 Detect new brands: Intel, PlusStyle, New Bridge, ZIK, Famous, Facetel, HLLO,
      LNMBBS, Quest, SNAMI, TeachTouch, YUMKEM, TTK-TV, Emporia, GEOZON, iReplace, actiMirror
    - #7134 Detect devices for several existing brands – Acer, Ulefone, Vodafone, Sony, Xiaomi
    - #7137 Detect devices for existing brands – RoyQueen, Sico, Digicel, Xolo
    - #7138 Fix version truncation for client hints
    - #7140 Detect devices for existing brands – Samsung, QMovile, MyPhone, Huawei
    - #7141 Detect Petal Search app and Detect Nova 9 SE device for Huawei brand
    - #7142 Detect devices for existing brands – Nubia, Stylo, Kivi and others
    - #7143 Add bots: aiHitBot, ADmantX Service Fetcher, DomainCrawler,
      DNSResearchBot, AdAuth, Faveeo, Kozmonavt, CriteoBot
    - #7144 Detect bots: aiHitBot, ADmantX Service Fetcher, DomainCrawler,
      DNSResearchBot, AdAuth, Faveeo, Kozmonavt, CriteoBot
    - #7145 Detect devices for existing brands – FiGi, Xiaomi, Hotwav, FiGi
    - #7147 Detect devices for existing brands – Cherry Mobile, Alcatel, Panasonic, Symphony and others
    - #7148 Add detection LastMod Bot
    - #7149 Detect app Snapchat for Android
    - #7150 Detect devices for existing brands – Artel, Allview, Sony, F2 Mobile and others
    - #7151 Improve performance by skipping device parse if useragent matches desktop pattern
    - #7152 Detect devices for existing brands – Sharp, Hyundai, Starmobile
    - #7154 Detect devices for existing brands – Infinix, iBrit, Vivax, Karbonn
    - #7155 Detect devices for existing brands – Motorola, QMobile, Infinix and others
    - #7156 Adds detection for apps – Amazon shopping, Snapchat, OkHttp, PayPal IPN and others
    - #7158 Added Internet Browser Secure, Hexa Web Browser, Browspeed Browser to available browsers
    - #7160 Detect devices for existing brands – Winnovo, Samsung, Realme, Maxtron and others
    - #7161 Detect devices for existing brands – iHunt, Aspera, Pixelbook, QMobile
    - #7162 Improves version detection for iOS, macOS and tvOS
    - #7163 Improves version detection for iPadOS
    - #7164 Detect devices for existing brands – QMobile, Fero, Blu, Hometech, Infinix
    - #7165 Adds detection for various apps and browsers
    - #7166 Detect browsers: Rabbit Private Browser, Office Browser, Lynket Browser,
      Vivid Browser Mini, Yo Browser, Yuzu Browser, BF Browser, G Browser
    - #7167 Adds detection for Nova and improves version detection for Fedora, iOS,
      macOS, Mandriva, Mint operating systems
    - #7168 Adds detection for various bots and apps
    - #7169 Adds detection for Keepsafe Browser, Inspect Browser and improves detection for Seznam Browser
    - #7171 Detect devices – ClearPHONE, Mintt, Sky Elite D5, and others
    - #7176 Detect devices for existing brands – Hardkernel, Blu, AT&T, Vivo
    - #7177 Detect devices for existing brands
    - #7178 Detect devices Logic L4T, Mastertech, and others
    - #7179 Adds detection for various devices and improves os detection
    - #7181 Rename Oculus brand to Meta and improves detection for Meta Quest 2
    - #7182 Adds detection for Seolyt Bot
    - #7183 Detect devices for existing brands and new brands – Unistrong, Equator, AXXA
    - #7184 Detect devices for existing and new brands – D-Tech, OneClick
    - #7186 Detect devices for existing and new brand – iXTech
    - #7187 Detect devices for existing and new brands – BlueSky, Legend, Vue Micro
    - #7190 Detect devices for existing and new brands – NTT West, JREN, Tibuta, ATOL, FILIX
    - #7191 Adds detection for LinkWalker bot
    - #7193 Optimise devices detection for apple
    - #7194 Detect Container-related tools
    - #7197 Detect new browsers and apps – Tint Browser, hola!, RedReader [by @sanchezzzhak]
    - #7198 Adds detection for RouterOS
    - #7199 Adds detection for INETDEX-BOT and NETZZAPPEN
    - #7201 Detect devices for existing and new brands – HexaByte, CipherLab, BrandCode, Lumitel, Elevate
    - #7202 Detect mobile app for Microsoft Office Access
    - #7203 Improves detection for Fairphone devices and Atom, Ecosia, Iridium browsers
    - #7204 Various consumer electronics detected as bots
    - #7206 Improves detection for Google and Roku devices
    - #7208 Detect devices for existing and new brands – Ceibal, Weelikeit
    - #7209 Improves client hints version detection for Atom, hola! Browser, Opera, Smart Lenovo Browser
    - #7211 Detect devices for existing and new brands – Boost, Orbsmart, TOX
    - #7212 Adds detection for Panscient bot
    - #7213 Detect devices for existing and new brands – HiHi, M3 Mobile, Hugerock, Coopers
    - #7215 Detect devices for existing and new brands – iStar, ENIE, Dcode
    - #7216 Adds detection for Smart Kassel, X96Q brands and improves detection for various browsers, os, libraries
    - #7217 Adds detection for Amerigo, Internet Browser Private, 18+ Privacy, Beyond Private, Black Lion
    - #7218 Adds detection for Wiseiplay, Always Safe Security 24, Zoe Business
    - #7219 Detect devices for existing and new brands – Stream
    - #7220 Detect Open Browser fast 5G
    - #7221 Adds detection for various apps
    - #7222 Adds detection for various browsers
    - #7227 Detect browsers for ClientHints
  * matomo-org/referrer-spam-list
    - #1323 Add ucban.xyz
    - #1324 Add hrtonline.xyz
    - #1325 Add mytraffic.shop, supertraffic.xyz, trafficdrive.club
    - #1326 Add bottraffic329.xyz
    - #1327 Add getbottraffic4free.xyz
    - #1328 Add goyua.xyz
    - #1329 Add nanwar.xyz
    - #1330 Add qtrstar.xyz
  * matomo-org/searchengine-and-social-list
    - #83 Adds TikTok to social networks

OBS-URL: https://build.opensuse.org/request/show/1008109
OBS-URL: https://build.opensuse.org/package/show/network:utilities/matomo?expand=0&rev=109
2022-10-05 06:14:37 +00:00

246 lines
11 KiB
RPMSpec

#
# 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: 4.12.0
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}
%patch1 -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'
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