rpm-suse.spec 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Name: rustdesk
  2. Version: 1.1.9
  3. Release: 0
  4. Summary: RPM package
  5. License: GPL-3.0
  6. Requires: gtk3 libxcb1 xdotool libXfixes3 alsa-utils libXtst6 libvdpau1 libva2 pam gstreamer-plugins-base gstreamer-plugin-pipewire
  7. Recommends: libayatana-appindicator3-1
  8. %description
  9. The best open-source remote desktop client software, written in Rust.
  10. %prep
  11. # we have no source, so nothing here
  12. %build
  13. # we have no source, so nothing here
  14. %global __python %{__python3}
  15. %install
  16. mkdir -p %{buildroot}/usr/bin/
  17. mkdir -p %{buildroot}/usr/lib/rustdesk/
  18. mkdir -p %{buildroot}/usr/share/rustdesk/files/
  19. mkdir -p %{buildroot}/usr/share/icons/hicolor/256x256/apps/
  20. mkdir -p %{buildroot}/usr/share/icons/hicolor/scalable/apps/
  21. install -m 755 $HBB/target/release/rustdesk %{buildroot}/usr/bin/rustdesk
  22. install $HBB/libsciter-gtk.so %{buildroot}/usr/lib/rustdesk/libsciter-gtk.so
  23. install $HBB/res/rustdesk.service %{buildroot}/usr/share/rustdesk/files/
  24. install $HBB/res/128x128@2x.png %{buildroot}/usr/share/icons/hicolor/256x256/apps/rustdesk.png
  25. install $HBB/res/scalable.svg %{buildroot}/usr/share/icons/hicolor/scalable/apps/rustdesk.svg
  26. install $HBB/res/rustdesk.desktop %{buildroot}/usr/share/rustdesk/files/
  27. install $HBB/res/rustdesk-link.desktop %{buildroot}/usr/share/rustdesk/files/
  28. %files
  29. /usr/bin/rustdesk
  30. /usr/lib/rustdesk/libsciter-gtk.so
  31. /usr/share/rustdesk/files/rustdesk.service
  32. /usr/share/icons/hicolor/256x256/apps/rustdesk.png
  33. /usr/share/icons/hicolor/scalable/apps/rustdesk.svg
  34. /usr/share/rustdesk/files/rustdesk.desktop
  35. /usr/share/rustdesk/files/rustdesk-link.desktop
  36. %changelog
  37. # let's skip this for now
  38. # https://www.cnblogs.com/xingmuxin/p/8990255.html
  39. %pre
  40. # can do something for centos7
  41. case "$1" in
  42. 1)
  43. # for install
  44. ;;
  45. 2)
  46. # for upgrade
  47. systemctl stop rustdesk || true
  48. ;;
  49. esac
  50. %post
  51. cp /usr/share/rustdesk/files/rustdesk.service /etc/systemd/system/rustdesk.service
  52. cp /usr/share/rustdesk/files/rustdesk.desktop /usr/share/applications/
  53. cp /usr/share/rustdesk/files/rustdesk-link.desktop /usr/share/applications/
  54. systemctl daemon-reload
  55. systemctl enable rustdesk
  56. systemctl start rustdesk
  57. update-desktop-database
  58. %preun
  59. case "$1" in
  60. 0)
  61. # for uninstall
  62. systemctl stop rustdesk || true
  63. systemctl disable rustdesk || true
  64. rm /etc/systemd/system/rustdesk.service || true
  65. ;;
  66. 1)
  67. # for upgrade
  68. ;;
  69. esac
  70. %postun
  71. case "$1" in
  72. 0)
  73. # for uninstall
  74. rm /usr/share/applications/rustdesk.desktop || true
  75. rm /usr/share/applications/rustdesk-link.desktop || true
  76. update-desktop-database
  77. ;;
  78. 1)
  79. # for upgrade
  80. ;;
  81. esac