Files
rustdesk-server/rustdesk-server.spec
T
jmrothst c21b63d8a4 Initial version
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-07 22:50:39 -04:00

83 lines
2.5 KiB
RPMSpec

%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