summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMatheus2022-11-08 11:40:13 +0100
committerMatheus2022-11-08 11:40:13 +0100
commite768248375fe095541016fe05509e54985cde6f0 (patch)
treeb487efe121eed2612d3217b2284449db102237d7 /PKGBUILD
parent2991bbd6d6226d1af213195ad688256e7c6cd101 (diff)
downloadaur-e768248375fe095541016fe05509e54985cde6f0.tar.gz
Huge revision.
Diffstat (limited to 'PKGBUILD')
-rwxr-xr-xPKGBUILD148
1 files changed, 103 insertions, 45 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 2a05e4b5782c..75f81dd54b92 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,9 +1,12 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck disable=SC2154
-# Maintainer: Matheus Gabriel Werny de Lima <matheusgwdl@protonmail.com>
+# The PKGBUILD for Matomo.
+# Maintainer: Matheus <matheusgwdl@protonmail.com>
+# Contributor: Matheus <matheusgwdl@protonmail.com>
_pkgname="matomo"
+_tag="866da57b5acc69037c82ee147848d16b0b5248ef"
pkgname="matomo-git"
pkgver="4.12.3"
@@ -12,7 +15,7 @@ pkgdesc="A powerful web analytics platform."
arch=("any")
url="https://github.com/matomo-org/${_pkgname}"
license=("GPL3")
-depends=("php" "php-fpm" "php-gd")
+depends=("bash" "java-runtime" "php" "php-fpm" "php-gd" "perl" "python" "python-beautifulsoup4" "python-pillow" "python-requests" "python-yaml")
makedepends=("composer" "curl" "git" "git-lfs")
optdepends=("apache: HTTP server"
"certbot: Creates SSL certificates."
@@ -20,67 +23,122 @@ optdepends=("apache: HTTP server"
"nginx: HTTP server")
provides=("${_pkgname}")
conflicts=("matomo")
-source=("git+${url}.git")
-sha512sums=("SKIP")
+install="${_pkgname}.install"
+source=("${_pkgname}::git+${url}.git#tag=${_tag}"
+ "git+https://github.com/matomo-org/matomo-icons.git"
+ "git+https://github.com/matomo-org/matomo-log-analytics.git"
+ "git+https://github.com/matomo-org/plugin-AnonymousPiwikUsageMeasurement.git"
+ "git+https://github.com/matomo-org/plugin-Bandwidth.git"
+ "git+https://github.com/matomo-org/plugin-CustomAlerts.git"
+ "git+https://github.com/matomo-org/plugin-CustomVariables.git"
+ "git+https://github.com/matomo-org/plugin-DeviceDetectorCache.git"
+ "git+https://github.com/matomo-org/plugin-LoginLdap.git"
+ "git+https://github.com/matomo-org/plugin-LogViewer.git"
+ "git+https://github.com/matomo-org/plugin-MarketingCampaignsReporting.git"
+ "git+https://github.com/matomo-org/plugin-Provider.git"
+ "git+https://github.com/matomo-org/plugin-QueuedTracking.git"
+ "git+https://github.com/matomo-org/plugin-SecurityInfo.git"
+ "git+https://github.com/matomo-org/plugin-TasksTimetable.git"
+ "git+https://github.com/matomo-org/plugin-TrackingSpamPrevention.git"
+ "git+https://github.com/matomo-org/plugin-TreemapVisualization.git"
+ "git+https://github.com/matomo-org/plugin-VisitorGenerator.git"
+ "git+https://github.com/matomo-org/tag-manager.git"
+ "git+https://github.com/matomo-org/travis-scripts.git"
+ "override_${_pkgname}.conf")
+sha512sums=("SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "SKIP"
+ "3802c7aae4c26cf23a61c48fedabe1d4bb516bbc07e42573cdb8cdfd19a556cc0b65941eae03ceb1c9cbf3eff2d40742e01eea12f3b420ae0d277c3582368b34")
-build()
+prepare()
{
- # Information
- echo -e "\033[0;32mConfiguration is needed before the installation. For assistance, read the included \"README.md\".\033[0m"
-
cd "${srcdir}"/"${_pkgname}"/ || exit 1
- git checkout tags/"${pkgver}"
- git submodule update --init --merge --recursive
- composer install --no-dev
-}
+ git submodule init
-package()
-{
- # Assure that the directories exist.
- mkdir -p "${pkgdir}"/etc/systemd/system/php-fpm.service.d/
- mkdir -p "${pkgdir}"/usr/share/doc/"${_pkgname}"/
- mkdir -p "${pkgdir}"/usr/share/webapps/"${_pkgname}"/misc/
+ git config submodule.misc/log-analytics.url "${srcdir}"/matomo-log-analytics/
+ git config submodule.plugins/AnonymousPiwikUsageMeasurement.url "${srcdir}"/plugin-AnonymousPiwikUsageMeasurement/
+ git config submodule.plugins/Bandwidth.url "${srcdir}"/plugin-Bandwidth/
+ git config submodule.plugins/CustomAlters.url "${srcdir}"/plugin-CustomAlters/
+ git config submodule.plugins/CustomVariables.url "${srcdir}"/plugin-CustomVariables/
+ git config submodule.plugins/DeviceDetectorCache.url "${srcdir}"/plugin-DeviceDetectorCache/
+ git config submodule.plugins/LoginLdap.url "${srcdir}"/plugin-LoginLdap/
+ git config submodule.plugins/LogViewer.url "${srcdir}"/plugin-LogViewer/
+ git config submodule.plugins/MarketingCampaignsReporting.url "${srcdir}"/plugin-MarketingCampaignsReporting/
+ git config submodule.plugins/Morpheus/icons.url "${srcdir}"/matomo-icons/
+ git config submodule.plugins/Provider.url "${srcdir}"/plugin-Provider/
+ git config submodule.plugins/QueuedTracking.url "${srcdir}"/plugin-QueuedTracking/
+ git config submodule.plugins/SecurityInfo.url "${srcdir}"/plugin-SecurityInfo/
+ git config submodule.plugins/TagManager.url "${srcdir}"/tag-manager/
+ git config submodule.plugins/TasksTimetable.url "${srcdir}"/plugin-TasksTimetable/
+ git config submodule.plugins/TrackingSpamPrevention.url "${srcdir}"/plugin-TrackingSpamPrevention/
+ git config submodule.plugins/TreemapVisualization.url "${srcdir}"/plugin-TreemapVisualization/
+ git config submodule.plugins/VisitorGenerator.url "${srcdir}"/plugin-VisitorGenerator/
+ git config submodule.tests/travis.url "${srcdir}"/travis-scripts/
- # Install the software.
- cp -r "${srcdir}"/"${_pkgname}"/ "${pkgdir}"/usr/share/webapps/
+ git -c protocol.file.allow=always submodule update
- ## GeoIP database
- current_year=$(date +"%Y")
- current_month=$(date +"%m")
+ # GeoIP database
+ _current_year="$(date +"%Y")"
+ _current_month="$(date +"%m")"
- while [[ "$(curl -s -o /dev/null/ -w "%{http_code}" https://download.db-ip.com/free/dbip-city-lite-"${current_year}"-"${current_month}".mmdb.gz || true)" != "200" ]]; do
- ### Remove the preceding 0.
- if [[ "${current_month::1}" == "0" ]]; then
- current_month=${current_month:1}
+ while [[ "$(curl -o /dev/null/ -sw "%{http_code}" https://download.db-ip.com/free/dbip-city-lite-"${_current_year}"-"${_current_month}".mmdb.gz || true)" != "200" ]]; do
+ ## Remove the preceding "0".
+ if [[ "${_current_month::1}" == "0" ]]; then
+ _current_month=${_current_month:1}
fi
- ### Take the last month.
- if [[ "${current_month}" -gt "1" ]]; then
- ((current_month--))
+ ## Take the last month.
+ if [[ "${_current_month}" -gt "1" ]]; then
+ ((_current_month--))
else
- ((current_year--))
- current_month="12"
+ ((_current_year--))
+ _current_month="12"
fi
- ### Put a 0 at the beginning again.
- if [[ "${#current_month}" == "2" ]]; then
- current_month="0${current_month}"
+ ## Put a "0" at the beginning again.
+ if [[ "${#_current_month}" == "2" ]]; then
+ _current_month="0${_current_month}"
fi
done
- curl https://download.db-ip.com/free/dbip-city-lite-"${current_year}"-"${current_month}".mmdb.gz -o DBIP-City-Lite.mmdb.gz
+ curl https://download.db-ip.com/free/dbip-city-lite-"${_current_year}"-"${_current_month}".mmdb.gz -o "${srcdir}"/DBIP-City-Lite.mmdb.gz
gzip -d "${srcdir}"/DBIP-City-Lite.mmdb.gz
- install -Dm644 "${srcdir}"/DBIP-City-Lite.mmdb "${pkgdir}"/usr/share/webapps/"${_pkgname}"/misc/
+}
- ## Configure php-fpm.
- echo -e "[Service]
-ReadWritePaths = /usr/share/webapps/${_pkgname}/config/
-ReadWritePaths = /usr/share/webapps/${_pkgname}/matomo.js
-ReadWritePaths = /usr/share/webapps/${_pkgname}/misc/user/
-ReadWritePaths = /usr/share/webapps/${_pkgname}/plugins/
-ReadWritePaths = /usr/share/webapps/${_pkgname}/tmp/" > "${pkgdir}"/etc/systemd/system/php-fpm.service.d/override_matomo.conf
+build()
+{
+ cd "${srcdir}"/"${_pkgname}"/ || exit 1
+ composer install --no-dev
+}
- ## Set the owner.
+package()
+{
+ # Assure that the directories exist.
+ mkdir -p "${pkgdir}"/usr/lib/systemd/system/php-fpm.service.d/
+ mkdir -p "${pkgdir}"/usr/share/doc/"${_pkgname}"/
+ mkdir -p "${pkgdir}"/usr/share/webapps/"${_pkgname}"/misc/
+
+ # Install the software.
+ cp -r "${srcdir}"/"${_pkgname}"/ "${pkgdir}"/usr/share/webapps/
+ install -Dm644 "${srcdir}"/DBIP-City-Lite.mmdb "${pkgdir}"/usr/share/webapps/"${_pkgname}"/misc/
+ install -Dm644 "${srcdir}"/override_"${_pkgname}".conf "${pkgdir}"/usr/lib/systemd/system/php-fpm.service.d/
chown -R http:http "${pkgdir}"/usr/share/webapps/"${_pkgname}"/
# Install the documentation.