## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond_without check %global shortversion 1.1.14 %global commit 8557c4ab8259a9084879ad78a41c5a9539fd75a3 #global committag 1 %global commitversion %{?committag:%{commit}}%{?!committag:%{shortversion}} %global shortcommitversion %{?committag:%(c=%{commit}; echo ${c:0:7})}%{?!committag:%{shortversion}} %global commitdatestring 2025-01-25 13:47:19 +0100 %global commitdate 20250125 %global hbb_commonversion driver %global commitgit %{?committag:^git%{commitdate}.%(c=%{commit}; echo ${c:0:7})} Name: rustdesk-server Version: %{shortversion}%{commitgit} Release: 1%{?dist} Summary: RustDesk Server Program License: AGPL-3.0 URL: https://github.com/rustdesk/rustdesk-server Source0: https://github.com/rustdesk/rustdesk-server/archive/refs/tags/%{commitversion}/rustdesk-server-%{shortcommitversion}.tar.gz # To create the below sources: # * git clone https://github.com/rustdesk/rustdesk-server.git at the specified commit # * cargo vendor > vendor-config-%%{shortcommitversion}.toml # * tar -pczf vendor-%%{shortcommitversion}.tar.xz vendor Source1: vendor-%{shortcommitversion}.tar.xz # * mv vendor-config-%%{shortcommitversion}.toml .. Source2: vendor-config-%{shortcommitversion}.toml # https://github.com/evenorog/license/issues/6 Source3: https://github.com/rustdesk/hbb_common/archive/refs/tags/%{hbb_commonversion}/hbb_common-%{hbb_commonversion}.tar.gz Patch0: %{name}-%{shortversion}-hbbs-unit-fix.patch BuildRequires: cargo-rpm-macros >= 26 BuildRequires: rustc BuildRequires: cargo BuildRequires: systemd-rpm-macros %description Self-host your own RustDesk server, it is free and open source. %prep %autosetup -n %{name}-%{commitversion} -p1 -a1 -b3 # move hbb_common files to libs mv -v ../hbb_common-%{hbb_commonversion}/* libs/hbb_common/ %cargo_prep -N # Check if .cargo/config.toml exists if [ -f .cargo/config.toml ]; then # If it exists, append the contents of %%{SOURCE2} to .cargo/config.toml cat %{SOURCE2} >> .cargo/config.toml echo "Appended %{SOURCE2} to .cargo/config.toml" else # If it does not exist, append the contents of %%{SOURCE2} to .cargo/config cat %{SOURCE2} >> .cargo/config echo "Appended %{SOURCE2} to .cargo/config" fi %build # Set vergen environment variables export VERGEN_GIT_COMMIT_DATE="date --utc '%{commitdatestring}'" export VERGEN_GIT_SHA="%{commit}" %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %{cargo_vendor_manifest} sed 's/\(.*\) (.*#\(.*\))/\1+git\2/' -i cargo-vendor.txt sed 's/^\([^+]*\)+.*+\([^+]*\)$/\1+\2/' -i cargo-vendor.txt %install install -d %{buildroot}%{_sharedstatedir}/%{name} install -d %{buildroot}%{_localstatedir}/lib/%{name} install -d %{buildroot}%{_localstatedir}/log/%{name} install -D target/release/hbbr -t %{buildroot}%{_bindir}/ install -D target/release/hbbs -t %{buildroot}%{_bindir}/ install -D target/release/rustdesk-utils -t %{buildroot}%{_bindir}/ install -D systemd/rustdesk-hbbr.service -t %{buildroot}%{_unitdir}/ install -D systemd/rustdesk-hbbs.service -t %{buildroot}%{_unitdir}/ %if %{with check} %check # Set vergen environment variables export VERGEN_GIT_COMMIT_DATE="date --utc '%{commitdatestring}'" export VERGEN_GIT_SHA="%{commit}" %cargo_test %endif %post %post_service rustdesk-hbbr.service %post_service rustdesk-hbbs.service %preun %preun_service rustdesk-hbbr.service %preun_service rustdesk-hbbs.service %files %license LICENSE %license LICENSE.dependencies %license cargo-vendor.txt %doc README*.md %{_bindir}/hbbr %{_bindir}/hbbs %{_bindir}/rustdesk-utils %{_unitdir}/rustdesk-hbbs.service %{_unitdir}/rustdesk-hbbr.service %{_sharedstatedir}/%{name} %{_localstatedir}/lib/%{name} %{_localstatedir}/log/%{name} %changelog * Sat Nov 15 2025 Jean-Marc Liger - 1.1.14-1 - Initial package