net-irc/thelounge: ‎Modern & responsive web IRC client

add 4.4.1 and 4.4.2-rc.1

Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
This commit is contained in:
Rahil Bhimjiani
2024-03-08 08:31:44 +05:30
parent 0cb55cf2b3
commit b061292d27
10 changed files with 265 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
DIST thelounge-4.4.1-deps.tar.xz 81407420 BLAKE2B 027652411cf7848fae713770444ee6c20c18b2d90abf8967976954df844dea8b39110bc0a1742926174346fbfa976c06883f9538722ab02a94579203e3d61dde SHA512 0626e55b16a92346729b4504a1b8d3f5cc108a2a59d648476abbc844043efe3f577d83240c3ea5a61572216ab1af53018cab8e0dac133b938ad0ab9d42878fbe
DIST thelounge-4.4.1-sqlite3.tar.xz 3994944 BLAKE2B 01d12ca8947465c91e4ac455c743503fedce2f53ce8ee5fbdf0e77188bfc67378bfcc58a1ad4172ef46a5c1ba04a37fcb19726f0b7aa3352efa4f5ceca6245d1 SHA512 b81734ca8b32d5ddc7bad28aead5a96e578844aa2a8e6635ffe62b7dcd38daf3b7e218569d43e0cb9e6cd12adfa07a8c41fb51877f65717e3c98e6ce3c25a017
DIST thelounge-4.4.1.tar.gz 577766 BLAKE2B f5ce4b381445e7d8d33e83431e4222b3fdc7ad2870c7819c9d641b2e7aca9e4cbd7d000a188132f40a39b775904d8d145e87a5edda6d6195bb2de2d9a6b6eb0a SHA512 7695121a713a23688bc6f52dae2574bab1288eea930fd50d4dd85037233e9f23bd8e460980c69cdd14ea8648da4720d84e8196547b6a18e69d2f478b43d6e29a
DIST thelounge-4.4.2_rc1-deps.tar.xz 82563560 BLAKE2B 4511199d37825a2627f1865386da988047d33471b3b12ef8e84b3b3aca14d4bf50180a54436ba13487ddd21583abe2db2fdb830cde38c4872479b485117f5763 SHA512 3358b07fd9a27f8e4f16cdcff00c13b7a08850db4629f28320e485a9ad35a081174245715c3089fdf95307317cf2e198c959611a291070cfc1bdb0f0e4b567ca
DIST thelounge-4.4.2_rc1-sqlite3.tar.xz 4110020 BLAKE2B 39eaf47ea4f18b7e5f73af53771a5b3042f547476608579de0d36417e58693956fa2b6dbed17cdbadc254bc9844c452c45fb8fb016f2aed66c4220193e2c69e2 SHA512 a39202018e3927504913d62f4eaaeeda70a20dc7b35ed7b9f40b46a709982b46fc5a618bc425084b533ff6634c1f56924aec5e3a5bcc2393ae176d8f72e5f237
DIST thelounge-4.4.2_rc1.tar.gz 588927 BLAKE2B 24e1b47e124ac1654cfeb967ceffc0d72e54691b59a0c71bfd00fe9a4ef68b8e0279561cb52f56bd281876af1d04a995481602f8a0e647bf30af3fa9a7ce5ef7 SHA512 24c8304566aca12fa0264e175e8340687f8488afbb1cb49430323c7d5c6a5fdc6e0ad14f1bd0e327e4284d3b7477cd61a18677a63836a2c49a1f4c7f785a8e33

View File

@@ -0,0 +1,4 @@
# Fields: type; path; mode; uid; gid; age; argument
# tmpfiled.d(5)
d /var/lib/thelounge 0750 thelounge thelounge
f /var/log/thelounge.log 0640 thelounge thelounge

View File

@@ -0,0 +1,13 @@
[Unit]
Description=thelounge - Modern, responsive, cross-platform, self-hosted web IRC client
Documentation=https://thelounge.chat/docs
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/%N start
UMask=0027
[Install]
WantedBy=default.target

View File

@@ -0,0 +1,3 @@
## Sets the Data directory for thelounge.
## It contains config, logs database, logs txt files, user records, extra packages installed with `thelounge install` etc.
# THELOUNGE_HOME=/var/lib/thelounge

View File

@@ -0,0 +1,20 @@
#!/sbin/openrc-run
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
name="thelounge"
description="Modern, responsive, cross-platform, self-hosted web IRC client"
command="/usr/bin/${RC_SVCNAME}"
command_args="start"
command_user="${RC_SVCNAME}:${RC_SVCNAME}"
command_background="true"
pidfile="/run/${RC_SVCNAME}.pid"
output_log="/var/log/${RC_SVCNAME}.log"
error_log="/var/log/${RC_SVCNAME}.log"
: "${THELOUNGE_HOME:=/var/lib/${RC_SVCNAME}}"
directory="${THELOUNGE_HOME}"
umask=0027
depend() {
after net
}

View File

@@ -0,0 +1,7 @@
/var/log/thelounge.log {
missingok
size 5M
rotate 3
compress
copytruncate
}

View File

@@ -0,0 +1,44 @@
[Unit]
Description=thelounge - Modern, responsive, cross-platform, self-hosted web IRC client
Documentation=https://thelounge.chat/docs
After=network-online.target
Wants=network-online.target
[Service]
Environment=THELOUNGE_HOME=/var/lib/%N
ExecStart=/usr/bin/%N start
WorkingDirectory=/var/lib/%N
User=%N
Group=%N
UMask=0027
# Sandboxing and hardening systemd.exec(5)
PrivateUsers=yes
ProtectClock=yes
ProtectHostname=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
RestrictNamespaces=yes
LockPersonality=yes
RestrictSUIDSGID=yes
RemoveIPC=yes
RestrictRealtime=yes
PrivateTmp=true
PrivateDevices=true
ProtectHome=true
NoNewPrivileges=true
# set entire file system to read only except following ReadWritePaths
ProtectSystem=strict
ReadWritePaths=/var/lib/%N
# Set reasonable connection and process limits
LimitNOFILE=1048576
LimitNPROC=64
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>me@rahil.rocks</email>
<name>Rahil Bhimjiani</name>
</maintainer>
<upstream>
<remote-id type="github">thelounge/thelounge</remote-id>
<bugs-to>https://github.com/thelounge/thelounge/issues</bugs-to>
</upstream>
</pkgmetadata>

View File

