Initial version

Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
This commit is contained in:
2026-05-07 22:50:39 -04:00
parent 46c0785c53
commit c21b63d8a4
5 changed files with 126 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
[Unit]
Description=RustDesk Relay server
After=network.target
[Service]
Type=simple
WorkingDirectory=/var/lib/rustdesk-server
ExecStart=/usr/bin/hbbr
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>hbbr</short>
<description>RustDesk Relay server</description>
<port protocol="tcp" port="21117"/>
<port protocol="tcp" port="21119"/>
</service>
+13
View File
@@ -0,0 +1,13 @@
[Unit]
Description=RustDesk ID/Rendezvous server
After=network.target
[Service]
Type=simple
WorkingDirectory=/var/lib/rustdesk-server
ExecStart=/usr/bin/hbbs
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>hbbs</short>
<description>RustDesk ID/Rendezvous server</description>
<port protocol="tcp" port="21115"/>
<port protocol="udp" port="21115"/>
<port protocol="tcp" port="21116"/>
<port protocol="udp" port="21116"/>
<port protocol="tcp" port="21118"/>
</service>
+83
View File
@@ -0,0 +1,83 @@
%global hbb_commit 87b11a7
Name: rustdesk-server
Version: 1.1.15
Release: 1%{?dist}
Summary: RustDesk Server Program
License: AGPL-3.0-only
URL: https://github.com/rustdesk/rustdesk-server
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Source1: https://github.com/rustdesk/hbb_common/archive/%{hbb_commit}/hbb_common-%{hbb_commit}.tar.gz
Source2: hbbs.xml
Source3: hbbr.xml
Source4: hbbs.service
Source5: hbbr.service
BuildRequires: cargo
BuildRequires: rust
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: pkgconfig
BuildRequires: openssl-devel
BuildRequires: systemd-rpm-macros
Requires: firewalld-filesystem
%{?systemd_requires}
%description
RustDesk Server Program. Includes the hbbs (RustDesk ID/Rendezvous server)
and hbbr (RustDesk Relay server) binaries.
%prep
%autosetup -n %{name}-%{version}
# Replace the empty hbb_common directory with the submodule source
rm -rf libs/hbb_common/*
tar -xzf %{SOURCE1} -C libs/hbb_common --strip-components=1
%build
cargo build --release
%install
mkdir -p %{buildroot}%{_bindir}
install -m 0755 target/release/hbbs %{buildroot}%{_bindir}/hbbs
install -m 0755 target/release/hbbr %{buildroot}%{_bindir}/hbbr
# Include rustdesk-utils if it exists in the build output
[ -f target/release/rustdesk-utils ] && install -m 0755 target/release/rustdesk-utils %{buildroot}%{_bindir}/rustdesk-utils || :
# Install firewalld service files
mkdir -p %{buildroot}%{_prefix}/lib/firewalld/services
install -m 0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/firewalld/services/hbbs.xml
install -m 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/firewalld/services/hbbr.xml
# Install systemd service files
mkdir -p %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/hbbs.service
install -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/hbbr.service
# Create working directory for keys/database
mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
%post
%systemd_post hbbs.service hbbr.service
%preun
%systemd_preun hbbs.service hbbr.service
%postun
%systemd_postun_with_restart hbbs.service hbbr.service
%files
%license LICENSE
%doc README.md
%{_bindir}/*
%{_prefix}/lib/firewalld/services/hbbs.xml
%{_prefix}/lib/firewalld/services/hbbr.xml
%{_unitdir}/hbbs.service
%{_unitdir}/hbbr.service
%dir %{_sharedstatedir}/%{name}
%changelog
* Mon Jan 01 2024 RPM Builder <builder@example.com> - 1.1.15-1
- Initial package creation for RHEL and Fedora