SHA256
1
0
forked from pool/matomo
matomo/matomo.spec
Eric Schirra e007200ed7 Accepting request 972382 from home:ecsos:server
- Update to 4.9.0
  * matomo-org/matomo
    - #15985 New segments for ‘Ecommerce Order Revenue’ and ‘Revenue left in cart’
    - #18066 Detect when the website is a Single Page App (SPA) or a Progressive Web App (PWA) and link to the relevant guide
    - #18934 Matomo knowledgebase discoverability improvements
    - #18618 Improve performance in deleteLogDataForDeletedSites when deleting data for more than one site
    - #18787 Clarify the Newsletter Opt-in message during installation
    - #18865 Handle case only file name updates on case insensitive file systems
    - #19006 Fix Sarawak and Terengganu on Visitors Interactive Map Widget
    - #18806 Inline Help – show report generation date on “Overview” reports with Evolution Graphs
    - #17738 Don’t log an error when not supported browser is used
    - #17892 Don’t create test cookies when cookies are disabled
    - #18902 Set the _pk_id in the past when deleting cookie.
    - #18873 Remove subtable tooltip if rows are displayed expanded upon search
    - #18990 Minor performance improvement for archive invalidator
    - #18054 Multi server environment in maintenance mode shouldn’t result in 503 response
    - #18790 Prevent archiving of data for time periods that start in the future
    - #18852 Apply max execution query time to Live.getCounters API and queryAdjacentVisitorId method
    - #18883 Migrate Dashboard directive/model to VueJS
    - #18903 Fix PHP8 Trim Error
    - #18926 Migrate custom dimension management
    - #18931 Migrate LanguagesManager to VueJS
    - #18932 Migrate live widget refresh to VueJS
    - #18939 Migrate multisites plugin components to VueJS
    - #18956 Rename dimensions and segments with Server time to Site Time/Time in UTC
    - #18975 Migrate AnonymizeIpController to VueJS
    - #18989 Migrate DoNotTrackPreferenceController to VueJS
    - #18995 Fix issue where date ranges might include too many subperiods
  * matomo-org/tag-manager
    - #443 Add new option to Matomo Variable to disable browser feature detection in Matomo Tag
    - #321 Improve tracking capabilities of visibility events
    - #450 Fix bug preventing “0” value for trigger condition
    - #423 Migrate version management to VueJS
    - #424 Migrate container management to VueJS
  * matomo-org/device-detector
    - #5316 Add detection for new device type wearables
    - #6989 Introduce browser client hint detection
    - #7018 Detect devices for brands: Teclast, Readboy, Vivo, Xiaomi,
      Conquest, Huawei, AllDocube, OPPO, Meizu, Newman, Lava, Hisense
    - #7021 Detect new brands Angelcare, Hamlet, Vorcom and Detect devices for several existing brands
    - #7022 Add engine for CCleaner and ToGate
    - #7023 Improve version detection for Chrome OS
    - #7025 Adds detection for ClearPHONE, Doppio, Jio, Point Mobile, Schok, Vios devices,
      improves detection for Alcatel, Allview, AT&T, Blu, Crosscall, Digicel, Hipstreet,
      Hisense, HTC, Huawei, Hurricane, Hyundai, iHunt, Kalley, Kodak, KRIP, LG, Logic,
      Mione, Motorola, OnePlus, OpelMobile, Pantech, Positivo, Quantum, Realme, Sky, TCL,
      Techwood, Tecno Mobile, Tigers, Vivo, Wiko, Wolki, Xiaomi, Yes, Yezz, ZTE devices,
      adds detection for ClearOS Mobile
    - #7027 Adds detection for CyBrowser, Hi Browser, Navegador, improves detection for Opera,
      UC Browser, UC Browser Mini
    - #7028 Adds detection for AdBlock Browser and YouCare
    - #7029 Adds detection for Decentr browser
    - #7030 Improve detection of Chromium GOST
    - #7032 Adds detection for China OS, PocketBook Browser, improves detection for Linux, Android Browser, Tizen Browser
    - #7033 Adds detection for various bots and libraries
    - #7035 Detect new brands: Autan, UNNO, VDVD, Shanling, ecom and Detect devices for several existing brands
    - #7036 Add Detection for Samsung Watch
    - #7040 Add client hints fixture for Whale Browser
    - #7045 Improves detection for CentOS, GNU/Linux, PCLinuxOS, Red Hat, adds detection for Amazon Linux,
      TencentOS, adds detection for cPanel HTTP Client, ALittle Client, PHP cURL Class, SafeIP, NAVER Mail
      and adds detection for various bots
    - #7046 Add client hints fixture for Opera GX
    - #7051 Detect new brands LOKMAT, Joy, iWaylink and Detect devices for several existing brands
    - #7052 Adds detection for Bittium, EGL, Logic Instrument brands, improves detection for AllDocube,
      Brondi, Hi, Hot Pepper, Energizer, Huawei, iPro, Sky, X-View brands, adds detection for Bliss OS
    - #7055 Adds detection for GeoIP Update
    - #7056 Adds detection for Dolphin Zero, Dolphin, OH Private Browser, Atlas, Jelly browsers
    - #7057 Detect Flow Browser
    - #7061 Detect browsers: UC Browser Mini, Soul Browser, Indian UC Mini Browser,
      Opera, Opera Mini, Fast Explorer, Comfort Browser, CM Mini, SilverMob US
    - #7062 Improves detection for Delta Browser, Monument Browser, Super Fast Browser
      and adds detection for APUS Browser, Ask.com, Ayoba, Savannah Browser, SavySoda, SnapU2B,
      Surf Browser, Ui Browser Mini
    - #7063 Implement Blink version detection via Chrome/ token.
    - #7064 Improves detection for generic bots
    - #7066 TVs detected as smartphone
    - #7067 Improves detection for EKO, Kogan, Sharp, Sony, Vodafone devices
    - #7069 Detect new brands: YU Fly, VOGA, Haipai, Huagan, TD Tech and Detect devices for several existing brands
    - #7070 Adds detection for CentOS Stream, improves detection for CentOS, Roku OS

OBS-URL: https://build.opensuse.org/request/show/972382
OBS-URL: https://build.opensuse.org/package/show/network:utilities/matomo?expand=0&rev=104
2022-04-24 13:55:24 +00:00

247 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.9.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/matomo/matomo-php-tracker/run_tests.sh
%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