From 222245a60c36f885fd7077374077cfaf01077a4a Mon Sep 17 00:00:00 2001 From: rustdesk Date: Mon, 23 May 2022 11:59:56 +0800 Subject: [PATCH] more linux distro --- .gitignore | 4 ++- PKGBUILD | 31 +++++++++++++++++++++ build.py | 24 ++++++++++++++++ pacman_install | 45 ++++++++++++++++++++++++++++++ rpm-suse.spec | 70 +++++++++++++++++++++++++++++++++++++++++++++++ rpm.spec | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ rustdesk.desktop | 19 +++++++++++++ 7 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 PKGBUILD create mode 100644 pacman_install create mode 100644 rpm-suse.spec create mode 100644 rpm.spec create mode 100644 rustdesk.desktop diff --git a/.gitignore b/.gitignore index 08b24f4d2..9ab24b514 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,6 @@ flutter_hbb web_hbb sciter.dll **pdb -src/bridge_generated.rs \ No newline at end of file +src/bridge_generated.rs +*deb +rustdesk diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000..0d67a28b6 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,31 @@ +pkgname=rustdesk +pkgver=1.1.9 +pkgrel=0 +epoch= +pkgdesc="" +arch=('x86_64') +url="" +license=('GPL-3.0') +groups=() +depends=('gtk3' 'xdotool' 'libxcb' 'libxfixes' 'alsa-lib' 'pulseaudio' 'ttf-arphic-uming' 'python-pip' 'curl') +makedepends=() +checkdepends=() +optdepends=() +provides=() +conflicts=() +replaces=() +backup=() +options=() +install=pacman_install +changelog= +noextract=() +md5sums=() #generate with 'makepkg -g' + +package() { + install -Dm 755 ${HBB}/target/release/${pkgname} -t "${pkgdir}/usr/bin" + install -Dm 644 ${HBB}/libsciter-gtk.so -t "${pkgdir}/usr/lib/rustdesk" + install -Dm 644 $HBB/rustdesk.service -t "${pkgdir}/usr/share/rustdesk/files" + install -Dm 644 $HBB/rustdesk.desktop -t "${pkgdir}/usr/share/rustdesk/files" + install -Dm 644 $HBB/pynput_service.py -t "${pkgdir}/usr/share/rustdesk/files" + install -Dm 644 $HBB/256-no-margin.png "${pkgdir}/usr/share/rustdesk/files/rustdesk.png" +} diff --git a/build.py b/build.py index 7d03819e1..ff547651f 100644 --- a/build.py +++ b/build.py @@ -44,6 +44,30 @@ def main(): else: print('Not signed') os.system('cp -rf target/release/RustDesk.exe rustdesk-%s-putes.exe'%version) + elif os.path.isfile('/usr/bin/pacman'): + os.system('cargo build --release --features inline') + os.system('git checkout src/ui/common.tis') + os.system('strip target/release/rustdesk') + os.system("sed -i 's/pkgver=.*/pkgver=%s/g' PKGBUILD"%version) + # pacman -S -needed base-devel + os.system('HBB=`pwd` makepkg -f') + os.system('mv rustdesk-%s-0-x86_64.pkg.tar.zst rustdesk-%s-manjaro-arch.pkg.tar.zst'%(version, version)) + # pacman -U ./rustdesk.pkg.tar.zst + elif os.path.isfile('/usr/bin/yum'): + os.system('cargo build --release --features inline') + os.system('strip target/release/rustdesk') + os.system("sed -i 's/Version: .*/Version: %s/g' rpm.spec"%version) + os.system('HBB=`pwd` rpmbuild -ba rpm.spec') + os.system('mv $HOME/rpmbuild/RPMS/x86_64/rustdesk-%s-0.x86_64.rpm ./rustdesk-%s-fedora28-centos8.rpm'%(version, version)) + # yum localinstall rustdesk.rpm + elif os.path.isfile('/usr/bin/zypper'): + os.system('cargo build --release --features inline') + os.system('strip target/release/rustdesk') + os.system("sed -i 's/Version: .*/Version: %s/g' rpm-suse.spec"%version) + os.system('HBB=`pwd` rpmbuild -ba rpm-suse.spec') + os.system('mv $HOME/rpmbuild/RPMS/x86_64/rustdesk-%s-0.x86_64.rpm ./rustdesk-%s-suse.rpm'%(version, version)) + # yum localinstall rustdesk.rpm + else: os.system('cargo bundle --release --features inline') if osx: diff --git a/pacman_install b/pacman_install new file mode 100644 index 000000000..d22423574 --- /dev/null +++ b/pacman_install @@ -0,0 +1,45 @@ +# arg 1: the new package version +#pre_install() { +#} + +# arg 1: the new package version +post_install() { + # do something here + cp /usr/share/rustdesk/files/rustdesk.service /etc/systemd/system/rustdesk.service + cp /usr/share/rustdesk/files/rustdesk.desktop /usr/share/applications/ + sudo -H pip3 install pynput + systemctl daemon-reload + systemctl enable rustdesk + systemctl start rustdesk + update-desktop-database +} + +# arg 1: the new package version +# arg 2: the old package version +pre_upgrade() { + systemctl stop rustdesk || true +} + +# arg 1: the new package version +# arg 2: the old package version +post_upgrade() { + cp /usr/share/rustdesk/files/rustdesk.service /etc/systemd/system/rustdesk.service + cp /usr/share/rustdesk/files/rustdesk.desktop /usr/share/applications/ + systemctl daemon-reload + systemctl enable rustdesk + systemctl start rustdesk + update-desktop-database +} + +# arg 1: the old package version +pre_remove() { + systemctl stop rustdesk || true + systemctl disable rustdesk || true + rm /etc/systemd/system/rustdesk.service || true +} + +# arg 1: the old package version +post_remove() { + rm /usr/share/applications/rustdesk.desktop || true + update-desktop-database +} diff --git a/rpm-suse.spec b/rpm-suse.spec new file mode 100644 index 000000000..8863f3da2 --- /dev/null +++ b/rpm-suse.spec @@ -0,0 +1,70 @@ +Name: rustdesk +Version: 1.1.9 +Release: 0 +Summary: RPM package +License: GPL-3.0 +Requires: gtk3 libxcb1 xdotool libXfixes3 pulseaudio-utils alsa-utils arphic-uming-fonts python3-pip curl libXtst6 python3-devel + +%description +The best open-source remote desktop client software, written in Rust. + +%prep +# we have no source, so nothing here + +%build +# we have no source, so nothing here + +%global __python %{__python3} + +%install +mkdir -p %{buildroot}/usr/bin/ +mkdir -p %{buildroot}/usr/lib/rustdesk/ +mkdir -p %{buildroot}/usr/share/rustdesk/files/ +install -m 755 $HBB/target/release/rustdesk %{buildroot}/usr/bin/rustdesk +install $HBB/libsciter-gtk.so %{buildroot}/usr/lib/rustdesk/libsciter-gtk.so +install $HBB/rustdesk.service %{buildroot}/usr/share/rustdesk/files/ +install $HBB/256-no-margin.png %{buildroot}/usr/share/rustdesk/files/rustdesk.png +install $HBB/rustdesk.desktop %{buildroot}/usr/share/rustdesk/files/ +install $HBB/pynput_service.py %{buildroot}/usr/share/rustdesk/files/ + +%files +/usr/bin/rustdesk +/usr/lib/rustdesk/libsciter-gtk.so +/usr/share/rustdesk/files/rustdesk.service +/usr/share/rustdesk/files/rustdesk.png +/usr/share/rustdesk/files/rustdesk.desktop +/usr/share/rustdesk/files/pynput_service.py + +%changelog +# let's skip this for now + +# https://www.cnblogs.com/xingmuxin/p/8990255.html +%pre +# can do something for centos7 +case "$1" in + 1) + # for install + ;; + 2) + # for upgrade + service rustdesk stop || true + ;; +esac + +%post +cp /usr/share/rustdesk/files/rustdesk.service /etc/systemd/system/rustdesk.service +cp /usr/share/rustdesk/files/rustdesk.desktop /usr/share/applications/ +sudo -H pip3 install pynput +systemctl daemon-reload +systemctl enable rustdesk +systemctl start rustdesk +update-desktop-database + +%preun +systemctl stop rustdesk || true +systemctl disable rustdesk || true +rm /etc/systemd/system/rustdesk.service || true + +%postun +rm /usr/share/applications/rustdesk.desktop || true +update-desktop-database diff --git a/rpm.spec b/rpm.spec new file mode 100644 index 000000000..ff32d7b97 --- /dev/null +++ b/rpm.spec @@ -0,0 +1,71 @@ +Name: rustdesk +Version: 1.1.9 +Release: 0 +Summary: RPM package +License: GPL-3.0 +Requires: gtk3 libxcb libxdo libXfixes pulseaudio-libs alsa-lib cjkuni-uming-fonts python3-pip curl + +%description +The best open-source remote desktop client software, written in Rust. + +%prep +# we have no source, so nothing here + +%build +# we have no source, so nothing here + +%global __python %{__python3} + +%install +mkdir -p %{buildroot}/usr/bin/ +mkdir -p %{buildroot}/usr/lib/rustdesk/ +mkdir -p %{buildroot}/usr/share/rustdesk/files/ +install -m 755 $HBB/target/release/rustdesk %{buildroot}/usr/bin/rustdesk +install $HBB/libsciter-gtk.so %{buildroot}/usr/lib/rustdesk/libsciter-gtk.so +install $HBB/rustdesk.service %{buildroot}/usr/share/rustdesk/files/ +install $HBB/256-no-margin.png %{buildroot}/usr/share/rustdesk/files/rustdesk.png +install $HBB/rustdesk.desktop %{buildroot}/usr/share/rustdesk/files/ +install $HBB/pynput_service.py %{buildroot}/usr/share/rustdesk/files/ + +%files +/usr/bin/rustdesk +/usr/lib/rustdesk/libsciter-gtk.so +/usr/share/rustdesk/files/rustdesk.service +/usr/share/rustdesk/files/rustdesk.png +/usr/share/rustdesk/files/rustdesk.desktop +/usr/share/rustdesk/files/pynput_service.py +/usr/share/rustdesk/files/__pycache__/* + +%changelog +# let's skip this for now + +# https://www.cnblogs.com/xingmuxin/p/8990255.html +%pre +# can do something for centos7 +case "$1" in + 1) + # for install + ;; + 2) + # for upgrade + service rustdesk stop || true + ;; +esac + +%post +cp /usr/share/rustdesk/files/rustdesk.service /etc/systemd/system/rustdesk.service +cp /usr/share/rustdesk/files/rustdesk.desktop /usr/share/applications/ +sudo -H pip3 install pynput +systemctl daemon-reload +systemctl enable rustdesk +systemctl start rustdesk +update-desktop-database + +%preun +systemctl stop rustdesk || true +systemctl disable rustdesk || true +rm /etc/systemd/system/rustdesk.service || true + +%postun +rm /usr/share/applications/rustdesk.desktop || true +update-desktop-database diff --git a/rustdesk.desktop b/rustdesk.desktop new file mode 100644 index 000000000..8bdbe06e0 --- /dev/null +++ b/rustdesk.desktop @@ -0,0 +1,19 @@ +[Desktop Entry] +Version=1.0 +Name=RustDesk +GenericName=Remote Desktop +Comment=Remote Desktop +Exec=rustdesk %u +Icon=/usr/share/rustdesk/files/rustdesk.png +Terminal=false +Type=Application +StartupNotify=true +Categories=Other; +Keywords=internet; +Actions=new-window; + +X-Desktop-File-Install-Version=0.23 + +[Desktop Action new-window] +Name=Open a New Window +