@@ -0,0 +1,78 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit readme.gentoo-r1 systemd tmpfiles
DESCRIPTION="Modern, responsive, cross-platform, self-hosted web IRC client"
HOMEPAGE="https://thelounge.chat/"
SRC_URI="
https://github.com/thelounge/thelounge/archive/refs/tags/v${PV/_rc/-rc.}.tar.gz -> ${P}.tar.gz
https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz -> ${P}-deps.tar.xz
https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/sqlite3.tar.xz -> ${P}-sqlite3.tar.xz
"
S="${WORKDIR}/${PN}-${PV/_rc/-rc.}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
RDEPEND="
acct-user/${PN}
acct-group/${PN}
>=net-libs/nodejs-16
"
BDEPEND="
>=net-libs/nodejs-16[npm]
sys-apps/yarn
"
DOC_CONTENTS="\n
##### Defaults #####\n
Data directory: /var/lib/${PN}\n
Listens on: 0.0.0.0:9000\n
Log file (openrc): /var/log/${PN}.log\n
\n
##### Initialization #####\n
Run \`THELOUNGE_HOME=/var/lib/${PN} ${PN} add <user>\`
"
mooyarn() {
yarn --verbose --non-interactive --frozen-lockfile --cache-folder ../yarn-cache \
--offline --global-folder moobuild "${@}" || die
}
src_compile() {
mooyarn install
NODE_ENV=production mooyarn build
local BUILT_TAR=$(npm pack)
NODE_ENV=production mooyarn global add file:$(realpath ${BUILT_TAR})
# this workaround because sqlite3 module requires network access
mv -v ../sqlite3 moobuild/node_modules/ || die
}
src_install() {
insinto /usr/$(get_libdir)/node_modules/"${PN}"
doins -r moobuild/node_modules
fperms 755 /usr/$(get_libdir)/node_modules/"${PN}"/node_modules/"${PN}"/index.js
dosym -r /usr/$(get_libdir)/node_modules/"${PN}"/node_modules/"${PN}"/index.js /usr/bin/"${PN}"
systemd_newunit "${FILESDIR}"/"${PN}"-4.4.1.service "${PN}".service
systemd_newuserunit "${FILESDIR}"/"${PN}"-4.4.1-user.service "${PN}".service
newinitd "${FILESDIR}"/"${PN}"-4.4.1.initd "${PN}"
newconfd "${FILESDIR}"/"${PN}"-4.4.1.confd "${PN}"
newtmpfiles "${FILESDIR}"/"${PN}"-4.4.1-tmpfiles.conf "${PN}".conf
insinto /etc/logrotate.d
newins "${FILESDIR}"/"${PN}"-4.4.1.logrotate "${PN}"
readme.gentoo_create_doc
}
pkg_postinst() {
tmpfiles_process "${PN}".conf
readme.gentoo_print_elog
}

View File

@@ -0,0 +1,78 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit readme.gentoo-r1 systemd tmpfiles
DESCRIPTION="Modern, responsive, cross-platform, self-hosted web IRC client"
HOMEPAGE="https://thelounge.chat/"
SRC_URI="
https://github.com/thelounge/thelounge/archive/refs/tags/v${PV/_rc/-rc.}.tar.gz -> ${P}.tar.gz
https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz -> ${P}-deps.tar.xz
https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/sqlite3.tar.xz -> ${P}-sqlite3.tar.xz
"
S="${WORKDIR}/${PN}-${PV/_rc/-rc.}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
RDEPEND="
acct-user/${PN}
acct-group/${PN}
>=net-libs/nodejs-18
"
BDEPEND="
>=net-libs/nodejs-18[npm]
sys-apps/yarn
"
DOC_CONTENTS="\n
##### Defaults #####\n
Data directory: /var/lib/${PN}\n
Listens on: 0.0.0.0:9000\n
Log file (openrc): /var/log/${PN}.log\n
\n
##### Initialization #####\n
Run \`THELOUNGE_HOME=/var/lib/${PN} ${PN} add <user>\`
"
mooyarn() {
yarn --verbose --non-interactive --frozen-lockfile --cache-folder ../yarn-cache \
--offline --global-folder moobuild "${@}" || die
}
src_compile() {
mooyarn install
NODE_ENV=production mooyarn build
local BUILT_TAR=$(npm pack)
NODE_ENV=production mooyarn global add file:$(realpath ${BUILT_TAR})
# this workaround because sqlite3 module requires network access
mv -v ../sqlite3 moobuild/node_modules/ || die
}
src_install() {
insinto /usr/$(get_libdir)/node_modules/"${PN}"
doins -r moobuild/node_modules
fperms 755 /usr/$(get_libdir)/node_modules/"${PN}"/node_modules/"${PN}"/index.js
dosym -r /usr/$(get_libdir)/node_modules/"${PN}"/node_modules/"${PN}"/index.js /usr/bin/"${PN}"
systemd_newunit "${FILESDIR}"/"${PN}"-4.4.1.service "${PN}".service
systemd_newuserunit "${FILESDIR}"/"${PN}"-4.4.1-user.service "${PN}".service
newinitd "${FILESDIR}"/"${PN}"-4.4.1.initd "${PN}"
newconfd "${FILESDIR}"/"${PN}"-4.4.1.confd "${PN}"
newtmpfiles "${FILESDIR}"/"${PN}"-4.4.1-tmpfiles.conf "${PN}".conf
insinto /etc/logrotate.d
newins "${FILESDIR}"/"${PN}"-4.4.1.logrotate "${PN}"
readme.gentoo_create_doc
}
pkg_postinst() {
tmpfiles_process "${PN}".conf
readme.gentoo_print_elog
}