View | Details | Raw Unified | Return to bug 265807 | Differences between
and this patch

Collapse All | Expand All

(-)b/GIDs (-1 / +1 lines)
Lines 698-704 c-lightning:*:735: Link Here
698
# free: 754
698
# free: 754
699
# free: 755
699
# free: 755
700
# free: 756
700
# free: 756
701
# free: 757
701
sopel:*:757:
702
# free: 758
702
# free: 758
703
# free: 759
703
# free: 759
704
# free: 760
704
# free: 760
(-)b/UIDs (-1 / +1 lines)
Lines 703-709 c-lightning:*:735:735::0:0:c-lightning Daemon:/var/db/c-lightning:/usr/sbin/nolo Link Here
703
# free: 754
703
# free: 754
704
# free: 755
704
# free: 755
705
# free: 756
705
# free: 756
706
# free: 757
706
sopel:*:757:757::0:0:Sopel IRC Bot:/var/db/sopel:/usr/sbin/nologin
707
# free: 758
707
# free: 758
708
# free: 759
708
# free: 759
709
# free: 760
709
# free: 760
(-)b/irc/py-sopel/Makefile (+50 lines)
Added Link Here
1
PORTNAME=	sopel
2
DISTVERSION=	7.1.9
3
CATEGORIES=	irc python
4
MASTER_SITES=	PYPI
5
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
6
7
MAINTAINER=	DtxdF@disroot.org
8
COMMENT=	Easy-to-use and highly extensible IRC Bot framework
9
WWW=		https://sopel.chat/
10
11
LICENSE=	EFLv2
12
LICENSE_GROUPS=	FSF GPL OSI
13
LICENSE_NAME=	Eiffel Forum License, version 2
14
LICENSE_FILE=	${WRKSRC}/COPYING
15
LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
16
17
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}dnspython>0:dns/py-dnspython@${PY_FLAVOR} \
18
		${PYTHON_PKGNAMEPREFIX}GeoIP2>0:net/py-GeoIP2@${PY_FLAVOR} \
19
		${PYTHON_PKGNAMEPREFIX}importlib-metadata>0:devel/py-importlib-metadata@${PY_FLAVOR} \
