FreeBSD Bugzilla – Attachment 240421 Details for
Bug 265807
[NEW PORT] irc/py-sopel: Easy-to-use and highly extensible IRC Bot framework
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
py-sopel-7.1.9.patch
0001-irc-py-sopel-New-port-Easy-to-use-and-highly-extensi.patch (text/plain), 12.92 KB, created by
Jesús Daniel Colmenares Oviedo
on 2023-02-26 12:50:18 UTC
(
hide
)
Description:
py-sopel-7.1.9.patch
Filename:
MIME Type:
Creator:
Jesús Daniel Colmenares Oviedo
Created:
2023-02-26 12:50:18 UTC
Size:
12.92 KB
patch
obsolete
>From 6820c07fbd82485c9a0365f14380c902fc2a4831 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Jes=C3=BAs=20Daniel=20Colmenares=20Oviedo?= > <DtxdF@disroot.org> >Date: Sun, 26 Feb 2023 08:19:16 -0400 >Subject: [PATCH] irc/py-sopel: New port: Easy-to-use and highly extensible IRC > Bot framework > >Sopel is a simple, lightweight, open source, easy-to-use IRC Utility >bot, written in Python. It's designed to be easy to use, run and >extend. > >WWW: https://sopel.chat/ >--- > GIDs | 2 +- > UIDs | 2 +- > irc/py-sopel/Makefile | 50 ++++++++ > irc/py-sopel/distinfo | 3 + > irc/py-sopel/files/patch-requirements.txt | 37 ++++++ > irc/py-sopel/files/pkg-message.in | 45 +++++++ > irc/py-sopel/files/sopel-default.cfg | 21 ++++ > irc/py-sopel/files/sopel.in | 147 ++++++++++++++++++++++ > irc/py-sopel/pkg-descr | 3 + > irc/py-sopel/pkg-plist | 6 + > 10 files changed, 314 insertions(+), 2 deletions(-) > create mode 100644 irc/py-sopel/Makefile > create mode 100644 irc/py-sopel/distinfo > create mode 100644 irc/py-sopel/files/patch-requirements.txt > create mode 100644 irc/py-sopel/files/pkg-message.in > create mode 100644 irc/py-sopel/files/sopel-default.cfg > create mode 100644 irc/py-sopel/files/sopel.in > create mode 100644 irc/py-sopel/pkg-descr > create mode 100644 irc/py-sopel/pkg-plist > >diff --git a/GIDs b/GIDs >index c6882f3386..866f8c30c9 100644 >--- a/GIDs >+++ b/GIDs >@@ -698,7 +698,7 @@ c-lightning:*:735: > # free: 754 > # free: 755 > # free: 756 >-# free: 757 >+sopel:*:757: > # free: 758 > # free: 759 > # free: 760 >diff --git a/UIDs b/UIDs >index 7326744a45..38d5ae5564 100644 >--- a/UIDs >+++ b/UIDs >@@ -703,7 +703,7 @@ c-lightning:*:735:735::0:0:c-lightning Daemon:/var/db/c-lightning:/usr/sbin/nolo > # free: 754 > # free: 755 > # free: 756 >-# free: 757 >+sopel:*:757:757::0:0:Sopel IRC Bot:/var/db/sopel:/usr/sbin/nologin > # free: 758 > # free: 759 > # free: 760 >diff --git a/irc/py-sopel/Makefile b/irc/py-sopel/Makefile >new file mode 100644 >index 0000000000..767a3717fb >--- /dev/null >+++ b/irc/py-sopel/Makefile >@@ -0,0 +1,50 @@ >+PORTNAME= sopel >+PORTVERSION= 7.1.9 >+CATEGORIES= irc python >+MASTER_SITES= PYPI >+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} >+ >+MAINTAINER= DtxdF@disroot.org >+COMMENT= Easy-to-use and highly extensible IRC Bot framework >+WWW= https://sopel.chat/ >+ >+LICENSE= EFLv2 >+LICENSE_GROUPS= FSF GPL OSI >+LICENSE_NAME= Eiffel Forum License, version 2 >+LICENSE_FILE= ${WRKSRC}/COPYING >+LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept >+ >+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dnspython>0:dns/py-dnspython@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}GeoIP2>0:net/py-GeoIP2@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}importlib-metadata>0:devel/py-importlib-metadata@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}praw>0:www/py-praw@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}pytz>0:devel/py-pytz@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}sqlalchemy13>0:databases/py-sqlalchemy13@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}urllib3>0:net/py-urllib3@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}xmltodict>=0.12:devel/py-xmltodict@${PY_FLAVOR} >+ >+USES= python:3.8+ >+USE_PYTHON= autoplist distutils >+ >+USE_RC_SUBR= sopel >+SUB_FILES+= pkg-message >+SUB_LIST+= PYTHON_CMD=${PYTHON_CMD} >+ >+USERS= sopel >+GROUPS= sopel >+ >+PLIST_SUB= GROUP="${GROUPS:[0]}" \ >+ USER="${USERS:[0]}" >+ >+post-install: >+ @${MKDIR} ${STAGEDIR}/${ETCDIR} >+ @${CP} ${FILESDIR}/sopel-default.cfg ${STAGEDIR}/${ETCDIR}/sopel-default.cfg.sample >+.for dir in run log db >+ @${MKDIR} ${STAGEDIR}/var/${dir}/sopel >+.endfor >+ @${MKDIR} ${STAGEDIR}/var/db/sopel/www >+ >+.include <bsd.port.mk> >diff --git a/irc/py-sopel/distinfo b/irc/py-sopel/distinfo >new file mode 100644 >index 0000000000..384a7f61a7 >--- /dev/null >+++ b/irc/py-sopel/distinfo >@@ -0,0 +1,3 @@ >+TIMESTAMP = 1660249423 >+SHA256 (sopel-7.1.9.tar.gz) = 209fa8bcb42febf514d687a9994423cda5811b745d777c6fba2ec58caf3952bb >+SIZE (sopel-7.1.9.tar.gz) = 263438 >diff --git a/irc/py-sopel/files/patch-requirements.txt b/irc/py-sopel/files/patch-requirements.txt >new file mode 100644 >index 0000000000..b04c638252 >--- /dev/null >+++ b/irc/py-sopel/files/patch-requirements.txt >@@ -0,0 +1,37 @@ >+--- requirements.txt.orig 2023-02-26 10:45:58 UTC >++++ requirements.txt >+@@ -1,27 +1,8 @@ >+-xmltodict<0.12.0; python_version == '3.3' >+-xmltodict==0.12; python_version != '3.3' >++xmltodict >+ pytz >+-praw>=4.0.0,<6.0.0 >+-# transitive dependency of praw; v0.18 introduced f-string syntax >+-update-checker<0.18; python_version < '3.6' >+-geoip2<3.0; python_version <= '3.5' and python_version != '2.7' >+-geoip2>=3.0,<4.0; python_version == '2.7' >+-geoip2>=4.0,<5.0; python_version >= '3.6' >+-# transitive dependency of geoip2; v2 dropped py2.7 & py3 < 3.6 >+-maxminddb<2.0; python_version < '3.6' >+-ipaddress<2.0; python_version < '3.3' >+-requests>=2.24.0,<3.0.0; python_version != '3.3' and python_version != '3.4' >+-# py3.3 doesn't work with the chardet/charset-normalizer detection added in 2.26 >+-requests>=2.24.0,<2.26; python_version == '3.3' >+-# py3.4 isn't supported after requests 2.21 >+-requests==2.21.0; python_version == '3.4' >+-# transitive dependency of requests >+-# 2.0 will drop EOL Python 2.7 & 3.5, just like Sopel 8 plans to >+-urllib3<1.27; python_version != '3.3' and python_version != '3.4' >+-urllib3<1.23; python_version == '3.3' >+-urllib3<1.25; python_version == '3.4' >+-dnspython<2.0; python_version == '2.7' >+-dnspython<1.16.0; python_version == '3.3' >+-dnspython<3.0; python_version >= '3.4' >+-sqlalchemy<1.3; python_version == '3.3' >+-sqlalchemy<1.4; python_version != '3.3' >++praw >++geoip2 >++requests >++urllib3 >++dnspython >++sqlalchemy >diff --git a/irc/py-sopel/files/pkg-message.in b/irc/py-sopel/files/pkg-message.in >new file mode 100644 >index 0000000000..119c74c283 >--- /dev/null >+++ b/irc/py-sopel/files/pkg-message.in >@@ -0,0 +1,45 @@ >+[ >+{ >+ type: install >+ message: <<EOM >+Sopel was installed and there are some notes: >+ >+1. The default profile or configuration file is installed in >+%%ETCDIR%%/sopel-default.cfg. >+ >+2. The default profile uses logdir (/var/log/sopel), pid_dir >+(/var/run/sopel) and homedir (/var/db/sopel) directories, which are >+already created. You can change them in %%ETCDIR%%/sopel-default.cfg. >+ >+3. Enable sopel with: >+sysrc sopel_enable="YES" >+ >+4. Sopel can configure the common options with: >+service sopel configure >+ >+5. Before starting sopel, it must be configured using service sopel configure >+or directly in the configuration file. After it is configured, the >+not_configured parameter in the configuration file must be removed >+or change its value to False. >+ >+6. The service can run multiple instances of sopel, the default >+profile is "default". You can change or add more profiles by making >+a copy or creating other files with the prefix sopel- and the name >+of the profile: >+ >+cp %%ETCDIR%%/sopel-default.cfg.sample %%ETCDIR%%/sopel-profile1.cfg >+cp %%ETCDIR%%/sopel-default.cfg.sample %%ETCDIR%%/sopel-profile2.cfg >+cp %%ETCDIR%%/sopel-default.cfg.sample %%ETCDIR%%/sopel-profile3.cfg >+ >+Edit and add them in /etc/rc.conf: >+ >+sysrc sopel_profiles+="profile1 profile2 profile3" >+ >+7. Each plugin has its own configuration. If you observe strange behavior, please >+make sure you have configured the module correctly before reporting it as a bug. >+ >+8. Start the service: >+service sopel start >+EOM >+} >+] >diff --git a/irc/py-sopel/files/sopel-default.cfg b/irc/py-sopel/files/sopel-default.cfg >new file mode 100644 >index 0000000000..7f8a5a4a28 >--- /dev/null >+++ b/irc/py-sopel/files/sopel-default.cfg >@@ -0,0 +1,21 @@ >+# >+# IMPORTANT NOTE! >+# You must delete the not_configured line in order for the bot to work, >+# otherwise it will refuse to start. >+[core] >+nick=sopel >+not_configured=True >+host=irc.libera.chat >+port=6697 >+use_ssl=True >+verify_ssl=True >+owner= >+logdir=/var/log/sopel >+pid_dir=/var/run/sopel >+homedir=/var/db/sopel >+ >+[meetbot] >+# If this directory is not created, sopel will see "/www/meetings" >+# and not as "/var/db/sopel/www/meetings". Sopel runs by default >+# as a non-root user, it cannot make a directory in /. >+meeting_log_path = /var/db/sopel/www/meetings >diff --git a/irc/py-sopel/files/sopel.in b/irc/py-sopel/files/sopel.in >new file mode 100644 >index 0000000000..278c461cbe >--- /dev/null >+++ b/irc/py-sopel/files/sopel.in >@@ -0,0 +1,147 @@ >+#!/bin/sh >+ >+# PROVIDE: sopel >+# REQUIRE: LOGIN >+# KEYWORD: shutdown >+# >+# Configuration settings for sopel in /etc/rc.conf >+# >+# sopel_enable (bool): Enable sopel. (default=NO) >+# sopel_piddir (str): Directory in which to put the process ID file. (default=/var/run/sopel) >+# sopel_confdir (str): Configuration directory. (default=%%ETCDIR%%) >+# sopel_flags (str): Flags used for sopel. (default=--config-dir "${sopel_confdir}") >+# sopel_script (str): Path to sopel application. (default=%%PREFIX%%/bin/sopel) >+# sopel_user (str): User to run sopel as. (default=sopel) >+# sopel_profiles (str): List of profiles for running multiple sopel instances. >+# (default=default) >+# sopel_prefix (str): Each profile or configuration file must begin with thix prefix >+# followed by the profile name, followed by the extension .cfg, >+# such as sopel-default.cfg, sopel-libera.chat.cfg, etc. >+# (default=sopel-) >+# sopel_output (str): Send stdout and stderr to a file. If you set the logdir parameter in >+# the sopel file configuration, your best option is to send the output >+# to /dev/null. But this can be changed for debugging. >+# (default=/dev/null) >+ >+. /etc/rc.subr >+ >+name=sopel >+rcvar=sopel_enable >+desc="Simple, easy-to-use, open-source IRC utility bot, written in Python" >+start_precmd=sopel_checkprofile >+stop_precmd=sopel_checkprofile >+start_cmd=sopel_start >+stop_cmd=sopel_stop >+restart_cmd=sopel_restart >+status_cmd=sopel_status >+configure_cmd=sopel_configure >+extra_commands="configure status" >+command_interpreter="%%PYTHON_CMD%%" >+ >+load_rc_config $name >+ >+: ${sopel_enable:=NO} >+: ${sopel_piddir:=/var/run/sopel} >+: ${sopel_confdir:=%%ETCDIR%%} >+: ${sopel_flags=--config-dir "${sopel_confdir}"} >+: ${sopel_script:=%%PREFIX%%/bin/sopel} >+: ${sopel_user:=sopel} >+: ${sopel_profiles:=default} >+: ${sopel_prefix:=sopel-} >+: ${sopel_output:=/dev/null} >+ >+sopel_checkprofile() >+{ >+ if ! [ -f "${sopel_confdir}/${sopel_prefix}${profile}.cfg" ]; then >+ echo "Sopel profile '${profile}' does not exist." >+ return 1 >+ fi >+ >+ return 0 >+} >+ >+sopel_start() >+{ >+ local profile >+ >+ profile="$1"; shift >+ >+ echo "Starting sopel profile '${profile}'." && sleep 1 >+ daemon \ >+ -o "${sopel_output}" \ >+ -t "${desc}" \ >+ -u "${sopel_user}" \ >+ ${command_interpreter} \ >+ ${sopel_script} start ${sopel_flags} \ >+ -c "${sopel_prefix}${profile}" $@ >+} >+ >+sopel_stop() >+{ >+ local pid pidfile profile >+ >+ profile="$1"; shift >+ >+ pidfile="${sopel_piddir}/sopel-${sopel_prefix}${profile}.pid" >+ if ! [ -f "${pidfile}" ]; then >+ echo "sopel profile '${profile}' not running? (check ${sopel_piddir}/sopel-${sopel_prefix}${profile}.pid)." >+ return 1 >+ fi >+ >+ pid=`cat ${pidfile}` >+ >+ echo "Stopping sopel profile '${profile}'." >+ daemon \ >+ -o "${sopel_output}" \ >+ ${command_interpreter} \ >+ ${sopel_script} stop ${sopel_flags} \ >+ -c "${sopel_prefix}${profile}" $@ >+ >+ wait_for_pids $pid >+} >+ >+sopel_restart() >+{ >+ local profile >+ >+ profile="$1"; shift >+ >+ run_rc_command stop "${profile}" $@ >+ run_rc_command start "${profile}" $@ >+} >+ >+sopel_status() >+{ >+ local profile pid >+ >+ profile="$1"; shift >+ >+ pid=`check_pidfile \ >+ "${sopel_piddir}/sopel-${sopel_prefix}${profile}.pid" \ >+ "${sopel_script}" \ >+ "${command_interpreter}"` >+ >+ if [ -n "${pid}" ]; then >+ echo "Sopel profile '${profile}' is running as pid ${pid}." >+ else >+ echo "Sopel profile '${profile}' is not running." >+ fi >+} >+ >+sopel_configure() >+{ >+ local profile >+ >+ profile="$1"; shift >+ >+ echo "Configuring profile '${profile}'..." >+ >+ ${command_interpreter} \ >+ ${sopel_script} configure ${sopel_flags} \ >+ -c "${sopel_confdir}/${sopel_prefix}${profile}" $@ >+} >+ >+cmd="$1"; shift >+for profile in ${sopel_profiles}; do >+ run_rc_command "${cmd}" "${profile}" $@ >+done >diff --git a/irc/py-sopel/pkg-descr b/irc/py-sopel/pkg-descr >new file mode 100644 >index 0000000000..906e7de0af >--- /dev/null >+++ b/irc/py-sopel/pkg-descr >@@ -0,0 +1,3 @@ >+Sopel is a simple, lightweight, open source, easy-to-use IRC Utility >+bot, written in Python. It's designed to be easy to use, run and >+extend. >diff --git a/irc/py-sopel/pkg-plist b/irc/py-sopel/pkg-plist >new file mode 100644 >index 0000000000..504814fd29 >--- /dev/null >+++ b/irc/py-sopel/pkg-plist >@@ -0,0 +1,6 @@ >+@sample(%%USER%%,%%GROUP%%,640) %%ETCDIR%%/sopel-default.cfg.sample %%ETCDIR%%/sopel-default.cfg >+@dir(%%USER%%,%%GROUP%%,0700) %%ETCDIR%% >+@dir(%%USER%%,%%GROUP%%,0700) /var/db/sopel >+@dir(%%USER%%,%%GROUP%%,) /var/db/sopel/www >+@dir(%%USER%%,%%GROUP%%,0700) /var/log/sopel >+@dir(%%USER%%,%%GROUP%%,0700) /var/run/sopel >-- >2.38.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 265807
:
235872
|
236293
|
240421
|
241833