1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
Name: meshbay-node
Version: __VERSION__
Release: 1%{?dist}
Summary: MeshBay Node — local file host, streaming server, and group daemon
License: AGPLv3+
URL: https://meshbay.org
AutoReqProv: no
BuildArch: noarch
Requires: meshbay-common = %{version}
Recommends: ffmpeg
# Weak deps: an unresolvable one is skipped, so naming the drivers of both
# families costs nothing and covers Fedora and RHEL alike. See hwaccel.py
# (node) / main.js (client) — neither assumes any of this is installed.
Recommends: libva
Recommends: intel-media-driver
Recommends: mesa-va-drivers
%description
MeshBay Node indexes local directories and serves encrypted files to
authenticated group members over WebRTC. Includes video streaming (fMP4
remux via ffmpeg), group chat, and a token-gated loopback control API
on 127.0.0.1:18000 for the CLI and the desktop client.
Installs node code into the shared venv at /opt/meshbay-common/venv/.
Ships a default TMDB API token for the Videos app.
Runs as a systemd user service.
%install
cp -a %{_staging_root}/* %{buildroot}/
%post
if [ -d /run/systemd/system ]; then
systemctl daemon-reload || true
fi
# After the whole transaction, so that meshbay-common is in place too. A
# marker left by %pre says whether this was an upgrade.
%pre
if [ "$1" -ge 2 ]; then
touch /run/meshbay-node-upgrade 2>/dev/null || true
fi
%posttrans
# The node runs as a user service, in every signed-in user's own systemd
# manager: the system-wide reload does not reach those, and each would keep
# the old unit and the old code until restarted by hand. Every running user
# manager reloads, and restarts the node where it was running.
reload_user_managers() {
for bus in /run/user/*/systemd/private; do
[ -S "$bus" ] || continue
uid=$(basename "$(dirname "$(dirname "$bus")")")
user=$(id -nu "$uid" 2>/dev/null) || continue
systemctl --user -M "$user@" daemon-reload 2>/dev/null || true
[ -n "$upgraded" ] && systemctl --user -M "$user@" try-restart meshbay-node.service 2>/dev/null || true
done
}
upgraded=
if [ -e /run/meshbay-node-upgrade ]; then
upgraded=1
rm -f /run/meshbay-node-upgrade
fi
if [ -d /run/systemd/system ]; then
systemctl daemon-reload || true
if [ -n "$upgraded" ]; then
systemctl try-restart 'meshbay-node@*.service' 2>/dev/null || true
fi
reload_user_managers
fi
%preun
# A node left running once its package is gone serves from deleted code, and
# keeps writing bytecode into the shared venv. Every instance stops on erase
# ($1 = 0): the system ones, and the user service in each running user manager.
if [ "$1" -eq 0 ] && [ -d /run/systemd/system ]; then
systemctl stop 'meshbay-node@*.service' 2>/dev/null || true
for bus in /run/user/*/systemd/private; do
[ -S "$bus" ] || continue
uid=$(basename "$(dirname "$(dirname "$bus")")")
user=$(id -nu "$uid" 2>/dev/null) || continue
systemctl --user -M "$user@" stop meshbay-node.service 2>/dev/null || true
done
fi
# The node's code lives in meshbay-common's venv, whose own cleanup runs only
# after this package is gone: the bytecode compiled next to it is removed here.
if [ "$1" -eq 0 ]; then
find /opt/meshbay-common/venv/lib/python3.*/site-packages/meshbay_node \
-depth -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
fi
%files
/opt/meshbay-node
/opt/meshbay-common/venv/lib/python*/site-packages/meshbay_node/
/opt/meshbay-common/venv/lib/python*/site-packages/meshbay_node-*.dist-info/
/opt/meshbay-common/venv/bin/meshbay-node
/usr/bin/meshbay-node
%{_unitdir}/meshbay-node@.service
%{_userunitdir}/meshbay-node.service
/etc/ufw/applications.d/meshbay
/usr/lib/firewalld/services/meshbay-node.xml
%changelog
* Sun Aug 31 2026 MeshBay Team <devel@meshbay.org> - %{version}-1
- Packaging overhaul: installs into shared venv under /opt
|