20
		${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \
21
		${PYTHON_PKGNAMEPREFIX}praw>0:www/py-praw@${PY_FLAVOR} \
22
		${PYTHON_PKGNAMEPREFIX}pytz>0:devel/py-pytz@${PY_FLAVOR} \
23
		${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \
24
		${PYTHON_PKGNAMEPREFIX}sqlalchemy13>0:databases/py-sqlalchemy13@${PY_FLAVOR} \
25
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
26
		${PYTHON_PKGNAMEPREFIX}urllib3>0:net/py-urllib3@${PY_FLAVOR} \
27
		${PYTHON_PKGNAMEPREFIX}xmltodict>=0.12:devel/py-xmltodict@${PY_FLAVOR}
28
29
USES=		python:3.8+
30
USE_PYTHON=	autoplist distutils
31
32
USE_RC_SUBR=	sopel
33
SUB_FILES+=	pkg-message
34
SUB_LIST+=	PYTHON_CMD=${PYTHON_CMD}
35
36
USERS=		sopel
37
GROUPS=		sopel
38
39
PLIST_SUB=	GROUP="${GROUPS:[0]}" \
40
		USER="${USERS:[0]}"
41
42
post-install:
43
	@${MKDIR} ${STAGEDIR}/${ETCDIR}
44
	@${CP} ${FILESDIR}/sopel-default.cfg ${STAGEDIR}/${ETCDIR}/sopel-default.cfg.sample
45
.for dir in run log db
46
	@${MKDIR} ${STAGEDIR}/var/${dir}/sopel
47
.endfor
48
	@${MKDIR} ${STAGEDIR}/var/db/sopel/www
49
50
.include <bsd.port.mk>
(-)b/irc/py-sopel/distinfo (+3 lines)
Added Link Here
1
TIMESTAMP = 1660249423
2
SHA256 (sopel-7.1.9.tar.gz) = 209fa8bcb42febf514d687a9994423cda5811b745d777c6fba2ec58caf3952bb
3
SIZE (sopel-7.1.9.tar.gz) = 263438
(-)b/irc/py-sopel/files/patch-requirements.txt (+37 lines)
Added Link Here
1
--- requirements.txt.orig	2023-02-26 10:45:58 UTC
2
+++ requirements.txt
3
@@ -1,27 +1,8 @@
4
-xmltodict<0.12.0; python_version == '3.3'
5
-xmltodict==0.12; python_version != '3.3'
6
+xmltodict
7
 pytz
8
-praw>=4.0.0,<6.0.0
9
-# transitive dependency of praw; v0.18 introduced f-string syntax
10
-update-checker<0.18; python_version < '3.6'
11
-geoip2<3.0; python_version <= '3.5' and python_version != '2.7'
12
-geoip2>=3.0,<4.0; python_version == '2.7'
13
-geoip2>=4.0,<5.0; python_version >= '3.6'
14
-# transitive dependency of geoip2; v2 dropped py2.7 & py3 < 3.6
15
-maxminddb<2.0; python_version < '3.6'
16
-ipaddress<2.0; python_version < '3.3'
17
-requests>=2.24.0,<3.0.0; python_version != '3.3' and python_version != '3.4'
18
-# py3.3 doesn't work with the chardet/charset-normalizer detection added in 2.26
19
-requests>=2.24.0,<2.26; python_version == '3.3'
20
-# py3.4 isn't supported after requests 2.21
21
-requests==2.21.0; python_version == '3.4'
22
-# transitive dependency of requests
23
-# 2.0 will drop EOL Python 2.7 & 3.5, just like Sopel 8 plans to
24
-urllib3<1.27; python_version != '3.3' and python_version != '3.4'
25
-urllib3<1.23; python_version == '3.3'
26
-urllib3<1.25; python_version == '3.4'
27
-dnspython<2.0; python_version == '2.7'
28
-dnspython<1.16.0; python_version == '3.3'
29
-dnspython<3.0; python_version >= '3.4'
30
-sqlalchemy<1.3; python_version == '3.3'
31
-sqlalchemy<1.4; python_version != '3.3'
32
+praw
33
+geoip2
34
+requests
35
+urllib3
36
+dnspython
37
+sqlalchemy
(-)b/irc/py-sopel/files/pkg-message.in (+45 lines)
Added Link Here
1
[
2
{
3
  type: install
4
  message: <<EOM
5
Sopel was installed and there are some notes:
6
7
1. The default profile or configuration file is installed in
8
%%ETCDIR%%/sopel-default.cfg.
9
10
2. The default profile uses logdir (/var/log/sopel), pid_dir
11
(/var/run/sopel) and homedir (/var/db/sopel) directories, which are
12
already created. You can change them in %%ETCDIR%%/sopel-default.cfg.
13
14
3. Enable sopel with:
15
sysrc sopel_enable="YES"
16
17
4. Sopel can configure the common options with:
18
service sopel configure
19
20
5. Before starting sopel, it must be configured using service sopel configure
21
or directly in the configuration file. After it is configured, the
22
not_configured parameter in the configuration file must be removed
23
or change its value to False.
24
25
6. The service can run multiple instances of sopel, the default
26
profile is "default". You can change or add more profiles by making
27
a copy or creating other files with the prefix sopel- and the name
28
of the profile:
29
30
cp %%ETCDIR%%/sopel-default.cfg.sample %%ETCDIR%%/sopel-profile1.cfg
31
cp %%ETCDIR%%/sopel-default.cfg.sample %%ETCDIR%%/sopel-profile2.cfg
32
cp %%ETCDIR%%/sopel-default.cfg.sample %%ETCDIR%%/sopel-profile3.cfg
33
34
Edit and add them in /etc/rc.conf:
35
36
sysrc sopel_profiles+="profile1 profile2 profile3"
37
38
7. Each plugin has its own configuration. If you observe strange behavior, please
39
make sure you have configured the module correctly before reporting it as a bug.
40
41
8. Start the service:
42
service sopel start
43
EOM
44
}
45
]
(-)b/irc/py-sopel/files/sopel-default.cfg (+21 lines)
Added Link Here
1
#
2
# IMPORTANT NOTE!
3
# You must delete the not_configured line in order for the bot to work,
4
# otherwise it will refuse to start.
5
[core]
6
nick=sopel
7
not_configured=True
8
host=irc.libera.chat
9
port=6697
10
use_ssl=True
11
verify_ssl=True
12
owner=
13
logdir=/var/log/sopel
14
pid_dir=/var/run/sopel
15
homedir=/var/db/sopel
16
17
[meetbot]
18
# If this directory is not created, sopel will see "/www/meetings"
19
# and not as "/var/db/sopel/www/meetings". Sopel runs by default
20
# as a non-root user, it cannot make a directory in /.
21
meeting_log_path = /var/db/sopel/www/meetings
(-)b/irc/py-sopel/files/sopel.in (+147 lines)
Added Link Here
1
#!/bin/sh
2
3
# PROVIDE: sopel
4
# REQUIRE: LOGIN
5
# KEYWORD: shutdown
6
#
7
# Configuration settings for sopel in /etc/rc.conf
8
#
9
# sopel_enable (bool):	Enable sopel. (default=NO)
10
# sopel_piddir (str):	Directory in which to put the process ID file. (default=/var/run/sopel)
11
# sopel_confdir (str):	Configuration directory. (default=%%ETCDIR%%)
12
# sopel_flags (str):	Flags used for sopel. (default=--config-dir "${sopel_confdir}")
13
# sopel_script (str):	Path to sopel application. (default=%%PREFIX%%/bin/sopel)
14
# sopel_user (str):	User to run sopel as. (default=sopel)
15
# sopel_profiles (str):	List of profiles for running multiple sopel instances.
16
#			(default=default)
17
# sopel_prefix (str):	Each profile or configuration file must begin with thix prefix
18
#			followed by the profile name, followed by the extension .cfg,
19
#			such as sopel-default.cfg, sopel-libera.chat.cfg, etc.
20
#			(default=sopel-)
21
# sopel_output (str):	Send stdout and stderr to a file. If you set the logdir parameter in
22
#			the sopel file configuration, your best option is to send the output
23
#			to /dev/null. But this can be changed for debugging.
24
#			(default=/dev/null)
25
26
. /etc/rc.subr
27
28
name=sopel
29
rcvar=sopel_enable
30
desc="Simple, easy-to-use, open-source IRC utility bot, written in Python"
31
start_precmd=sopel_checkprofile
32
stop_precmd=sopel_checkprofile
33
start_cmd=sopel_start
34
stop_cmd=sopel_stop
35
restart_cmd=sopel_restart
36
status_cmd=sopel_status
37
configure_cmd=sopel_configure
38
extra_commands="configure status"
39
command_interpreter="%%PYTHON_CMD%%"
40
41
load_rc_config $name
42
43
: ${sopel_enable:=NO}
44
: ${sopel_piddir:=/var/run/sopel}
45
: ${sopel_confdir:=%%ETCDIR%%}
46
: ${sopel_flags=--config-dir "${sopel_confdir}"}
47
: ${sopel_script:=%%PREFIX%%/bin/sopel}
48
: ${sopel_user:=sopel}
49
: ${sopel_profiles:=default}
50
: ${sopel_prefix:=sopel-}
51
: ${sopel_output:=/dev/null}
52
53
sopel_checkprofile()
54
{
55
	if ! [ -f "${sopel_confdir}/${sopel_prefix}${profile}.cfg" ]; then
56
		echo "Sopel profile '${profile}' does not exist."
57
		return 1
58
	fi
59
60
	return 0
61
}
62
63
sopel_start()
64
{
65
	local profile
66
67
	profile="$1"; shift
68
69
	echo "Starting sopel profile '${profile}'." && sleep 1
70
        daemon \
71
		-o "${sopel_output}" \
72
		-t "${desc}" \
73
		-u "${sopel_user}" \
74
		${command_interpreter} \
75
		${sopel_script} start ${sopel_flags} \
76
			-c "${sopel_prefix}${profile}" $@
77
}
78
79
sopel_stop()
80
{
81
	local pid pidfile profile
82
83
	profile="$1"; shift
84
85
	pidfile="${sopel_piddir}/sopel-${sopel_prefix}${profile}.pid"
86
	if ! [ -f "${pidfile}" ]; then
87
		echo "sopel profile '${profile}' not running? (check ${sopel_piddir}/sopel-${sopel_prefix}${profile}.pid)."
88
		return 1
89
	fi
90
91
	pid=`cat ${pidfile}`
92
93
	echo "Stopping sopel profile '${profile}'."
94
        daemon \
95
		-o "${sopel_output}" \
96
		${command_interpreter} \
97
		${sopel_script} stop ${sopel_flags} \
98
			-c "${sopel_prefix}${profile}" $@
99
100
	wait_for_pids $pid
101
}
102
103
sopel_restart()
104
{
105
	local profile
106
107
	profile="$1"; shift
108
109
        run_rc_command stop "${profile}" $@
110
        run_rc_command start "${profile}" $@
111
}
112
113
sopel_status()
114
{
115
	local profile pid
116
117
	profile="$1"; shift
118
119
	pid=`check_pidfile \
120
		"${sopel_piddir}/sopel-${sopel_prefix}${profile}.pid" \
121
		"${sopel_script}" \
122
		"${command_interpreter}"`
123
124
	if [ -n "${pid}" ]; then
125
		echo "Sopel profile '${profile}' is running as pid ${pid}."
126
	else
127
		echo "Sopel profile '${profile}' is not running."
128
	fi
129
}
130
131
sopel_configure()
132
{
133
	local profile
134
135
	profile="$1"; shift
136
137
	echo "Configuring profile '${profile}'..."
138
139
	${command_interpreter} \
140
        ${sopel_script} configure ${sopel_flags} \
141
		-c "${sopel_confdir}/${sopel_prefix}${profile}" $@
142
}
143
144
cmd="$1"; shift
145
for profile in ${sopel_profiles}; do
146
	run_rc_command "${cmd}" "${profile}" $@
147
done
(-)b/irc/py-sopel/pkg-descr (+3 lines)
Added Link Here
1
Sopel is a simple, lightweight, open source, easy-to-use IRC Utility
2
bot, written in Python. It's designed to be easy to use, run and
3
extend.
(-)b/irc/py-sopel/pkg-plist (-1 / +6 lines)
Added Link Here
0
- 
1
@sample(%%USER%%,%%GROUP%%,640) %%ETCDIR%%/sopel-default.cfg.sample %%ETCDIR%%/sopel-default.cfg
2
@dir(%%USER%%,%%GROUP%%,0700) %%ETCDIR%%
3
@dir(%%USER%%,%%GROUP%%,0700) /var/db/sopel
4
@dir(%%USER%%,%%GROUP%%,) /var/db/sopel/www
5
@dir(%%USER%%,%%GROUP%%,0700) /var/log/sopel
6
@dir(%%USER%%,%%GROUP%%,0700) /var/run/sopel

Return to bug 265807