FreeBSD Bugzilla – Attachment 236293 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]
Update port maintainer
0001-irc-py-sopel-new-port.patch (text/plain), 11.07 KB, created by
Jesús Daniel Colmenares Oviedo
on 2022-09-01 21:32:52 UTC
(
hide
)
Description:
Update port maintainer
Filename:
MIME Type:
Creator:
Jesús Daniel Colmenares Oviedo
Created:
2022-09-01 21:32:52 UTC
Size:
11.07 KB
patch
obsolete
>From fea6a04acef4887443bdcdc5b2f35518629b0efe Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Jes=C3=BAs=20Daniel=20Colmenares=20Oviedo?= > <DtxdF@disroot.org> >Date: Thu, 1 Sep 2022 09:49:29 -0400 >Subject: [PATCH] irc/py-sopel: new port > >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://github.com/sopel-irc/sopel >--- > GIDs | 2 +- > UIDs | 2 +- > irc/py-sopel/Makefile | 49 +++++++++ > irc/py-sopel/distinfo | 3 + > 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 | 5 + > irc/py-sopel/pkg-plist | 6 ++ > 9 files changed, 278 insertions(+), 2 deletions(-) > create mode 100644 irc/py-sopel/Makefile > create mode 100644 irc/py-sopel/distinfo > 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 7440c023f..f7d362964 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 57906f772..009c68c53 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 000000000..2e78c4101 >--- /dev/null >+++ b/irc/py-sopel/Makefile >@@ -0,0 +1,49 @@ >+PORTNAME= sopel >+PORTVERSION= 7.1.9 >+CATEGORIES= irc python >+MASTER_SITES= CHEESESHOP >+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} >+ >+MAINTAINER= DtxdF@disroot.org >+COMMENT= Simple and extensible IRC bot >+ >+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}sqlalchemy14>0:databases/py-sqlalchemy14@${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 >+ >+USERS= sopel >+GROUPS= sopel >+ >+USE_RC_SUBR= sopel >+SUB_FILES+= pkg-message >+SUB_LIST+= PYTHON_CMD=${PYTHON_CMD} >+ >+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 000000000..384a7f61a >--- /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/pkg-message.in b/irc/py-sopel/files/pkg-message.in >new file mode 100644 >index 000000000..82d6c637f >--- /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 000000000..7f8a5a4a2 >--- /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 000000000..a94ea9124 >--- /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 000000000..2d5eaffef >--- /dev/null >+++ b/irc/py-sopel/pkg-descr >@@ -0,0 +1,5 @@ >+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://github.com/sopel-irc/sopel >diff --git a/irc/py-sopel/pkg-plist b/irc/py-sopel/pkg-plist >new file mode 100644 >index 000000000..504814fd2 >--- /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.37.2 >
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