Compress deb packages better
This commit is contained in:
@@ -20,6 +20,7 @@ Version: $Version
|
|||||||
Maintainer: Vlyaii <voronin9032n3@gmail.com>
|
Maintainer: Vlyaii <voronin9032n3@gmail.com>
|
||||||
Homepage: https://git.vlyaii.ru/voronin9032/v2rayN
|
Homepage: https://git.vlyaii.ru/voronin9032/v2rayN
|
||||||
Architecture: all
|
Architecture: all
|
||||||
|
Depends: ca-certificates
|
||||||
Description: v2rayn-unofficial repository configuration
|
Description: v2rayn-unofficial repository configuration
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -42,5 +43,5 @@ sudo find "${PackagePath}/etc" -type f -exec chmod 644 {} +
|
|||||||
# ensure main binaries are 755 (executable by all users)
|
# ensure main binaries are 755 (executable by all users)
|
||||||
|
|
||||||
# build deb package
|
# build deb package
|
||||||
sudo dpkg-deb -Zzstd --build "$PackagePath"
|
sudo dpkg-deb -Zzstd -z19 --build "$PackagePath"
|
||||||
sudo mv "${PackagePath}.deb" "v2rayn-unofficial-repo_${Version}_all.deb"
|
sudo mv "${PackagePath}.deb" "v2rayn-unofficial-repo_${Version}_all.deb"
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ OutputPath="$(mktemp -d)"
|
|||||||
Version="$1"
|
Version="$1"
|
||||||
|
|
||||||
PROJ="./v2rayN/v2rayN.Desktop/v2rayN.Desktop.csproj"
|
PROJ="./v2rayN/v2rayN.Desktop/v2rayN.Desktop.csproj"
|
||||||
dotnet clean "${PROJ}" -c Release
|
dotnet restore "$PROJ"
|
||||||
sudo rm -rf "$(dirname "$PROJ")/bin/Release/net8.0"
|
sudo rm -rf "$(dirname "$PROJ")/bin/Release/net8.0"
|
||||||
dotnet publish "${PROJ}" -c Release -r "linux-x64" --self-contained -o "$OutputPath"
|
dotnet publish "${PROJ}" -c Release -r "linux-x64" --self-contained -p:StripSymbols=true -o "$OutputPath"
|
||||||
PROJ="./v2rayN/AmazTool/AmazTool.csproj"
|
PROJ="./v2rayN/AmazTool/AmazTool.csproj"
|
||||||
dotnet clean "${PROJ}" -c Release
|
dotnet restore "$PROJ"
|
||||||
sudo rm -rf "$(dirname "$PROJ")/bin/Release/net8.0"
|
sudo rm -rf "$(dirname "$PROJ")/bin/Release/net8.0"
|
||||||
dotnet publish "${PROJ}" -c Release -r "linux-x64" --self-contained -p:PublishTrimmed=true -o "$OutputPath"
|
dotnet publish "${PROJ}" -c Release -r "linux-x64" --self-contained -p:StripSymbols=true -p:PublishTrimmed=true -o "$OutputPath"
|
||||||
|
|
||||||
export RID_DIR="linux-x64"
|
export RID_DIR="linux-x64"
|
||||||
download_xray "$OutputPath/bin/xray"
|
download_xray "$OutputPath/bin/xray"
|
||||||
@@ -29,6 +29,7 @@ mkdir -p "${PackagePath}/DEBIAN"
|
|||||||
mkdir -p "${PackagePath}/opt"
|
mkdir -p "${PackagePath}/opt"
|
||||||
cp -rf "$OutputPath" "${PackagePath}/opt/v2rayN"
|
cp -rf "$OutputPath" "${PackagePath}/opt/v2rayN"
|
||||||
echo "When this file exists, app will not store configs under this folder" >"${PackagePath}/opt/v2rayN/NotStoreConfigHere.txt"
|
echo "When this file exists, app will not store configs under this folder" >"${PackagePath}/opt/v2rayN/NotStoreConfigHere.txt"
|
||||||
|
sudo find "${PackagePath}/opt/v2rayN" -type f -name "*.so" -exec strip {} +
|
||||||
|
|
||||||
if [ "$Arch" = "linux-64" ]; then
|
if [ "$Arch" = "linux-64" ]; then
|
||||||
Arch2="amd64"
|
Arch2="amd64"
|
||||||
@@ -43,14 +44,15 @@ Version: $Version
|
|||||||
Maintainer: Vlyaii <voronin9032n3@gmail.com>
|
Maintainer: Vlyaii <voronin9032n3@gmail.com>
|
||||||
Homepage: https://git.vlyaii.ru/voronin9032/v2rayN
|
Homepage: https://git.vlyaii.ru/voronin9032/v2rayN
|
||||||
Architecture: $Arch2
|
Architecture: $Arch2
|
||||||
Replaces: v2rayN, v2rayn
|
Replaces: v2rayn
|
||||||
Depends: desktop-file-utils, xdg-utils
|
Depends: libc6 (>= 2.35), desktop-file-utils, xdg-utils
|
||||||
Breaks: v2rayN, v2rayn
|
Breaks: v2rayn
|
||||||
Conflicts: v2rayN, v2rayn
|
Conflicts: v2rayn
|
||||||
Description: A GUI client for Windows and Linux, support Xray core and sing-box-core and others
|
Description: A GUI client for Windows and Linux, support Xray core and sing-box-core and others
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat >"${PackagePath}/DEBIAN/postinst" <<-EOF
|
cat >"${PackagePath}/DEBIAN/postinst" <<-EOF
|
||||||
|
#!/bin/sh
|
||||||
if [ ! -s /usr/share/applications/v2rayN.desktop ]; then
|
if [ ! -s /usr/share/applications/v2rayN.desktop ]; then
|
||||||
cat >/usr/share/applications/v2rayN.desktop<<-END
|
cat >/usr/share/applications/v2rayN.desktop<<-END
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
@@ -83,6 +85,6 @@ sudo chmod 755 "${PackagePath}/opt/v2rayN/v2rayN" 2>/dev/null || true
|
|||||||
sudo chmod 755 "${PackagePath}/opt/v2rayN/AmazTool" 2>/dev/null || true
|
sudo chmod 755 "${PackagePath}/opt/v2rayN/AmazTool" 2>/dev/null || true
|
||||||
|
|
||||||
# build deb package
|
# build deb package
|
||||||
sudo dpkg-deb -Zzstd --build "$PackagePath"
|
sudo dpkg-deb -Zzstd -z19 --build "$PackagePath"
|
||||||
sudo mv "${PackagePath}.deb" "v2rayn-unofficial_${Version}_${Arch2}.deb"
|
sudo mv "${PackagePath}.deb" "v2rayn-unofficial_${Version}_${Arch2}.deb"
|
||||||
sudo rm -rf "$OutputPath"
|
sudo rm -rf "$OutputPath"
|
||||||
|
|||||||
@@ -176,22 +176,22 @@ build_for_arch() {
|
|||||||
echo "[*] Building for target: $short (RID=$rid, RPM --target $rpm_target)"
|
echo "[*] Building for target: $short (RID=$rid, RPM --target $rpm_target)"
|
||||||
|
|
||||||
# .NET publish (self-contained) for this RID
|
# .NET publish (self-contained) for this RID
|
||||||
dotnet clean "$PROJECT" -c Release
|
|
||||||
rm -rf "$(dirname "$PROJECT")/bin/Release/net8.0" || true
|
|
||||||
|
|
||||||
dotnet restore "$PROJECT"
|
dotnet restore "$PROJECT"
|
||||||
|
rm -rf "$(dirname "$PROJECT")/bin/Release/net8.0" || true
|
||||||
dotnet publish "$PROJECT" \
|
dotnet publish "$PROJECT" \
|
||||||
-c Release -r "$rid" \
|
-c Release -r "$rid" \
|
||||||
--sc \
|
--sc \
|
||||||
-p:PublishSingleFile=false \
|
-p:PublishSingleFile=false \
|
||||||
-p:SelfContained=true \
|
-p:SelfContained=true \
|
||||||
-p:IncludeNativeLibrariesForSelfExtract=true
|
-p:IncludeNativeLibrariesForSelfExtract=true \
|
||||||
|
-p:StripSymbols=true
|
||||||
|
|
||||||
# Per-arch variables (scoped)
|
# Per-arch variables (scoped)
|
||||||
local RID_DIR="$rid"
|
local RID_DIR="$rid"
|
||||||
local PUBDIR
|
local PUBDIR
|
||||||
PUBDIR="$(dirname "$PROJECT")/bin/Release/net8.0/${RID_DIR}/publish"
|
PUBDIR="$(dirname "$PROJECT")/bin/Release/net8.0/${RID_DIR}/publish"
|
||||||
[[ -d "$PUBDIR" ]]
|
[[ -d "$PUBDIR" ]]
|
||||||
|
sudo find "$PUBDIR" -type f -name "*.so" -exec strip {} +
|
||||||
|
|
||||||
# Make RID_DIR visible to download helpers (they read this var)
|
# Make RID_DIR visible to download helpers (they read this var)
|
||||||
export RID_DIR
|
export RID_DIR
|
||||||
|
|||||||
Reference in New Issue
Block a user