diff --git a/mail/notimail/Makefile b/mail/notimail/Makefile new file mode 100644 index 000000000000..83b344443955 --- /dev/null +++ b/mail/notimail/Makefile @@ -0,0 +1,36 @@ +PORTNAME= NotiMail +DISTVERSIONPREFIX= v +DISTVERSION= 2.0.1 +CATEGORIES= mail python + +MAINTAINER= stefano@dragas.it +COMMENT= Server-side email notification manager with push support +WWW= https://github.com/draga79/NotiMail + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}configparser>0:devel/py-configparser@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}argparse>0:devel/py-argparse@${PY_FLAVOR} + +USES= python shebangfix +USE_GITHUB= yes +GH_ACCOUNT= draga79 +USE_RC_SUBR= notimail +SHEBANG_FILES= NotiMail.py + +NO_BUILD= yes +NO_ARCH= yes +SUB_FILES= pkg-message + +do-install: + ${INSTALL_SCRIPT} ${WRKSRC}/NotiMail.py ${STAGEDIR}${PREFIX}/bin/notimail + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/notimail + ${INSTALL_DATA} ${WRKSRC}/config.ini.sample ${STAGEDIR}${PREFIX}/etc/notimail/config.ini.sample + ${INSTALL_MAN} ${WRKSRC}/man/notimail.1 ${STAGEDIR}${PREFIX}/share/man/man1/ + ${MKDIR} ${STAGEDIR}/var/cache/notimail + ${MKDIR} ${STAGEDIR}/var/log/notimail + +.include diff --git a/mail/notimail/distinfo b/mail/notimail/distinfo new file mode 100644 index 000000000000..7b26cbe19a12 --- /dev/null +++ b/mail/notimail/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1740244881 +SHA256 (draga79-NotiMail-v2.0.1_GH0.tar.gz) = 297123f920607f5c4b4db4d7ebb2c7cb6e23bd40b9acb7bc8892251ce82ea880 +SIZE (draga79-NotiMail-v2.0.1_GH0.tar.gz) = 18061 diff --git a/mail/notimail/files/notimail.in b/mail/notimail/files/notimail.in new file mode 100644 index 000000000000..de087d13c7b7 --- /dev/null +++ b/mail/notimail/files/notimail.in @@ -0,0 +1,49 @@ +#!/bin/sh + +# PROVIDE: notimail +# REQUIRE: DAEMON +# KEYWORD: shutdown + +. /etc/rc.subr + +name="notimail" +rcvar="${name}_enable" + +load_rc_config $name + +: ${notimail_enable:="NO"} +: ${notimail_user:="daemon"} +: ${notimail_group:="daemon"} +: ${notimail_command:="%%PREFIX%%/bin/notimail"} +: ${notimail_flags:="-c %%PREFIX%%/etc/notimail/config.ini"} + +pidfile="/var/run/${name}.pid" +command="/usr/sbin/daemon" +command_args="-p ${pidfile} -f ${notimail_command} ${notimail_flags}" + +start_cmd="${name}_start" +stop_cmd="${name}_stop" +restart_cmd="${name}_restart" + +notimail_start() { + echo "Starting ${name}." + /usr/sbin/daemon -p ${pidfile} -f ${notimail_command} ${notimail_flags} +} + +notimail_stop() { + echo "Stopping ${name}." + if [ -e "${pidfile}" ]; then + kill -s TERM `cat ${pidfile}` + rm -f ${pidfile} + else + echo "${name} is not running." + fi +} + +notimail_restart() { + ${name}_stop + sleep 2 + ${name}_start +} + +run_rc_command "$1" diff --git a/mail/notimail/files/pkg-message.in b/mail/notimail/files/pkg-message.in new file mode 100644 index 000000000000..8d259eb4aa96 --- /dev/null +++ b/mail/notimail/files/pkg-message.in @@ -0,0 +1,9 @@ +Thank you for installing NotiMail! + +To finalize the installation, please configure + + %%PREFIX%%/etc/notimal/config.ini + +according to your needs. If this is an upgrade and you already have +a config.ini, the new config file is installed as config.ini.sample. +Review and merge any necessary changes. diff --git a/mail/notimail/pkg-descr b/mail/notimail/pkg-descr new file mode 100644 index 000000000000..cdaa8d01e792 --- /dev/null +++ b/mail/notimail/pkg-descr @@ -0,0 +1,3 @@ +NotiMail is a server-side email notification manager that utilizes +various push providers for real-time alerts, conserving mobile battery +life without compromising on notification immediacy. diff --git a/mail/notimail/pkg-plist b/mail/notimail/pkg-plist new file mode 100644 index 000000000000..49451bb7e9b8 --- /dev/null +++ b/mail/notimail/pkg-plist @@ -0,0 +1,5 @@ +bin/notimail +@sample(daemon,daemon,640) etc/notimail/config.ini.sample +share/man/man1/notimail.1.gz +@dir(daemon,daemon,755) /var/cache/notimail +@dir(daemon,daemon,755) /var/log/notimail