commit:     4caf5383b47e63bc1edd27a76803a0320abdcd7c
Author:     Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Sat Nov 29 12:26:03 2025 +0000
Commit:     Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
CommitDate: Sat Nov 29 12:39:25 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4caf5383

www-apps/goatcounter: new package, add 2.6.0

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>

 www-apps/goatcounter/Manifest                  |  2 ++
 www-apps/goatcounter/files/goatcounter.confd   | 20 +++++++++++
 www-apps/goatcounter/files/goatcounter.initd   | 24 +++++++++++++
 www-apps/goatcounter/files/goatcounter.service | 16 +++++++++
 www-apps/goatcounter/goatcounter-2.6.0.ebuild  | 47 ++++++++++++++++++++++++++
 www-apps/goatcounter/metadata.xml              | 11 ++++++
 6 files changed, 120 insertions(+)

diff --git a/www-apps/goatcounter/Manifest b/www-apps/goatcounter/Manifest
new file mode 100644
index 0000000000..82bf9412bf
--- /dev/null
+++ b/www-apps/goatcounter/Manifest
@@ -0,0 +1,2 @@
+DIST goatcounter-2.6.0-vendor.tar.xz 3767044 BLAKE2B 
f173800fe4c27d37642e8784a9619c46abf5bfc0dd003847d28824537dafbda59a17ef99d93fcbe177d86f27a588efed26d9995e3d201f8084a7aa639c844273
 SHA512 
7ee6e0de47caaac678dd99ec049478fb1c8943e968fb003917c9b1969c475f5649d2384680e4c97cf723018f997d3e24b1e84c504f6f4d818bbe725b970632b0
+DIST goatcounter-2.6.0.tar.gz 5343019 BLAKE2B 
33869c43bf52b4441dadfdb960c9463887fd54a8281c4d20ccd8db060bc6b234337cdad171a37f4a4eb53a13545aac5e773cdd7f39eb60187cfeaf83d70b95e6
 SHA512 
7a834f5cc36c663e97e4a762928e6601a6576d46b69cca21989b45829b8c42f4ed16ad7ff80c63ff972d1a3c404f07ff423db38aa8427e46789f9ed95c5770c9

diff --git a/www-apps/goatcounter/files/goatcounter.confd 
b/www-apps/goatcounter/files/goatcounter.confd
new file mode 100644
index 0000000000..f082e8f75b
--- /dev/null
+++ b/www-apps/goatcounter/files/goatcounter.confd
@@ -0,0 +1,20 @@
+# Database connection: "sqlite+<file>" or "postgres+<connect>".
+# See "goatcounter help db" for detailed documentation.
+export GOATCOUNTER_DB="sqlite+/var/db/goatcounter/db.sqlite3"
+
+# Address to listen on.
+# See "goatcounter help listen" for detailed documentation.
+#export GOATCOUNTER_LISTEN=":8080"
+
+# Whether to serve over TLS.
+# See "goatcounter help listen" for detailed documentation.
+#export GOATCOUNTER_TLS="http"
+
+# Automatically run all pending migrations on startup.
+export GOATCOUNTER_AUTOMIGRATE=1
+
+# SMTP relay server, as URL (e.g. "smtp://user:pass@server").
+#export GOATCOUNTER_SMTP=""
+
+# Use a websocket to send data.
+#export GOATCOUNTER_WEBSOCKET=1

diff --git a/www-apps/goatcounter/files/goatcounter.initd 
b/www-apps/goatcounter/files/goatcounter.initd
new file mode 100644
index 0000000000..3ef4d10095
--- /dev/null
+++ b/www-apps/goatcounter/files/goatcounter.initd
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# shellcheck shell=sh
+#
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+supervisor="supervise-daemon"
+description="GoatCounter web analytics daemon service"
+command="/usr/bin/goatcounter"
+command_user="goatcounter:goatcounter"
+pidfile="/run/goatcounter.pid"
+capabilities="^cap_net_bind_service"
+
+output_log="/var/log/goatcounter.log"
+error_log="${output_log}"
+
+depend() {
+       need net
+       use dns firewall postgresql
+}
+
+start_pre() {
+       checkpath -fo "${command_user}" "${output_log}"
+}

diff --git a/www-apps/goatcounter/files/goatcounter.service 
b/www-apps/goatcounter/files/goatcounter.service
new file mode 100644
index 0000000000..010bb33159
--- /dev/null
+++ b/www-apps/goatcounter/files/goatcounter.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=GoatCounter web analytics daemon service
+After=network.target
+
+[Service]
+Type=simple
+Restart=always
+User=goatcounter
+Group=goatcounter
+ExecStart=/usr/bin/goatcounter serve -automigrate -db 
sqlite+/var/db/goatcounter/db.sqlite3
+NoNewPrivileges=true
+# allow binding to privileged ports (80 and 443 in our case)
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+
+[Install]
+WantedBy=multi-user.target

diff --git a/www-apps/goatcounter/goatcounter-2.6.0.ebuild 
b/www-apps/goatcounter/goatcounter-2.6.0.ebuild
new file mode 100644
index 0000000000..111aa45be5
--- /dev/null
+++ b/www-apps/goatcounter/goatcounter-2.6.0.ebuild
@@ -0,0 +1,47 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module systemd
+
+DESCRIPTION="Easy web analytics without tracking of personal data"
+HOMEPAGE="
+       https://www.goatcounter.com
+       https://github.com/arp242/goatcounter
+"
+SRC_URI="https://github.com/arp242/${PN}/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz
+       
https://github.com/gentoo-golang-dist/${PN}/releases/download/v${PV}/${P}-vendor.tar.xz
+"
+
+LICENSE="EUPL-1.2 ISC MIT OFL-1.1"
+LICENSE+=" Apache-2.0 BSD BSD-2 MIT public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="acct-user/goatcounter"
+BDEPEND=">=dev-lang/go-1.24.4"
+
+DOCS=( CHANGELOG.md README.md docs/. )
+
+src_compile() {
+       ego build -ldflags="-X zgo.at/goatcounter/v2.Version=${PV}" 
./cmd/goatcounter
+}
+
+src_test() {
+       ego test -vet=off ./...
+}
+
+src_install() {
+       dobin goatcounter
+       einstalldocs
+
+       keepdir /var/db/goatcounter
+       fowners goatcounter:goatcounter /var/db/goatcounter
+       fperms 750 /var/db/goatcounter
+
+       newinitd "${FILESDIR}"/goatcounter.initd goatcounter
+       newconfd "${FILESDIR}"/goatcounter.confd goatcounter
+
+       systemd_dounit "${FILESDIR}"/goatcounter.service
+}

diff --git a/www-apps/goatcounter/metadata.xml 
b/www-apps/goatcounter/metadata.xml
new file mode 100644
index 0000000000..b01ab44384
--- /dev/null
+++ b/www-apps/goatcounter/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Anna</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">arp242/goatcounter</remote-id> 
+       </upstream>
+</pkgmetadata>

Reply via email to