summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD37
-rw-r--r--onemouse.sh29
3 files changed, 82 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c1e6bc6703bb
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = onemouse-bin
+ pkgdesc = An intranet remote control tool.一个内网远程控制工具
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://github.com/Scanood/onemouse
+ arch = x86_64
+ license = MIT
+ depends = electron30
+ provides = onemouse=1.0.0
+ conflicts = onemouse
+ source = onemouse-1.0.0.deb::https://github.com/Scanood/onemouse/releases/download/release-v1.0.0/onemouse_1.0.0_amd64.deb
+ source = onemouse.sh
+ sha256sums = e0edcc3f8040daf5dabeceb92f5c27369ab08b3aab548886e73a55f5a2d2d2c6
+ sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051
+
+pkgname = onemouse-bin
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..de0967abca4c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
+pkgname=onemouse-bin
+_pkgname="One Mouse"
+pkgver=1.0.0
+_electronversion=30
+pkgrel=1
+pkgdesc="An intranet remote control tool.一个内网远程控制工具"
+arch=("x86_64")
+url="https://github.com/Scanood/onemouse"
+license=("MIT")
+provides=("${pkgname%-bin}=${pkgver}")
+conflicts=("${pkgname%-bin}")
+depends=(
+ "electron${_electronversion}"
+)
+source=(
+ "${pkgname%-bin}-${pkgver}.deb::${url}/releases/download/release-v${pkgver}/onemouse_${pkgver}_amd64.deb"
+ "${pkgname%-bin}.sh"
+)
+sha256sums=('e0edcc3f8040daf5dabeceb92f5c27369ab08b3aab548886e73a55f5a2d2d2c6'
+ '2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051')
+build() {
+ sed -e "s|@electronversion@|${_electronversion}|g" \
+ -e "s|@appname@|${pkgname%-bin}|g" \
+ -e "s|@runname@|app.asar|g" \
+ -e "s|@cfgdirname@|${pkgname%-bin}|g" \
+ -e "s|@options@|env ELECTRON_OZONE_PLATFORM_HINT=auto|g" \
+ -i "${srcdir}/${pkgname%-bin}.sh"
+ bsdtar -xf "${srcdir}/data."*
+}
+package() {
+ install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
+ install -Dm644 "${srcdir}/usr/lib/${pkgname%-bin}/resources/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}"
+ install -Dm644 "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications"
+ install -Dm644 "${srcdir}/usr/share/pixmaps/${pkgname%-bin}.png" -t "${pkgdir}/usr/share/pixmaps"
+ install -Dm644 "${srcdir}/usr/share/doc/${pkgname%-bin}/copyright" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+} \ No newline at end of file
diff --git a/onemouse.sh b/onemouse.sh
new file mode 100644
index 000000000000..4cfe3ac09dd8
--- /dev/null
+++ b/onemouse.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+set -o pipefail
+_APPDIR="/usr/lib/@appname@"
+_RUNNAME="${_APPDIR}/@runname@"
+_CFGDIR="@cfgdirname@/"
+_OPTIONS="@options@"
+export PATH="${_APPDIR}:${PATH}"
+export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}"
+export ELECTRON_IS_DEV=0
+export ELECTRON_FORCE_IS_PACKAGED=true
+export ELECTRON_DISABLE_SECURITY_WARNINGS=true
+export ELECTRON_OVERRIDE_DIST_PATH="/usr/bin/electron@electronversion@"
+export NODE_ENV=production
+export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
+export _FLAGS_FILE="${XDG_CONFIG_HOME}/${_CFGDIR}@appname@-flags.conf"
+declare -a _USER_FLAGS
+if [[ -f "${_FLAGS_FILE}" ]]; then
+ while read -r line; do
+ if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
+ _USER_FLAGS+=("${line}")
+ fi
+ done < "${_FLAGS_FILE}"
+fi
+cd "${_APPDIR}"
+if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then
+ exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} "${_USER_FLAGS[@]}" "$@"
+else
+ exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} --no-sandbox "${_USER_FLAGS[@]}" "$@"
+fi \ No newline at end of file