mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-18 00:10:04 +00:00
net-im/snac: new port
Snac is a simple, minimalistic ActivityPub instance. It features: - Lightweight, minimal dependencies - Extensive support of ActivityPub operations. - Multiuser - Mastodon API support, so Mastodon-compatible apps can be used - Simple but effective web interface - Easily-accessed MUTE button - Tested interoperability with related software - No database needed - Totally JavaScript-free PR: 278385 Reviewed by: bofh
This commit is contained in:
parent
ea2855f6a7
commit
c39afa6d93
2
GIDs
2
GIDs
@ -276,7 +276,7 @@ keycloak:*:332:
|
||||
honeytrap:*:333:
|
||||
percona:*:334:
|
||||
benthos:*:335:
|
||||
# free: 336
|
||||
snac:*:336:
|
||||
daapd:*:337:
|
||||
murmur:*:338:
|
||||
mumble-server:*:339:
|
||||
|
1
UIDs
1
UIDs
@ -281,6 +281,7 @@ keycloak:*:332:332::0:0:keycloak server:/nonexistent:/usr/sbin/nologin
|
||||
honeytrap:*:333:333::0:0:HoneyTrap Daemon:/nonexistent:/usr/sbin/nologin
|
||||
percona:*:334:334::0:0:Percona Daemons:/nonexistent:/usr/sbin/nologin
|
||||
benthos:*:335:335::0:0:Benthos Daemon:/nonexistent:/usr/sbin/nologin
|
||||
snac:*:336:336::0:0:Snac Daemon:/nonexistent:/usr/sbin/nologin
|
||||
_pma:*:336:80::0:0:phpMyAdmin Owner:/nonexistent:/usr/sbin/nologin
|
||||
daapd:*:337:337::0:0:daapd User:/nonexistent:/usr/sbin/nologin
|
||||
murmur:*:338:338::0:0:& User:/nonexistent:/usr/sbin/nologin
|
||||
|
@ -141,6 +141,7 @@
|
||||
SUBDIR += signal-desktop
|
||||
SUBDIR += signald
|
||||
SUBDIR += slack-term
|
||||
SUBDIR += snac
|
||||
SUBDIR += spectral
|
||||
SUBDIR += ssh-chat
|
||||
SUBDIR += sshout
|
||||
|
40
net-im/snac/Makefile
Normal file
40
net-im/snac/Makefile
Normal file
@ -0,0 +1,40 @@
|
||||
PORTNAME= snac
|
||||
DISTVERSION= 2.57
|
||||
CATEGORIES= net-im www
|
||||
MASTER_SITES= https://codeberg.org/grunfink/snac2/archive/${DISTVERSIONFULL}${EXTRACT_SUFX}?dummy=/
|
||||
|
||||
MAINTAINER= matthew@matthewphillips.info
|
||||
COMMENT= Simple, minimalistic ActivityPub instance written in portable C
|
||||
WWW= https://codeberg.org/grunfink/snac2
|
||||
|
||||
LICENSE= MIT
|
||||
|
||||
LIB_DEPENDS= libcurl.so:ftp/curl
|
||||
|
||||
USES= ssl
|
||||
USE_RC_SUBR= snac
|
||||
|
||||
SUB_FILES= pkg-message \
|
||||
snac
|
||||
SUB_LIST= SNACDATADIR="${SNACDATADIR}" \
|
||||
GROUP="${GROUPS}" \
|
||||
USER="${USERS}"
|
||||
|
||||
SNACDATADIR= /var/db/snac
|
||||
|
||||
WRKSRC= ${WRKDIR}/snac2
|
||||
|
||||
USERS= snac
|
||||
GROUPS= snac
|
||||
|
||||
PKGMESSAGE= ${FILESDIR}/pkg-message
|
||||
|
||||
PLIST_FILES= bin/snac \
|
||||
share/man/man1/snac.1.gz \
|
||||
share/man/man5/snac.5.gz \
|
||||
share/man/man8/snac.8.gz
|
||||
|
||||
post-install:
|
||||
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/snac
|
||||
|
||||
.include <bsd.port.mk>
|
3
net-im/snac/distinfo
Normal file
3
net-im/snac/distinfo
Normal file
@ -0,0 +1,3 @@
|
||||
TIMESTAMP = 1724244538
|
||||
SHA256 (snac-2.57.tar.gz) = 16e25990391b04079caadeea6a5c24656a0df5ed5e7500516402c1cca21e831e
|
||||
SIZE (snac-2.57.tar.gz) = 180441
|
33
net-im/snac/files/patch-Makefile
Normal file
33
net-im/snac/files/patch-Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
--- Makefile.orig 2024-04-04 08:13:06 UTC
|
||||
+++ Makefile
|
||||
@@ -1,5 +1,5 @@
|
||||
-PREFIX=/usr/local
|
||||
-PREFIX_MAN=$(PREFIX)/man
|
||||
+PREFIX:=$(PREFIX)
|
||||
+PREFIX_MAN=$(PREFIX)/share/man
|
||||
CFLAGS?=-g -Wall -Wextra
|
||||
|
||||
all: snac
|
||||
@@ -18,14 +18,14 @@ install:
|
||||
$(CC) -I/usr/local/include -MM *.c > makefile.depend
|
||||
|
||||
install:
|
||||
- mkdir -p -m 755 $(PREFIX)/bin
|
||||
- install -m 755 snac $(PREFIX)/bin/snac
|
||||
- mkdir -p -m 755 $(PREFIX_MAN)/man1
|
||||
- install -m 644 doc/snac.1 $(PREFIX_MAN)/man1/snac.1
|
||||
- mkdir -p -m 755 $(PREFIX_MAN)/man5
|
||||
- install -m 644 doc/snac.5 $(PREFIX_MAN)/man5/snac.5
|
||||
- mkdir -p -m 755 $(PREFIX_MAN)/man8
|
||||
- install -m 644 doc/snac.8 $(PREFIX_MAN)/man8/snac.8
|
||||
+ mkdir -p -m 755 $(DESTDIR)$(PREFIX)/bin
|
||||
+ install -m 755 snac $(DESTDIR)$(PREFIX)/bin/snac
|
||||
+ mkdir -p -m 755 $(DESTDIR)$(PREFIX_MAN)/man1
|
||||
+ install -m 644 doc/snac.1 $(DESTDIR)$(PREFIX_MAN)/man1/snac.1
|
||||
+ mkdir -p -m 755 $(DESTDIR)$(PREFIX_MAN)/man5
|
||||
+ install -m 644 doc/snac.5 $(DESTDIR)$(PREFIX_MAN)/man5/snac.5
|
||||
+ mkdir -p -m 755 $(DESTDIR)$(PREFIX_MAN)/man8
|
||||
+ install -m 644 doc/snac.8 $(DESTDIR)$(PREFIX_MAN)/man8/snac.8
|
||||
|
||||
uninstall:
|
||||
rm $(PREFIX)/bin/snac
|
27
net-im/snac/files/pkg-message.in
Normal file
27
net-im/snac/files/pkg-message.in
Normal file
@ -0,0 +1,27 @@
|
||||
[
|
||||
{ type: install
|
||||
message: <<EOM
|
||||
|
||||
To use snac, enable it in rc.conf using
|
||||
|
||||
sysrc snac_enable=yes
|
||||
|
||||
To initialize the data, run
|
||||
|
||||
service snac init
|
||||
|
||||
You can then start snac by running:
|
||||
|
||||
service snac start
|
||||
|
||||
You can add a user by running:
|
||||
|
||||
service snac run adduser <name>
|
||||
|
||||
Data is stored at %%SNACDATADIR%%/data. For convenience the service includes
|
||||
a `run` command for executing snac commands against this directory, such as
|
||||
the `adduser` command shown above. See `snac --help` for a full list of
|
||||
commands.
|
||||
EOM
|
||||
}
|
||||
]
|
62
net-im/snac/files/snac.in
Normal file
62
net-im/snac/files/snac.in
Normal file
@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
|
||||
# PROVIDE: snac
|
||||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
#
|
||||
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
|
||||
# to enable this service:
|
||||
#
|
||||
# snac_enable (bool): Set to NO by default.
|
||||
# Set it to YES to enable snac.
|
||||
# snac_user (user): Set user to run snac.
|
||||
# Default is "snac".
|
||||
# snac_group (group): Set group to run snac.
|
||||
# Default is "snac".
|
||||
# snac_dir (dir): Set data storage dir.
|
||||
# Default is /var/db/snac/".
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=snac
|
||||
rcvar=snac_enable
|
||||
desc="Simple fediverse server"
|
||||
|
||||
start_precmd="${name}_prestart"
|
||||
extra_commands="init run"
|
||||
init_cmd="snac_init"
|
||||
run_cmd="snac_run"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
: ${snac_enable:=NO}
|
||||
: ${snac_user=%%USER%%}
|
||||
: ${snac_group=%%GROUP%%}
|
||||
: ${snac_dir=%%SNACDATADIR%%}
|
||||
|
||||
procname="%%PREFIX%%/bin/${name}"
|
||||
command=/usr/sbin/daemon
|
||||
command_args="-c -S -T ${name} ${procname} httpd ${snac_dir}/data"
|
||||
|
||||
snac_prestart()
|
||||
{
|
||||
if [ ! -d "${snac_dir}/data" ]; then
|
||||
echo "The snac data directory does not exist. Please run: service snac init"
|
||||
fi
|
||||
}
|
||||
|
||||
snac_init()
|
||||
{
|
||||
mkdir -p "${snac_dir}"
|
||||
${procname} init "${snac_dir}/data"
|
||||
chown -R ${snac_user}:${snac_group} "${snac_dir}/data"
|
||||
}
|
||||
|
||||
snac_run()
|
||||
{
|
||||
snaccmd="$1"
|
||||
shift
|
||||
${procname} $snaccmd "${snac_dir}/data" $@
|
||||
}
|
||||
|
||||
run_rc_command "$@"
|
13
net-im/snac/pkg-descr
Normal file
13
net-im/snac/pkg-descr
Normal file
@ -0,0 +1,13 @@
|
||||
Snac is a simple, minimalistic ActivityPub instance.
|
||||
|
||||
It features:
|
||||
|
||||
- Lightweight, minimal dependencies
|
||||
- Extensive support of ActivityPub operations.
|
||||
- Multiuser
|
||||
- Mastodon API support, so Mastodon-compatible apps can be used
|
||||
- Simple but effective web interface
|
||||
- Easily-accessed MUTE button
|
||||
- Tested interoperability with related software
|
||||
- No database needed
|
||||
- Totally JavaScript-free
|
Loading…
Reference in New Issue
Block a user