From 8d9992d81448a1b1fb51ef79b14b5d30d009742f Mon Sep 17 00:00:00 2001 From: Shin'ya Minazuki Date: Mon, 6 Jul 2026 13:22:40 -0300 Subject: [PATCH] www-apps/yarnd: add pertinent system group and account Signed-off-by: Shin'ya Minazuki --- acct-group/yarnd/yarnd-0.ebuild | 6 ++++++ acct-user/yarnd/yarnd-0.ebuild | 10 ++++++++++ www-apps/yarnd/files/yarnd.service | 18 ++++++++++++++++++ www-apps/yarnd/yarnd-9999.ebuild | 15 ++++++++++++--- 4 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 acct-group/yarnd/yarnd-0.ebuild create mode 100644 acct-user/yarnd/yarnd-0.ebuild create mode 100644 www-apps/yarnd/files/yarnd.service diff --git a/acct-group/yarnd/yarnd-0.ebuild b/acct-group/yarnd/yarnd-0.ebuild new file mode 100644 index 0000000..6d47c62 --- /dev/null +++ b/acct-group/yarnd/yarnd-0.ebuild @@ -0,0 +1,6 @@ +# Copyright 2026 Shin'ya Minazuki +EAPI=8 + +inherit acct-group + +ACCT_GROUP_ID=-1 diff --git a/acct-user/yarnd/yarnd-0.ebuild b/acct-user/yarnd/yarnd-0.ebuild new file mode 100644 index 0000000..ecdbc8c --- /dev/null +++ b/acct-user/yarnd/yarnd-0.ebuild @@ -0,0 +1,10 @@ +# Copyright 2026 Shin'ya Minazuki +EAPI=8 + +inherit acct-user + +DESCRIPTION="System user for the Yarn.social daemon" +ACCT_USER_ID=-1 +ACCT_USER_GROUPS=( yarnd ) + +acct-user_add_deps diff --git a/www-apps/yarnd/files/yarnd.service b/www-apps/yarnd/files/yarnd.service new file mode 100644 index 0000000..f721d4a --- /dev/null +++ b/www-apps/yarnd/files/yarnd.service @@ -0,0 +1,18 @@ +[Unit] +Description=Yarn.social is an open-source, self-hosted, de-centralised micro-blogging platform +Documentation=https://git.mills.io/yarnsocial/yarn +After=network.target + +[Service] +Type=simple +Restart=on-failure +RestartSec=10 +StartLimitBurst=5 +StartLimitInterval=100 +User=yarnd +Group=yarnd +ExecStart=/usr/sbin/yarnd -OR +EnvironmentFile=/etc/conf.d/yarnd + +[Install] +WantedBy=multi-user.target diff --git a/www-apps/yarnd/yarnd-9999.ebuild b/www-apps/yarnd/yarnd-9999.ebuild index 73e7120..9f904ce 100644 --- a/www-apps/yarnd/yarnd-9999.ebuild +++ b/www-apps/yarnd/yarnd-9999.ebuild @@ -1,7 +1,7 @@ # Copyright 2026 Shin'ya Minazuki EAPI=8 -inherit git-r3 go-module +inherit git-r3 go-module systemd DESCRIPTION="Self-hosted non-social social media (daemon)" HOMEPAGE="https://yarn.social" @@ -14,7 +14,15 @@ KEYWORDS="~amd64 ~arm64 ~x86" # There's also other two build dependencies, # but they are not required for building, and no user # I know gives a crap. -BDEPEND="dev-util/minify" +BDEPEND=" + >=dev-lang/go-1.25.0 + dev-util/minify +" + +RDEPEND=" + acct-group/yarnd + acct-user/yarnd +" DOCS=( AUTHORS README.md ) @@ -32,7 +40,7 @@ src_configure() { } src_compile() { - export VERSION="0.15.1-${EGIT_COMMIT}" + export VERSION="LIVE-${EGIT_COMMIT}" export COMMIT="${EGIT_COMMIT}" export BUILD="$(date +%Y-%m-%d)" export CGO_ENABLED="0" @@ -49,5 +57,6 @@ src_install() { dosbin yarnd newinitd "${FILESDIR}/yarnd.initd-r1" "${PN}" newconfd "${FILESDIR}/yarnd.confd-r1" "${PN}" + systemd_dounit "${FILESDIR}/yarnd.service" einstalldocs }