rpm.spec 2.6 KB

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