mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-20 12:33:40 -04:00
net-misc/fedigroup: new package, add 1.0.6
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
1
net-misc/fedigroup/Manifest
Normal file
1
net-misc/fedigroup/Manifest
Normal file
@@ -0,0 +1 @@
|
||||
DIST fedigroup.py-1.0.6.tar.gz 17909 BLAKE2B d4a9003d0fd06f3bb74777966b71618cb5283aa017ecf91ac182f8fb460fc028469e13aace678b4319714e555ede2c6f4aa7f16b449efb272bf9a6d441be423f SHA512 0481bd1de94d3d4cf2f5c57c078244a079ac3541393555bcb6b36db88457ed10505d065eeee63da222280e62ec14fb5c492b727da6f6495f1d91936c7b9ea53c
|
||||
38
net-misc/fedigroup/fedigroup-1.0.6.ebuild
Normal file
38
net-misc/fedigroup/fedigroup-1.0.6.ebuild
Normal file
@@ -0,0 +1,38 @@
|
||||
# Copyright 2022 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{8..11} )
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
DISTUTILS_SINGLE_IMPL=1
|
||||
inherit distutils-r1 edo
|
||||
|
||||
MY_PN="${PN}.py"
|
||||
MY_P="${MY_PN}-${PV}"
|
||||
DESCRIPTION="Emulate group accounts on Mastodon/Pleroma"
|
||||
HOMEPAGE="
|
||||
https://pypi.org/project/fedigroup.py/
|
||||
https://github.com/uanet-exception/fedigroup.py
|
||||
"
|
||||
SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
|
||||
LICENSE="GPL-3+"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
RDEPEND="
|
||||
acct-user/fedigroup
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/mastodon-py[${PYTHON_USEDEP}]
|
||||
dev-python/requests[${PYTHON_USEDEP}]
|
||||
')
|
||||
"
|
||||
|
||||
src_install() {
|
||||
distutils-r1_src_install
|
||||
|
||||
newinitd "${FILESDIR}"/fedigroup.initd ${PN}
|
||||
newconfd "${FILESDIR}"/fedigroup.confd ${PN}
|
||||
}
|
||||
5
net-misc/fedigroup/files/fedigroup.confd
Normal file
5
net-misc/fedigroup/files/fedigroup.confd
Normal file
@@ -0,0 +1,5 @@
|
||||
# Fedigroup bot name
|
||||
#FEDIGROUP_BOT="${RC_SVCNAME#fedigroup.}"
|
||||
|
||||
# Fedigroup configuration file
|
||||
#FEDIGROUP_CONFIG="/etc/fedigroup.conf"
|
||||
64
net-misc/fedigroup/files/fedigroup.initd
Normal file
64
net-misc/fedigroup/files/fedigroup.initd
Normal file
@@ -0,0 +1,64 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 2022 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# shellcheck shell=sh disable=SC2034
|
||||
|
||||
: ${FEDIGROUP_BOT:=${RC_SVCNAME#fedigroup.}}
|
||||
: ${FEDIGROUP_CONFIG:=/etc/fedigroup.conf}
|
||||
|
||||
extra_commands="create remove list"
|
||||
description_create="create a new bot"
|
||||
description_remove="remove selected bot from config file"
|
||||
description_list="list all bots from config file"
|
||||
|
||||
command="/usr/bin/fedigroup.py"
|
||||
command_args="run ${FEDIGROUP_BOT} -c ${FEDIGROUP_CONFIG}"
|
||||
command_user="fedigroup:fedigroup"
|
||||
command_background=yes
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
output_log="/var/log/${RC_SVCNAME}.log"
|
||||
error_log="${output_log}"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
fix_config_perms() {
|
||||
checkpath -q -o fedigroup:fedigroup -m 0640 -f "${FEDIGROUP_CONFIG}"
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if [ "${FEDIGROUP_BOT}" = "${RC_SVCNAME}" ]; then
|
||||
eerror "Missing FEDIGROUP_BOT variable"
|
||||
return 1
|
||||
fi
|
||||
|
||||
fix_config_perms || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
create() {
|
||||
local name=""
|
||||
printf "Enter the name of the bot to be created: "
|
||||
read name
|
||||
|
||||
fix_config_perms || return 1
|
||||
"${command}" create "${name}" -c "${FEDIGROUP_CONFIG}" || return 1
|
||||
}
|
||||
|
||||
remove() {
|
||||
local name=""
|
||||
printf "Enter the name of the bot to be removed: "
|
||||
read name
|
||||
|
||||
fix_config_perms || return 1
|
||||
start-stop-daemon --quiet --exec "${command}" \
|
||||
-- remove "${name}" -c "${FEDIGROUP_CONFIG}" || return 1
|
||||
}
|
||||
|
||||
list() {
|
||||
fix_config_perms || return 1
|
||||
start-stop-daemon --quiet --exec "${command}" \
|
||||
-- list -c "${FEDIGROUP_CONFIG}" || return 1
|
||||
}
|
||||
12
net-misc/fedigroup/metadata.xml
Normal file
12
net-misc/fedigroup/metadata.xml
Normal 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>cyber+gentoo@sysrq.in</email>
|
||||
<name>Anna</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="pypi">fedigroup.py</remote-id>
|
||||
<remote-id type="github">uanet-exception/fedigroup.py</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
Reference in New Issue
Block a user