diff --git a/.github/workflows/build-qv2ray-cmake.yml b/.github/workflows/build-qv2ray-cmake.yml index 446a65bee..6d767863b 100644 --- a/.github/workflows/build-qv2ray-cmake.yml +++ b/.github/workflows/build-qv2ray-cmake.yml @@ -168,6 +168,10 @@ jobs: cp -r public_res/* windows64 rm -rf public_res *.pdb #### + sudo bash ../libs/package_debian.sh ${{ github.event.inputs.tag }} + mv nekoray.deb $version_standalone-linux64.deb + sudo rm -rf nekoray + #### mv linux64 nekoray zip -r $version_standalone-linux64.zip nekoray rm -rf nekoray diff --git a/docs/Run_Linux.md b/docs/Run_Linux.md index 7bd3c259e..9d722ed77 100644 --- a/docs/Run_Linux.md +++ b/docs/Run_Linux.md @@ -1,3 +1,21 @@ +## Linux 安装 + +### Debian 系发行版 + +使用 Debian 系发行版时,推荐使用 .deb 包安装: + +```shell +sudo apt install ./nekoray-*-linux64.deb +``` + +安装完成后,桌面快捷方式启动自带参数 `-appdata`,如果想要直接启动并使用之前的配置,注意附带本参数。 + +### 其他发行版 + +下载 .zip 文件,解压到合理的路径,开箱即用。具体使用方法见下文。 + +或者使用 AUR `nekoray-git` + ## Linux 运行 **使用 Linux 系统相信您已具备基本的排错能力, diff --git a/libs/package_debian.sh b/libs/package_debian.sh new file mode 100644 index 000000000..0c79a48b3 --- /dev/null +++ b/libs/package_debian.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +version="$1" + +mkdir -p nekoray/DEBIAN +mkdir -p nekoray/opt +cp -r linux64 nekoray/opt/ +mv nekoray/opt/linux64 nekoray/opt/nekoray +rm -rf nekoray/opt/nekoray/usr +rm nekoray/opt/nekoray/launcher + +# basic +cat >nekoray/DEBIAN/control <<-EOF +Package: nekoray +Version: $version +Architecture: amd64 +Maintainer: MatsuriDayo nekoha_matsuri@protonmail.com +Depends: libxcb-xinerama0, libqt5core5a, libqt5gui5, libqt5network5, libqt5widgets5, libqt5svg5, libqt5x11extras5, desktop-file-utils +Description: Qt based cross-platform GUI proxy configuration manager (backend: v2ray / sing-box) +EOF + +cat >nekoray/DEBIAN/postinst <<-EOF +cat >/usr/share/applications/nekoray.desktop<<-END +[Desktop Entry] +Name=nekoray +Version=$version +Comment=Qt based cross-platform GUI proxy configuration manager (backend: v2ray / sing-box) +Exec=/opt/nekoray/nekoray -appdata +Icon=/opt/nekoray/nekoray.png +Terminal=false +Type=Application +Categories=Network;Application; +END +update-desktop-database +EOF + +sudo chmod 755 nekoray/DEBIAN/postinst + +# desktop && PATH + +sudo dpkg-deb -Zxz --build nekoray