mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 12:35:46 +00:00
Compare commits
7 commits
e80b56270c
...
e971c77d41
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e971c77d41 | ||
|
|
4812b388e4 | ||
|
|
d32a1e559c | ||
|
|
de4fb23450 | ||
|
|
3b1d1cc984 | ||
|
|
89e0fc20eb | ||
|
|
2010187fde |
2 changed files with 20 additions and 28 deletions
|
|
@ -248,7 +248,7 @@ download_xray() {
|
||||||
tmp="$(mktemp -d)"
|
tmp="$(mktemp -d)"
|
||||||
curl -fL "$url" -o "$tmp/$zipname"
|
curl -fL "$url" -o "$tmp/$zipname"
|
||||||
unzip -q "$tmp/$zipname" -d "$tmp"
|
unzip -q "$tmp/$zipname" -d "$tmp"
|
||||||
install -Dm755 "$tmp/xray" "$outdir/xray"
|
install -m 755 "$tmp/xray" "$outdir/xray"
|
||||||
rm -rf "$tmp"
|
rm -rf "$tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -271,7 +271,7 @@ download_singbox() {
|
||||||
tar -C "$tmp" -xzf "$tmp/$tarname"
|
tar -C "$tmp" -xzf "$tmp/$tarname"
|
||||||
bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)"
|
bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)"
|
||||||
[[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; rm -rf "$tmp"; return 1; }
|
[[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; rm -rf "$tmp"; return 1; }
|
||||||
install -Dm755 "$bin" "$outdir/sing-box"
|
install -m 755 "$bin" "$outdir/sing-box"
|
||||||
rm -rf "$tmp"
|
rm -rf "$tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -444,7 +444,7 @@ build_for_arch() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Wrapper
|
# Wrapper
|
||||||
cat > "$STAGE/usr/bin/v2rayn" <<'EOF'
|
install -m 755 /dev/stdin "$STAGE/usr/bin/v2rayn" <<'EOF'
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
DIR="/opt/v2rayN"
|
DIR="/opt/v2rayN"
|
||||||
|
|
@ -464,7 +464,6 @@ echo "v2rayN launcher: no executable found in $DIR" >&2
|
||||||
ls -l "$DIR" >&2 || true
|
ls -l "$DIR" >&2 || true
|
||||||
exit 1
|
exit 1
|
||||||
EOF
|
EOF
|
||||||
chmod 0755 "$STAGE/usr/bin/v2rayn"
|
|
||||||
|
|
||||||
SHLIBS_DEPENDS=""
|
SHLIBS_DEPENDS=""
|
||||||
EXTRA_DEPENDS="libc6 (>= 2.34), fontconfig (>= 2.13.1), desktop-file-utils (>= 0.26), xdg-utils (>= 1.1.3), coreutils (>= 8.32), bash (>= 5.1), libfreetype6 (>= 2.11)"
|
EXTRA_DEPENDS="libc6 (>= 2.34), fontconfig (>= 2.13.1), desktop-file-utils (>= 0.26), xdg-utils (>= 1.1.3), coreutils (>= 8.32), bash (>= 5.1), libfreetype6 (>= 2.11)"
|
||||||
|
|
@ -484,16 +483,10 @@ EOF
|
||||||
|
|
||||||
local SYS_LIBDIR=""
|
local SYS_LIBDIR=""
|
||||||
local SYS_USRLIBDIR=""
|
local SYS_USRLIBDIR=""
|
||||||
case "$deb_arch" in
|
multiarch="$(dpkg-architecture -a"$deb_arch" -qDEB_HOST_MULTIARCH)"
|
||||||
amd64)
|
|
||||||
SYS_LIBDIR="/lib/x86_64-linux-gnu"
|
SYS_LIBDIR="/lib/$multiarch"
|
||||||
SYS_USRLIBDIR="/usr/lib/x86_64-linux-gnu"
|
SYS_USRLIBDIR="/usr/lib/$multiarch"
|
||||||
;;
|
|
||||||
arm64)
|
|
||||||
SYS_LIBDIR="/lib/aarch64-linux-gnu"
|
|
||||||
SYS_USRLIBDIR="/usr/lib/aarch64-linux-gnu"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
: > "$DEBIAN_DIR/substvars"
|
: > "$DEBIAN_DIR/substvars"
|
||||||
mapfile -t ELF_FILES < <(
|
mapfile -t ELF_FILES < <(
|
||||||
|
|
@ -524,7 +517,7 @@ EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Desktop file
|
# Desktop file
|
||||||
cat > "$STAGE/usr/share/applications/v2rayn.desktop" <<'EOF'
|
install -m 644 /dev/stdin "$STAGE/usr/share/applications/v2rayn.desktop" <<'EOF'
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=v2rayN
|
Name=v2rayN
|
||||||
|
|
@ -534,7 +527,6 @@ Icon=v2rayn
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Categories=Network;
|
Categories=Network;
|
||||||
EOF
|
EOF
|
||||||
chmod 0644 "$STAGE/usr/share/applications/v2rayn.desktop"
|
|
||||||
|
|
||||||
# Control file
|
# Control file
|
||||||
cat > "$DEBIAN_DIR/control" <<EOF
|
cat > "$DEBIAN_DIR/control" <<EOF
|
||||||
|
|
@ -552,7 +544,7 @@ Description: v2rayN (Avalonia) GUI client for Linux
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# postinst
|
# postinst
|
||||||
cat > "$DEBIAN_DIR/postinst" <<'EOF'
|
install -m 755 /dev/stdin "$DEBIAN_DIR/postinst" <<'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
update-desktop-database /usr/share/applications >/dev/null 2>&1 || true
|
update-desktop-database /usr/share/applications >/dev/null 2>&1 || true
|
||||||
|
|
@ -561,10 +553,9 @@ if command -v gtk-update-icon-cache >/dev/null 2>&1; then
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
EOF
|
EOF
|
||||||
chmod 0755 "$DEBIAN_DIR/postinst"
|
|
||||||
|
|
||||||
# postrm
|
# postrm
|
||||||
cat > "$DEBIAN_DIR/postrm" <<'EOF'
|
install -m 755 /dev/stdin "$DEBIAN_DIR/postrm" <<'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
update-desktop-database /usr/share/applications >/dev/null 2>&1 || true
|
update-desktop-database /usr/share/applications >/dev/null 2>&1 || true
|
||||||
|
|
@ -573,14 +564,11 @@ if command -v gtk-update-icon-cache >/dev/null 2>&1; then
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
EOF
|
EOF
|
||||||
chmod 0755 "$DEBIAN_DIR/postrm"
|
|
||||||
|
|
||||||
# Normalize permissions
|
# Normalize permissions
|
||||||
find "$STAGE/opt/v2rayN" -type d -exec chmod 0755 {} +
|
find "$STAGE/opt/v2rayN" -type d -exec chmod 0755 {} +
|
||||||
find "$STAGE/opt/v2rayN" -type f -exec chmod 0644 {} +
|
find "$STAGE/opt/v2rayN" -type f -exec chmod 0644 {} +
|
||||||
[[ -f "$STAGE/opt/v2rayN/v2rayN" ]] && chmod 0755 "$STAGE/opt/v2rayN/v2rayN" || true
|
[[ -f "$STAGE/opt/v2rayN/v2rayN" ]] && chmod 0755 "$STAGE/opt/v2rayN/v2rayN" || true
|
||||||
[[ -f "$STAGE/opt/v2rayN/bin/xray/xray" ]] && chmod 0755 "$STAGE/opt/v2rayN/bin/xray/xray" || true
|
|
||||||
[[ -f "$STAGE/opt/v2rayN/bin/sing_box/sing-box" ]] && chmod 0755 "$STAGE/opt/v2rayN/bin/sing_box/sing-box" || true
|
|
||||||
|
|
||||||
local deb_out
|
local deb_out
|
||||||
deb_out="$OUTPUT_DIR/v2rayn_${VERSION}_${deb_arch}.deb"
|
deb_out="$OUTPUT_DIR/v2rayn_${VERSION}_${deb_arch}.deb"
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ download_xray() {
|
||||||
tmp="$(mktemp -d)"; trap '[[ -n "${tmp:-}" ]] && rm -rf "$tmp"' RETURN
|
tmp="$(mktemp -d)"; trap '[[ -n "${tmp:-}" ]] && rm -rf "$tmp"' RETURN
|
||||||
curl -fL "$url" -o "$tmp/$zipname"
|
curl -fL "$url" -o "$tmp/$zipname"
|
||||||
unzip -q "$tmp/$zipname" -d "$tmp"
|
unzip -q "$tmp/$zipname" -d "$tmp"
|
||||||
install -Dm755 "$tmp/xray" "$outdir/xray"
|
install -m 755 "$tmp/xray" "$outdir/xray"
|
||||||
}
|
}
|
||||||
|
|
||||||
download_singbox() {
|
download_singbox() {
|
||||||
|
|
@ -249,7 +249,7 @@ download_singbox() {
|
||||||
tar -C "$tmp" -xzf "$tmp/$tarname"
|
tar -C "$tmp" -xzf "$tmp/$tarname"
|
||||||
bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)"
|
bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)"
|
||||||
[[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; return 1; }
|
[[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; return 1; }
|
||||||
install -Dm755 "$bin" "$outdir/sing-box"
|
install -m 755 "$bin" "$outdir/sing-box"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Move geo files to outroot/bin
|
# Move geo files to outroot/bin
|
||||||
|
|
@ -484,9 +484,14 @@ https://github.com/2dust/v2rayN
|
||||||
install -dm0755 %{buildroot}/opt/v2rayN
|
install -dm0755 %{buildroot}/opt/v2rayN
|
||||||
cp -a * %{buildroot}/opt/v2rayN/
|
cp -a * %{buildroot}/opt/v2rayN/
|
||||||
|
|
||||||
|
# Normalize permissions
|
||||||
|
find %{buildroot}/opt/v2rayN -type d -exec chmod 0755 {} +
|
||||||
|
find %{buildroot}/opt/v2rayN -type f -exec chmod 0644 {} +
|
||||||
|
[ -f %{buildroot}/opt/v2rayN/v2rayN ] && chmod 0755 %{buildroot}/opt/v2rayN/v2rayN || :
|
||||||
|
|
||||||
# Launcher (prefer native ELF first, then DLL fallback)
|
# Launcher (prefer native ELF first, then DLL fallback)
|
||||||
install -dm0755 %{buildroot}%{_bindir}
|
install -dm0755 %{buildroot}%{_bindir}
|
||||||
cat > %{buildroot}%{_bindir}/v2rayn << 'EOF'
|
install -m0755 /dev/stdin %{buildroot}%{_bindir}/v2rayn << 'EOF'
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
DIR="/opt/v2rayN"
|
DIR="/opt/v2rayN"
|
||||||
|
|
@ -503,11 +508,10 @@ echo "v2rayN launcher: no executable found in $DIR" >&2
|
||||||
ls -l "$DIR" >&2 || true
|
ls -l "$DIR" >&2 || true
|
||||||
exit 1
|
exit 1
|
||||||
EOF
|
EOF
|
||||||
chmod 0755 %{buildroot}%{_bindir}/v2rayn
|
|
||||||
|
|
||||||
# Desktop file
|
# Desktop file
|
||||||
install -dm0755 %{buildroot}%{_datadir}/applications
|
install -dm0755 %{buildroot}%{_datadir}/applications
|
||||||
cat > %{buildroot}%{_datadir}/applications/v2rayn.desktop << 'EOF'
|
install -m0644 /dev/stdin %{buildroot}%{_datadir}/applications/v2rayn.desktop << 'EOF'
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=v2rayN
|
Name=v2rayN
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue